/* Kvellion — tekhelet blue, Jerusalem gold, parchment. Everything chunky, nothing rounded. */

@font-face {
  font-family: Handjet; font-weight: 400 900; font-display: swap;
  src: url(../fonts/handjet-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Handjet; font-weight: 400 900; font-display: swap;
  src: url(../fonts/handjet-hebrew.woff2) format('woff2');
  unicode-range: U+0590-05FF, U+20AA, U+FB1D-FB4F;
}

:root {
  --ink: #06102b; --ink2: #0b1c44; --line: #27407a;
  --gold: #ffd45e; --gold2: #d99a1e; --gold3: #a8731a;
  --parch: #f3e3b6; --parch2: #c9a85c; --parch-ink: #2b1a08; --parch-dim: #684c22;
  --text: #f6ecd0; --dim: #9db0d6; --edge: #2b1a08;
  --t-floater: #e3d2a4; --t-chochem: #ff9a3d; --t-mensch: #4aa8ff; --t-maven: #ff5a6e; --t-gaon: #a98bff; --t-kvellion: #ffd45e; --t-miss: #8492b3;
  --tc: var(--gold);
}
[data-tier='floater'] { --tc: var(--t-floater); }
[data-tier='chochem'] { --tc: var(--t-chochem); }
[data-tier='mensch'] { --tc: var(--t-mensch); }
[data-tier='maven'] { --tc: var(--t-maven); }
[data-tier='gaon'] { --tc: var(--t-gaon); }
[data-tier='kvellion'] { --tc: var(--t-kvellion); }
[data-tier='miss'] { --tc: var(--t-miss); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[role='dialog']:focus, #modal-body:focus { outline: none; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; overscroll-behavior: none; }
body { font-family: Handjet, 'Courier New', monospace; font-size: 20px; font-weight: 600; letter-spacing: .03em; line-height: 1.1; color: var(--text); -webkit-font-smoothing: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
img.px, .px { image-rendering: pixelated; image-rendering: crisp-edges; }
/* Running text is a step heavier and a hair apart (body), so Handjet's one-pixel crossbars stop lining up
   into a strike through the words. Display type and Hebrew keep the face as drawn. */
.title-he, .zone .he, .bsd, .pod b, #card-q, #candle-num, #land-pts, .final-nums b, .round-row .p, .streak-n, .legend .pt, .stat-grid b, .p-q, .p-win h2 { letter-spacing: 0; }

#app { position: fixed; left: 0; top: 0; width: 100%; height: 100dvh; overflow: hidden; background: var(--ink); --anchor: 42%; --mw: 240px; --room: 170px; --colw: 100vw; --gut: 0px; user-select: none; -webkit-user-select: none; }
/* --mw: how wide the menorah is drawn; --room: what the results sheet leaves free above it for the HUD;
   --colw: the column everything a viewer reads stays in, and --gut: what is left either side of it */
.setting.creator-only { display: none; } /* the setting for it, too, only where it can show */
/* Creator layout (a setting, for anyone recording for reels or TikTok): a stream gets cut down to
   a phone's shape, the middle of the picture, 9/16 of its height wide. So the HUD, the menorah,
   the tier lines, what floats by and the cards all stay in that column, laid out as on a phone of
   its width (sizes in --colw, not vw), and only the menu, the sound and the QR code (for whoever
   watches the whole stream) keep the edges. Not on short screens: nobody streams from those. */
@media (orientation: landscape) and (min-height: 621px) {
  #app.creator { --colw: min(100vw, 100dvh * 9 / 16); --gut: calc((100vw - var(--colw)) / 2); }
  #app.creator .icon-btn { top: calc(8px + env(safe-area-inset-top)); } /* the corners are free: up where Krillion keeps them */
  #app.creator .pod, #app.creator .hud-mid { background: var(--ink); } /* captions pass behind the menorah for whole rounds here */
  #app.creator #toast { max-width: calc(var(--colw) - 24px); white-space: normal; text-align: center; } /* a long one wraps instead of leaving the crop */
  .setting.creator-only { display: flex; }
}

/* ---------- the sea ---------- */
#scene { position: absolute; inset: 0; overflow: hidden; }
#scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
#scene .fore { pointer-events: none; }
#scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(rgba(0, 0, 0, .1) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(2, 4, 12, .55)); }
#app.urgent .vignette { background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(184, 44, 69, .5)); animation: urgent .5s steps(2) infinite; }
.flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: var(--fc, #fff); }
.flash.on { animation: flash .6s ease-out; }
#scene.shake { animation: shake .45s steps(8); }

.world { position: absolute; left: 0; top: 0; width: 100%; height: 0; will-change: transform; }
.surface { position: absolute; left: 0; right: 0; bottom: 58px; text-align: center; padding: 0 12px; }
.title { margin: 0; font-size: clamp(36px, min(calc(var(--colw) * .135), 15vh), 124px); font-weight: 900; line-height: .86; letter-spacing: .05em; color: var(--gold); text-shadow: 0 4px 0 var(--gold3), 0 8px 0 rgba(0, 0, 0, .35); }
[data-brand="gefillion"] .title { font-size: clamp(34px, min(calc(var(--colw) * .122), 15vh), 112px); } /* a letter longer */
.title span { display: inline-block; animation: wave 2.6s ease-in-out infinite; }
.title-he { font-size: clamp(22px, calc(var(--colw) * .050), 38px); font-weight: 700; color: #fff1b8; opacity: .85; margin-top: 2px; }
.tagline { margin-top: 8px; font-size: clamp(18px, calc(var(--colw) * .042), 28px); font-weight: 700; letter-spacing: .34em; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.subline { display: inline-block; margin-top: 6px; padding: 1px 8px 3px; font-size: clamp(15px, calc(var(--colw) * .034), 20px); color: #fff; background: rgba(6, 16, 43, .6); }

/* at the surface the water belongs to the home buttons; the markers appear once you dive */
.amb, .zone, .hud-mid, .surface { transition: opacity .5s steps(5); }
#app.diving .surface { opacity: 0; } /* the title bows out once the dive starts; the HUD needs that sky */
#app.at-surface .amb, #app.at-surface .zone, #app.at-surface .hud-mid { opacity: 0; }
.amb { position: absolute; max-width: min(calc(var(--colw) * .42), 320px); padding: 3px 9px 5px; font-size: clamp(18px, calc(var(--colw) * .038), 20px); line-height: 1.05; color: rgba(228, 239, 255, .94); background: rgba(4, 10, 28, .72); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.amb.L { left: calc(8px + var(--gut)); border-left: 3px solid rgba(205, 225, 255, .55); }
.amb.R { right: calc(8px + var(--gut)); text-align: right; border-right: 3px solid rgba(205, 225, 255, .55); }
.amb b { display: block; font-size: 18px; letter-spacing: .1em; color: rgba(255, 212, 94, .95); font-weight: 600; }
.zone { position: absolute; left: calc(12px + var(--gut)); max-width: calc(var(--colw) * .46); color: #d6ad4a; text-shadow: 0 3px 0 rgba(0, 0, 0, .5); }
.zone.R { left: auto; right: calc(12px + var(--gut)); text-align: right; }
.zone.C { left: 0; right: 0; max-width: none; text-align: center; }
.zone .he { display: block; font-size: clamp(40px, calc(var(--colw) * .100), 84px); font-weight: 800; line-height: .9; }
.zone .en { display: block; font-size: clamp(18px, calc(var(--colw) * .044), 30px); font-weight: 700; letter-spacing: .4em; }
.zone .sub { display: inline-block; margin-top: 2px; padding: 1px 8px 3px; font-size: clamp(14px, calc(var(--colw) * .032), 18px); color: #a9bbdc; background: rgba(4, 10, 28, .72); } /* a plate, as the depth captions have */
.zone::after { content: ''; display: block; height: 3px; margin-top: 8px; background: repeating-linear-gradient(90deg, rgba(255, 212, 94, .45) 0 9px, transparent 9px 18px); }

/* tier lines: the dashes are faint, the labels are not — reading them is the suspense */
.tline { position: absolute; z-index: 1; left: calc(var(--gut) + var(--colw) * .06); right: calc(var(--gut) + var(--colw) * .06); height: 0; border-top: 3px dashed var(--tc); border-top-color: color-mix(in srgb, var(--tc) 55%, transparent); transition: opacity .3s; }
.tline span { position: absolute; right: 0; bottom: 4px; padding: 0 7px 2px; font-size: 18px; font-weight: 600; letter-spacing: .1em; color: var(--tc); white-space: nowrap; background: var(--ink); }
.tline.passed { border-top-color: color-mix(in srgb, var(--tc) 22%, transparent); }
.tline.passed span { color: color-mix(in srgb, var(--tc) 55%, var(--ink)); }
.tline.hit { border-top: 3px solid var(--tc); filter: drop-shadow(0 0 8px var(--tc)); }
.tline.hit span { display: none; } /* the answer resting on it now carries the points, and the panel the name */
.tline.gone { opacity: 0; }
@supports not (color: color-mix(in srgb, red, blue)) {
  .tline { opacity: .7; }
  .tline.passed { opacity: .4; }
  .tline.hit { opacity: 1; }
}

.chip { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); max-width: calc(var(--colw) * .86); padding: 3px 12px 4px; font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--parch); color: var(--parch-ink); border: 3px solid var(--edge); box-shadow: 4px 4px 0 rgba(0, 0, 0, .35); }
.chip.landed { background: var(--tc); box-shadow: 0 0 18px var(--tc), 4px 4px 0 rgba(0, 0, 0, .35); }
.chip.landed small { margin-left: 8px; font-size: .85em; font-weight: 600; }
.chip.landed.old { filter: saturate(.4) brightness(1.15); box-shadow: none; }
.chip.pop { animation: pop 1.3s ease-out forwards; }

/* ---------- Gefilte ---------- */
#mascot { position: absolute; left: 50%; top: var(--anchor); z-index: 3; transform: translate(-50%, -58%); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mascot-sprite { display: block; animation: bob 2.6s ease-in-out infinite; transform-origin: 50% 60%; }
.mascot-sprite img { display: block; }
#mascot.dive .mascot-sprite { animation: swim .5s ease-in-out infinite; }
#mascot.sad .mascot-sprite { animation: none; filter: saturate(.35) brightness(.8); transform: rotate(-14deg) translateY(4px); }
#mascot.faint .mascot-sprite { animation: none; transform: rotate(168deg); transition: transform .5s; }
#mascot.happy .mascot-sprite { animation: hop .45s ease-in-out 4; }
#mascot.gold .mascot-sprite { filter: sepia(1) saturate(3.6) hue-rotate(-10deg) brightness(1.15) drop-shadow(0 0 10px var(--gold)); }
.mascot-say { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 10px; padding: 1px 10px 2px; font-size: 20px; font-weight: 700; white-space: nowrap; background: var(--parch); color: var(--parch-ink); border: 3px solid var(--edge); animation: sayin .18s steps(3); }
.mascot-say::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -3px; width: 6px; height: 6px; background: var(--edge); }

/* ---------- HUD ---------- */
#hud { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, calc(var(--mw) + 22px)) minmax(max-content, 1fr); align-items: start; gap: 6px 14px; padding: calc(8px + env(safe-area-inset-top)) calc(10px + var(--gut) + env(safe-area-inset-right)) 0 calc(10px + var(--gut) + env(safe-area-inset-left)); pointer-events: none; }
/* the menu and sound buttons sit in #hud's padding, so they keep the corners of the screen */
.pod { justify-self: start; min-width: 108px; padding: 4px 10px 6px; background: rgba(6, 16, 43, .8); border: 3px solid var(--gold2); box-shadow: 0 0 0 3px var(--ink), 5px 5px 0 2px rgba(0, 0, 0, .3); }
.pod.right { grid-column: 3; justify-self: end; text-align: right; }
.pod .lbl { display: block; font-size: 13px; letter-spacing: .2em; color: var(--dim); }
.pod .num { display: block; white-space: nowrap; }
.pod b { font-size: 34px; line-height: .86; font-weight: 700; color: var(--gold); }
.pod i { font-style: normal; font-size: 14px; color: var(--dim); margin-left: 4px; }
.pod.bump b { animation: bump .35s steps(4); }
.hud-mid { min-width: 0; text-align: center; padding: 4px 8px 5px; background: rgba(6, 16, 43, .8); border: 3px solid var(--line); box-shadow: 0 0 0 3px var(--ink); }
/* the dive at a glance: as wide as the HUD can spare, up to --mw; beside the play once the screen has a side (below) */
#menorah { display: block; width: 100%; height: auto; aspect-ratio: 120 / 44; margin: 0 auto; overflow: visible; }
#menorah .arms { stroke: #9a7630; }
#menorah .cups rect { fill: var(--gold2); }
#menorah .flames path { fill: rgba(255, 255, 255, .09); }
#menorah .flames path.now { fill: rgba(255, 255, 255, .55); animation: flick .6s steps(2) infinite; }
#menorah .flames path.lit { fill: var(--tc); filter: drop-shadow(0 0 3px var(--tc)); animation: flick .7s steps(2) infinite; }
#hud-round { margin-top: 3px; font-size: 16px; letter-spacing: .22em; color: var(--dim); white-space: nowrap; }
/* בס״ד — top right of the page, as on any letter; only at the surface */
.bsd { position: absolute; right: calc(136px + var(--gut) + env(safe-area-inset-right)); top: calc(14px + env(safe-area-inset-top)); font-size: 18px; color: rgba(255, 241, 184, .75); opacity: 0; transition: opacity .5s steps(5); }
#app.at-surface .bsd { opacity: 1; }
.icon-btn { position: absolute; top: calc(70px + env(safe-area-inset-top)); width: 40px; height: 38px; padding: 0; pointer-events: auto; cursor: pointer; background: rgba(6, 16, 43, .8); border: 3px solid var(--line); color: var(--dim); font-size: 24px; font-weight: 700; line-height: 1; }
.icon-btn:hover { border-color: var(--gold2); color: var(--gold); }
#btn-menu { left: calc(10px + env(safe-area-inset-left)); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
#btn-menu i { display: block; width: 18px; height: 3px; background: currentColor; }
#btn-sound { right: calc(10px + env(safe-area-inset-right)); display: flex; align-items: center; justify-content: center; }
#btn-sound .mute, #btn-sound.off .wave { display: none; }
#btn-sound.off .mute { display: block; }
#btn-sound.off { color: #6b7896; }

/* the way in for anyone watching a stream: beside the play, once the screen is wide enough to
   spare the room, and on the left, because the tier labels end on the right. Dark modules on
   parchment, four modules of it all round, so a phone can read it off a video; the size is
   whole pixels per module. */
#qr, .setting.qr-only { display: none; } /* the setting for it, too, only where it can show */
@media (min-width: 1100px) and (min-height: 600px) {
  #qr { --m: 5px; position: absolute; left: calc(16px + env(safe-area-inset-left)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 10px 9px; pointer-events: none; background: rgba(6, 16, 43, .8); border: 3px solid var(--gold2); box-shadow: 0 0 0 3px var(--ink), 5px 5px 0 2px rgba(0, 0, 0, .3); }
  .setting.qr-only { display: flex; }
  #qr b { font-size: 16px; font-weight: 700; letter-spacing: .24em; color: var(--gold); }
  #qr .qr-code { display: block; padding: calc(4 * var(--m)); background: var(--parch); border: 3px solid var(--edge); }
  #qr .qr-code img { display: block; width: calc(25 * var(--m)); height: calc(25 * var(--m)); }
  #qr i { font-style: normal; font-size: 17px; letter-spacing: .04em; color: var(--text); }
}
@media (min-width: 1600px) and (min-height: 860px) { #qr { --m: 6px; } }
#app.party-on #qr { z-index: 16; } /* a party is worth streaming too: above its curtain */

/* Where the screen has room beside the scroll, the menorah leaves the HUD for the left side,
   level with Gefilte, between the menu and the QR code, at twice its drawn size (three times
   on the biggest screens: whole multiples, so its pixels stay square). The tier lines draw
   in to clear it, and the top of the screen goes back to the results sheet. Not in the creator
   layout, which keeps it in the HUD, in the middle. */
@media (min-width: 1222px) and (min-height: 621px) {
  #app:not(.creator) { --side: 292px; --room: 40px; }
  #app:not(.creator) .hud-mid { position: absolute; left: calc(10px + env(safe-area-inset-left)); top: var(--anchor); width: calc(var(--mw) + 22px); padding: 10px 8px 8px; transform: translateY(-50%); border-color: var(--gold2); }
  #app:not(.creator) #hud-round { margin-top: 8px; font-size: 20px; }
  #app:not(.creator) .tline { left: var(--side); right: var(--side); }
  #app:not(.creator) :is(.amb.L, .zone.L) { left: var(--side); max-width: calc(50vw - var(--side) - 90px); } /* and what floats by on the left passes beside it, not under */
}
@media (min-width: 1462px) and (min-height: 860px) {
  #app:not(.creator) { --mw: 360px; --side: 412px; }
  #app:not(.creator) #hud-round { font-size: 24px; }
}

/* ---------- buttons ---------- */
.btn { position: relative; padding: 7px 16px 9px; font-size: 21px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; cursor: pointer; color: var(--parch-ink); background: var(--gold); border: 3px solid var(--edge); border-radius: 0; box-shadow: 0 5px 0 var(--gold3), 0 5px 0 3px var(--edge); }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold3), 0 1px 0 3px var(--edge); }
.btn:focus-visible, .icon-btn:focus-visible, .home-links button:focus-visible, #drawer button:focus-visible, .x:focus-visible, .round-row:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.parch :focus-visible, .parch.modal-box .x:focus-visible { outline: 3px solid var(--parch-ink); outline-offset: 3px; }
#modal-body:focus-visible { outline-offset: -7px; }
.btn.big { padding: 12px 26px 14px; font-size: clamp(22px, calc(var(--colw) * .056), 30px); animation: breathe 1.8s ease-in-out infinite; }
.btn.alt { background: var(--t-mensch); color: var(--ink); box-shadow: 0 5px 0 #1f62c4, 0 5px 0 3px var(--edge); }
.btn.alt:active { box-shadow: 0 1px 0 #1f62c4, 0 1px 0 3px var(--edge); }
.btn.ghost { background: transparent; color: #5c4320; border-color: #8a6a33; box-shadow: none; }
.btn.ghost:active { transform: translateY(2px); box-shadow: none; }
.btn[disabled] { opacity: .5; pointer-events: none; animation: none; }
.btn.small { padding: 3px 10px 5px; font-size: 16px; box-shadow: 0 3px 0 var(--gold3), 0 3px 0 3px var(--edge); }
.btn.small:active { transform: translateY(2px); }
.btn.ghost.small { box-shadow: none; }
.btn.alt.small { box-shadow: 0 3px 0 #1f62c4, 0 3px 0 3px var(--edge); }
a.btn { display: inline-block; text-align: center; text-decoration: none; }
/* unlimited, for players who have signed in: a lock where the ∞ was, so no button grows */
.needs-in .inf { display: none; }
.needs-in::before { content: ''; display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -1px; background: var(--lock) center / 100% no-repeat; image-rendering: pixelated; }
#card-form.wait .btn, .p-form.wait .btn { opacity: .55; pointer-events: none; }

/* ---------- stage: home, card, landed, final ---------- */
#stage { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; padding: 0 calc(12px + var(--gut) + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + var(--gut) + env(safe-area-inset-left)); pointer-events: none; }
#stage > section { pointer-events: auto; width: min(100%, 600px); }
#stage > section.in { animation: rise .28s steps(6); }

#home { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 4px; text-align: center; }
.home-date, #home-note:not(:empty) { padding: 1px 10px 3px; background: rgba(6, 16, 43, .78); }
.home-date { font-size: 19px; letter-spacing: .14em; color: #d6e6ff; }
.home-date span + span::before { content: ' · '; }
#home-note { min-height: 20px; font-size: 19px; color: #d6e6ff; }
#home-note b { color: var(--gold); font-weight: 600; }
.home-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.home-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.home-links button { padding: 8px 6px 6px; background: rgba(6, 16, 43, .78); border: 0; border-bottom: 3px solid rgba(214, 230, 255, .35); color: #d6e6ff; font-size: 18px; cursor: pointer; }
.home-links button:hover { color: var(--gold); border-color: var(--gold); }
@media (max-width: 340px) { .home-links [data-go="how"] { display: none; } } /* four links don't fit the narrowest phones; this one is in the menu too */

/* the scroll: parchment between two rollers */
.parch { position: relative; margin: 10px 19px; padding: 14px 16px; background: var(--parch) linear-gradient(rgba(255, 255, 255, .28), transparent 30%, rgba(160, 110, 40, .16)); color: var(--parch-ink); border: 3px solid var(--edge); box-shadow: inset 0 0 0 3px var(--parch2), 6px 6px 0 rgba(0, 0, 0, .4); }
.parch::before, .parch::after { content: ''; position: absolute; top: -12px; bottom: -12px; width: 16px; border: 3px solid var(--edge); background: linear-gradient(var(--gold) 0 8px, transparent 8px calc(100% - 8px), var(--gold) calc(100% - 8px)), linear-gradient(90deg, #5c381b, #b07a40 45%, #6b4424); }
.parch::before { left: -19px; }
.parch::after { right: -19px; }

#card .parch { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
.card-main { min-width: 0; }
.card-top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: .16em; color: var(--parch-dim); }
#card-q { margin: 4px 0 2px; font-size: clamp(26px, calc(var(--colw) * .064), 38px); font-weight: 700; line-height: .98; text-wrap: balance; }
#card-note { margin: 0 0 8px; font-size: 17px; color: var(--parch-dim); }
#card-note:empty { margin-bottom: 6px; }
#card-form { display: flex; gap: 10px; align-items: flex-start; }
#card-input { flex: 1; min-width: 0; height: 44px; padding: 4px 10px 6px; font: inherit; font-size: 25px; font-weight: 600; color: var(--parch-ink); background: #fff8e2; border: 3px solid var(--edge); border-radius: 0; outline: none; box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .12); user-select: text; -webkit-user-select: text; }
#card-input::placeholder, .p-form input::placeholder { color: #7a6238; opacity: 1; }
#card-input:focus { box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .12), 0 0 0 3px var(--t-mensch); }
#card-form.nope { animation: nope .3s steps(6); }
#card-msg { min-height: 22px; margin-top: 8px; font-size: 18px; color: var(--parch-dim); }
#card-msg.bad { color: #b82c45; font-weight: 700; }

.candle { display: flex; flex-direction: column; align-items: center; width: 36px; }
.candle-track { position: relative; flex: 1; width: 20px; min-height: 86px; margin-top: 24px; }
.candle-wax { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; background: linear-gradient(90deg, #fffbe9, #efdfae 55%, #c9b077); border: 3px solid var(--edge); }
.candle-flame { position: absolute; left: 50%; bottom: calc(var(--lit, 100%) + 1px); width: 14px; height: 22px; margin-left: -7px; background: linear-gradient(#ff9a3d, var(--gold) 45%, #fff 80%); clip-path: polygon(50% 0, 100% 55%, 80% 100%, 20% 100%, 0 55%); animation: flick .3s steps(2) infinite; filter: drop-shadow(0 0 5px #ff9a3d); }
.candle.unlit .candle-flame, .candle.out .candle-flame { display: none; }
.candle.low .candle-flame { animation-duration: .12s; }
#candle-num { margin-top: 3px; font-size: 27px; font-weight: 600; line-height: 1; }
.candle.low #candle-num { color: #b82c45; animation: bump .5s steps(4) infinite; }

.badge { display: inline-block; padding: 0 8px 2px; font-weight: 700; letter-spacing: .06em; background: var(--tc); color: #1a1005; border: 3px solid var(--edge); }
.land-head { display: flex; align-items: center; gap: 12px; }
#land-icon img, #final-icon img { display: block; }
.land-mid { min-width: 0; }
#land-tier { font-size: clamp(22px, calc(var(--colw) * .054), 30px); }
#land-ans { margin-top: 5px; font-size: 22px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
#land-ans small { display: block; font-size: 16px; color: var(--parch-dim); }
#land-pts { margin-left: auto; font-size: clamp(40px, calc(var(--colw) * .100), 58px); font-weight: 700; line-height: .9; }
#land-blurb { margin: 10px 0 14px; font-size: 20px; line-height: 1.12; text-wrap: pretty; }
#land-blurb:empty { display: none; }
#land-said { margin: -8px 0 12px; font-size: 17px; color: var(--parch-dim); }
.land-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding-bottom: 6px; }

#final { align-self: flex-end; }
#final .parch { display: flex; flex-direction: column; padding: 0; max-height: calc(var(--vh, 100dvh) - var(--room) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
#final .parch-in { overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 6px; scrollbar-width: thin; scrollbar-color: var(--parch2) transparent; }
.final-foot { position: relative; flex: none; padding: 12px 16px 10px; border-top: 3px solid var(--parch2); }
#final.more .final-foot::before { content: ''; position: absolute; left: 3px; right: 3px; bottom: 100%; height: 26px; background: linear-gradient(transparent, rgba(150, 105, 40, .45)); pointer-events: none; }
#final.more .final-foot::after { content: '▼ more'; position: absolute; left: 50%; bottom: calc(100% - 3px); transform: translateX(-50%); padding: 1px 10px 3px; font-size: 14px; letter-spacing: .12em; white-space: nowrap; color: var(--parch-dim); background: var(--parch); border: 3px solid var(--parch2); border-bottom: 0; pointer-events: none; }
.final-head { text-align: center; }
.final-head b { display: block; font-size: clamp(42px, calc(var(--colw) * .110), 66px); font-weight: 700; line-height: .9; letter-spacing: .06em; }
.final-head span { font-size: 18px; letter-spacing: .14em; color: var(--parch-dim); }
.final-band { display: flex; align-items: center; gap: 12px; margin: 12px 0 10px; padding: 8px 10px; background: rgba(255, 255, 255, .4); border: 3px solid var(--edge); }
.final-band p { margin: 5px 0 0; font-size: 19px; line-height: 1.1; text-wrap: pretty; }
.final-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.final-nums b { display: block; font-size: clamp(34px, calc(var(--colw) * .090), 48px); font-weight: 700; line-height: .9; }
.final-nums span { font-size: 15px; letter-spacing: .1em; color: var(--parch-dim); }
.final-hint { margin: 12px 0 4px; font-size: 15px; letter-spacing: .12em; text-align: center; color: var(--parch-dim); }
#final-rounds { list-style: none; margin: 0; padding: 0; }
.round-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; text-align: left; background: none; border: 0; border-top: 3px dotted var(--parch2); cursor: pointer; }
.round-row:hover { background: rgba(255, 255, 255, .35); }
.round-row .q { display: block; font-size: 16px; color: var(--parch-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-row .a { display: block; font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-row .p { font-size: 26px; font-weight: 600; }
.round-row > span:nth-child(2) { min-width: 0; }
.final-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 10px; padding-bottom: 6px; }
#final-next { margin-top: 6px; text-align: center; font-size: 19px; color: var(--parch-dim); }
#final-next:empty { display: none; }

/* the day's scores, in bars; streaks; the cards that say where the rest of us are */
.final-block { margin: 12px 0 0; padding: 8px 10px 10px; background: rgba(255, 255, 255, .4); border: 3px solid var(--parch2); }
.final-block h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; letter-spacing: .16em; color: var(--parch-dim); }
#curve { display: flex; align-items: flex-end; gap: 3px; height: 78px; padding: 20px 4px 0; border-bottom: 3px solid var(--edge); }
#curve i { position: relative; flex: 1; min-width: 0; background: var(--parch2); border: 2px solid var(--edge); border-bottom: 0; }
#curve i.you { background: var(--tc); }
#curve i.you b { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 3px; padding: 0 5px 1px; font-size: 13px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; background: var(--parch-ink); color: var(--parch); }
.curve-axis { display: flex; justify-content: space-between; padding: 0 4px; font-size: 14px; color: var(--parch-dim); }
#curve-line { margin: 4px 0 0; font-size: 18px; line-height: 1.1; text-wrap: pretty; }
#final-unlock { background: var(--t-kvellion); border-color: var(--edge); }
.unlock { display: flex; align-items: center; gap: 10px; }
.unlock + .unlock { margin-top: 8px; }
.unlock img { display: block; }
.unlock span { flex: 1; min-width: 0; font-size: 21px; font-weight: 700; line-height: 1; }
.unlock span b { display: block; font-size: 14px; letter-spacing: .16em; }
#streak-next { margin: 6px 0; font-size: 18px; line-height: 1.1; text-wrap: pretty; }
#streak-bar { height: 12px; margin-bottom: 8px; background: #fff8e2; border: 2px solid var(--edge); }
#streak-bar i { display: block; height: 100%; background: var(--t-chochem); }

.streak { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; color: #d6e6ff; }
button.streak { padding: 3px 10px 5px; cursor: pointer; background: rgba(6, 16, 43, .78); border: 3px solid var(--line); }
button.streak:hover { border-color: var(--gold2); }
button.streak:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.streak .fl img { display: block; }
.streak-n { font-size: 30px; font-weight: 700; line-height: .9; color: var(--dim); }
.streak.lit .streak-n { color: var(--gold); }
.streak-lbl { font-size: 15px; letter-spacing: .14em; white-space: nowrap; }
.week { display: inline-flex; gap: 3px; margin-left: 2px; }
.week i { width: 19px; height: 21px; font-style: normal; font-size: 14px; line-height: 17px; text-align: center; color: var(--dim); border: 2px solid var(--line); }
.week i.on { font-weight: 700; color: #1a1005; background: var(--t-chochem); border-color: var(--edge); }
.week i.today { border-color: var(--gold); }
.streak.risk .week i.today { animation: flick .6s steps(2) infinite; }
.parch .streak { flex-wrap: wrap; gap: 6px 8px; color: var(--parch-ink); }
.parch .streak-lbl { letter-spacing: .08em; }
.parch .streak-n, .parch .streak.lit .streak-n { color: var(--parch-ink); }
.parch .week i { color: var(--parch-dim); border-color: var(--parch2); }
.parch .week i.on { color: #1a1005; border-color: var(--edge); }
.parch .week i.today { border-color: var(--edge); }

/* the account: who is signed in, and the nudge to sign in */
.btn.discord { background: #5865f2; color: #fff; box-shadow: 0 5px 0 #3c45a5, 0 5px 0 3px var(--edge); }
.btn.discord:active { box-shadow: 0 1px 0 #3c45a5, 0 1px 0 3px var(--edge); }
.btn.discord.small { box-shadow: 0 3px 0 #3c45a5, 0 3px 0 3px var(--edge); }
.avatar { display: block; flex: none; border: 2px solid var(--edge); image-rendering: pixelated; background: var(--ink2); }
#final-account p { margin: 0 0 8px; font-size: 19px; line-height: 1.05; }
#final-account .acct-in { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.acct { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 8px 10px; background: rgba(255, 255, 255, .4); border: 3px solid var(--parch2); }
.acct > span { flex: 1; min-width: 0; }
.acct b { display: block; font-size: 22px; line-height: 1; overflow-wrap: anywhere; }
.acct i { display: block; margin-top: 2px; font-style: normal; font-size: 16px; line-height: 1.05; color: var(--parch-dim); }
#drawer-account { color: var(--gold); overflow-wrap: anywhere; }
#final-account .btn { margin: 0 6px 8px 0; }
#final-account #acct-saved { font-size: 16px; color: var(--parch-dim); overflow-wrap: anywhere; }
#final-account #acct-rank { font-weight: 700; }
button.link { padding: 0; font: inherit; color: inherit; text-decoration: underline; background: none; border: 0; cursor: pointer; }
/* the leaderboard */
.tabs { display: flex; gap: 6px; margin: 10px 0 8px; }
.tabs button { flex: 1; min-width: 0; padding: 4px 4px 6px; font-size: 17px; font-weight: 800; letter-spacing: .06em; cursor: pointer; color: var(--parch-dim); background: rgba(255, 255, 255, .35); border: 3px solid var(--parch2); }
.tabs button.on { color: var(--parch-ink); background: var(--gold); border-color: var(--edge); }
.board { margin: 0; padding: 0; list-style: none; }
.board li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-bottom: 3px dotted var(--parch2); font-size: 21px; line-height: 1; }
.board li.you { background: rgba(255, 212, 94, .45); border-bottom-style: solid; border-color: var(--gold3); }
.board li.gap { justify-content: center; padding: 0 6px 4px; border: 0; color: var(--parch-dim); }
.board .pl { flex: none; width: 34px; font-weight: 800; text-align: right; color: var(--parch-dim); }
.board li.p1 .pl { color: #a8731a; } .board li.p2 .pl { color: #6b7896; } .board li.p3 .pl { color: #9a5a2a; }
.board .nm { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.board .nm small { margin-left: 6px; font-size: 14px; letter-spacing: .1em; color: var(--parch-dim); }
.board b { flex: none; font-size: 24px; }
.board b small { margin-left: 3px; font-size: 14px; font-weight: 600; color: var(--parch-dim); }
.board .avatar { width: 24px; height: 24px; }
.board .avatar.ini { display: grid; place-items: center; font-size: 15px; font-weight: 800; color: var(--gold); text-transform: uppercase; }
#drawer-account .avatar { width: 24px; height: 24px; border-color: var(--gold2); }
.follow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 8px; }
.follow-card { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; color: #fff; text-decoration: none; border: 3px solid var(--edge); box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.follow-card.ig { background: #a3275f; }
.follow-card.tt { background: #1d1a24; }
.follow-card.yt { background: #b8261f; }
.follow-card.dc { background: #4752c4; }
.follow-card:hover { filter: brightness(1.12); }
.follow-card .ic img { display: block; }
.follow-card b { display: block; font-size: 18px; letter-spacing: .06em; line-height: 1; }
.follow-card i { display: block; margin-top: 2px; font-style: normal; font-size: 15px; line-height: 1; opacity: .92; overflow-wrap: anywhere; }

/* ---------- drawer + modal ---------- */
#drawer, #modal { position: absolute; inset: 0; z-index: 20; background: rgba(2, 5, 14, .7); }
.drawer-box { position: absolute; left: 0; top: 0; bottom: 0; width: min(86vw, 330px); display: flex; flex-direction: column; gap: 2px; padding: calc(14px + env(safe-area-inset-top)) 14px 14px; background: var(--ink2); border-right: 3px solid var(--gold2); overflow-y: auto; animation: slide .2s steps(5); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer-head b { font-size: 34px; font-weight: 900; letter-spacing: .06em; color: var(--gold); }
.drawer-box > button { display: flex; align-items: center; gap: 12px; padding: 9px 8px; text-align: left; font-size: 24px; font-weight: 600; background: none; border: 0; border-bottom: 3px solid var(--line); cursor: pointer; }
.drawer-box > button:hover { color: var(--gold); background: rgba(255, 255, 255, .05); }
.drawer-box > button span { display: inline-block; width: 24px; text-align: center; color: var(--gold); font-family: sans-serif; font-size: 18px; }
.drawer-box > button.needs-in::before { margin: 0 4px; }
.drawer-foot { margin: auto 0 0; padding-top: 16px; font-size: 17px; color: var(--dim); }
.x { width: 36px; height: 36px; padding: 0 0 4px; font-size: 30px; font-weight: 700; line-height: 1; cursor: pointer; background: none; border: 3px solid currentColor; }

#modal { display: flex; align-items: center; justify-content: center; padding: 20px calc(14px + var(--gut)); }
.modal-box { width: min(100%, 580px); max-height: 100%; display: flex; flex-direction: column; padding: 0; animation: rise .22s steps(5); }
.modal-box .x { position: absolute; right: 8px; top: 8px; z-index: 2; color: var(--parch-ink); background: var(--parch); }
#modal-body { overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 18px; scrollbar-width: thin; scrollbar-color: var(--parch2) transparent; user-select: text; -webkit-user-select: text; }
#modal-body h2 { margin: 0 44px 4px 0; font-size: clamp(30px, calc(var(--colw) * .074), 42px); font-weight: 700; line-height: .95; letter-spacing: .03em; text-wrap: balance; }
#modal-body h3 { margin: 16px 0 6px; font-size: 16px; letter-spacing: .18em; color: var(--parch-dim); }
#modal-body p { margin: 6px 0; font-size: 20px; line-height: 1.15; text-wrap: pretty; }
#modal-body .sub { color: var(--parch-dim); font-size: 18px; }
.rules { margin: 10px 0; padding: 0; list-style: none; counter-reset: r; }
.rules li { position: relative; padding: 4px 0 6px 34px; font-size: 21px; line-height: 1.1; border-top: 3px dotted var(--parch2); counter-increment: r; }
.rules li::before { content: counter(r); position: absolute; left: 0; top: 3px; width: 22px; height: 22px; font-size: 18px; font-weight: 700; line-height: 20px; text-align: center; background: var(--parch-ink); color: var(--parch); }
.legend { display: grid; gap: 6px; margin: 8px 0; }
.legend > div { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; }
.legend .nm { font-size: 20px; font-weight: 700; }
.legend .bl { display: block; font-size: 16px; color: var(--parch-dim); }
.legend .pt { font-size: 26px; font-weight: 600; }
.sheet-tier { margin-top: 12px; }
.sheet-tier .badge { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.sheet-tier .n { margin-left: 8px; font-size: 18px; color: var(--parch-dim); }
.ans { display: inline-block; margin: 0 6px 6px 0; padding: 0 7px 2px; font: inherit; font-size: 18px; color: inherit; background: #fff8e2; border: 2px solid var(--parch2); border-radius: 0; }
button.ans { cursor: pointer; }
button.ans::after { content: ' •'; color: var(--parch-dim); }
button.ans:hover { border-color: var(--edge); }
.ans.you { background: var(--tc); border-color: var(--edge); font-weight: 700; }
.rule { padding: 6px 8px !important; font-size: 18px !important; background: rgba(255, 255, 255, .4); border-left: 3px solid var(--parch2); }
.rule b { margin-right: 6px; font-size: 13px; letter-spacing: .16em; color: var(--parch-dim); }
.sheet-quip { position: sticky; top: 0; z-index: 1; margin: 8px 0 !important; padding: 5px 46px 7px 8px; font-size: 18px !important; color: var(--parch-dim); background: var(--parch); border: 3px dashed var(--parch2); }
.sheet-quip.on { color: var(--parch-ink); background: #fff8e2; border: 3px solid var(--edge); }
.hats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.hat { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 8px 4px 9px; font: inherit; color: inherit; text-align: center; cursor: pointer; background: rgba(255, 255, 255, .4); border: 3px solid var(--parch2); border-radius: 0; }
.hat b { font-size: 18px; line-height: 1; }
.hat > span:last-child { font-size: 14px; line-height: 1.05; color: var(--parch-dim); }
.hat i { display: block; font-style: normal; white-space: nowrap; }
.hat .pic { position: relative; display: block; }
.hat .pic img { display: block; }
.hat.locked { cursor: default; }
.hat.locked .pic img:first-child { filter: grayscale(1) contrast(.7) brightness(.9); opacity: .6; }
.hat .lock { position: absolute; right: -8px; bottom: 0; }
.hat.on { background: var(--t-kvellion); border-color: var(--edge); }
.hat.on > span:last-child { color: var(--parch-ink); }
.story-img { display: block; width: auto; max-width: 100%; max-height: min(58vh, 540px); margin: 8px auto; border: 3px solid var(--edge); }
.story-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 12px 0 6px; padding-bottom: 6px; }
.arc-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 7px 0; border-top: 3px dotted var(--parch2); }
.arc-row .d b { font-size: 22px; font-weight: 600; }
.arc-row .d span { display: block; font-size: 18px; color: var(--parch-dim); }
.arc-row .e { font-family: sans-serif; font-size: 14px; letter-spacing: 1px; }
.arc-row .btn { font-size: 17px; padding: 4px 10px 6px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; margin: 10px 0; text-align: center; }
.stat-grid b { display: block; font-size: 40px; font-weight: 700; line-height: .9; }
.stat-grid span { font-size: 15px; letter-spacing: .08em; color: var(--parch-dim); }
.bars > div { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 8px; margin: 5px 0; font-size: 18px; font-weight: 600; }
.bars i { display: block; height: 16px; min-width: 3px; background: var(--tc); border: 2px solid var(--edge); }
.bars em { font-style: normal; text-align: right; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 3px dotted var(--parch2); font-size: 21px; }
.setting small { display: block; font-size: 16px; color: var(--parch-dim); }
.toggle { flex: none; width: 76px; padding: 3px 0 5px; font-size: 18px; font-weight: 800; letter-spacing: .1em; cursor: pointer; background: #fff8e2; color: var(--parch-dim); border: 3px solid var(--edge); }
.toggle.on { background: var(--t-mensch); color: var(--ink); }
.toggle.wide { width: auto; min-width: 76px; padding: 3px 8px 5px; white-space: nowrap; }
.credit { margin-top: 14px !important; font-size: 15px !important; color: var(--parch-dim); }

/* ---------- Latke Party ---------- */
#app.party-on #hud, #app.party-on #stage, #app.party-on #mascot, #app.party-on .surface { visibility: hidden; }
#app.party-on #scene .fore { z-index: 16; } /* the winner's confetti falls in front of the party, not behind it */
#party { position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column; align-items: center; padding: calc(12px + env(safe-area-inset-top)) calc(12px + var(--gut)) calc(12px + env(safe-area-inset-bottom)); background: rgba(4, 9, 26, .86); overflow-y: auto; }
.party-top { display: flex; align-items: center; justify-content: space-between; width: min(100%, 620px); }
.party-top b { font-size: clamp(30px, calc(var(--colw) * .080), 46px); font-weight: 900; letter-spacing: .05em; color: var(--t-chochem); text-shadow: 0 4px 0 #8a3f0a; }
.party-top .x { color: var(--dim); }
.party-box { width: min(100%, 620px); margin: auto 0; }
.party-box > p { margin: 8px 0; font-size: 20px; color: #d6e6ff; text-wrap: pretty; }
.p-names { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.p-names input { width: 100%; height: 42px; padding: 2px 10px 4px; font: inherit; font-size: 22px; font-weight: 600; color: var(--text); background: var(--ink2); border: 3px solid var(--line); border-radius: 0; outline: none; user-select: text; -webkit-user-select: text; }
.p-names input:focus { border-color: var(--t-chochem); }
.p-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 0 18px; font-size: 20px; }
.p-opts .step { display: inline-flex; align-items: center; gap: 8px; }
.p-opts .step button { width: 36px; height: 36px; padding: 0 0 4px; font-size: 24px; font-weight: 800; cursor: pointer; background: var(--ink2); border: 3px solid var(--line); }
.p-opts .step b { min-width: 22px; text-align: center; font-size: 26px; color: var(--gold); }
.p-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0; }
.p-player { padding: 3px 10px 5px; font-size: 19px; font-weight: 700; background: var(--ink2); border: 3px solid var(--line); }
.p-player.on { background: var(--t-chochem); color: #1a1005; border-color: var(--edge); box-shadow: 0 0 16px rgba(255, 154, 61, .7); }
.p-player.out { opacity: .55; text-decoration: line-through; }
.p-player i { margin-left: 6px; font-style: normal; letter-spacing: 2px; color: var(--gold); }
.p-player.on i { color: #7a2a05; }
.p-hot { display: flex; align-items: center; justify-content: center; height: 150px; }
.p-hot img { display: block; animation: sizzle .12s steps(2) infinite; transform: translate(calc(var(--sz, 0) * 1px), 0) scale(calc(1 + var(--heat, 0) * .25)); filter: saturate(calc(1 + var(--heat, 0))) drop-shadow(0 0 calc(6px + var(--heat, 0) * 26px) rgba(255, 90, 40, calc(.3 + var(--heat, 0) * .6))); }
.p-hot.burnt img { animation: none; filter: brightness(.25) contrast(1.4); transform: scale(1.5) rotate(12deg); transition: transform .25s steps(4); }
.p-turn { text-align: center; font-size: 18px; letter-spacing: .16em; color: var(--dim); }
.p-turn b { display: block; font-size: clamp(30px, calc(var(--colw) * .080), 46px); font-weight: 700; letter-spacing: .03em; color: var(--gold); }
#party .parch { margin-top: 12px; }
.p-q { margin: 0 0 8px; font-size: clamp(24px, calc(var(--colw) * .060), 34px); font-weight: 700; line-height: 1; text-wrap: balance; }
.p-form { display: flex; gap: 10px; }
.p-form input { flex: 1; min-width: 0; height: 44px; padding: 4px 10px 6px; font: inherit; font-size: 25px; font-weight: 600; color: var(--parch-ink); background: #fff8e2; border: 3px solid var(--edge); border-radius: 0; outline: none; user-select: text; -webkit-user-select: text; }
.p-form input:focus { box-shadow: 0 0 0 3px var(--t-mensch); }
.p-form.nope { animation: nope .3s steps(6); }
.p-msg { min-height: 22px; margin-top: 8px; font-size: 18px; color: var(--parch-dim); }
.p-msg.bad { color: #b82c45; font-weight: 700; }
.p-said { max-height: 96px; margin-top: 10px; overflow: hidden; display: flex; flex-wrap: wrap-reverse; align-content: flex-start; gap: 6px; }
.p-said .ans { margin: 0; background: var(--tc); border-color: var(--edge); }
.p-load { text-align: center; font-size: 24px !important; }
.p-win { text-align: center; }
.p-win h2 { margin: 6px 0; font-size: clamp(42px, calc(var(--colw) * .115), 76px); font-weight: 700; line-height: .9; color: var(--gold); text-shadow: 0 4px 0 var(--gold3); }
.p-win p { font-size: 22px; }
.p-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }

#toast { position: absolute; left: 50%; bottom: 46%; z-index: 30; transform: translateX(-50%); padding: 4px 14px 6px; font-size: 21px; font-weight: 700; white-space: nowrap; background: var(--gold); color: var(--parch-ink); border: 3px solid var(--edge); opacity: 0; pointer-events: none; }
#toast.on { animation: toast 1.8s steps(12) forwards; }

/* ---------- Bubby (bubby.js) ---------- */
.bubby img { display: block; }
/* beside the score while a dive is on: the pod becomes two columns, her face down the first */
.pod.with-bubby { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
.pod.with-bubby .bubby { grid-row: 1 / 3; }
.bubby.beat img { animation: bubby-yes .4s steps(4) 2; }
.bubby.beat[data-face='alright'] img { animation: none; }
.bubby.beat[data-face='wince'] img { animation: bubby-no .3s steps(6); }
/* on the results sheet: her face, and a box for her line that shows once she speaks */
.final-bubby { display: flex; align-items: center; gap: 13px; margin-top: 12px; }
.bubby-says { position: relative; flex: 1; min-width: 0; margin: 0; padding: 6px 10px 8px; font-size: 19px; line-height: 1.1; text-wrap: pretty; background: #fff8e2; border: 3px solid var(--edge); visibility: hidden; }
.bubby-says::before { content: ''; position: absolute; right: 100%; top: 50%; width: 6px; height: 6px; margin: -3px 3px 0 0; background: var(--edge); }
.final-bubby.said .bubby-says { visibility: visible; animation: rise .28s steps(6); }
.final-bubby.said .bubby img { animation: bump .35s steps(4); }
@keyframes bubby-yes { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes bubby-no { 0%, 100% { transform: translateX(0); } 25%, 75% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }

/* ---------- motion ---------- */
@keyframes bob { 0%, 100% { transform: translateY(-3px) rotate(-2deg); } 50% { transform: translateY(4px) rotate(2deg); } }
@keyframes swim { 0%, 100% { transform: rotate(34deg) translateX(-2px); } 50% { transform: rotate(46deg) translateX(2px); } }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(-10deg); } }
@keyframes wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.14); } }
@keyframes flick { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-1px); opacity: .8; } }
@keyframes bump { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes rise { 0% { transform: translateY(26px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: none; } }
@keyframes nope { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes sayin { 0% { transform: translateX(-50%) scale(.4); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes pop { 0% { opacity: 1; } 35% { transform: translateX(-50%) translateY(-14px) rotate(-5deg); opacity: 1; } 100% { transform: translateX(-50%) translateY(-70px) rotate(8deg); opacity: 0; } }
@keyframes flash { 0% { opacity: .6; } 100% { opacity: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translate(-5px, 3px); } 50% { transform: translate(5px, -3px); } 75% { transform: translate(-3px, -2px); } }
@keyframes urgent { 0% { opacity: 1; } 100% { opacity: .55; } }
@keyframes sizzle { 0% { margin-left: calc(var(--heat, 0) * -5px); } 100% { margin-left: calc(var(--heat, 0) * 5px); } }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8px); } }

/* Motion off — the Settings switch, or the system's reduced-motion preference until that
   switch is touched (game.js). Nothing loops, shakes, flashes or slides; the canvas side
   of this lives in scene.js under `calm`. The toast keeps its fade or it would never show. */
#app.calm *, #app.calm *::before, #app.calm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
#app.calm #toast.on { animation-duration: 1.8s !important; }
#app.calm .p-hot img { transform: none; } /* the latke still glows hotter, but it does not swell */

/* ---------- small screens ----------
   Three things run short: width (phones), height (a phone on its side, a small window,
   any phone once its keyboard is up), and both at once. Each block below gives back
   whatever that shortage costs, and none of them may leave two things on top of each other. */
@media (max-width: 520px) {
  body { font-size: 19px; }
  .pod { min-width: 92px; padding: 3px 8px 5px; }
  .pod b { font-size: 27px; }
  #hud-round { font-size: 15px; letter-spacing: .1em; }
  .bsd { right: calc(114px + env(safe-area-inset-right)); }
  .icon-btn { top: calc(62px + env(safe-area-inset-top)); }
  .parch { padding: 12px 12px; margin: 10px 17px; }
  #card .parch { gap: 8px; }
  .candle { width: 30px; }
  .btn { font-size: 19px; padding: 7px 12px 9px; }
  .final-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 8px; } /* two rows of two: every button a full thumb wide */
  .final-actions .btn { padding: 6px 6px 8px; font-size: 17px; letter-spacing: .04em; }
  .p-names { grid-template-columns: 1fr 1fr; }
  .hats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .follow { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  #card-form { flex-wrap: wrap; } /* the answer box gets the whole row */
  #card-form .btn { flex: 1 0 100%; }
  .card-top { font-size: 13px; letter-spacing: .04em; white-space: nowrap; } /* "PROMPT 3 / 7" and "WORDS & NAMES" on one line */
  /* three pods across 320px, still with room for "7,000 cubits" */
  #hud { gap: 4px 10px; padding-left: calc(6px + env(safe-area-inset-left)); padding-right: calc(6px + env(safe-area-inset-right)); }
  .pod { min-width: 70px; padding: 3px 6px 4px; }
  .pod b { font-size: 24px; }
  .pod i { margin-left: 3px; font-size: 13px; }
  .hud-mid { padding: 3px 4px 4px; }
  #hud-round { font-size: 13px; letter-spacing: .02em; }
  #btn-menu { left: calc(6px + env(safe-area-inset-left)); }
  #btn-sound { right: calc(6px + env(safe-area-inset-right)); }
  .bsd { right: calc(90px + env(safe-area-inset-right)); }
  .streak-lbl { display: none; } /* the flame, the number and the week say it */
  .home-links button { padding: 8px 4px 6px; font-size: 17px; }
  .final-nums span { font-size: 13px; letter-spacing: .04em; }
}
/* a phone held upright: the menorah gets a row of its own under the pods, between the menu and
   the sound, so wide numbers (or Bubby) in the pods never squeeze it */
@media (max-width: 520px) and (min-height: 521px) {
  #app { --mw: 180px; --room: 206px; }
  #hud { grid-template-columns: 1fr 1fr; }
  .pod.right { grid-column: 2; grid-row: 1; }
  .hud-mid { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: calc(var(--mw) + 22px); }
  #hud-round { font-size: 15px; letter-spacing: .1em; }
}
/* upright with the keyboard up: no room for that row, so the pods sit close in to give the menorah what they can */
@media (max-width: 520px) and (max-height: 520px) {
  #hud { column-gap: 6px; }
  .hud-mid { padding-left: 4px; padding-right: 4px; }
}

/* the creator layout on a screen under 926px tall: a column under 521px, so it takes the rules a
   phone upright has (above), the menorah on a row of its own under the pods. :where() keeps them
   as specific as the phone's own, so .btn.big, #final .parch and the rest still win as there */
@media (orientation: landscape) and (min-height: 621px) and (max-height: 925px) {
  #app.creator { --mw: 180px; --room: 206px; }
  :where(#app.creator) #hud { grid-template-columns: 1fr 1fr; }
  :where(#app.creator) .pod { min-width: 92px; padding: 3px 8px 5px; }
  :where(#app.creator) .pod b { font-size: 27px; }
  :where(#app.creator) .pod.right { grid-column: 2; grid-row: 1; }
  :where(#app.creator) .hud-mid { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: calc(var(--mw) + 22px); }
  :where(#app.creator) #hud-round { font-size: 15px; letter-spacing: .1em; }
  :where(#app.creator) .bsd { right: calc(114px + var(--gut) + env(safe-area-inset-right)); }
  :where(#app.creator) .parch { padding: 12px 12px; margin: 10px 17px; }
  :where(#app.creator) #card .parch { gap: 8px; }
  :where(#app.creator) .candle { width: 30px; }
  :where(#app.creator) .btn { font-size: 19px; padding: 7px 12px 9px; }
  :where(#app.creator) .final-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 8px; }
  :where(#app.creator) .final-actions .btn { padding: 6px 6px 8px; font-size: 17px; letter-spacing: .04em; }
  :where(#app.creator) .hats { grid-template-columns: repeat(2, 1fr); }
}
@media (orientation: landscape) and (min-height: 621px) and (max-height: 782px) {
  :where(#app.creator) .follow { grid-template-columns: 1fr; } /* a column under 441px */
}
@media (orientation: landscape) and (min-height: 621px) and (max-height: 640px) {
  :where(#app.creator) #card-form { flex-wrap: wrap; } /* a column under 361px: the answer box gets the whole row, as on a phone */
  :where(#app.creator) #card-form .btn { flex: 1 0 100%; }
}

/* short: the sky has less room for the title, the water less for the buttons */
@media (max-height: 620px) {
  .subline { display: none; }
  #home { gap: 8px; }
}
@media (max-height: 620px) and (min-width: 521px) {
  #app { --mw: 160px; --room: 140px; } /* clear of what Gefilte says, just under the HUD */
}
@media (max-height: 560px) {
  /* the results take the whole screen, over the top of the HUD */
  #final .parch { max-height: calc(var(--vh, 100dvh) - 38px - env(safe-area-inset-bottom)); }
  #modal { padding: 8px 10px; }
  /* Latke Party with the keyboard up: the question and the box to type in come first */
  #party { padding-top: 6px; }
  .party-top b { font-size: 26px; }
  .party-box { margin: 0; }
  .p-players { gap: 4px; margin: 4px 0; }
  .p-player { padding: 0 6px 2px; font-size: 16px; border-width: 2px; }
  .p-hot { height: 54px; }
  .p-hot img { width: 80px; height: 45px; }
  .p-turn { font-size: 13px; }
  .p-turn b { font-size: 26px; }
  #party .parch { margin-top: 6px; padding: 8px 10px; }
  .p-q { margin-bottom: 6px; font-size: 22px; }
  .p-msg { min-height: 18px; margin-top: 4px; }
  .p-said { display: none; }
}
@media (max-height: 520px) {
  #app { --mw: 112px; }
  .title-he, .bsd { display: none; }
  .surface { bottom: 34px; }
  .tagline { margin-top: 12px; font-size: 16px; letter-spacing: .28em; }
  #home { gap: 6px; }
  .btn.big { padding: 8px 20px 10px; }
  .home-links button { padding: 5px 4px 4px; }
  .candle-track { min-height: 60px; margin-top: 6px; }
  #card-note:not(:empty) { display: none; }
}
@media (max-height: 420px) {
  #app { --mw: 78px; }
  .hud-mid { padding: 2px 6px 3px; }
  #hud-round { font-size: 13px; letter-spacing: .08em; }
  #card .parch, #landed .parch { padding-top: 8px; padding-bottom: 8px; }
  #card-q { margin-top: 2px; font-size: clamp(22px, 5vw, 28px); }
  #card-msg { min-height: 18px; margin-top: 5px; font-size: 16px; }
  .candle-track { min-height: 36px; margin-top: 2px; }
  #candle-num { font-size: 23px; }
  #land-blurb { margin: 6px 0 8px; font-size: 18px; }
  #land-said { margin-top: -4px; margin-bottom: 8px; }
  #land-pts { font-size: 40px; }
  .final-head b { font-size: 40px; }
}
/* too short for the fish and a scroll at once: while a scroll is up, the scroll wins */
@media (max-height: 360px) {
  #app.panel #mascot { visibility: hidden; }
  #home-note { display: none; }
  .title { font-size: clamp(32px, 12vh, 44px); }
}
@media (max-height: 340px) and (max-width: 559px) {
  #app.at-surface #mascot { visibility: hidden; }
  .home-date { display: none; }
  #app.panel .icon-btn { visibility: hidden; }
}
/* a phone on its side with its keyboard up: room for the question and the box, so those stay */
@media (max-height: 260px) {
  #app.panel #hud { visibility: hidden; }
  .card-top, .candle-track, #land-blurb, #land-said { display: none; }
  #card .parch, #landed .parch { margin-top: 4px; margin-bottom: 4px; padding-top: 5px; padding-bottom: 5px; }
  #card-msg { min-height: 0; margin-top: 3px; }
  .land-actions { margin-top: 6px; padding-bottom: 5px; }
  #stage { padding-bottom: 4px; }
}

/* short and wide — a phone on its side: lay things out along the width instead */
@media (max-height: 520px) and (min-width: 560px) {
  #stage > section { width: min(100%, 760px); }
  /* the round beside the menorah, not under it: the HUD stays shallow, clear of what Gefilte says */
  #hud { grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); }
  .hud-mid { display: flex; align-items: center; gap: 10px; }
  #menorah { width: var(--mw); }
  #hud-round { margin-top: 0; }
  #home { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; align-items: center; gap: 6px 10px; }
  #home > #home-streak, #home > .home-date, #home > #home-note, #home > .home-links { grid-column: 1 / -1; justify-self: center; }
  .home-row { display: contents; } /* its two buttons join DIVE on one row… */
  #home > #home-note { order: 1; } /* …so what sat between them moves below */
  #home > .home-links { order: 2; }
  .btn.big { padding: 7px 16px 9px; font-size: 22px; }
  #stage > #final { width: min(100%, 940px); }
  #final .parch-in { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-items: start; }
  .final-b .final-hint { margin-top: 0; }
  .final-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 16px; padding: 8px 12px 6px; }
  .final-actions { padding-bottom: 5px; }
  #final-next { margin-top: 0; }
}
