/* LAWS:
   - design only. No copy, no logic, no data — a rule here decides how the trophy screen LOOKS and
     nothing about what it says or what it may open.
   - colours come from ui/kit tokens; geometry from the --tr* raw tokens. No hex, no px literal
     (spelltrail/tools/ui-gate.mjs check ①), which is also why a look can restyle this screen
     without opening it.
   - the map's own paint is map.js's (.qm*). This sheet frames it and never reaches inside it.
   History: NOTES.md */

/* ══ THE TROPHY MAP (TROPHY-MAP-SPEC §3, drawn in outputs/trophy-map-design/) ═══════════════════
   Landscape: the country on the left, the ledger of what was found in it on the right. Portrait
   stacks — the owner's ruling, and the honest one: a 60/40 split squeezed onto a phone is two
   things too small rather than one thing at a time.

   IT IS PARCHMENT, DELIBERATELY, ON A DARK APP. Every other screen here is the night palette; this
   one is paper, because the thing it is a frame for is a painted map and a map in a dark chrome
   reads as a photograph of a map. The map screen already made this choice (map.js paints its stage
   in parchment); this screen extends it to the whole surface rather than floating paper on night. */
/* THE SCREEN IS THE VIEWPORT, AND THE LEDGER SCROLLS INSIDE IT — not the page. Without this the
   whole surface grows to the height of 35 rows and the map scrolls off the top of the window, which
   is the opposite of what a map-and-list screen is for: the country must stay in sight while you
   read the list beside it. body.mapfull has already taken the h1, the tagline and the footer out of
   the way, so the screen may have the whole window. dvh, not vh, because a phone's address bar is
   not a constant. */
#trophy{ padding:0; }
#trophy.show{ display:flex; flex-direction:column; }
#trophyhost{ display:flex; flex-grow:1; min-height:0; }
.trroot{
  display:flex; flex-direction:column; min-height:0; flex-grow:1; height:100dvh;
  background:linear-gradient(180deg,var(--parch),var(--parch2));
  color:var(--parchInk);
  font-family:var(--fbody);
  border-radius:var(--trR); overflow:hidden;
}

/* ── the header band ──────────────────────────────────────────────────────────────────────────── */
/* ONE ROW, AT EVERY WIDTH (§36 (d), laws 1 and 3). It used to wrap — `flex-wrap:wrap` plus three
   text pills — and at 390px that cost 221px of header above a 228px map. The three controls are
   44px icons now, so there is nothing left to wrap and the rule that allowed it is gone: a header
   that can grow to four rows is a header that will. */
.trhead{
  display:flex; align-items:center; justify-content:space-between; gap:calc(var(--trGap)*.5);
  padding:calc(var(--trGap)*.4) calc(var(--trPad)*.65);
  border-bottom:var(--trRule) solid rgba(59,44,20,.22);
  flex-shrink:0;
}
.trheadL{ display:flex; align-items:center; gap:calc(var(--trGap)*.5); min-width:0; flex-grow:1; }
/* `min-width:0` on BOTH the row and the title block: a flex item's default `min-width:auto` is its
   content, so the ellipsis below never fires and the tally simply runs on under the icons. */
.trheadT{ min-width:0; flex-grow:1; }
.trheadR{ display:flex; align-items:center; gap:calc(var(--trGap)*.4); flex-shrink:0; }
/* the round pill the app bar's own three wear, in this screen's parchment. 24 inside 44, so every
   stroke lands on a whole pixel at any ratio (§34.5's measurement, law 6). */
.trbtn.tricon{
  width:var(--trTap); height:var(--trTap); padding:0; flex-shrink:0;
  border-radius:var(--trPill); justify-content:center;
}
.trbtn.tricon svg{ width:1.5rem; height:1.5rem; display:block; }
.trtitle{ font-family:var(--fdisp); font-weight:900; font-size:1.55rem; line-height:1.15; }
.trsub{ font-size:.9rem; color:var(--parchInk2); }
/* the header's own tally is ONE line: it is a glance, not a paragraph, and on a phone it used to
   take two rows of the band the icons were bought to shrink. The ledger's `.trsub` (the empty-map
   line) is deliberately untouched — it is a sentence and it is allowed to wrap. */
.trheadT .trtitle, .trheadT .trsub{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* every control on this screen wears the same quiet parchment chrome, and every one of them is at
   least a 44px target — this is a screen a six-year-old uses with a thumb. */
.trbtn{
  display:inline-flex; align-items:center; gap:.5rem;
  min-height:var(--trTap); padding:.5rem .95rem; border-radius:var(--trPill);
  background:rgba(255,250,240,.6); border:calc(var(--trRule)*.75) solid rgba(95,76,36,.35);
  color:var(--parchInk2); font:inherit; font-weight:800; font-size:.9rem; cursor:pointer;
}
@media (hover:hover){ .trbtn:hover{ background:rgba(255,250,240,.9); } }
.trbtn:focus-visible{ outline:var(--trRule) solid var(--cyan); outline-offset:.12rem; }
/* ── THE HEADER LEGEND IS GONE (owner's polish ruling, 2026-09-01) ─────────────────────────────
   `.trlegend` / `.trlegbtn` and their three swatches were removed with it. The gesture that
   survived is the one on the medals themselves, and the three definitions moved inside the story
   panel (ui/screens/journey/journey.css `.jpick`) so none of them became unreachable. Nothing is
   left here to style: an empty ruleset for a removed element is the kind of debt this file's own
   header argues against. */

/* ── THE MEDAL BOARD'S BAND (ROADMAP §11.4) ───────────────────────────────────────────────────
   One full-width slot between the header and the country, owned by ui/screens/journey/ and styled
   there. This is the SLOT and nothing else: it holds no paint of its own, and it collapses to
   nothing on a child with no medals because the board draws nothing into it. */
.trshelf{ flex-shrink:0; }

/* ── the two halves ───────────────────────────────────────────────────────────────────────────── */
.trbody{ display:grid; grid-template-columns:minmax(0,1fr) var(--trLedger); flex-grow:1; min-height:0; }
/* the plate keeps its own aspect, so a pane taller than the paper has air above and below it —
   centred, because paper pinned to the top of a tall pane reads as a layout that gave up. */
.trmap{ position:relative; overflow:hidden; padding:var(--trGap); min-width:0;
  display:flex; align-items:center; justify-content:center; }

/* map.js's root is a column; with the chrome off it is just the paper, and the paper keeps the
   plate's own aspect. It must NOT be stretched to the pane's height — a stretched root leaves the
   stage pinned to the top of a tall column with a dead parchment band above it, which is exactly
   what the zoom buttons were floating in. Content height, centred by .trmap. */
.trmap .qmstage{ width:100%; }

/* ── THE GLINT ON A WON PLACE ──────────────────────────────────────────────────────────────────
   A pin wearing a medal ring catches the light, slowly, on THIS screen only. The country is the
   trophy cabinet's other half and it was the half that said nothing: the ledger listed the medals
   and the map beside it drew the same three rings it draws while travelling.

   IT IS HERE AND NOT IN map.js ON PURPOSE. The grade classes are already on the pin — map.js puts
   them there from ctx.gradeFor, which is a pure read this screen already hands in — so the glint
   costs no new read, no new hand-off, and not one line inside the file whose reads three separate
   guards are written around. `.trmap` scopes it: the travelling map is unchanged, because a pin
   that shimmers while you are choosing where to GO is a pin asking to be pressed, and this is the
   standing surface where nothing is being asked.

   Slow, small, and off entirely under reduced motion — the same contract map.js's own here-pulse
   keeps. No art file: a sparkle a child can see at pin size is a sparkle that competes with the
   medal, and the ring is already the mark. */
@keyframes trglint{
  0%,88%,100%{ filter:none; }
  94%{ filter:brightness(1.22) saturate(1.12); }
}
.trmap .qmpin.g-bronze,
.trmap .qmpin.g-silver,
.trmap .qmpin.g-gold{ animation:trglint 7s ease-in-out infinite; }
/* the three are deliberately out of step: a country that twinkles in unison reads as a screensaver */
.trmap .qmpin.g-silver{ animation-delay:2.3s; }
.trmap .qmpin.g-gold{ animation-delay:4.1s; }
@media (prefers-reduced-motion:reduce){
  .trmap .qmpin.g-bronze,
  .trmap .qmpin.g-silver,
  .trmap .qmpin.g-gold{ animation:none; }
}
/* ══ A WORD'S FOOTPRINT (ROADMAP §37.7) ═════════════════════════════════════════════════════════
   Tap a word on the board and the places it touches light: a ring drawn OUTSIDE the pin, so the
   pin's own grade ring and the selection outline underneath are untouched. Ink, never gold — gold
   on this map means EARNED, and a footprint is where a word lives, not what was won there. The
   word's home wears a solid ring and every other place a dashed one: the same place, her word.
   It draws in once and then stands still; under reduced motion it simply appears. trophy.js puts
   the two classes on (a view operation, cleared when the row closes), and only on reached pins. */
@keyframes trfpin{ from{ transform:scale(.4); opacity:0; } to{ transform:none; opacity:1; } }
.trmap .qmpin.trfp::after{
  content:''; position:absolute; pointer-events:none; border-radius:50%;
  inset:calc(var(--trRule) * -3 * var(--qmz,1));
  border:calc(var(--trRule) * var(--qmz,1)) dashed var(--parchInk);
  animation:trfpin .45s ease-out both;
}
.trmap .qmpin.trfphome::after{ border-style:solid; }
@media (prefers-reduced-motion:reduce){
  .trmap .qmpin.trfp::after{ animation:none; }
}
/* the holder map.js mounts into: it is the thing that gets centred, and the zoom rides on IT so the
   buttons land on the paper's corner rather than in the air above it. */
.trhold{ position:relative; width:100%; }

/* the zoom pair, TOP-LEFT on both frames (owner ruling): the bottom-left of the plate is the palms,
   the jetty and the whole village — its busiest corner. Top-left is mesa and sky. */
.trzoom{
  position:absolute; left:var(--trGap); top:var(--trGap);
  display:flex; flex-direction:column; border-radius:var(--trRsm); overflow:hidden;
  border:calc(var(--trRule)*.75) solid rgba(95,76,36,.45);
  box-shadow:0 .4rem 1.1rem -.5rem rgba(59,44,20,.55); z-index:2;
}
.trzoom button{
  width:var(--trTap); height:var(--trTap); background:var(--parch); border:none;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  font-family:var(--fdisp); font-weight:900; font-size:1.25rem; color:var(--parchInk); line-height:1;
}
.trzoom button + button{ border-top:calc(var(--trRule)*.75) solid rgba(95,76,36,.3); }
/* a spent zoom dims its SIGN, not its tile (polish survey 2026-11-11): see-through paper read as a broken button */
.trzoom button:disabled{ color:rgba(59,44,20,.3); cursor:default; }

/* ── the ledger ───────────────────────────────────────────────────────────────────────────────── */
.trled{
  position:relative; display:flex; flex-direction:column; min-height:0;
  background:linear-gradient(180deg,var(--parchHi),var(--parch) 55%,var(--parch2));
  box-shadow:-.9rem 0 1.9rem -1.1rem rgba(59,44,20,.55);
}
.trledhd{ padding:var(--trPad) var(--trPad) calc(var(--trGap)*.6); flex-shrink:0; }
.trledhd h2{ margin:0; font-family:var(--fdisp); font-weight:900; font-size:1.2rem; }
.trledhd p{ margin:.2rem 0 0; font-size:.9rem; color:var(--parchInk2); }
.trrows{ display:flex; flex-direction:column; gap:.6rem; padding:0 var(--trGap) var(--trPad); overflow-y:auto; }

.trrow{
  display:flex; align-items:center; gap:.85rem; width:100%; text-align:left;
  padding:.7rem .85rem; border-radius:var(--trR); font:inherit; color:inherit; cursor:pointer;
  background:rgba(255,250,240,.66); border:calc(var(--trRule)*.75) solid rgba(95,76,36,.22);
}
@media (hover:hover){ .trrow:hover{ background:rgba(255,250,240,.92); } }
.trrow:focus-visible{ outline:var(--trRule) solid var(--cyan); outline-offset:.12rem; }
.trrow.sel{
  background:linear-gradient(180deg,var(--parchLit),var(--parch));
  border:var(--trRule) solid rgba(122,92,20,.55);
  box-shadow:0 .7rem 1.6rem -1rem rgba(59,44,20,.6);
}
.trrow.here{ background:rgba(255,250,240,.9); border:var(--trRule) dashed rgba(122,92,20,.5); }
.trnm{ flex-grow:1; min-width:0; }
.trnm b{ display:block; font-weight:800; font-size:1rem; }
.trnm span{ display:block; font-size:.82rem; color:var(--parchInk2); }
.trcount{ font-size:.82rem; font-weight:700; color:var(--parchInk2); flex-shrink:0; }
/* the line a WON place with nothing finished shows in place of "0 of 8". It is a sentence rather
   than a number, so it is set as one: lighter, not bold, and it never reads as a score. */
.trcount.won{ font-weight:600; font-style:italic; max-width:11rem; text-align:right; line-height:1.25; }

/* ── ONE MEDAL GRAMMAR, EVERYWHERE. The disc is gold; the RING is the grade. It is the mark the
      pins already wear on the map (map.js .qmpin.g-*), so a child reads the ledger with what the
      country already taught them, and there is exactly one thing to learn. */
.trmed{ width:var(--trPin); height:var(--trPin); border-radius:50%; flex-shrink:0;
  background:var(--gold); border:var(--trRule) solid var(--goldD); }
.trmed.g-scouted{ background:var(--parch); }
/* `working` is not a medal — it is the place being explored right now, and the here-row already
   wears its own ring. This keeps a working row from falling through to no background at all. */
.trmed.g-working{ background:var(--parch); }
.trmed.g-bronze{ box-shadow:0 0 0 .19rem rgba(205,127,50,.55); }
.trmed.g-silver{ box-shadow:0 0 0 .19rem rgba(200,205,215,.75); }
.trmed.g-gold{ box-shadow:0 0 0 .19rem rgba(255,209,102,.9),0 0 .5rem .12rem rgba(255,209,102,.5); }
.trmed.here{ background:var(--parchLit); border-width:calc(var(--trRule)*1.5);
  box-shadow:0 0 0 .25rem rgba(255,209,102,.5); }
.trpips{ display:flex; gap:.3rem; flex-shrink:0; }
.trpips i{ width:var(--trPip); height:var(--trPip); border-radius:50%; display:block;
  background:rgba(95,76,36,.25); }
.trpips i.on{ background:var(--goldD); }

/* ── the expanded row: the place's own painting, then its exercises as tiles ──────────────────── */
/* THE PLATE HEADS THE TRAIL, which is what the in-quest location panel already does with the same
   two images. It matters most where there is least: the six Foundation places have no per-exercise
   art at all, so without this their expanded row is nothing but dashed frames. */
.trbody2{ display:flex; flex-direction:column; }
.trplate{ position:relative; margin:0 var(--trGap) .6rem; border-radius:var(--trRsm); overflow:hidden;
  border:var(--trRule) solid rgba(122,92,20,.5); }
.trplate img{ width:100%; display:block; } /* painted plates since the art program (2026-09-07) — pixelated would stair-step the brush */
/* the conquered variant wears the gold the medals wear — this is the most trophy-like image the
   app owns, and it should look earned. */
.trplate.won{ border-color:var(--goldD); box-shadow:0 0 0 .12rem rgba(255,209,102,.55); }
.trwon{ position:absolute; right:.4rem; top:.4rem; padding:.05rem .5rem; border-radius:var(--trPill);
  background:rgba(255,209,102,.92); color:var(--parchInk); font-size:.65rem; font-weight:800;
  letter-spacing:.06em; }

/* ── THE SKIES. The place's own painted backdrops, one per sky the child has actually stood under.
      A horizontal strip because that is what they are — the same view at different hours — and a
      grid would invite the eye to compare them as if they were different places. */
.trskies{ margin:0 var(--trGap) .7rem; }
.trskyhd{ font-size:.72rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase;
  color:rgba(95,76,36,.75); margin-bottom:.35rem; }
.trskystrip{ display:flex; gap:.5rem; overflow-x:auto; padding-bottom:.15rem; }
.trsky{ margin:0; flex:0 0 auto; width:8.5rem; }
.trsky img{ width:100%; display:block; border-radius:var(--trRsm); aspect-ratio:3/2; object-fit:cover;
  border:calc(var(--trRule)*.75) solid rgba(122,92,20,.45); }
.trsky figcaption{ font-size:.68rem; font-weight:700; color:var(--parchInk2); text-align:center;
  margin-top:.2rem; }

/* ── the exercises ────────────────────────────────────────────────────────────────────────────── */
.trspots{ display:grid; grid-template-columns:repeat(auto-fill,minmax(5.5rem,1fr));
  gap:.6rem; padding:.15rem var(--trGap) var(--trGap); }
.trsp{ position:relative; display:flex; flex-direction:column; gap:.35rem; } /* relative: the level medal's seat (journey.css .jlvseat) lies over the picture */
.trsp figure{ position:relative; margin:0; border-radius:var(--trRsm); overflow:hidden;
  border:var(--trRule) solid rgba(122,92,20,.5); aspect-ratio:5/3; background:rgba(255,250,240,.5); }
.trsp img{ width:100%; height:100%; object-fit:cover; display:block; } /* est_/won_ tiles are crops of painted plates now */
.trsp figcaption{ font-size:.75rem; font-weight:700; text-align:center; }
.trsp.done figure{ box-shadow:0 0 0 .12rem rgba(255,209,102,.55); }
/* NOT YET DONE is a quiet tile, never a struck-out one: it is an invitation, and nothing on this
   screen may shame (map.js's mist rule, carried over). */
.trsp.todo figure{ border-color:rgba(95,76,36,.3); filter:saturate(.45); opacity:.72; }
.trsp.todo figcaption{ color:var(--parchInk2); }
/* ── A BLANK IS A HOLE IN THE CONTENT, NEVER A HOLE IN THE CHILD (TROPHY-MAP-SPEC §5) ──────────
      An exercise nobody has painted yet must not sit in the same grammar as one the child has not
      done. So it is a DASHED EMPTY FRAME with no picture in it at all — visibly a gap in the book,
      not a dim version of something earned. The same frame carries the third case, an image the
      device has not cached yet, because to a child offline they are the same fact: nothing to look
      at here, and nothing about you. */
.trsp.blank figure{ border-style:dashed; border-color:rgba(95,76,36,.4); background:rgba(247,232,200,.45);
  display:flex; align-items:center; justify-content:center; filter:none; opacity:1; }
.trsp.blank figure::after{ content:""; width:1.1rem; height:1.1rem; border-radius:50%;
  border:var(--trRule) dashed rgba(95,76,36,.45); }
.trboss{ position:absolute; left:.3rem; top:.3rem; padding:.05rem .45rem; border-radius:var(--trPill);
  background:rgba(59,44,20,.78); color:var(--parch); font-size:.62rem; font-weight:800;
  letter-spacing:.04em; }
/* WHICH HELPING THIS IS. Tranche siblings share one painting — the art resolver strips the digit —
   so without a mark the second and third visit to one grapheme are pixel-identical tiles sitting
   next to each other, which reads as a bug rather than as three visits. Same corner as BOSS, and
   they are mutually exclusive: a boss is never a sibling. A disc, not a pill, so it can never be
   mistaken for the medal grammar — a level's own coin is metal, has a rim and sits below it, in the
   lower left (journey.css .jcoin; owner 2026-11-12). */
.trmore{ position:absolute; left:.3rem; top:.3rem; width:1.05rem; height:1.05rem; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(59,44,20,.7); color:var(--parch); font-size:.65rem; font-weight:800; }

/* ── THE HORIZON. Past here the child has not been, and A62's law says a place ahead opens
      nothing — so it is names and nothing else: no counts, no frames, no empty slots to fill.
      They fade with distance, which is what a horizon does. */
.trhz{ display:flex; align-items:center; gap:.75rem; margin:.5rem .15rem .15rem; }
.trhz i{ height:var(--trHair); flex-grow:1; background:rgba(95,76,36,.28); font-style:normal; }
.trhz b{ font-size:.75rem; font-weight:800; letter-spacing:.1em; color:rgba(95,76,36,.75); }
.trfar{ display:flex; flex-wrap:wrap; gap:.5rem 1rem; padding:.15rem .4rem; }
.trfar span{ font-size:.88rem; color:rgba(95,76,36,.6); }

/* ── PORTRAIT STACKS (owner ruling) ───────────────────────────────────────────────────────────── */
/* 56.25em is --trStack, in the one unit a media query can carry: a query is evaluated before the
   cascade, so it cannot read a custom property, and this is the single number in this sheet that
   therefore has to be written twice. Change --trStack and change this with it. */
@media (max-width:56.25em){
  .trbody{ grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto; }
  .trroot{ height:auto; min-height:100dvh; }
  .trmap{ aspect-ratio:3/2; flex-grow:0; }
  .trbody{ flex-grow:0; }
  .trled{ box-shadow:none; border-top:var(--trRule) solid rgba(95,76,36,.28); }
  .trrows{ overflow:visible; }
  .trtitle{ font-size:1.3rem; }
}

/* THE PRESS (polish survey 2026-11-11, item 8): a row settles under a finger and a button presses in; under reduced
   motion they dim instead. Tokens in kit/tokens.raw.css. */
.trrow:active{ transform:scale(var(--press-card)); }
.trbtn:active{ transform:scale(var(--press-small)); }
@media (prefers-reduced-motion:reduce){ .trrow:active, .trbtn:active{ transform:none; opacity:var(--press-dim); } }
