/* =====================================================================
   HOME — PREMIUM ESPORTS REDESIGN (v1)
   Loads LAST (after home-polish.css) so it only needs to add/override,
   never duplicate. Scoped to #home and the handful of home-only classes
   below — every other tab is untouched. Reuses the site's own design
   language (the cut-corner plates and gold hairlines already shipped in
   season-banner.css / admin-console.css) instead of inventing a new one,
   and only the site's existing tokens (--gold, --panel, --line, Teko,
   Manrope…) so both the Gold and Neon themes keep working for free.
   No new image assets are introduced — every effect below is CSS only.
   ===================================================================== */

/* ---------- 0. Arena backdrop ---------- */
/* Inserted as the first child of #home (position:absolute, out of the
   flex flow — see home-polish.css's #home{display:flex}), so it needs no
   "order" and cannot disturb the stacking of the real content. */
#home .home-aurora{
  position:absolute; inset:-60px 0 auto 0; height:min(1100px, 150%);
  z-index:0; pointer-events:none; overflow:hidden;
}
#home .home-aurora::before,
#home .home-aurora::after{
  content:""; position:absolute; inset:0;
}
/* soft arena lighting, brighter than the old lone .floodlight */
#home .home-aurora::before{
  background:
    radial-gradient(640px 420px at 18% 8%, rgba(var(--gold-rgb),.16), transparent 70%),
    radial-gradient(760px 520px at 86% 18%, rgba(var(--pitch-rgb),.14), transparent 72%),
    radial-gradient(900px 600px at 50% 0%, rgba(var(--gold-rgb),.10), transparent 75%);
}
/* faint HUD grid, fading out toward the edges so it reads as texture,
   not wallpaper */
#home .home-aurora::after{
  background-image:
    linear-gradient(rgba(var(--gold-rgb),.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--gold-rgb),.10) 1px, transparent 1px);
  background-size:46px 46px;
  -webkit-mask-image:radial-gradient(ellipse 85% 70% at 50% 10%, #000 35%, transparent 78%);
  mask-image:radial-gradient(ellipse 85% 70% at 50% 10%, #000 35%, transparent 78%);
  opacity:.55;
  animation:homeGridDrift 34s linear infinite;
}
@keyframes homeGridDrift{ from{background-position:0 0, 0 0;} to{background-position:92px 46px, 92px 46px;} }

/* ---------- 1. Crest stage ---------- */
/* .hero-crest keeps its id-free <img> exactly as before; it is now the
   only child of this new stage wrapper, which takes over the layout
   "order" the image used to carry (see home-polish.css §1). */
#home .crest-stage{ order:2; position:relative; z-index:1; }
#home .crest-stage{
  display:grid; place-items:center;
  width:clamp(230px, min(32vw, 40vh), 390px);
  margin:0 auto; padding:18px;
  perspective:900px;
  animation:crestFloat 6s ease-in-out infinite; /* idle bob lives on the
    outer stage; the tilt below lives on the <img> itself so home-fx.js's
    pointer tilt (also a transform) never fights this animation for the
    same property on the same element. */
}
#home .crest-stage .hero-crest{
  order:unset; margin:0; width:100%;
  transform:rotateX(0) rotateY(0);
  transition:transform .35s cubic-bezier(.2,.8,.3,1);
  will-change:transform;
}
@keyframes crestFloat{ 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
#home .crest-glow{
  position:absolute; inset:14%; z-index:-1; border-radius:50%;
  background:radial-gradient(closest-side, rgba(var(--gold-rgb),.38), transparent 72%);
  filter:blur(6px);
  animation:crestPulse 4.5s ease-in-out infinite;
}
@keyframes crestPulse{ 0%,100%{opacity:.55; transform:scale(.96);} 50%{opacity:1; transform:scale(1.04);} }
#home .crest-ring{
  position:absolute; inset:6%; z-index:-1; border-radius:50%;
  border:1px solid rgba(var(--gold-rgb),.3);
  -webkit-mask-image:conic-gradient(#000 0 65%, transparent 65% 100%);
  mask-image:conic-gradient(#000 0 65%, transparent 65% 100%);
  animation:crestSpin 16s linear infinite;
}
#home .crest-ring-2{
  inset:0%; border-color:rgba(var(--gold-rgb),.16);
  animation-duration:24s; animation-direction:reverse;
}
@keyframes crestSpin{ to{ transform:rotate(360deg); } }

/* ---------- 2. Headline + CTAs ---------- */
#home .create-account-btn{ position:relative; overflow:hidden; }
#home .create-account-btn::after{
  content:""; position:absolute; top:-30%; bottom:-30%; left:-60%; width:35%;
  background:linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform:skewX(-20deg);
  animation:ctaSheen 5.5s 1s ease-in-out infinite;
}
@keyframes ctaSheen{ 0%,18%{left:-60%;} 42%,100%{left:130%;} }

/* ---------- 3. Stat strip (.facts) — HUD chips with icons ---------- */
#home .facts{ gap:10px; }
#home .facts span{
  position:relative; display:inline-flex; align-items:center; gap:8px;
  padding:10px 18px 10px 14px; border-radius:0; border-color:rgba(var(--gold-rgb),.22);
  background:linear-gradient(180deg, rgba(var(--gold-rgb),.07), rgba(255,255,255,.015));
  clip-path:polygon(10px 0,100% 0,calc(100% - 10px) 100%,0 100%);
  transition:transform .2s, border-color .2s, background .2s;
}
#home .facts span:hover{ transform:translateY(-2px); border-color:rgba(var(--gold-rgb),.55); background:rgba(var(--gold-rgb),.1); }
#home .facts span::before{
  content:""; flex:none; width:15px; height:15px; background:var(--gold);
  -webkit-mask:var(--fi) center/contain no-repeat; mask:var(--fi) center/contain no-repeat;
  opacity:.9;
}
#home .facts span:nth-child(1){ --fi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M3.5 19c.4-3 2.7-5 5.5-5s5.1 2 5.5 5M16 5.2a3.1 3.1 0 0 1 0 5.6M17.5 14.3c1.8.6 3 2.3 3.3 4.7'/%3E%3C/svg%3E"); }
#home .facts span:nth-child(2){ --fi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15' rx='2'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
#home .facts span:nth-child(3){ --fi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h10l-3-3M20 17H10l3 3M4 17h4M16 7h4'/%3E%3C/svg%3E"); }
#home .facts span:nth-child(4){ --fi:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='9' r='5.2'/%3E%3Cpath d='m8 13.5-1.5 7L12 18l5.5 2.5-1.5-7'/%3E%3C/svg%3E"); }

/* ---------- 4. Captains' Cup banner ---------- */
#home .home-cup{
  border-radius:0; border-color:rgba(var(--gold-rgb),.32);
  clip-path:polygon(16px 0,100% 0,100% calc(100% - 16px),calc(100% - 16px) 100%,0 100%,0 16px);
}
#home .home-cup .hc-ico{ position:relative; }
#home .home-cup .hc-ico::after{
  content:""; position:absolute; inset:-5px; border-radius:inherit; clip-path:inherit;
  box-shadow:0 0 0 1px rgba(var(--gold-rgb),.4);
  animation:hcPulse 2.6s ease-in-out infinite;
}
@keyframes hcPulse{ 0%,100%{ opacity:.35; transform:scale(1); } 50%{ opacity:.9; transform:scale(1.08); } }

/* ---------- 5. Feature cards — HUD tiles ---------- */
#home .home-features{ gap:14px; }
#home .hf-card{
  position:relative; border-radius:0; padding:20px 18px 18px;
  background:linear-gradient(165deg, rgba(var(--gold-rgb),.09), rgba(255,255,255,.015) 55%);
  border:1px solid rgba(var(--gold-rgb),.16);
  clip-path:polygon(0 0,calc(100% - 18px) 0,100% 18px,100% 100%,18px 100%,0 calc(100% - 18px));
  overflow:hidden;
}
#home .hf-card::before{ /* gold hairline top edge, brightens on hover */
  content:""; position:absolute; top:0; left:0; right:0; height:2px;
  background:linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity:.35; transition:opacity .25s;
}
#home .hf-card:hover::before{ opacity:1; }
#home .hf-card::after{ /* corner index number, HUD-style */
  position:absolute; top:10px; right:16px;
  font-family:'Teko',sans-serif; font-size:13px; letter-spacing:.1em;
  color:rgba(var(--gold-rgb),.45);
}
#home .hf-card:nth-of-type(1)::after{ content:"01"; }
#home .hf-card:nth-of-type(2)::after{ content:"02"; }
#home .hf-card:nth-of-type(3)::after{ content:"03"; }
#home .hf-card:nth-of-type(4)::after{ content:"04"; }
#home .hf-card:hover{ background:linear-gradient(165deg, rgba(var(--gold-rgb),.14), rgba(255,255,255,.02) 55%); }
#home .hf-ico{ border-radius:0; clip-path:polygon(7px 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%,0 7px); }

/* ---------- 6. Countdown + standings — cut-corner HUD frames ---------- */
/* Same geometry as the season banner's cut corners. .hs-panel and
   .hs-ticker both already use overflow:hidden (.hs-ticker's own ::after
   is its text fade-out, which this must not touch), so only
   .countdown-card — the one with room to spare — gets the full two-layer
   hairline trick from .sb-plate/.sb-inner (a gold-gradient layer peeking
   out from behind an identically-clipped layer, which is how a straight
   CSS border can't trace a diagonal cut but this can). It's a ::after,
   not a new wrapper element, so admin-only children like #countdownEditBtn
   don't have to move. */
#home .countdown-card, #home .hero-standings-card .hs-panel{
  border-radius:0 !important;
  clip-path:polygon(0 0,calc(100% - 14px) 0,100% 14px,100% 100%,14px 100%,0 calc(100% - 14px));
}
/* countdown-card is already position:absolute (style.css), which already
   establishes the containing block the ::after below needs — do not
   touch its position here, that's what the (max-width:980px) rule
   switches to position:static for mobile stacking. */
#home .countdown-card::after{
  content:""; position:absolute; inset:-2px; z-index:-1; pointer-events:none;
  background:linear-gradient(135deg, rgba(var(--gold-rgb),.85), rgba(var(--gold-rgb),.12) 45%, rgba(var(--gold-rgb),.6));
  clip-path:inherit;
}

/* ---------- 6b. Announcement ticker — promoted to a top banner ---------- */
/* home-fx.js physically moves the existing #hsNotice (.hs-ticker) and
   #hsNoticeEmpty nodes into this wrapper, right above the season banner —
   same elements, same ids/classes/listeners, just a better spot on the
   page. This only has to style the new wrapper + make the (unchanged)
   ticker read as a bigger, more confident banner instead of a side-card
   afterthought. */
#home .home-ticker-bar{
  order:0; position:relative; z-index:1;
  width:100%; max-width:820px; margin:0 auto 16px;
}
#home .home-ticker-bar .hs-ticker{
  position:relative; width:100%; padding:14px 46px 14px 52px;
  border-radius:0; clip-path:polygon(0 0,calc(100% - 16px) 0,100% 16px,100% 100%,16px 100%,0 calc(100% - 16px));
  background:linear-gradient(90deg, rgba(var(--gold-rgb),.12), rgba(23,31,22,.92) 18%, rgba(15,20,13,.94));
  border:1px solid rgba(var(--gold-rgb),.4);
  box-shadow:0 18px 40px -20px rgba(0,0,0,.75), 0 0 26px -12px rgba(var(--gold-rgb),.4);
}
/* megaphone icon, left-aligned, replacing the plain text start */
#home .home-ticker-bar .hs-ticker::before{
  content:""; position:absolute; left:16px; top:50%; transform:translateY(-50%);
  width:20px; height:20px; background:var(--gold);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11v2a2 2 0 0 0 2 2h1l9 4V5L6 9H5a2 2 0 0 0-2 2Z'/%3E%3Cpath d='M15 9.5a3 3 0 0 1 0 5M19 7a7 7 0 0 1 0 10'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11v2a2 2 0 0 0 2 2h1l9 4V5L6 9H5a2 2 0 0 0-2 2Z'/%3E%3Cpath d='M15 9.5a3 3 0 0 1 0 5M19 7a7 7 0 0 1 0 10'/%3E%3C/svg%3E") center/contain no-repeat;
  animation:tickerHorn 2.4s ease-in-out infinite;
}
@keyframes tickerHorn{ 0%,100%{opacity:.75;} 50%{opacity:1; filter:drop-shadow(0 0 6px rgba(var(--gold-rgb),.8));} }
#home .home-ticker-bar .hs-ticker-item{ font-size:13.5px; font-weight:600; letter-spacing:.02em; padding-right:56px; }
#home .home-ticker-bar .hs-notice-edit{ top:50%; right:12px; transform:translateY(-50%); }
#home .home-ticker-bar.is-admin .hs-notice-empty{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  width:100%; padding:12px 18px; color:var(--muted); font-size:12.5px;
  border:1px dashed rgba(var(--gold-rgb),.35);
  clip-path:polygon(0 0,calc(100% - 16px) 0,100% 16px,100% 100%,16px 100%,0 calc(100% - 16px));
}
#home .home-ticker-bar .hs-notice-empty button{
  border:1px solid rgba(var(--gold-rgb),.5); background:transparent; color:var(--gold);
  font-size:11px; padding:5px 12px; border-radius:0; cursor:pointer;
  clip-path:polygon(6px 0,100% 0,calc(100% - 6px) 100%,0 100%);
}
#home .home-ticker-bar .hs-notice-empty button:hover{ background:rgba(var(--gold-rgb),.14); }
@media (max-width:640px){
  #home .home-ticker-bar .hs-ticker{ padding:12px 40px 12px 44px; }
  #home .home-ticker-bar .hs-ticker::before{ left:12px; width:17px; height:17px; }
}

/* ---------- 6c. Player status chip — paired visually with "See fixtures" ---------- */
/* Same cut-corner language and button height as .hero-secondary right
   next to it, instead of the old plain rounded pill, so the two read as
   one deliberate row instead of two different eras of the site. */
#home .player-status:not(:empty){
  position:relative; height:50px; padding:0 20px 0 17px; border-radius:0;
  display:inline-flex; align-items:center; gap:9px;
  border:1px solid rgba(var(--gold-rgb),.35);
  background:linear-gradient(135deg, rgba(var(--gold-rgb),.14), rgba(255,255,255,.02));
  clip-path:polygon(14px 0,100% 0,calc(100% - 14px) 100%,0 100%);
  font-size:13px; color:var(--muted);
}
#home .player-status:not(:empty)::before{
  content:""; flex:none; width:8px; height:8px; border-radius:50%;
  background:var(--pitch); box-shadow:0 0 8px var(--pitch);
  animation:playerStatusPulse 1.8s ease-in-out infinite;
}
#home .player-status b{ color:var(--gold); font-family:'Teko',sans-serif; font-size:18px; font-weight:600; letter-spacing:.02em; }
@keyframes playerStatusPulse{ 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.35; transform:scale(.7);} }
@media (prefers-reduced-motion:reduce){ #home .player-status:not(:empty)::before{ animation:none; } }

/* ---------- 7. Entrance choreography ---------- */
/* scroll-effects.js already arms every direct child of #home with
   .reveal-init / .reveal-in (see armRevealFor in scroll-effects.js) —
   this just makes the very first paint (the season banner + crest, both
   already visible without scrolling) animate in immediately rather than
   waiting on IntersectionObserver, which only fires once a target enters
   the viewport. */
#home.tab-active .season-banner.reveal-init,
#home.tab-active .crest-stage.reveal-init,
#home.tab-active .powered-by.reveal-init,
#home.tab-active .sub.reveal-init,
#home.tab-active .hero-actions.reveal-init{
  animation:homeFirstPaint .7s ease both;
}
#home.tab-active .crest-stage.reveal-init{ animation-delay:.08s; }
#home.tab-active .powered-by.reveal-init{ animation-delay:.16s; }
#home.tab-active .hero-actions.reveal-init{ animation-delay:.24s; }
/* .home-ticker-bar is created by home-fx.js after scroll-effects.js has
   already armed #home's then-existing children, so it never gets a
   .reveal-init class to key off of — give it the same first-paint
   treatment unconditionally instead. */
#home.tab-active .home-ticker-bar{ animation:homeFirstPaint .7s ease both; }
@keyframes homeFirstPaint{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:none; } }

@media (prefers-reduced-motion:reduce){
  #home .hero-crest, #home .crest-stage, #home .crest-glow, #home .crest-ring, #home .home-aurora::after,
  #home .create-account-btn::after, #home .home-cup .hc-ico::after,
  #home .home-ticker-bar .hs-ticker::before{ animation:none !important; }
}

/* ---------- 8. Responsive ---------- */
@media (max-width:980px){
  #home .crest-stage{ padding:10px; }
}
@media (max-width:520px){
  #home .facts{ gap:8px; }
  #home .facts span{ padding:9px 14px 9px 11px; font-size:13px; }
}
