/* Jack-o'-Lantern (D11). James's pick, 2026-09-30: the jack-o'-lantern look
   (inbox/lookdev/seasonal-halloween-01-jack-o-lantern.png). A charred cube on
   a foggy night: every key burnt dark, numbers that glow like a carved
   pumpkin's candle, ember-orange cracks between the boxes, set in the
   plate's hollow (the haunted house under a full moon, carved pumpkins at its
   foot), with low fog and faint sparks (the fog and sparks are jack.js's scene).
   DESIGNER-OWNED FILE (themes/CONTRACT.md). Every rule is zero-weight
   :where(body[data-theme="jack"]); keys, panels, inks and lines are set
   through variables only, so a selected, matched, row/column or mistake key
   always keeps the game's own look. Readability is measured, not guessed:
   test/theme-jack.test.mjs (declared colours) and the browser D3/D9 checks.
   Left navy on purpose (shared, not themeable): the native safe-area strips,
   meta theme-color #090b17 and the game's buttons. */

/* ---- Backdrop: the plate (jack/hollow.webp, see ASSET-SOURCES.md) ----
   The haunted house on its crag under a full moon at the top, a calm fog in
   the middle for the cube, carved pumpkins and candles at the foot.
   Phones (the card is the screen less 8 px: W = 100vw - 8px). The plate is
   laid out three times, so each part lands where the phone leaves room:
   - the card: the plate at 110% of W from its top-left corner, so the moon
     sits between the title and the mode label and the house behind the
     label, its crag in the corners above the cube (3D);
   - 3D: the stage's foot (.stage:before) carries the pumpkins either side of
     the orbit buttons (the plate's y 1760 at the stage's bottom edge), faded
     in under the cube so no edge shows; the bar below runs on from it;
   - a flat board covers the stage: the bar under it carries the pumpkin row
     (the plate from y 1450), darkened behind its text and end buttons.
   The card also pools dark behind the mode label (the house's moonlit clouds
   would wash it out). */
:where(body[data-theme="jack"]) .ambient{background:radial-gradient(ellipse 95% 36% at 50% 0%,#38404c5c,transparent 72%),radial-gradient(ellipse 75% 30% at 50% 104%,#c2410c3d,transparent 70%),#0b0807}
:where(body[data-theme="jack"]) .ambient:after{background-image:none}
:where(body[data-theme="jack"]) .stage-shell{background:radial-gradient(ellipse 120% 34% at 50% 0%,#2f37438f,transparent 76%),linear-gradient(172deg,#1a1411ef,#0e0a08f5 52%,#150c08ef);border-color:#ff8a2a30;box-shadow:0 26px 90px #000b,inset 0 1px #ffb27a1f}
@media(max-width:720px){
:where(body[data-theme="jack"]) .stage-shell{background:radial-gradient(ellipse 64px 22px at calc(100% - 82px) 42px,#0b0807b8,#0b080700),url(jack/hollow.webp) 0 0/110% auto no-repeat,#0b0807}
:where(body[data-theme="jack"]):where(:not(.flat-view)) .stage:before{background:url(jack/hollow.webp) 0 calc(100% + (100vw - 8px) * .09848)/100% auto no-repeat;-webkit-mask-image:linear-gradient(#0000 0,#0000 45%,#000 66%);mask-image:linear-gradient(#0000 0,#0000 45%,#000 66%)}
:where(body[data-theme="jack"]):where(.flat-view) .stage:before{background:none}
:where(body[data-theme="jack"]):where(:not(.flat-view)) .stage-bottom{background:url(jack/hollow.webp) 0 calc((100vw - 8px) * -2.0633)/100% auto no-repeat,#0b0807;border-top-color:#ff8a2a00}
:where(body[data-theme="jack"]):where(.flat-view) .stage-bottom{background:radial-gradient(ellipse 70px 30px at calc(100% - 58px) calc(100% - 31px),#0b0807e6 50%,#0b080700),radial-gradient(ellipse 56px 30px at 46px calc(100% - 31px),#0b0807e0 50%,#0b080700),linear-gradient(90deg,#0b080700 0,#0b0807a8 30% 70%,#0b080700 100%),url(jack/hollow.webp) 0 calc((100vw - 8px) * -1.6999)/100% auto no-repeat,#0b0807;border-top-color:#ff8a2a2e}
:where(body[data-theme="jack"]) .stage:after{background:none}
}
/* Wider screens: the card carries the plate at its width from its top (the
   moon and the house over the header and the cube's top), the stage the
   plate's foot (its bottom edge on the stage's), faded in under the cube. */
@media(min-width:721px){
:where(body[data-theme="jack"]) .stage-shell{background:linear-gradient(180deg,#0b080700 0,#0b080700 34%,#0b0807b3 62%,#0b0807 100%),url(jack/hollow.webp) 0 0/100% auto no-repeat,#0b0807}
:where(body[data-theme="jack"]) .stage:before{background:url(jack/hollow.webp) 0 100%/100% auto no-repeat;-webkit-mask-image:linear-gradient(#0000 0,#0000 40%,#000 62%);mask-image:linear-gradient(#0000 0,#0000 40%,#000 62%)}
:where(body[data-theme="jack"]) .stage:after{background:linear-gradient(90deg,#0b0807 0,#0b080700 7% 93%,#0b0807 100%)}
:where(body[data-theme="jack"]) .stage-bottom{background:#0b0807d9;border-top-color:#ff8a2a1f}
}
/* The orbit rings and the floor grid: embers instead of cyan. */
:where(body[data-theme="jack"]) .stage-halo{border-color:#ff8a2a1f;box-shadow:0 0 60px #ff6a1a1c,inset 0 0 60px #c2410c1c}
:where(body[data-theme="jack"]) .stage-halo:before,:where(body[data-theme="jack"]) .stage-halo:after{border-color:#ffa04a1c}
:where(body[data-theme="jack"]) .floor{background:repeating-linear-gradient(0deg,#ff9a4a17 0 1px,transparent 1px 35px),repeating-linear-gradient(90deg,#ff9a4a17 0 1px,transparent 1px 35px)}
/* Chrome around it. */
:where(body[data-theme="jack"]) .topbar{background:#0d0907c7;border-bottom-color:#ff8a2a1a}
:where(body[data-theme="jack"]) .reward-overlay{background:#0a0604de}

/* ---- Digits on plain keys (highlighted keys keep the standard inks) ----
   Givens: candle orange-amber with a pumpkin glow. Entries (and earned
   clues, as on Supercharged where both are lime): the reference's lantern
   green, so your numbers never read as the puzzle's. Notes: candle-wax cream. */
:where(body[data-theme="jack"]){--ink-given:#ffa640;--ink-given-glow:#ff6a00a6;--ink-entry:#aef260;--ink-entry-glow:#6fd82a8c;--ink-note:#ffdcaa;--ink-note-glow:#ff8a2a59;--ink-earned:#aef260;--ink-earned-glow:#7be03a}

/* ---- Faces: front+back charred black, right+left burnt umber, top+bottom
   deep plum, smoky like the reference's charred cube (all dark);
   ember-orange 3x3 cracks; dark rims with an ember glow.
   The real char-tile artwork is repeated at the keys' corners by the
   face pseudo-element below; the gradients add a brighter bevel while
   keeping the centre clear of texture. ---- */
:where(body[data-theme="jack"]) .face{--face-rim:#0b0705;--face-glow:#ff6a1a5c;--guide:#ffb15c;--guide-glow:#ff8a2ab8;--gap:#0a0605}
:where(body[data-theme="jack"]) .face-front,:where(body[data-theme="jack"]) .face-back{--face-panel:#110a07}
:where(body[data-theme="jack"]) .face-front .voxel,:where(body[data-theme="jack"]) .face-back .voxel{--key:radial-gradient(circle at 100% 100%,#ff6a1a66 0 1px,#ff6a1a00 6px),radial-gradient(circle at 0 100%,#ff8a2a40 0 .5px,#ff8a2a00 4.5px),linear-gradient(145deg,#ffc08a1c 0,#ffc08a00 24% 76%,#ff5a0a33 100%),linear-gradient(145deg,#2e2622,#141010);--band-hi:#ffcf9a4d;--band-lo:#030202b3;--lit-side:#e99b61c4;--lit-top:#e8a26ac4}
:where(body[data-theme="jack"]) .face-right,:where(body[data-theme="jack"]) .face-left{--face-panel:#190c05}
:where(body[data-theme="jack"]) .face-right .voxel,:where(body[data-theme="jack"]) .face-left .voxel{--key:radial-gradient(circle at 100% 100%,#ff6a1a66 0 1px,#ff6a1a00 6px),radial-gradient(circle at 0 100%,#ff8a2a40 0 .5px,#ff8a2a00 4.5px),linear-gradient(145deg,#ffc08a1c 0,#ffc08a00 24% 76%,#ff5a0a33 100%),linear-gradient(145deg,#4f2d16,#26140a);--band-hi:#ffc58a52;--band-lo:#0d0602b3;--lit-side:#ee9c5ecc;--lit-top:#f6b47ed1}
:where(body[data-theme="jack"]) .face-top,:where(body[data-theme="jack"]) .face-bottom{--face-panel:#150a12}
:where(body[data-theme="jack"]) .face-top .voxel,:where(body[data-theme="jack"]) .face-bottom .voxel{--key:radial-gradient(circle at 100% 100%,#ff6a1a66 0 1px,#ff6a1a00 6px),radial-gradient(circle at 0 100%,#ff8a2a40 0 .5px,#ff8a2a00 4.5px),linear-gradient(145deg,#ffc08a1c 0,#ffc08a00 24% 76%,#ff5a0a33 100%),linear-gradient(145deg,#3c2232,#1d0f18);--band-hi:#efc0d44d;--band-lo:#0a0408b3;--lit-side:#dcabc3e6;--lit-top:#ddb0c6cc}

/* ---- The menu tile: its swatch smoulders. ---- */
#theme-choices [data-theme-choice="jack"] .theme-swatch{box-shadow:inset 0 0 0 1px #ff8a2a4d,inset 0 -6px 10px #ff6a1a2e}

/* 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="jack"]){--material-gap:2px}
@media(max-width:500px){:where(body[data-theme="jack"]){--material-gap:1px}}
:where(body[data-theme="jack"]) .face::after{content:'';position:absolute;inset:var(--rail);z-index:4;pointer-events:none;opacity:.05;background-image:url(jack/char-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="jack"]) .face{--pair-rim-3d:1px}
