/* Home sheets and shared Home tokens (VG-457, VG-587; menu R&D 4.2, 4.6, 4.7, 4.11). Home's own layout, its
   controls and the mode cards live in home-layout.css (VG-585). The frame is already the safe area. */
:root{--home-panel:#12303aeb;--home-line:#fff5da40;--home-cream:#fff5da;--home-gold:#ffc93c;--home-dark:#1c1a24;
  --home-teal:#2ec4b6;--home-ease:cubic-bezier(.2,.8,.2,1);
  /* Sheets (VG-725, research E12): 250 ms in, 200 ms out. */
  --home-sheet-in:cubic-bezier(.05,.7,.1,1);--home-sheet-out:cubic-bezier(.3,0,.8,.15)}
body .ga-screen.ga-home-screen{padding:0;overflow:hidden;display:block}
/* Home's shade over the arena; VG-765: the result screen's stage (result-stage.js) dims the arena with this same rule,
   in the same safe-area frame as Home's screen, under the result card (z-index 5) and the confetti (6). */
body .ga-screen.ga-home-screen,.ga-result-stage::before{
  background:radial-gradient(ellipse 70% 75% at 50% 48%,#0a253830 35%,#0a2538c4 100%),#0a25384d}
body .ga-result-stage{position:fixed;inset:var(--ga-safe-top) var(--ga-safe-right) var(--ga-safe-bottom) var(--ga-safe-left);
  z-index:4;overflow:hidden;pointer-events:none}
.ga-result-stage[hidden]{display:none}
.ga-result-stage::before{content:"";position:absolute;inset:0;opacity:var(--ga-result-shade,0)}
.ga-result-stage>.ga-stage-gl{position:absolute;inset:0}
.ga-screen .ga-panel.ga-home-panel{position:absolute;inset:0;width:auto;max-width:none;padding:0;background:none;border:0;
  border-radius:0;box-shadow:none;text-align:left}
.ga-home{position:absolute;inset:0;color:var(--home-cream);font:400 15px/1.3 'Lilita One',Trebuchet MS,Arial,sans-serif;
  letter-spacing:.01em}
.ga-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:-1px}
.ga-home button{font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.ga-home .ga-icon{flex:none;width:28px;height:28px}
/* Press, hover, focus and selected states are shared by every menu control: menu-states.css (VG-725). */

#ga-analytics-copy a{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;
  min-width:44px;min-height:44px;color:#ffd54a;text-decoration:underline}

/* Sheets: a right-side panel on desktop and landscape, a bottom sheet on portrait; the backdrop dims to 40 percent. */
/* VG-587: the dim is the top layer over every Home control (one shade for each, and it takes their taps); the panel is
   opaque, so controls behind it are covered, never half-lit. */
.ga-sheet-dim{position:absolute;inset:0;z-index:1;background:#0b151c99;animation:ga-fade 250ms ease both}
.ga-sheet-dim.ga-closing{animation:ga-fade-out 200ms ease both}
.ga-sheet{position:absolute;top:0;right:0;bottom:0;width:min(440px,92%);box-sizing:border-box;display:flex;flex-direction:column;
  gap:12px;padding:16px 20px 20px;overflow:hidden;z-index:2;background:#12303a;border-left:2px solid var(--home-line);
  border-radius:20px 0 0 20px;box-shadow:-12px 0 40px #03121f99;animation:ga-sheet-side 250ms var(--home-sheet-in) both}
.ga-sheet.ga-closing{animation:ga-sheet-side-out 200ms var(--home-sheet-out) both}
.ga-sheet-dim[hidden],.ga-sheet[hidden]{display:none}
.ga-sheet header{display:flex;align-items:center;gap:10px;flex:none}
.ga-sheet [data-sheet-body]{min-height:0;overflow:auto;padding:2px;scroll-padding:4px}
.ga-home .ga-sheet h2{margin:0;font-weight:400;font-size:28px;color:var(--home-gold)}
.ga-home .ga-sheet h3{margin:4px 0;font-weight:400;font-size:19px;color:var(--home-gold)}
.ga-home .ga-sheet p{margin:0;max-width:52ch;font-size:16px;line-height:1.4;color:#e6f2ee}
.ga-back{display:grid;place-items:center;width:44px;height:44px;padding:0;border-radius:50%;border:2px solid var(--home-line);
  background:#224550;color:var(--home-cream);box-sizing:border-box;cursor:pointer;flex:none}
.ga-sheet-list{display:grid;gap:10px}
.ga-sheet-item{display:flex;align-items:center;gap:12px;min-height:64px;padding:8px 14px;border-radius:16px;
  border:2px solid var(--home-line);background:#224550;color:var(--home-cream);text-decoration:none;font-size:18px;text-align:left}
.ga-sheet-item[aria-pressed=true]{border-color:var(--home-gold);background:#36545a}
.ga-sheet-item small{display:block;font-size:14px;color:#cfe3dc}
.ga-sheet-item:disabled{opacity:.6;cursor:default} /* Play my map before a map is saved (VG-592) */
.ga-sheet .ga-sheet-item{min-height:64px} /* outranks phone-safe.css's 44 px button floor (VG-592) */
.ga-sheet .ga-more .ga-sheet-item{min-height:72px} /* More rows (VG-587) */
/* Batch 4: Language (VG-545) and Top players (VG-629) make six More rows; on an upright phone each row is 72 px in
   all (its padding and border inside), so the six fit without scrolling. Other sizes keep their rows. */
@media(max-width:600px) and (orientation:portrait){.ga-sheet .ga-more .ga-sheet-item{box-sizing:border-box}}
/* More, Create and Help rows share one height per sheet (VG-587); the caption under them is text, not a control. */
.ga-sheet[data-sheet-name=more] .ga-sheet-list,.ga-sheet[data-sheet-name=create] .ga-sheet-list,
.ga-sheet[data-sheet-name=help] .ga-sheet-list{grid-auto-rows:1fr}
.ga-home .ga-sheet .ga-sheet-caption{margin:0;padding:0 16px;font-size:14px;line-height:1.35;color:#cfe3dc}
.ga-home .ga-sheet .ga-version{font-size:13px;opacity:.6}
/* Start again (VG-579): one 64 px control in Profile; it asks once before the saved profile is cleared. */
.ga-restart{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.ga-restart button{min-height:64px;min-width:120px;padding:0 22px;border:2px solid #2ec4b6;border-radius:18px;background:#224550;color:#fff5da;font:inherit;font-size:20px;cursor:pointer}
.ga-restart button[data-restart-yes]{border-color:#ff8a65;background:#5a2e2a}
.ga-restart p{flex-basis:100%}
.ga-stat-row{display:flex;justify-content:space-between;gap:12px;padding:10px 14px;border-radius:14px;background:#224550;font-size:18px}
.ga-sheet .ga-controls{grid-template-columns:1fr;margin:0}
.ga-sheet .ga-controls dl{font:15px/1.35 Trebuchet MS,Arial,sans-serif}
.ga-sheet .ga-controls dd[tabindex]{scroll-margin-block:8px}
@keyframes ga-fade{from{opacity:0}}
@keyframes ga-fade-out{to{opacity:0}}
@keyframes ga-sheet-side{from{transform:translateX(100%)}80%{transform:translateX(-4%)}to{transform:none}}
@keyframes ga-sheet-side-out{to{transform:translateX(100%)}}
@keyframes ga-sheet-up{from{transform:translateY(100%)}80%{transform:translateY(-4%)}to{transform:none}}
@keyframes ga-sheet-up-out{to{transform:translateY(100%)}}

/* The match sticks (input.js) are not painted while Home or its sheets show (VG-587); a match brings them back. */
body:has(.ga-screen.ga-home-screen:not([hidden])) :is(.ga-touch-pad,.ga-touch-zone){display:none!important}

/* Select screen back chevron (Heroes, VG-457). */
.ga-select-back{position:sticky;top:0;float:left;margin:-6px 0 0 -6px;z-index:1}

/* Phone landscape sheets (844 x 390 and similar); Home's own layout is home-layout.css. */
@media(max-height:500px) and (orientation:landscape){
  /* Sheets go wider with two columns, so every More, Create and Help row fits without scrolling (VG-587). */
  .ga-sheet{width:min(640px,calc(100% - 24px));gap:6px;padding:6px 16px}
  .ga-sheet[data-sheet-name=more] .ga-sheet-list,.ga-sheet[data-sheet-name=create] .ga-sheet-list,
  .ga-sheet[data-sheet-name=help] .ga-sheet-list{grid-template-columns:1fr 1fr;gap:8px}
  .ga-sheet-item small{font-size:13px}
}

/* Phone portrait sheets (390 x 844): a bottom sheet. */
@media(max-width:600px) and (orientation:portrait){
  .ga-sheet{top:auto;left:0;width:auto;max-height:82%;border-left:0;border-top:2px solid var(--home-line);
    border-radius:20px 20px 0 0;animation-name:ga-sheet-up}
  .ga-sheet.ga-closing{animation-name:ga-sheet-up-out}
}

/* Reduced motion (4.7): sheets fade in 120 ms; no overshoot, lift or press scale. */
@media(prefers-reduced-motion:reduce){
  .ga-sheet,.ga-sheet.ga-closing,.ga-sheet-dim,.ga-sheet-dim.ga-closing{animation:ga-fade 120ms ease both}
  .ga-sheet.ga-closing,.ga-sheet-dim.ga-closing{animation-direction:reverse}
}
/* VG-629: the board scrolls inside its sheet; names wrap and rows keep a 56 px minimum at both review sizes. */
/* A definite height bounds the flex body. Fade without a slide so the sheet stays in its safe frame even on entry. */
.ga-sheet[data-sheet-name=board]{height:100%;max-height:100%;min-height:0;overflow:hidden;animation-name:ga-fade}
.ga-sheet[data-sheet-name=board].ga-closing{animation-direction:reverse}
.ga-sheet[data-sheet-name=board]>header{flex-shrink:0}
.ga-sheet[data-sheet-name=board] [data-sheet-body]{flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden}
.ga-board-controls{position:sticky;top:0;z-index:1;background:#12303a;padding:2px 2px 8px}
.ga-board-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.ga-home .ga-board-tab{min-height:52px;padding:6px 10px;border:2px solid var(--home-line);border-radius:12px;
  background:#224550;color:var(--home-cream);font-size:18px;line-height:1.2}
.ga-home .ga-board-tab[aria-selected=true]{border-color:var(--home-gold);background:#36545a;color:var(--home-gold)}
.ga-home .ga-sheet .ga-board-week-note{margin:6px 0 0;font-size:14px;text-align:center}
.ga-board-panel:focus-visible{outline-offset:-3px}
.ga-board-list{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:8px}
.ga-board-row{display:grid;grid-template-columns:28px 36px minmax(0,1fr) 58px 36px;gap:8px;align-items:center;
  min-height:56px;box-sizing:border-box;padding:6px;border:2px solid #527680;border-radius:12px;background:#224550}
.ga-board-row img{width:36px;height:36px;border-radius:8px;object-fit:cover}
.ga-board-name{overflow-wrap:anywhere;font-size:16px;line-height:1.25}
.ga-board-wins{font-size:14px;text-align:right}
.ga-board-rank{text-align:center;font-size:16px}
.ga-board-own{border-color:var(--home-gold);background:#36545a}

/* Language sheet rows (VG-545). */
.ga-language-list .ga-sheet-item{min-height:72px}
/* The picked language row grows to 1.04 (VG-725): side room so it never overflows the list. */
.ga-sheet .ga-sheet-list.ga-language-list{padding:0 16px}
.ga-draft{margin-left:8px;padding:2px 8px;border-radius:999px;border:1px solid currentColor;font-size:.7em;font-weight:700;opacity:.8;vertical-align:middle}
.ga-sheet-item>span{min-width:0;overflow-wrap:anywhere}
/* VG-720: signed in, the account's masked email hangs under the player chip as a small pill (part of the chip). */
.ga-profile{position:relative}
.ga-profile .ga-account{position:absolute;top:calc(100% + 4px);left:10px;padding:2px 10px;border:1px solid var(--home-line);
  border-radius:999px;background:var(--home-panel);font:400 13px/1.3 Trebuchet MS,Arial,sans-serif;white-space:nowrap}
.ga-profile .ga-account[hidden]{display:none}
/* Upright, the name and sentence sit over the top of the stage, under the pill: they and the fighter move down past it
   (batch 18, measured in the layout check). */
@media(max-width:600px) and (orientation:portrait){
  .ga-home:has(.ga-account:not([hidden])) .ga-home-title{margin-top:28px}
  .ga-home:has(.ga-account:not([hidden])) .ga-hero .ga-stage{top:78px}
}
/* Batch 18 (VG-727's check at 360 x 800): a signed-in two-word nickname (Brave Prikichi, about 111 px at 15 px) fits the
   chip on the narrowest phones: a smaller face and a 15 px name; the flag stays 56 px (Home's floor) and the row keeps
   its 12 px gap (home-layout-browser). Longer names still fall back to the ellipsis.
   home-layout.css loads after this file, so these rules carry the .ga-home .ga-top-left prefix. */
@media(max-width:380px) and (orientation:portrait){
  .ga-home .ga-top-left .ga-profile{min-width:140px;gap:6px;padding-right:10px}
  .ga-home .ga-top-left .ga-avatar{width:40px;height:40px}.ga-home .ga-top-left .ga-profile strong{font-size:15px}
  .ga-home .ga-top-left .ga-language-button{width:56px;height:56px}.ga-home .ga-top-left .ga-language-button [data-flag]{width:38px;height:38px}
}


/* Offline match Back stays above the rule card, lineup and coach, below the pause menu. */
.ga-match-back{position:fixed;z-index:8;inset:auto;top:calc(8px + env(safe-area-inset-top));left:calc(8px + env(safe-area-inset-left))}
.ga-match-back:focus-visible{outline:3px solid #ffc93c;outline-offset:2px}
.ga-back[hidden]{display:none}
