/* LAWS:
   - design only. No copy, no logic, no data — a rule here decides how the picker LOOKS and nothing
     about which faces exist, what they are called, or which one is stored.
   - colours come from the kit's semantic tokens; geometry from the --rs* raw tokens. No hex, no px
     literal (spelltrail/tools/ui-gate.mjs check ①).
   - EVERY SELECTOR IS INSIDE `.roster`, the class roster.view.js puts on the host it was handed.
     The two hosts (#newfaces and #facepick) keep their ids, their `.facerow` class and every rule
     that already applied to them — app.js still toggles #facepick with `display:flex` and that
     still works, because `.roster` only changes the DIRECTION of that flex.
   - THE CHIP ITSELF IS NOT RESTYLED. `.facechip` is index.html's, and a painted portrait inside one
     differs in exactly one way: `image-rendering`, which index.html decides from `data-art` for
     every picture in the app at once. A second copy of the chip's design here is how two
     vocabularies for one control start.
   History: NOTES.md */

.roster{
  display:flex; flex-direction:column; align-items:center; gap:var(--rsHeadGap);
  flex-wrap:nowrap;
}

/* ══ THE HEAD — the chosen explorer, large, with the name under it ═══════════════════════════
   New-explorer only. Home's look-picker leaves it out: the hero portrait one row above is already
   the chosen explorer large, beside the child's own greeting. */
.roster .rhead{ display:flex; flex-direction:column; align-items:center; text-align:center; }
.roster .rbig{
  width:var(--rsBig); height:var(--rsBig);
  display:flex; align-items:flex-end; justify-content:center;
}
.roster .rbig img{
  max-width:100%; max-height:100%; display:block; object-fit:contain;
}
.roster .rname{
  margin-top:var(--rsNameGap);
  font-family:var(--fdisp); font-weight:900; font-size:var(--rsName); color:var(--ink);
  line-height:1.15; word-break:break-word;
}

/* THE BOUNCE. It runs on the HEAD, not on the image, so the name rides up with the portrait and
   the two read as one object arriving. Re-triggered by roster.view.js removing and re-adding the
   class with a reflow between — a CSS animation cannot otherwise play twice for the same value. */
@keyframes rspop{
  0%   { transform:translateY(0) scale(1); }
  40%  { transform:translateY(calc(-1 * var(--rsPopLift))) scale(1.06); }
  100% { transform:translateY(0) scale(1); }
}
.roster .rhead.pop{ animation:rspop var(--rsPop) ease-out 1; }
@media (prefers-reduced-motion:reduce){ .roster .rhead.pop{ animation:none; } }

/* ══ THE GRID ════════════════════════════════════════════════════════════════════════════════
   Four fixed columns of the chip's own width. Fixed, not auto-fit: a roster whose shape changes
   with the card it is in is a roster a child has to re-learn every time they meet it. */
.roster .rgrid{
  display:grid;
  grid-template-columns:repeat(var(--rsCols), var(--rsChip));
  gap:var(--rsGap); justify-content:center; align-content:start;
}
@media (min-width:37.5em) and (orientation:landscape){
  .roster .rgrid{ grid-template-columns:repeat(var(--rsColsWide), var(--rsChip)); }
}

/* ══ THE COMPACT VARIANT — home's look-picker ════════════════════════════════════════════════
   No head, and the grid scrolls past --rsCap rather than growing to four rows. Opening the picker
   must cost one BLOCK of the page, not the rest of it: the child's primary action (Today's Quest)
   has to still be on the screen underneath (A49). */
.roster.rcompact .rgrid{
  max-height:var(--rsCap); overflow-y:auto; overscroll-behavior:contain;
  padding:var(--rsNameGap);
}
