/* VG-541 painted fighter cards and the code-drawn portrait fallback; VG-588 the Fighters screen without form fields:
   a grid of picture cards (5 x 3 on a landscape iPad, 6 x 2 on a landscape phone), All and Mine tabs, the large
   hero with its skin arrows, and PICK in the bottom right corner. Match options (match-options.js) is the second view. */
.ga-portrait-art{position:relative;display:inline-block;overflow:hidden;isolation:isolate;background:#224550;border-radius:14px}
.ga-portrait-art img{position:relative;z-index:1;display:block;width:100%;height:100%;object-fit:cover}
.ga-portrait-art img[hidden]{display:none}
.ga-silhouette{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 35%,#5d897f,#142d39)}
.ga-silhouette::before{content:'';position:absolute;width:32%;height:32%;border-radius:50%;left:34%;top:17%;background:#102530}
.ga-silhouette::after{content:'';position:absolute;width:72%;height:58%;left:14%;top:49%;border-radius:50% 50% 0 0;background:#102530}
body .ga-panel.ga-select{--gap:12px;--pad:6px;--cols:5;--rows:3;--top:64px;box-sizing:border-box;display:flex;flex-direction:column;
  width:min(100%,1300px);height:min(calc(100dvh - var(--ga-safe-top,0px) - var(--ga-safe-bottom,0px) - 16px),900px);
  padding:10px 16px 12px;text-align:left;border:3px solid #1c1a24;border-radius:22px;background:#142d39;box-shadow:0 8px 0 #0b1520;overflow:hidden}
.ga-fighters{display:flex;flex-direction:column;flex:1;min-height:0;gap:8px}
.ga-fighters[hidden],.ga-roster-options[hidden]{display:none}
.ga-fighters-top{flex:none;display:flex;align-items:center;gap:12px;min-height:var(--top)}
body .ga-select .ga-select-back{position:static;float:none;flex:none;width:64px;height:64px;margin:0}
body .ga-select h2{flex:1;min-width:0;margin:0;font:32px/1.1 'Lilita One',Trebuchet MS,sans-serif;letter-spacing:.01em}
.ga-tabs{flex:none;display:flex;gap:8px}
.ga-tabs button{min-width:88px;min-height:64px;padding:0 16px;border:3px solid #1c1a24;border-radius:14px;background:#285059;color:#fff5da;
  font:22px 'Lilita One',Trebuchet MS,sans-serif;cursor:pointer;box-shadow:0 4px 0 #081a23}
/* The roster grid: the grid box is a size container, so a row is exactly a third (or half) of what is visible. */
.ga-roster{flex:1;min-height:0;display:grid;gap:10px 16px;grid-template-columns:minmax(0,1fr) clamp(260px,32%,400px);
  grid-template-rows:minmax(0,1fr) auto auto;grid-template-areas:'grid detail' 'grid skin' 'grid pick'}
.ga-grid-box{grid-area:grid;min-width:0;min-height:0;container-type:size}
body .ga-select .ga-choices{box-sizing:border-box;height:100%;display:grid;margin:0;padding:var(--pad);gap:var(--gap);overflow:auto;
  overscroll-behavior:contain;scroll-padding:var(--pad);grid-template-columns:repeat(var(--cols),minmax(0,1fr));align-content:start;
  grid-auto-rows:calc((100cqh - 2 * var(--pad) - (var(--rows) - 1) * var(--gap)) / var(--rows))}
body .ga-select .ga-choice{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding:0;overflow:hidden;
  border:3px solid #1c1a24;border-radius:16px;background:#285059;color:inherit;text-decoration:none;box-shadow:0 4px 0 #081a23;cursor:pointer;
  transition:transform var(--ga-press-out) var(--ga-spring),background .18s,border-color .18s;animation:ga-card-enter .28s backwards;animation-delay:var(--entry)}
/* Selected owns the 1.04 scale (menu-states.css, VG-725); a press inside the scrolling grid waits 60 ms (press-states.js). */
body .ga-select .ga-choice[aria-pressed=true]{border-color:#ffc93c;background:#39626a;transform:scale(var(--ga-select-scale));box-shadow:0 0 0 2px #ffc93c,0 4px 0 #081a23}
body .ga-select .ga-choice[data-press]{transform:scale(var(--ga-press-scale));transition-duration:var(--ga-press-in)}
body .ga-select .ga-choice[aria-pressed=true][data-press]{transform:scale(calc(var(--ga-select-scale) * var(--ga-press-scale)))}
body .ga-select .ga-portrait{box-sizing:border-box;display:block;flex:1;min-height:0;width:100%;border:0;border-bottom:3px solid #1c1a24;border-radius:0}
/* A long name (Hermes (Short)) wraps to a second line; the portrait above gives up the room. */
body .ga-select .ga-choice strong{flex:none;display:block;padding:4px 6px 5px;font:20px/1.05 'Lilita One',Trebuchet MS,sans-serif;text-align:center;
  overflow-wrap:anywhere}
.ga-choices[data-tab=mine] .ga-choice:not([data-mine]):not(.ga-make),.ga-choices[data-tab=all] .ga-choice[data-listed]{display:none}
.ga-mine-empty{grid-column:1/-1;margin:8px;color:#cee1d7;font-size:18px}.ga-mine-empty[hidden]{display:none}
.ga-make{align-items:center;justify-content:center}.ga-make-plus{font:64px/1 'Lilita One',Trebuchet MS,sans-serif;color:#ffc93c}
body .ga-select .ga-make strong{white-space:normal}
.ga-role-icon{width:22px;height:22px;flex:none;color:#ffe3a1}
.ga-choice>.ga-role-icon{position:absolute;right:5px;top:5px;z-index:2;width:16px;height:16px;padding:4px;border:2px solid #1c1a24;border-radius:50%;background:#142d39}
/* The large hero: the name, the portrait (the model covers it once built), the role, three stats. */
.ga-roster-detail{grid-area:detail;min-width:0;min-height:0;display:flex;flex-direction:column}
.ga-roster-detail>[data-roster-preview]{flex:1;min-height:0;display:flex;flex-direction:column;gap:6px}
.ga-roster-detail h3{flex:none;margin:0;font:34px/1.05 'Lilita One',Trebuchet MS,sans-serif;color:#ffe3a1;overflow-wrap:anywhere}
.ga-big-hero{position:relative;flex:1;min-height:0;border:3px solid #c99a3a;border-radius:16px;overflow:hidden;background:#224550}
.ga-big-portrait{display:block;width:100%;height:100%;border-radius:0}
.ga-big-hero .ga-preview-canvas{position:absolute;inset:0;z-index:2;width:100%;height:100%;background:radial-gradient(ellipse at 50% 60%,#2f6670,#163540)}
.ga-big-hero.ga-has-model .ga-big-portrait{visibility:hidden}
/* Under 160 px (preview.js): the whole portrait across the box width, centred, never cropped; no model there. */
.ga-big-hero.ga-narrow-hero{display:flex;align-items:center}
.ga-narrow-hero .ga-big-portrait{flex:none;height:auto;max-height:100%;aspect-ratio:1}
.ga-narrow-hero .ga-big-portrait img{object-fit:contain}
.ga-starter{position:absolute;left:6px;top:8px;z-index:3;padding:3px 7px;border:2px solid #1c1a24;border-radius:5px;background:#ffc93c;color:#142d39;font:16px 'Lilita One',Trebuchet MS,sans-serif;transform:rotate(-5deg)}
body .ga-roster-detail .ga-roster-role{flex:none;display:flex;gap:8px;align-items:center;margin:0;font-size:15px;line-height:1.2;color:#d6e6d7;
  overflow-wrap:anywhere;hyphens:auto}
.ga-roster-role span{min-width:0}
.ga-fighter-stats{flex:none;box-sizing:border-box;width:100%;display:grid;gap:6px}
.ga-fighter-stat>span{display:flex;justify-content:space-between;gap:6px;font-size:14px;line-height:1.2;color:#e2eee5}
.ga-fighter-stat b{font-variant-numeric:tabular-nums}
.ga-fighter-stat meter{display:block;width:100%;height:9px;border:0;border-radius:4px;background:#0b2632}
.ga-fighter-stat meter::-webkit-meter-bar{background:#0b2632;border:0;border-radius:4px}
.ga-fighter-stat meter::-webkit-meter-optimum-value{background:#2ec4b6;border-radius:4px}
.ga-fighter-stat meter::-moz-meter-bar{background:#2ec4b6}
/* Skin arrows (64 px targets); a fighter with one look keeps the row's space, invisible and untappable (VG-571). */
body .ga-select .ga-skin{grid-area:skin;display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:6px;margin:0;font-size:15px;color:#cee1d7}
body .ga-select .ga-skin[hidden]{display:flex;visibility:hidden}
body .ga-select .ga-skin button{flex:none;width:64px;height:64px;padding:0;border:3px solid #1c1a24;border-radius:14px;background:#285059;color:#fff5da;font:900 24px Trebuchet MS,sans-serif}
body .ga-select .ga-skin span{min-width:0;text-align:center;overflow-wrap:anywhere}
.ga-roster .ga-pick{grid-area:pick;justify-self:end;width:100%;min-width:64px;min-height:64px;margin:0;padding:0 8px;
  font:30px 'Lilita One',Trebuchet MS,sans-serif;border:3px solid #1c1a24}
/* Match options: the old fields as they were, in a list that scrolls under its own Back. */
.ga-roster-options{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding-bottom:16px}
.ga-roster-options>.ga-fighters-top{position:sticky;top:0;z-index:2;background:#142d39;margin-bottom:8px}
.ga-options-body{padding:4px 2px 0}
.ga-roster-options .ga-progression{max-width:100%}
/* The shared focus ring extends 5px beyond the select. Keep it clear of its label and the scrolling panel's edges. */
.ga-roster-options .ga-creator>div:has(>select[name="match-scope"]){display:grid;gap:8px;padding-inline:6px}
/* Keep WebKit's real select and keyboard interaction, with room for a finger and a visible arrow. */
.ga-roster-options select:is([name="match-scope"],[name="queue"]){
  appearance:none;box-sizing:border-box;min-width:44px;min-height:44px;padding:8px 30px 8px 10px;
  border:2px solid #95bbae;border-radius:8px;color:#fff5da;background-color:#224550;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-repeat:no-repeat;background-position:right 15px center,right 9px center;background-size:6px 6px;
}
body .ga-select .ga-modifier{display:inline-block;margin:0 12px 14px;vertical-align:top}
/* VG-592 bot difficulty: three tap cards, 64 px or more at both checked sizes. */
.ga-difficulty{display:flex;align-items:center;gap:8px;margin:0 0 16px;color:#cee1d7;font-size:14px}
.ga-difficulty button{flex:1;min-width:64px;min-height:64px;cursor:pointer;border:2px solid #95bbae;border-radius:12px;background:#224550;color:#fff5da;font:700 16px Trebuchet MS,Arial,sans-serif}
.ga-difficulty button[aria-pressed=true]{background:var(--ga-select-fill);color:#fff5da;border-color:var(--ga-select-line);border-width:3px}
.ga-vs-fighter>.ga-portrait-art{display:block;width:100%;aspect-ratio:5/6} /* VG-580: the VS team grid sizes the card */
@keyframes ga-card-enter{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}
/* Landscape phone (844 x 390): 6 x 2 cards; the large hero is the narrow right column, the skin arrows sit under the
   grid and PICK in the corner under the hero. No panel frame here, so six cards keep 116 px. Cards are measured
   inside the safe area: when the grid box cannot hold six cards of 116 px (6 x 116 + 5 gaps + 2 pads = 722 px, e.g. a
   notch with 47 px insets each side) it shows five columns of larger cards and scrolls one more row (station, round 2). */
@media(max-height:500px) and (orientation:landscape){
  /* A home bar (bottom inset) takes the screen's top and bottom padding (2 px stays for the 1.04 pressed tab) and the
     rows keep a 112 px floor, so two whole rows still fit; with no bottom inset the padding stays 8 px. */
  body .ga-screen:has(>.ga-panel.ga-select){padding-top:max(2px,8px - var(--ga-safe-bottom,0px));padding-bottom:max(0px,8px - var(--ga-safe-bottom,0px))}
  body .ga-panel.ga-select{--gap:4px;--pad:3px;--cols:6;--rows:2;padding:0;border:0;border-radius:0;box-shadow:none;background:#142d39;outline:8px solid #142d39;
    height:calc(100dvh - var(--ga-safe-top,0px) - var(--ga-safe-bottom,0px) - max(2px,8px - var(--ga-safe-bottom,0px)) - max(0px,8px - var(--ga-safe-bottom,0px)))}
  body .ga-select .ga-choices{grid-auto-rows:max(112px,calc((100cqh - 2 * var(--pad) - (var(--rows) - 1) * var(--gap)) / var(--rows)))}
  .ga-fighters{gap:2px}body .ga-select h2{font-size:24px}.ga-tabs button{min-width:72px;font-size:19px}
  .ga-roster{gap:2px 6px;grid-template-columns:minmax(0,736px) minmax(88px,1fr);grid-template-rows:minmax(0,1fr) 64px;
    grid-template-areas:'grid detail' 'skin pick'}
  body .ga-select .ga-choice strong{font-size:17px;padding:2px 4px 3px}
  .ga-roster-detail h3{font-size:18px}
  /* The selected card already has the role icon. Give the words the full width of the narrow detail column. */
  body .ga-roster-detail .ga-roster-role{font-size:14px}
  .ga-roster-detail .ga-roster-role>.ga-role-icon,body .ga-roster-detail .ga-fighter-stats{display:none}
  .ga-starter{font-size:12px;left:3px;top:4px}
  body .ga-select .ga-skin{justify-content:flex-start}.ga-roster .ga-pick{font-size:24px}
  .ga-roster-options h2{font-size:24px}
  @container (max-width:721.98px){body .ga-select .ga-choices{--cols:5}}
}
/* Portrait (phones and the upright iPad): the large hero on top, the grid under it, skin arrows and PICK at the foot. */
@media(orientation:portrait){
  body .ga-panel.ga-select{--cols:5;--rows:3;padding:8px 12px 10px;height:calc(100dvh - var(--ga-safe-top,0px) - var(--ga-safe-bottom,0px) - 16px)}
  .ga-roster{grid-template-columns:minmax(0,1fr) minmax(120px,30%);grid-template-rows:minmax(150px,34%) minmax(0,1fr) 64px;
    grid-template-areas:'detail detail' 'grid grid' 'skin pick'}
  .ga-roster-detail>[data-roster-preview]{display:grid;grid-template-columns:minmax(0,46%) minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);
    column-gap:12px;align-content:start}
  .ga-roster-detail .ga-big-hero{grid-row:1/-1;height:100%}
  .ga-roster-detail h3{font-size:30px}
}
@media(orientation:portrait) and (max-width:600px){
  body .ga-panel.ga-select{--gap:8px;--pad:4px;--cols:3;--rows:3;padding:6px 8px 8px}
  body .ga-select h2{font-size:22px}.ga-fighters-top{gap:6px}.ga-tabs{gap:6px}.ga-tabs button{min-width:64px;padding:0 8px;font-size:18px}
  .ga-roster{gap:8px;grid-template-rows:minmax(140px,30%) minmax(0,1fr) 64px}
  .ga-roster-detail h3{font-size:24px}.ga-fighter-stats{gap:3px}.ga-fighter-stat>span{font-size:12px}
  body .ga-select .ga-choice strong{font-size:17px}
  body .ga-select .ga-skin{gap:4px;font-size:12px}body .ga-select .ga-skin span{line-height:1.15}
}
/* Locked fighter (VG-579, VG-588): greyed, a padlock, no words; no tap or pad press picks it. */
body .ga-select .ga-choice.ga-locked{background:#1d3a44;cursor:default}
body .ga-select .ga-choice.ga-locked .ga-portrait img{filter:grayscale(1) brightness(.45)}
body .ga-select .ga-choice.ga-locked>.ga-role-icon{visibility:hidden}
body .ga-select .ga-choice.ga-locked strong{color:#8fa3a0}
.ga-lock{position:absolute;right:5px;top:5px;z-index:3;width:22px;height:22px;padding:6px;border:2px solid #1c1a24;border-radius:50%;background:#ffc93c;color:#142d39}
@media(prefers-reduced-motion:reduce){body .ga-select .ga-choice,body .ga-select .ga-choice[aria-pressed=true]{animation:none;transition:none;transform:none}}
/* Batch 18: VG-724's Papiamento heading (Luchadonan) fits beside Back and the two tabs on a 360 px phone. */
@media(orientation:portrait) and (max-width:380px){body .ga-select h2{font-size:19px}}
