/* Home launch layout (VG-585 with VG-712, VG-723 and VG-719; merged launch spec of 26 Nov 2026). Six controls
   (the mode group counted once, research question G1), in nine buttons: the player chip and the language flag top left, More top right, Change fighter under the fighter, the mode group
   (two picture cards, More modes and the map line, VG-772) and Play, which keeps one fixed gold and shows the selected mode's badge.
   One grid, re-drawn per size: iPad and desktop landscape (default), iPad portrait, phone portrait, phone landscape.
   Checked with Safari's bars (tests/home-layout-browser.test.mjs). Loaded after menu-states.css: the cards' selected
   look adds the mode colour to the shared press, focus and selected states, it does not replace them. */
/* Gaps leave 12 px between controls even with the selected card at 1.04 (it grows 2 percent each side). */
.ga-home{display:grid;box-sizing:border-box;padding:16px;column-gap:20px;row-gap:12px;
  grid-template-columns:minmax(260px,340px) minmax(0,1fr) minmax(0,1fr) 128px;grid-template-rows:72px minmax(0,1fr) 80px;
  grid-template-areas:"top top top top" "hero card1 card2 more" "change map play play"} /* map: VG-772, home-map.css */
.ga-modes{display:contents} /* one labelled group for assistive tech; its cards sit in Home's own grid */

/* Top row: chip and flag, the game name in the middle (where there is room), More. */
/* The row stops 12 px short of the drawn name's half width either side of the middle, so a long family nickname
   (VG-618) grows the chip and pushes the flag, and only past that falls back to the ellipsis. */
.ga-top-left{grid-area:top;justify-self:start;display:flex;align-items:center;gap:12px;min-width:0;max-width:calc(50% - 190px)}
.ga-home-title{grid-area:top;justify-self:center;align-self:center;text-align:center;pointer-events:none;white-space:nowrap;
  text-shadow:0 2px 0 var(--home-dark),1.5px 0 0 var(--home-dark),-1.5px 0 0 var(--home-dark)}
.ga-home .ga-home-title h1{margin:-.15em 0;padding:.15em 0;font:400 40px/1.05 'Lilita One',Trebuchet MS,Arial,sans-serif;
  color:var(--home-gold);letter-spacing:.02em}
/* The one sentence stays drawn under the name (VG-608's first-screen check), small and in one line. */
/* Panel rules elsewhere give headers and paragraphs their own margins; Home's title row sets its own. */
.ga-home .ga-home-title{margin:0;padding:0}
.ga-home .ga-home-title p{margin:2px 0 0;max-width:none;font-size:15px;line-height:1.2;color:var(--home-cream)}
.ga-profile{display:flex;align-items:center;gap:10px;flex:0 1 auto;min-width:156px;height:72px;padding:6px 16px 6px 6px;
  box-sizing:border-box;border:2px solid var(--home-line);border-radius:36px;background:var(--home-panel);text-align:left}
.ga-profile>span{min-width:0}
.ga-avatar{flex:none;width:56px;height:56px;border-radius:50%;object-fit:cover;background:#224550;border:2px solid var(--home-gold);box-sizing:border-box}
.ga-profile strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:400;font-size:20px;line-height:1.1}
.ga-trophies{display:flex;align-items:center;gap:4px;color:var(--home-gold);font-size:18px}
.ga-trophies .ga-icon{width:20px;height:20px}
.ga-language-button{flex:none;display:grid;place-items:center;width:64px;height:64px;padding:7px;box-sizing:border-box;
  border:2px solid var(--home-line);border-radius:50%;background:var(--home-panel)}
.ga-home .ga-language-button [data-flag]{width:44px;height:44px}
.ga-more-button{grid-area:top;justify-self:end;display:grid;place-items:center;width:72px;height:72px;padding:0;
  border-radius:24px;border:2px solid var(--home-line);background:var(--home-panel)}
.ga-home .ga-more-button .ga-icon{width:36px;height:36px}

/* The fighter: the stage is not a control of its own (a tap opens Fighters like Change fighter, a sideways drag turns
   the fighter, VG-670), so the page keeps vertical pans. Change fighter (VG-719) sits under the feet. */
.ga-hero{grid-area:hero;position:relative;min-width:0;min-height:0;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.ga-stage{position:absolute;inset:0;display:block;pointer-events:none}
.ga-stage-gl{display:block;width:100%!important;height:100%!important}
.ga-change{grid-area:change;justify-self:center;align-self:end;display:flex;align-items:center;gap:12px;width:min(320px,100%);
  height:80px;padding:6px 16px 6px 8px;box-sizing:border-box;border:2px solid #9fd3e840;border-radius:22px;background:#1d4e66;text-align:left}
.ga-change-face{flex:none;width:60px;height:60px;border-radius:50%;object-fit:cover;background:#224550;border:2px solid var(--home-gold);box-sizing:border-box}
.ga-change-text{display:flex;flex-direction:column;min-width:0}
.ga-change-text>*{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ga-change-text>span{font-size:24px;line-height:1.1}
.ga-change-text strong{font-weight:400;font-size:17px;line-height:1.15;color:var(--home-gold)}

/* Mode cards (VG-712): picture on top (65 percent), shape badge top left, name and goal line in the panel below. */
.ga-mode-card{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding:0;overflow:hidden;
  border:0;border-radius:20px;background:#12303a;text-align:left;align-self:center;height:min(330px,100%)}
.ga-mode-card[data-mode-card=gem-grab]{grid-area:card1}
.ga-mode-card[data-mode-card=showdown]{grid-area:card2}
.ga-more-modes{grid-area:more}
.ga-mode-card::after{content:"";position:absolute;inset:0;border-radius:inherit;border:2px solid #fff5da59;pointer-events:none}
.ga-mode-pic{flex:0 0 65%;position:relative;display:flex;overflow:hidden;background:#0c2530}
.ga-mode-pic img{flex:1 1 0;min-width:0;width:100%;height:100%;object-fit:cover;display:block;-webkit-user-drag:none;pointer-events:none}
.ga-mode-pic img[hidden]{display:none}
.ga-mini-pics{flex-direction:column;gap:3px;background:#0b1e27}
.ga-mode-badge,.ga-mode-tick{position:absolute;top:8px;display:grid;place-items:center;width:36px;height:36px;box-sizing:border-box;
  background:var(--mode,#224550);color:var(--mode-ink,#fff5da);border:2px solid #fff5da;box-shadow:0 2px 0 #0008}
.ga-mode-badge{left:8px;border-radius:11px}
.ga-home .ga-mode-badge .ga-icon{width:24px;height:24px}
.ga-mode-tick{right:8px;border-radius:50%;display:none}
.ga-home .ga-mode-tick .ga-icon{width:22px;height:22px}
.ga-mode-text{flex:1 1 0;display:flex;flex-direction:column;justify-content:center;gap:2px;min-height:0;padding:6px 12px;background:#12303a}
.ga-mode-text>*{display:block;overflow:hidden}
.ga-mode-text strong{font-weight:400;font-size:26px;line-height:1.1;white-space:nowrap;text-overflow:ellipsis}
.ga-mode-text small{font-size:16px;line-height:1.2;color:#d8efe9;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.ga-mode-text small:empty{display:none}
/* Selected: 6 px border in the mode colour, the tick, the name panel filled in the mode colour (4.5:1 or better),
   and the shared 1.04 scale; one 160 ms ease-out pop on select. Unselected cards keep their full-colour picture. */
.ga-home .ga-mode-card[aria-pressed=true]{background-color:#12303a}
/* The cream ring outside the colour keeps the deep teal visible against the dark arena at arm's length. */
.ga-mode-card[aria-pressed=true]::after{border:6px solid var(--mode);box-shadow:inset 0 0 0 2px #fff5da,0 0 0 3px #fff5da}
.ga-mode-card[aria-pressed=true] .ga-mode-tick{display:grid}
.ga-mode-card[aria-pressed=true] .ga-mode-text{background:var(--mode);color:var(--mode-ink)}
.ga-mode-card[aria-pressed=true] .ga-mode-text small{color:var(--mode-ink)}
.ga-mode-card.ga-pop{animation:ga-mode-pop 160ms ease-out}
@keyframes ga-mode-pop{from{transform:scale(1)}to{transform:scale(var(--ga-select-scale))}}
/* More modes, unpicked: a quiet tile with the extra modes' small pictures and the stacked-cards badge. */
.ga-more-modes:not([aria-pressed=true]) .ga-mode-badge{background:#224550;color:var(--home-cream)}
.ga-more-modes .ga-mode-text strong{font-size:20px;white-space:normal;line-height:1.05}

/* Play: one fixed gold and shape everywhere (the landmark), the selected mode's badge beside the word. */
.ga-play{grid-area:play;justify-self:end;align-self:end;display:flex;align-items:center;justify-content:center;gap:14px;
  width:min(360px,100%);height:80px;box-sizing:border-box;border:3px solid var(--home-dark);border-radius:24px;
  background:linear-gradient(#ffd75a,#f3aa1c);color:var(--home-dark)!important;box-shadow:0 6px 0 #9a5f12}
.ga-play[data-press]{box-shadow:0 5px 0 #8a540f}
.ga-play-badge{flex:none;display:grid;place-items:center;width:48px;height:48px;box-sizing:border-box;border-radius:14px;
  border:2px solid var(--home-dark);background:var(--mode);color:var(--mode-ink)}
.ga-home .ga-play-badge .ga-icon{width:30px;height:30px}
.ga-play-label{display:block;font-size:42px;line-height:1}
.ga-play.ga-pulse{animation:ga-play-pulse 300ms ease-in-out 2}
@keyframes ga-play-pulse{50%{transform:scale(1.06)}}
/* A refused Play or a player map that cannot play says why, just above Play; nothing shows at rest. */
.ga-hint-chip{position:absolute;right:16px;bottom:108px;z-index:1;max-width:min(360px,60%);padding:8px 14px;border-radius:14px;
  background:var(--home-panel);border:2px solid var(--home-line);font-size:15px}
.ga-hint-chip[hidden]{display:none}

/* iPad portrait (820 x 1180) and other upright tablets: one column, the cards and More modes in a row above Play. */
@media(min-width:601px) and (orientation:portrait){
  .ga-home{row-gap:20px;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 140px;grid-template-rows:72px minmax(0,1fr) 80px minmax(240px,330px) 64px 80px;
    grid-template-areas:"top top top" "hero hero hero" "change change change" "card1 card2 more" "map map map" "play play play"}
  /* The name and sentence sit over the top of the stage (the top row is too narrow for them beside the chip). */
  .ga-top-left{max-width:calc(100% - 88px)}
  .ga-home-title{grid-area:hero;align-self:start;z-index:1}
  .ga-home .ga-home-title h1{font-size:30px}.ga-home .ga-home-title p{font-size:15px}
  .ga-hero .ga-stage{top:60px}
  .ga-mode-card{height:100%}
  .ga-play{justify-self:center;width:min(420px,100%)}
}

/* Phone portrait (390 x 844, 360 x 800): top bar, the fighter, Change fighter, two cards side by side, a slim More
   modes tile across, Play across the bottom in the thumb zone. The game name and sentence sit over the top of the stage. */
@media(max-width:600px) and (orientation:portrait){
  .ga-home{padding:12px 16px;row-gap:12px;column-gap:16px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-rows:64px minmax(120px,1fr) 60px minmax(170px,230px) 60px 72px;
    grid-template-areas:"top top" "hero hero" "change change" "card1 card2" "more map" "play play"}
  .ga-home-title{grid-area:hero;align-self:start;z-index:1}.ga-home .ga-home-title h1{font-size:26px}.ga-home .ga-home-title p{font-size:14px}
  .ga-hero .ga-stage{top:50px} /* the fighter stands below the name and the sentence, never under them */
  .ga-top-left{max-width:calc(100% - 76px)}
  .ga-profile{min-width:148px;height:64px}.ga-avatar{width:48px;height:48px}
  .ga-profile strong{font-size:17px}.ga-trophies{font-size:15px}
  .ga-language-button{width:60px;height:60px}.ga-home .ga-language-button [data-flag]{width:40px;height:40px}
  .ga-more-button{width:64px;height:64px;border-radius:20px}
  .ga-change{height:60px;width:min(280px,100%);gap:10px;border-radius:18px}.ga-change-face{width:46px;height:46px}
  .ga-change-text>span{font-size:20px}.ga-change-text strong{font-size:15px}
  .ga-mode-card{height:calc(100% - 10px);border-radius:18px}
  /* The local fallback font can wrap both lines. Let the picture give their caption the height it needs. */
  [data-mode-card]>.ga-mode-pic{flex-shrink:1;min-height:0}
  [data-mode-card]>.ga-mode-text{flex:1 0 auto}
  /* A long name (Papiamento's Ultimo den wega) wraps to a second line instead of being cut. */
  .ga-mode-text{padding:5px 10px}.ga-mode-text strong{font-size:19px;white-space:normal;line-height:1.05}.ga-mode-text small{font-size:14px}
  .ga-play{justify-self:stretch;width:auto;height:72px}.ga-play-label{font-size:36px}
  .ga-hint-chip{bottom:96px;right:16px;font-size:14px;padding:6px 10px}
}

/* The slim More modes tile (phone portrait): badge and words in a row (phone landscape keeps the tall tile, VG-772). */
@media(max-width:600px) and (orientation:portrait){
  .ga-more-modes{flex-direction:row;align-items:stretch;height:100%;border-radius:16px}
  /* Picked, the slim tile grows to 1.04: 3 px of air above and below keeps it 12 px from Play and the cards. */
  .ga-more-modes[aria-pressed=true]{height:calc(100% - 6px);align-self:center}
  .ga-more-modes .ga-mode-pic{order:3;flex:0 0 auto;flex-direction:row;gap:4px;padding:6px;background:none}
  .ga-more-modes .ga-mode-pic img{flex:none;width:64px;height:auto;border-radius:8px}
  .ga-more-modes .ga-mode-badge{position:static;align-self:center;margin-left:10px}
  .ga-more-modes .ga-mode-tick{top:50%;translate:0 -50%;right:8px}
  .ga-more-modes[aria-pressed=true] .ga-mode-pic{display:none}
  .ga-more-modes .ga-mode-text{order:2;background:none;padding:4px 10px}
  .ga-more-modes[aria-pressed=true] .ga-mode-text{background:none;color:inherit}
  .ga-more-modes[aria-pressed=true]{background-color:var(--mode)}
  .ga-more-modes[aria-pressed=true] .ga-mode-text,.ga-more-modes[aria-pressed=true] .ga-mode-text small{color:var(--mode-ink)}
  .ga-more-modes .ga-mode-text strong{font-size:18px}.ga-more-modes .ga-mode-text small{-webkit-line-clamp:1;font-size:13px}
}

/* Phone landscape (844 x 390 down to 844 x 330 with Safari's bars): the fighter on the left with Change fighter under it;
   the two cards and a narrow More modes tile on the right; the map line (VG-772) beside Play (240 x 64) bottom right. */
@media(max-height:500px) and (orientation:landscape){
  .ga-home{padding:8px 16px;row-gap:16px;column-gap:18px;
    grid-template-columns:minmax(170px,200px) minmax(0,1fr) minmax(0,1fr) 104px;grid-template-rows:56px minmax(0,1fr) 64px;
    grid-template-areas:"top top top top" "hero card1 card2 more" "change map play play"}
  .ga-home .ga-home-title h1{font-size:22px;line-height:1.15;margin:0;padding:0}.ga-home .ga-home-title p{font-size:14px;margin-top:0}
  /* The name and sentence centre over the two card columns, so the chip and flag keep the left (notch insets too). */
  .ga-home-title{grid-column:2 / 4}
  .ga-top-left{max-width:calc(100% - 72px)}
  .ga-profile{min-width:148px;height:56px;padding-right:14px}.ga-avatar{width:44px;height:44px}
  .ga-profile strong{font-size:17px}.ga-trophies{font-size:15px}
  .ga-language-button{width:56px;height:56px;padding:6px}.ga-home .ga-language-button [data-flag]{width:40px;height:40px}
  .ga-more-button{width:56px;height:56px;border-radius:18px}
  .ga-change{height:64px;gap:8px;padding:4px 10px 4px 6px;border-radius:18px}.ga-change-face{width:48px;height:48px}
  .ga-change-text>span{font-size:18px}.ga-change-text strong{font-size:14px}
  .ga-mode-card{height:100%;max-height:200px;border-radius:16px}
  .ga-mode-pic{flex-basis:60%}
  .ga-mode-text{padding:4px 10px}.ga-mode-text strong{font-size:19px}.ga-mode-text small{font-size:13px;-webkit-line-clamp:1}
  .ga-more-modes .ga-mode-text strong{font-size:17px}
  .ga-play{width:min(240px,100%);height:64px;gap:10px}.ga-play-badge{width:40px;height:40px}.ga-play-label{font-size:32px}
  .ga-hint-chip{bottom:80px;font-size:14px;padding:6px 10px}
}

/* Reduced motion: no pop and no pulse; the border, tick and filled panel still mark the selected mode. */
@media(prefers-reduced-motion:reduce){.ga-mode-card.ga-pop,.ga-play.ga-pulse{animation:none}}

/* More modes sheet (VG-723): the same cards, two across, picked in one tap. */
.ga-mode-sheet{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:20px;padding:4px 6px 8px}
.ga-mode-sheet .ga-mode-card{align-self:stretch;height:min(240px,calc(100vh - 140px));min-height:150px}

/* Sheet Back (VG-585 touch floor): 56 px on phones, 64 px on tablets and desktop. */
.ga-home .ga-back{width:56px;height:56px}
@media(min-width:601px) and (min-height:501px){.ga-home .ga-back{width:64px;height:64px}}
/* The landscape sheet is tight so More fits unscrolled; the More modes sheet keeps 12 px between Back and the cards. */
@media(max-height:500px) and (orientation:landscape){.ga-sheet[data-sheet-name=mode]{gap:12px}}
