/* Frosty (D11). James, 2026-09-30: "the ice one is pretty cool, add more snow falling and in the background, all sides should look snowy or icy. i like the northern lights in the back."
   Look reference: inbox/gemini-themes-2026-09-30/GEMINI-3.8-Flash__theme-christmas-C2.png
   (light ice-blue keys, glacier-navy keys, snow-white Top, pale ice rims with snow
   on the top edges, an aurora over a starry night, snow everywhere).
   DESIGNER-OWNED FILE (themes/CONTRACT.md). Every rule is zero-weight
   :where(body[data-theme="frosty"]); keys, panels, inks and lines are set
   through variables only, so a selected, matched, row/column or mistake key
   always keeps the game's look.

   Readability (D3/D9, measured in test/theme-frosty.test.mjs and on pixels):
   - Light keys (front+back ice, top+bottom snow): near-black navy givens, deep
     violet entries (an aurora fringe colour, far from navy), near-black notes
     (no glow, and in 3D a 0.35 px stroke of their own colour, --ink-note-stroke:
     tiny notes on a steep light face measured 2.5-3.3:1 without it), and
     earned clues in the entries' violet (as Supercharged's are its entries' lime),
     so a reward never reads as a given; their 3x3 lines are a deep glacier blue (a white line
     cannot reach 3:1 on a light key), with a cyan ice glow; their lit
     edges are dark, so every gutter reads >= 3:1 in the flat view.
   - Dark keys (right+left glacier navy): white givens, aurora-mint entries,
     pale ice notes, lime earned clues; icy white-cyan 3x3 lines.
   Snow caps: a ::after on the four side faces, inside the face's top padding
   and the keys' top 5 px only, never where a digit sits. No filter or shadow
   on any key (WebKit repaint cost). */

/* The northern lights over a snowy valley: the real plate, frosty/aurora.webp
   (ChatGPT/Codex GPT-6.1 Sol), shipped as two crops so each feature can be
   placed in the room a layout leaves it: aurora-sky.webp (the plate's rows
   0-640: the aurora, opaque to row 470, then fading clear) is pinned to the
   top, aurora-land.webp (rows 860-1844: mountains, a frozen lake, snowy firs
   and drifts, fading in over its first 150 rows) to the bottom, and the
   plate's own calm night blue (#0b2044, its rows 480-900) fills between
   them, so no screen shape ever shows a seam or a second aurora. */
:where(body[data-theme="frosty"]) .ambient{background:url(frosty/aurora-sky.webp) 50% 0/100% auto no-repeat,linear-gradient(180deg,#0d2549 0,#0b2044 55%,#0c244a 100%)}
@media(max-width:720px){:where(body[data-theme="frosty"]) .ambient{background:url(frosty/aurora-sky.webp) 50% 0/100% auto no-repeat,url(frosty/aurora-land.webp) 50% 100%/100% auto no-repeat,linear-gradient(180deg,#0d2549 0,#0b2044 55%,#0c244a 100%)}}
:where(body[data-theme="frosty"]) .ambient:after{opacity:0;background-image:none}
:where(body[data-theme="frosty"]) .topbar{background:#08183aa8;border-bottom-color:#bfeaff24}
/* The card: on a larger screen (the cube in the middle, room either side)
   the aurora stands over the header and the cube's top, and the firs rise
   either side of the cube with the valley at its foot. */
:where(body[data-theme="frosty"]) .stage-shell{border-color:#a8e4ff45;box-shadow:0 26px 90px #0009,inset 0 1px #e6f8ff2e;background:url(frosty/aurora-sky.webp) 50% -120px/100% auto no-repeat,url(frosty/aurora-land.webp) left 50% bottom -194px/100% auto no-repeat,linear-gradient(180deg,#0d2549 0,#0b2044 50%,#0c244a 100%)}
/* Phones: the cube (or a flat board) fills the stage's width, so the plate is
   laid out for what is left (sizes in vw: the card is the screen's width less
   8 px; the crops are 104% of it, 0.4657 px a plate row at 390 px):
   - 3D: the aurora fills the header and the corners above the cube's top;
     the mountain tops (plate row 1180) stand just under the cube's foot (the
     card's bottom less 256 px: the 161 px foot, the orbit strip, 10 px), so
     the lake and the snowy firs sit around the orbit buttons;
   - a flat board (Quick Play, the Face view) covers the stage: the aurora's
     bright band rises into the header (78 px up), and the mountains and lake
     move down behind the foot (the card's bottom less 98 px). */
@media(max-width:720px){
  :where(body[data-theme="frosty"]) .stage-shell{background:url(frosty/aurora-sky.webp) 50% 0/104% auto no-repeat,url(frosty/aurora-land.webp) left 50% bottom calc(262.5px - 80.96vw)/104% auto no-repeat,linear-gradient(180deg,#0d2549 0,#0b2044 50%,#0c244a 100%)}
  :where(body[data-theme="frosty"]):where(.flat-view) .stage-shell{background:url(frosty/aurora-sky.webp) 50% -78px/104% auto no-repeat,url(frosty/aurora-land.webp) left 50% bottom calc(104.5px - 80.96vw)/104% auto no-repeat,linear-gradient(180deg,#0d2549 0,#0b2044 50%,#0c244a 100%)}
}
/* The header is the reference's dark title bar: night blue behind the title
   and the mode label (its 9 px label sits right on the aurora's brightest
   streak), clearing to nothing at its foot, so the aurora rises from behind
   the cube without a seam at the stage's top edge. */
:where(body[data-theme="frosty"]) .stage-top{background:radial-gradient(ellipse 92px 30px at calc(100% - 78px) 41px,#0b2044d1 0,#0b2044a6 55%,#0b204400 100%),linear-gradient(180deg,#0b2044e6 0,#0b2044c7 50%,#0b204466 80%,#0b204400 100%)}
/* On a flat board the header is all the sky there is: night blue only behind
   the title and the label, and the aurora shows between them. */
:where(body[data-theme="frosty"]):where(.flat-view) .stage-top{background:radial-gradient(ellipse 92px 30px at calc(100% - 78px) 41px,#0b2044e0 0,#0b2044b3 55%,#0b204400 100%),radial-gradient(ellipse 128px 44px at 92px 48px,#0b2044e0 0,#0b2044b8 55%,#0b204400 100%),linear-gradient(180deg,#0b2044b3 0,#0b204466 45%,#0b204400 85%)}
/* Match the approved website scene: the original valley's foreground drifts
   sit at the stage's foot, above the sky plate and behind every cube face.
   The soft fade keeps the northern lights visible around the cube. */
:where(body[data-theme="frosty"]) .stage:before{background:url(frosty/aurora-land.webp) 50% 100%/100% auto no-repeat;-webkit-mask-image:linear-gradient(transparent 35%,#000 78%);mask-image:linear-gradient(transparent 35%,#000 78%)}
:where(body[data-theme="frosty"]) .stage:after{background:linear-gradient(90deg,#0b2044 1%,#0b204400 19% 81%,#0b2044 99%)}
@media(max-width:720px){:where(body[data-theme="frosty"]) .stage:after{background:none}}
:where(body[data-theme="frosty"]) .stage-halo{border-color:#c9f1ff24;box-shadow:0 0 60px #8fdcff29,inset 0 0 60px #bfeaff1f}
:where(body[data-theme="frosty"]) .floor{background:none}
:where(body[data-theme="frosty"]) .stage-bottom{background:linear-gradient(180deg,#081c3dbd 0,#071a38db 40%,#061632eb 100%);border-top-color:#bfeaff1f}
:where(body[data-theme="frosty"]) .reward-overlay{background:#030d1cdb}

/* Every face: a pale ice rim and an icy glow. */
:where(body[data-theme="frosty"]) .face{--face-rim:#cdeaff;--face-glow:#9fe6ff5c}
/* Light faces' digits (ice and snow keys). */
:where(body[data-theme="frosty"]) .face-front,:where(body[data-theme="frosty"]) .face-back,:where(body[data-theme="frosty"]) .face-top,:where(body[data-theme="frosty"]) .face-bottom{--ink-given:#050d1a;--ink-given-glow:#ffffff8c;--ink-entry:#2e1078;--ink-entry-glow:#ffffff99;--ink-note:#02060d;--ink-note-glow:#0000;--ink-note-stroke:.35px;--ink-earned:#2e1078;--ink-earned-glow:#ffffff80;--guide:#062a4a;--guide-glow:#39c6ff8c}
/* Front+back: ice blue. */
:where(body[data-theme="frosty"]) .face-front,:where(body[data-theme="frosty"]) .face-back{--face-panel:#4d8ab6;--gap:#79b2da}
:where(body[data-theme="frosty"]) .face-front .voxel,:where(body[data-theme="frosty"]) .face-back .voxel{--key:linear-gradient(145deg,#cdeeff,#84c4ea);--band-hi:#ffffffc7;--band-lo:#0b3a5e6b;--lit-side:#0b3d66d1;--lit-top:#0b3d66d6}
/* Right+left: glacier ice, deep and clear: a sea-ice blue (cooler and greener
   than Supercharged's navy) under frost: texture layers ahead of the key's
   colour in --key (drawn over the colour, under the digit): rime crystals in
   each key's top-left corner, a glassy shine on its upper left and frost at
   its foot, all clear of the middle where the digit sits. White digits,
   aurora-mint entries. */
:where(body[data-theme="frosty"]) .face-right,:where(body[data-theme="frosty"]) .face-left{--face-panel:#0b1c37;--gap:#06111f;--ink-given:#f4fbff;--ink-given-glow:#9fe6ff66;--ink-entry:#7dffc8;--ink-entry-glow:#3fe0b080;--ink-note:#d4f3ff;--ink-note-glow:#84e4ff73;--ink-earned:#cbff4e;--ink-earned-glow:#cbff4e;--guide:#c8f6ff;--guide-glow:#7fe3ffa6}
:where(body[data-theme="frosty"]) .face-right .voxel,:where(body[data-theme="frosty"]) .face-left .voxel{--key:radial-gradient(circle at 0 0,#ffffffe0 0 1px,#e6f7ff8c 2.2px,#e6f7ff00 5.5px),radial-gradient(circle at 100% 100%,#e6f7ff70 0 1px,#e6f7ff00 4px),linear-gradient(145deg,#eaf8ff57 0,#eaf8ff1f 17%,#eaf8ff00 34% 72%,#d6f1ff1c 88%,#d6f1ff3d 100%),linear-gradient(145deg,#215e7c,#0b3446);--band-hi:#dff6ff80;--band-lo:#030b18a8;--lit-side:#d6f4ffbf;--lit-top:#eefbffd9}
/* Top+bottom: snow white and silver. */
:where(body[data-theme="frosty"]) .face-top,:where(body[data-theme="frosty"]) .face-bottom{--face-panel:#7d98b3;--gap:#a9bfd3}
:where(body[data-theme="frosty"]) .face-top .voxel,:where(body[data-theme="frosty"]) .face-bottom .voxel{--key:linear-gradient(145deg,#f7fbff,#c3d2e2);--band-hi:#ffffffe6;--band-lo:#3a5a7a6b;--lit-side:#133a5ef2;--lit-top:#133a5ef5}

/* Snow caps on the cube's top edges: the four side faces' top edge (each one
   meets Top there). A thick snow line, a scalloped drift below it and a few
   short icicles; 8 px tall in all, so it covers the face's top padding (3 px
   on a phone) and at most the first row's top 5 px, never a digit (a digit
   starts 6 px or more below its key's top, even on a 320 px phone's 22 px
   keys). Gradients only. */
:where(body[data-theme="frosty"]) .face-front::after,:where(body[data-theme="frosty"]) .face-back::after,:where(body[data-theme="frosty"]) .face-right::after,:where(body[data-theme="frosty"]) .face-left::after{content:'';position:absolute;left:0;right:0;top:0;height:8px;z-index:6;pointer-events:none;background:
  linear-gradient(180deg,#ffffff 0,#f2faff 2px,#e3f3ff 3px,#e3f3ff00 3.5px) 0 0/100% 4px no-repeat,
  radial-gradient(circle at 50% 0,#f6fcff 0 2.6px,#f6fcff00 3.1px) 0 2px/11px 5px repeat-x,
  radial-gradient(circle at 50% 0,#e8f6ff 0 3.2px,#e8f6ff00 3.7px) 4px 1px/17px 5px repeat-x,
  radial-gradient(ellipse 1.1px 4.5px at 50% 0,#dcf3ffeb 0 96%,#dcf3ff00) 7px 3px/29px 5px repeat-x,
  radial-gradient(ellipse .9px 3.5px at 50% 0,#dcf3ffd9 0 96%,#dcf3ff00) 18px 3px/41px 5px repeat-x}
/* The start menu tile: a little frost on its edge. */
#theme-choices [data-theme-choice="frosty"] .theme-swatch{box-shadow:inset 0 0 0 1px #cdeaff59,inset 0 2px #ffffff40}

/* Real material at each key's corners. One static layer per face, below the
   box lines, with a clear centre. The 5% opacity bounds even a black/white
   material pixel; it preserves the three face-pair colours. The repeat
   pitch follows the shared grid (nine cells and its existing gaps).
   No per-key filter, shadow, animation or extra DOM. */
:where(body[data-theme="frosty"]){--material-gap:2px}
@media(max-width:500px){:where(body[data-theme="frosty"]){--material-gap:1px}}
:where(body[data-theme="frosty"]) .face::before{content:'';position:absolute;inset:var(--rail);z-index:4;pointer-events:none;opacity:.05;background-image:url(frosty/ice-tile.webp);background-size:calc((100% + var(--material-gap))/9) calc((100% + var(--material-gap))/9);background-repeat:repeat;-webkit-mask-image:radial-gradient(circle at 2px 2px,#000 0 2px,#0000 4px),radial-gradient(circle at calc(100% - 4px) calc(100% - 4px),#000 0 2px,#0000 4px);mask-image:radial-gradient(circle at 2px 2px,#000 0 2px,#0000 4px),radial-gradient(circle at calc(100% - 4px) calc(100% - 4px),#000 0 2px,#0000 4px);-webkit-mask-size:calc((100% + var(--material-gap))/9) calc((100% + var(--material-gap))/9);mask-size:calc((100% + var(--material-gap))/9) calc((100% + var(--material-gap))/9);-webkit-mask-repeat:repeat;mask-repeat:repeat}
/* Top/Bottom key edges in 3D stay 1 px for this theme (its gaps and box lines measured right at 1 px). */
:where(body[data-theme="frosty"]) .face{--pair-rim-3d:1px}
