/* =====================================================================
   THE SCORE SCREEN — Zuhair's 442:535 (146:861 until Session H; the same slots)
   =====================================================================
   ONE FILE, TWO DOCUMENTS, AND THEY MUST BE THE SAME BYTES.

   The rig shell (rig/public/index.html) and the standalone game
   (rig/public/game/index.html) both draw this screen, and until S18 only the
   shell did -- the game still carried the portrait build's results panel, so
   http://localhost:8000/game/ and http://localhost:8000 showed two different
   screens for the same run. They were never shared code and never a stale
   path: they are two screens in two documents, and S17c had no reason to touch
   the second because a rider on a rig never sees it (game-host.js keeps the
   iframe hidden and the shell draws its own).

   WHY IT IS COPIED RATHER THAN LINKED. rig/bridge/server.js refuses to serve
   outside its --serve directory and tests/harness.py serves rig/public/game as
   a root, so the game document cannot reach `../score.css` -- the same
   constraint that puts a copy of the fonts at rig/public/game/fonts/. The
   copies are kept honest by tests/score_figma_game.py, which fails if the two
   files differ by a byte, and by score_figma.py and score_figma_game.py
   measuring the SAME Figma ink boxes against the two documents independently.

   EDIT rig/public/score.css AND RE-COPY:

       cp rig/public/score.css rig/public/game/score.css

   THE PALETTE AND THE FACE ARE DECLARED ON .sc-frame, not inherited. The two
   documents disagree at :root -- the shell has --orange #ff5900 and the game's
   core/shell.css has #ff6b00, the pre-S17 shell orange, with the brand palette
   scoped to #hud. Inheriting would have drawn this screen in two oranges. The
   values are the shell's, which are Zuhair's.

   The seven images it loads sit at `assets/score-*` in BOTH documents, which is
   what lets this file be byte-identical: rig/public/assets/ and
   rig/public/game/assets/. Copied by hand for the same reason as the CSS.
   ===================================================================== */

/* ------------------------------------------------------ result — 442:535 */

/* ZUHAIR'S 442:535 SINCE SESSION H, AND IT IS 146:861 WITH NEW ART. Every ink box the
   score tests hold lands on the same pixel in both frames' renders; the ground and the
   logo are what changed. So the numbers below are still 146:861's, and still right.

   EVERY NUMBER BELOW IS A FRAME COORDINATE off 146:861, and getting them took
   one more step than the waiting screen did. 146:861 is a `contents` node, so
   get_design_context reports every child at left:0 top:0 -- the S14 trap in its
   original form. These come from get_metadata's absolute coordinates minus the
   SCREEN's origin, which is 146:862 "Group 15" at (13740, 1421), not the outer
   frame's (13660, 1259): the outer frame is 2000x1242 and carries the "option
   1" annotation chrome, and the screen is the 1920x1080 inside it.

   The text `top`s carry the same measured CSS-vs-Figma baseline correction the
   waiting screen's do. Re-measure with tests/score_figma.py; do not nudge. */

.sc-frame {
  /* Declared here, not inherited -- see the header. */
  --orange: #ff5900;
  --cream: #f4ede3;
  --maroon: #411517;
  font-family: 'Talabat', system-ui, sans-serif;
  position: absolute; inset: 0;
  background: var(--orange);
  color: var(--maroon);
  overflow: hidden;
}
.sc-frame > * { position: absolute; }

/* 442:537 since Session H (146:862 until then), flat. Everything static in one
   opaque image -- see tools/art/crop_score_assets.py for why it is not masked layers. */
.sc-bg { left: 0; top: 0; width: 1920px; height: 1080px; }
/* 442:570, the talabat mart lockup: Figma's box is 198x135.47 at (45.99, 46), and
   the render rounds the last row up -- the waiting screen's 442:83, the same art. */
/* SESSION S: LOGOS.pdf's lockup in his 442:570's place, grown as wide as the space allows -- one scale, never
   stretched (tools/art/make_mart_lockup_assets.py, which writes this box's own image). */
.sc-logo { left: 50px; top: 70px; width: 412px; height: 98px; }

/* 442:551, his name box -- ALL OF IT SINCE SESSION O. The avatar (442:550's sticker,
   442:552's person) sat inside its left end at 1126..1258, so any name with more than
   309px of ink, centred on the box's 1412.5, ran through the badge -- every measured
   full name did; the owner took the avatar off, and a name is fitted to the whole
   581px, where it was fitted all along. */
.sc-name {
  left: 1122px; top: 101px; width: 581px;
  font-size: 64px; font-weight: 900;
  /* Pinned in px for the same reason the waiting screen's is: the name shrinks
     to fit and a ratio line-height would walk the block up the frame as it
     does. 136 is Figma's own box height. */
  line-height: 136px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 146:882 / 146:883 / 146:884 -- one asset, three times. The 0.16deg is
   Zuhair's; it is what stops three identical strokes reading as ruled lines. */
.sc-rule {
  width: 725px; height: 71px;
  transform: rotate(.16deg);
}
.sc-rule.a { left: 1036px; top: 226px; }
.sc-rule.b { left: 1040px; top: 443px; }
.sc-rule.c { left: 1040px; top: 668px; }

/* The two label/value pairs share an axis: x = 1404, the centre of the 608px
   value boxes. Figma's POSITION label box is only 291 wide; it is widened to
   608 here, on the same centre, so the gap wording fits the same slot. */
.sc-lbl {
  left: 1100px; width: 608px;
  font-size: 36px; font-weight: 700;
  letter-spacing: 3.6px; text-indent: 1.8px;
  text-align: center;
}
.sc-val {
  left: 1100px; width: 608px;
  font-size: 96px; font-weight: 900;
  line-height: 92px;
  color: var(--orange);
  text-align: center;
  white-space: nowrap;
  /* NOT tabular. Tabular figures exist so a number that ticks IN PLACE does not
     shimmy; these are set once per rider and never change while on screen, and
     proportional is what Zuhair set. The one number here that does tick is the
     countdown, and it is the one that keeps it. */
}
.sc-val[hidden] { display: none; }

.sc-score-l { top: 301px; }
.sc-score   { top: 350px; }
.sc-pos-l   { top: 514px; }
.sc-pos     { top: 567px; }

/* The POST has not landed, or is being retried. Set smaller because it is a
   word where a number goes, and dimmed because it is a state, not a result. */
.sc-wait {
  font-size: 52px; font-weight: 700;
  letter-spacing: 2px;
  color: rgba(65, 21, 23, .45);
}

/* 146:885-892. Four columns on the label boxes' centres: 1065.5, 1306.5,
   1519.5, 1732.5. The first gap is 241 and the others 213 -- that is the
   frame's, not a rounding. */
.sc-stat { width: 213px; text-align: center; }
.sc-stat.a { left: 959px; }
.sc-stat.b { left: 1200px; }
.sc-stat.c { left: 1413px; }
.sc-stat.d { left: 1626px; }
.sc-stat { top: 774px; }
.sc-sl {
  display: block;
  font-size: 20px; font-weight: 700;
  letter-spacing: 1px; text-indent: .5px;
}
.sc-sv {
  display: block;
  margin-top: 25px;
  font-size: 48px; font-weight: 900;
  line-height: 48px;
  letter-spacing: 2.4px; text-indent: 1.2px;
  color: var(--orange);
  white-space: nowrap;
}

/* 146:894. Measured out of the flat export: the bar sits at +(0,22) in the
   416x92 group and the patch at +(324,0), with the label's ink centred on
   x=168 -- left of the bar's own centre, because the patch covers its right
   end -- and the number centred on the patch. */
.sc-cd { left: 790px; top: 948px; width: 416px; height: 92px; }
.sc-cd > * { position: absolute; }
.sc-cd-bar { left: 0; top: 22px; width: 377px; height: 70px; }
.sc-cd-t {
  left: 0; top: 44px; width: 336px;
  font-size: 21px; font-weight: 700;
  color: var(--cream);
  text-align: center;
}
.sc-cd-patch { left: 324px; top: 0; width: 92px; height: 86px; }
.sc-cd-n {
  left: 324px; top: 24px; width: 92px;
  font-size: 36px; font-weight: 900;
  color: var(--cream);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
