/* Chaos Advent — dark premium Christmas: midnight blue and black, deep green, burgundy, gold. One file, no build step. */

@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 400 800;
  src: url(../fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 400 800;
  src: url(../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --night: #070b16; --navy: #0d1427; --panel: #121a30; --panel2: #18223d; --line: rgba(245, 199, 107, .18);
  --gold: #f5c76b; --gold2: #d9a441; --gold-d: #8a6420; --wine: #7a1f2e; --wine2: #a3243b; --pine: #1f5a3a; --pine2: #2f7a4a;
  --ice: #9fd8f0; --text: #f4ecdf; --muted: #b9b2c7; --red: #e8455a;
  --maxw: 1180px; --pad: 16px; --gap: 10px; --cols: 3;
  --cell: calc((min(100vw, var(--maxw)) - 2 * var(--pad) - (var(--cols) - 1) * var(--gap)) / var(--cols));
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
@media (min-width: 640px) { :root { --cols: 5; --gap: 12px; --pad: 22px; } }
@media (min-width: 960px) { :root { --cols: 6; --gap: 14px; --pad: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; font-family: var(--font); color: var(--text); line-height: 1.45; overflow-x: hidden;
  background: radial-gradient(1200px 700px at 15% -10%, #1b2a55 0%, transparent 60%), radial-gradient(900px 600px at 100% 10%, #3b1020 0%, transparent 55%),
    radial-gradient(900px 700px at 50% 110%, #0f3524 0%, transparent 60%), var(--night);
  background-attachment: fixed; transition: background-color .8s; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
a { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; }
.app { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) calc(28px + env(safe-area-inset-bottom)); }

/* ---------------- the top bar ---------------- */
.test-banner { margin: 10px 0 0; padding: 9px 14px; border-radius: 12px; background: rgba(159, 216, 240, .12); border: 1px dashed rgba(159, 216, 240, .5); font-size: .88rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 6px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .14em; font-size: .95rem; user-select: none; cursor: default; }
.logo b { color: var(--gold); }
.logo-tree { font-family: var(--emoji); font-size: 1.4rem; display: inline-block; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
/* the EN / ES switch */
.lang { display: inline-flex; margin-left: auto; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: rgba(18, 26, 48, .75); }
.lang button { min-width: 40px; min-height: 36px; padding: 4px 10px; border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: .78rem; letter-spacing: .06em; }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--gold); color: #2a1a00; }
.tb { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(18, 26, 48, .75); backdrop-filter: blur(6px); font-size: .85rem; font-weight: 600; transition: background .2s, border-color .2s, transform .15s; }
.tb:hover { background: rgba(30, 42, 74, .9); border-color: rgba(245, 199, 107, .45); }
.tb:active { transform: scale(.96); }
.tb-ic { font-family: var(--emoji); font-size: 1rem; line-height: 1; }
.tb[aria-pressed="true"] { border-color: var(--gold); background: rgba(245, 199, 107, .16); }
.tb.adult[aria-pressed="true"] { border-color: var(--red); background: rgba(232, 69, 90, .18); }
.tb.danger.armed { border-color: var(--red); background: rgba(232, 69, 90, .25); animation: pulse-red 1s infinite; }
.tb.nick { max-width: 190px; }
.tb.nick .tb-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; }
.tb.nick[data-status="ok"] .tb-dot { background: #4cd37a; }
.tb.nick[data-status="busy"] .tb-dot { background: var(--gold); animation: blink .6s steps(2) infinite; }
.tb.nick[data-status="error"] .tb-dot { background: var(--red); }
.tb.nick[data-status="off"] { border-color: rgba(245, 199, 107, .55); }
.nick-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.nick-form input { flex: 1; min-width: 160px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; font-weight: 700; }
.nick-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.nick-msg { min-height: 1.3em; margin: 0 0 8px; color: var(--muted); font-size: .88rem; }
.nick-note { margin: 0 0 14px; color: var(--muted); font-size: .8rem; }
.nick-label { margin: 10px 0 4px; font-weight: 700; font-size: .9rem; }
.tb-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: #2a1a00; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; }
@media (max-width: 639px) {
  .tb { padding: 7px 10px; }
  .tb .tb-tx { display: none; }
  .tb.danger.armed .tb-tx, .tb.adult[aria-pressed="true"] .tb-tx { display: inline; }
}

/* ---------------- the hero ---------------- */
.hero { padding: 18px 0 8px; }
h1 { margin: 6px 0 8px; font-weight: 800; line-height: .98; letter-spacing: -.02em; font-size: clamp(2.2rem, 8.2vw, 4.6rem); }
h1 span { display: inline-block; margin-right: .18em; }
@media (max-width: 639px) { h1 span { display: block; } }
h1 .hl { background: linear-gradient(100deg, var(--gold) 10%, #fff2c9 45%, var(--gold2) 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% 100%; animation: shimmer 6s linear infinite; }
.sub { margin: 0 0 16px; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.2rem); max-width: 40ch; }

.stats { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .stats { grid-template-columns: 1.3fr 1fr 1fr; } }
.stat { position: relative; padding: 12px 14px; border-radius: 16px; background: linear-gradient(160deg, rgba(24, 34, 61, .85), rgba(13, 20, 39, .85));
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat-label { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.countdown { display: flex; gap: 8px; align-items: stretch; }
.cd { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px; background: rgba(0, 0, 0, .28); cursor: default; user-select: none; }
.cd b { font-size: clamp(1.4rem, 4.5vw, 2rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; color: var(--gold); }
.cd small { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.cd-done { display: none; font-weight: 800; font-size: 1.3rem; color: var(--gold); padding: 8px 0; }
.countdown.done .cd { display: none; }
.countdown.done .cd-done { display: block; }
.countdown.frozen .cd b { color: var(--ice); text-shadow: 0 0 12px var(--ice); }
.fund-v { font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.1; }
.fund-note { font-size: .78rem; color: var(--muted); }
.bill { align-self: flex-start; margin-top: 2px; min-height: 34px; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(245, 199, 107, .5);
  background: rgba(245, 199, 107, .12); color: var(--gold); font-weight: 800; font-size: .8rem; transition: background .2s, transform .15s; }
.bill:hover { background: rgba(245, 199, 107, .24); }
.bill:active { transform: scale(.96); }
.fund.bump { animation: bump .7s cubic-bezier(.3, 1.6, .5, 1); }
.bar { height: 10px; border-radius: 6px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--pine2), var(--gold)); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.prog .stat-label { color: var(--text); }
.days-left { font-size: .84rem; color: var(--muted); }
.impatience { margin: 10px 0 0; display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .84rem; background: rgba(232, 69, 90, .12); border: 1px solid rgba(232, 69, 90, .4); }
.impatience b { color: #ff8b99; }
.impatience.hot { animation: pulse-red 1.6s infinite; }

/* ---------------- the windows ---------------- */
.board { margin: 18px 0 8px; }
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: calc(var(--cell) * 1.18); grid-auto-flow: dense; gap: var(--gap); }
.door { position: relative; display: block; border: 0; padding: 0; margin: 0; border-radius: 14px; background: transparent; rotate: var(--tilt, 0deg);
  transition: transform .25s, filter .25s, translate .35s cubic-bezier(.2, 1.4, .4, 1); animation: wob 14s var(--wob, 0s) infinite; }
.door.wide { grid-column: span 2; }
.door.big { grid-column: span 2; grid-row: span 2; }
/* a wider leaf needs a longer perspective, or its open edge grows far past the grid */
.door { perspective: calc(var(--cell) * 5); }
.door.wide, .door.big { perspective: calc(var(--cell) * 11); }
.door-in { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(245, 199, 107, .3), transparent 60%), linear-gradient(160deg, #2a0d16, #0b0b14);
  box-shadow: inset 0 0 0 2px rgba(245, 199, 107, .35), inset 0 10px 30px rgba(0, 0, 0, .6); }
.door-icon { font-family: var(--emoji); font-size: calc(var(--cell) * .38); opacity: 0; transform: scale(.6); transition: opacity .4s .25s, transform .5s .25s cubic-bezier(.3, 1.6, .5, 1); }
.door.big .door-icon { font-size: calc(var(--cell) * .8); }
.door-leaf { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; display: grid; place-items: center; transform-origin: 0 50%;
  transition: transform .75s cubic-bezier(.3, .9, .3, 1), filter .3s, box-shadow .3s; backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), inset 0 -10px 24px rgba(0, 0, 0, .35), 0 10px 22px rgba(0, 0, 0, .45); }
.door-num { position: relative; z-index: 2; font-weight: 800; font-size: calc(var(--cell) * .42); line-height: 1; letter-spacing: -.03em; color: #fff7e6;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 18px rgba(0, 0, 0, .35); }
.door.big .door-num { font-size: calc(var(--cell) * .95); }
.door-deco { position: absolute; z-index: 2; font-family: var(--emoji); font-size: calc(var(--cell) * .2); line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.door-deco.tl { top: 7%; left: 8%; } .door-deco.tr { top: 7%; right: 8%; } .door-deco.bl { bottom: 7%; left: 8%; } .door-deco.br { bottom: 7%; right: 8%; }
.door-lock { position: absolute; z-index: 3; right: 6%; bottom: 5%; font-family: var(--emoji); font-size: calc(var(--cell) * .14); opacity: 0; transition: opacity .3s; }
.door.ribbon .door-leaf::before, .door.ribbon .door-leaf::after { content: ''; position: absolute; z-index: 1; background: linear-gradient(90deg, #b8202f, #e8455a, #b8202f); box-shadow: 0 0 6px rgba(0, 0, 0, .35); }
.door.ribbon .door-leaf::before { left: 50%; top: 0; bottom: 0; width: 12%; translate: -50% 0; }
.door.ribbon .door-leaf::after { top: 50%; left: 0; right: 0; height: 10%; translate: 0 -50%; background: linear-gradient(180deg, #b8202f, #e8455a, #b8202f); }
.door.ribbon .door-num { background: rgba(0, 0, 0, .22); padding: .06em .16em; border-radius: .18em; }
.door.ribbon.t-gold .door-num, .door.ribbon.t-ice .door-num, .door.ribbon.t-paper .door-num { background: rgba(255, 247, 230, .62); }

/* the textures */
.t-velvet .door-leaf { background: radial-gradient(circle at 30% 20%, #c23b52, #7a1f2e 55%, #4a0f1b); }
.t-wood .door-leaf { background: linear-gradient(90deg, rgba(0, 0, 0, .15), transparent 20%, transparent 80%, rgba(0, 0, 0, .2)),
  repeating-linear-gradient(90deg, #6b4226 0 7px, #7d4f2e 7px 12px, #5c3820 12px 15px, #74482a 15px 23px); }
.t-gold .door-leaf { background: linear-gradient(125deg, #7d5a1c, #f5c76b 30%, #b88a2e 50%, #f7dc93 70%, #8a6420); background-size: 220% 220%; }
.t-gold .door-num { color: #3a2604; text-shadow: 0 1px 0 rgba(255, 240, 200, .6); }
.t-ice .door-leaf { background: radial-gradient(circle at 70% 15%, rgba(255, 255, 255, .7), transparent 40%), linear-gradient(160deg, #dff4fc, #8ec4de 55%, #4f84a6); }
.t-ice .door-num { color: #0f3550; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.t-knit .door-leaf { background-color: #1f5a3a;
  background-image: repeating-linear-gradient(60deg, rgba(255, 255, 255, .09) 0 5px, transparent 5px 10px), repeating-linear-gradient(-60deg, rgba(0, 0, 0, .14) 0 5px, transparent 5px 10px),
    linear-gradient(180deg, transparent 12%, #f4ecdf 12% 15%, transparent 15% 85%, #f4ecdf 85% 88%, transparent 88%); }
.t-plaid .door-leaf { background-color: #7a1f2e;
  background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .28) 0 12px, transparent 12px 24px), repeating-linear-gradient(90deg, rgba(20, 70, 45, .55) 0 12px, transparent 12px 24px),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(245, 199, 107, .55) 22px 24px), repeating-linear-gradient(0deg, transparent 0 22px, rgba(245, 199, 107, .4) 22px 24px); }
.t-paper .door-leaf { background-color: #c89f6d;
  background-image: radial-gradient(circle, rgba(122, 31, 46, .55) 1.6px, transparent 2px), radial-gradient(circle, rgba(31, 90, 58, .45) 1.6px, transparent 2px), linear-gradient(160deg, #d9b583, #b98c58);
  background-size: 22px 22px, 22px 22px, 100% 100%; background-position: 0 0, 11px 11px, 0 0; }
.t-paper .door-num { color: #4a2a10; text-shadow: 0 1px 0 rgba(255, 235, 200, .5); }
.t-glitter .door-leaf { background-color: #16213e;
  background-image: radial-gradient(circle, rgba(245, 199, 107, .95) 1px, transparent 1.6px), radial-gradient(circle, rgba(255, 255, 255, .8) .8px, transparent 1.4px), linear-gradient(160deg, #1d2b52, #0d1427);
  background-size: 17px 19px, 23px 13px, 100% 100%; }

/* every texture has its own hover */
@media (hover: hover) {
  .door:not(.opened):hover { transform: translateY(-4px); }
  .door:not(.opened):hover .door-leaf { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 16px 32px rgba(0, 0, 0, .55); }
  .t-velvet:not(.opened):hover .door-leaf { transform: rotateY(-9deg); }
  .t-wood:not(.opened):hover { animation: knock .5s; }
  .t-gold:not(.opened):hover .door-leaf { animation: gold-run 1.4s linear infinite; }
  .t-ice:not(.opened):hover .door-leaf { filter: brightness(1.15) saturate(1.2); }
  .t-knit:not(.opened):hover { animation: jiggle .5s; }
  .t-plaid:not(.opened):hover { transform: translateY(-4px) rotate(-2deg); }
  .t-paper:not(.opened):hover .door-leaf { transform: rotateY(-14deg) rotateX(4deg); }
  .t-glitter:not(.opened):hover .door-leaf { animation: twinkle .9s steps(3) infinite; }
}

/* the states */
.door.locked .door-leaf { filter: saturate(.55) brightness(.62); }
.door.locked .door-lock { opacity: .9; }
.door.available .door-leaf { box-shadow: inset 0 0 0 2px rgba(245, 199, 107, .55), 0 10px 22px rgba(0, 0, 0, .45); }
.door.today { z-index: 2; }
.door.today .door-leaf { box-shadow: inset 0 0 0 3px var(--gold), 0 0 0 3px rgba(245, 199, 107, .35), 0 0 28px rgba(245, 199, 107, .55); animation: glow 1.8s ease-in-out infinite; }
.door.today::after { content: 'TODAY'; position: absolute; z-index: 4; top: -9px; left: 50%; translate: -50% 0; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #2a1a00; font-size: .62rem; font-weight: 800; letter-spacing: .12em; }
.door.opened { animation: none; }
.door.opened .door-leaf { transform: rotateY(-76deg); filter: brightness(.8); }
.door.opened .door-icon { opacity: 1; transform: none; }
.door.opening { animation: jiggle .35s; }
.door.opening .door-leaf { transform: rotateY(-100deg); transition-duration: .6s; }
.door.peek .door-leaf { transform: rotateY(-24deg); transition-duration: 1.2s; }
.door.hold .door-leaf { transform: rotateY(-40deg); transition: transform 1.1s ease-out; }
.door.slam .door-leaf { transform: none; transition: transform .08s ease-in; }
.door.slam { animation: knock .4s; }
.door.running { z-index: 6; }
.door.lit .door-leaf { filter: none; box-shadow: inset 0 0 0 3px var(--gold), 0 0 34px rgba(245, 199, 107, .85); }
.door.lit .door-in { box-shadow: inset 0 0 0 3px var(--gold), 0 0 34px rgba(245, 199, 107, .85); }
.door-speech { position: absolute; z-index: 8; left: 50%; bottom: calc(100% + 6px); translate: -50% 0; width: max-content; max-width: 220px; padding: 7px 10px; border-radius: 12px;
  background: #fff7e6; color: #2a1a00; font-size: .78rem; font-weight: 800; line-height: 1.25; text-align: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); animation: pop-in .3s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.door-speech::after { content: ''; position: absolute; left: 50%; top: 100%; translate: -50% 0; border: 7px solid transparent; border-top-color: #fff7e6; }
.door-speech.big { font-size: .95rem; background: var(--red); color: #fff; }
.door-speech.big::after { border-top-color: var(--red); }
.santa-hand { position: absolute; z-index: 7; left: 50%; top: 50%; font-family: var(--emoji); font-size: calc(var(--cell) * .55); translate: -50% -50%; animation: hand .5s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }

/* ---------------- the scene ---------------- */
.scene { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 26px 0 0; padding: 0 4px; min-height: 170px; }
.scene-santa, .scene-snow { position: relative; display: flex; align-items: flex-end; gap: 8px; }
.santa, .snowman { width: clamp(92px, 18vw, 138px); cursor: pointer; user-select: none; transition: transform .3s, opacity .4s; }
.santa:active, .snowman:active { transform: scale(.95); }
.santa.away { opacity: 0; transform: translateX(-40px); pointer-events: none; }
.santa .pupils { transform: translate(var(--px, 0), var(--py, 0)); transition: transform .12s; }
.tree { width: clamp(110px, 22vw, 170px); cursor: pointer; user-select: none; transform-origin: 50% 100%; }
.tree .bulb { animation: bulb 1.6s var(--d, 0s) ease-in-out infinite alternate; }
.tree .star { transform-origin: 60px 12px; animation: star 3s ease-in-out infinite; }
.tree.boom { animation: boom .5s forwards; }
.tree.regrow { animation: regrow 1.2s cubic-bezier(.3, 1.5, .5, 1); }
.tree.blaze { filter: drop-shadow(0 0 22px rgba(245, 199, 107, .95)); }
.art { display: block; width: 100%; height: auto; overflow: visible; }
.santa-says { position: absolute; z-index: 5; left: 0; bottom: calc(100% + 8px); width: max-content; max-width: min(280px, 78vw); padding: 10px 12px; border-radius: 14px;
  background: #fff7e6; color: #2a1a00; font-size: .86rem; font-weight: 700; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); animation: pop-in .3s cubic-bezier(.3, 1.6, .5, 1); }
.santa-says::after { content: ''; position: absolute; left: 34px; top: 100%; border: 8px solid transparent; border-top-color: #fff7e6; }
.santa-says p { margin: 0; }
.santa-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .15); background: rgba(0, 0, 0, .06); font-size: .78rem; font-weight: 700; }
button.chip:hover { background: rgba(0, 0, 0, .12); }
.bonus-door { width: 54px; height: 70px; border-radius: 10px 10px 4px 4px; border: 2px solid var(--gold); background: linear-gradient(160deg, #4a3410, #1d1405); font-family: var(--emoji);
  font-size: 1.5rem; box-shadow: 0 0 20px rgba(245, 199, 107, .5); animation: glow 2s infinite; }
.bonus-door.pop { animation: pop-in .6s cubic-bezier(.3, 1.6, .5, 1), glow 2s .6s infinite; }
.foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: .78rem; }

/* ---------------- the narrator and the toasts ---------------- */
.narrator { position: fixed; z-index: 80; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 8px; max-width: min(380px, calc(100vw - 24px));
  opacity: 0; translate: 0 16px; transition: opacity .3s, translate .3s; pointer-events: none; }
.narrator.in { opacity: 1; translate: 0 0; }
.n-av { font-family: var(--emoji); font-size: 2rem; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.narrator p { margin: 0; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: rgba(255, 247, 230, .97); color: #2a1a00; font-weight: 700; font-size: .9rem; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.toasts { position: fixed; z-index: 90; top: calc(10px + env(safe-area-inset-top)); right: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(340px, calc(100vw - 20px)); padding: 10px 14px; border-radius: 14px; background: rgba(18, 26, 48, .96); border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5); font-size: .88rem; translate: 120% 0; transition: translate .35s cubic-bezier(.2, 1.2, .4, 1); }
.toast.in { translate: 0 0; }
.toast.reward { border-color: var(--gold); background: linear-gradient(135deg, rgba(60, 42, 8, .97), rgba(18, 26, 48, .97)); }
.toast-ic { font-family: var(--emoji); font-size: 1.6rem; }

/* ---------------- the dialog ---------------- */
.dlg { position: fixed; inset: 0; z-index: 50; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 12px; border: 0; color: var(--text);
  background: rgba(3, 5, 12, .74); backdrop-filter: blur(4px); display: grid; place-items: center; }
.dlg:not([open]) { display: none; }
.dlg[open] { animation: fade .2s; }
.dlg-panel { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; padding: 22px 20px 20px; border-radius: 22px;
  background: linear-gradient(170deg, #18223d, #0e1424 70%); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: rise .3s cubic-bezier(.2, 1.2, .4, 1); }
.dlg.wide .dlg-panel { width: min(760px, 100%); }
.dlg-close { position: sticky; top: 0; float: right; z-index: 5; width: 38px; height: 38px; margin: -10px -8px 0 8px; border-radius: 50%; border: 1px solid var(--line); background: rgba(13, 20, 39, .92); font-size: 1rem; }
.dlg-close:hover { border-color: var(--gold); }
.dlg-title { margin: 4px 0 6px; font-size: clamp(1.3rem, 4vw, 1.7rem); font-weight: 800; line-height: 1.15; }
.dlg-sub { margin: 0 0 12px; color: var(--muted); font-size: .88rem; }
.caption { color: var(--muted); font-size: .9rem; margin: 10px 0; }
.big-quote { font-size: clamp(1.1rem, 3.4vw, 1.35rem); font-weight: 700; line-height: 1.35; margin: 14px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 18px; border-radius: 999px; border: 1px solid rgba(245, 199, 107, .45);
  background: rgba(245, 199, 107, .1); font-weight: 700; transition: background .2s, transform .15s; }
.btn:hover { background: rgba(245, 199, 107, .2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #2a1a00; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .86rem; }
.btn:disabled { opacity: .55; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }

.reveal .rv-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.reveal .chip { border-color: var(--line); background: rgba(245, 199, 107, .12); color: var(--gold); }
.rv-day { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.rv-body { margin: 6px 0 4px; }
.rv-money { margin: 16px 0 0; padding: 10px 14px; border-radius: 14px; background: rgba(245, 199, 107, .08); border: 1px solid var(--line); font-size: .92rem; }
.rv-money.new { border-color: var(--gold); background: rgba(245, 199, 107, .16); animation: bump .8s .2s cubic-bezier(.3, 1.6, .5, 1) both; }
.rv-money b { color: var(--gold); }
.rv-quip { margin: 8px 4px 0; color: var(--muted); font-size: .88rem; font-style: italic; line-height: 1.4; }

/* the naughty list */
.naughty-card { margin: 16px 0 0; padding: 12px; border-radius: 16px; background: rgba(232, 69, 90, .08); border: 1px solid rgba(232, 69, 90, .35); }
.naughty-card figcaption { font-size: .8rem; font-weight: 700; color: #ff9aa7; margin: 0 0 8px; }
.nc-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.naughty-card.two .nc-row { grid-template-columns: 1fr 1fr; }
.nc-photo { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 380 / 508; max-height: 70dvh; margin: 0 auto; cursor: zoom-in; }
.nc-photo:not(.veiled):hover img { transform: scale(1.03); }
.nc-photo img { transition: transform .3s, filter .5s; }
/* the frosted glass with the devil and the question */
.nc-photo.veiled { cursor: pointer; }
.nc-photo.veiled img { filter: blur(26px) saturate(1.3) brightness(.75); transform: scale(1.18); }
.nc-glass { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; text-align: center; color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .04) 38%, rgba(255, 255, 255, .13) 58%, rgba(255, 255, 255, .03)),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 9px);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), inset 0 0 46px rgba(255, 255, 255, .1); border-radius: inherit; }
.nc-devil { font-family: var(--emoji); font-size: clamp(2.6rem, 11vw, 4.4rem); line-height: 1; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .55)); animation: devil 1.8s ease-in-out infinite; }
.nc-q { max-width: 17em; font-weight: 800; font-size: clamp(.92rem, 3.4vw, 1.2rem); line-height: 1.3; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.nc-go { display: inline-flex; padding: 9px 18px; border-radius: 999px; background: linear-gradient(180deg, #e8455a, #a3243b); font-weight: 800; font-size: .95rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .3); transition: transform .15s; }
.nc-photo.veiled:hover .nc-go { transform: scale(1.06); }
.naughty-card.two .nc-glass { gap: 7px; padding: 10px; }
.naughty-card.two .nc-q { font-size: clamp(.8rem, 2.6vw, 1.05rem); }
.naughty-card.two .nc-go { padding: 7px 12px; font-size: .82rem; }
.nc-photo.breaking .nc-glass { animation: shatter .6s forwards; }
.nc-photo.breaking .nc-glass::after { content: ''; position: absolute; inset: 0; background: no-repeat center / 100% 100%
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130' fill='none' stroke='white' stroke-width='.8' stroke-opacity='.9'%3E%3Cpath d='M50 62 L8 10 M50 62 L34 0 M50 62 L72 4 M50 62 L100 30 M50 62 L96 84 M50 62 L70 130 M50 62 L30 126 M50 62 L0 92 M50 62 L2 50'/%3E%3Cpath d='M38 48 L56 44 L64 58 L58 76 L40 78 L34 62 Z M24 30 L44 22 L74 26 L82 52 L80 90 L52 100 L22 92 L16 60 Z'/%3E%3C/svg%3E"); }
.naughty-card:not(.two) .nc-photo { width: min(100%, 380px); }
.nc-photo img { display: block; width: 100%; height: 100%; object-fit: cover; animation: fade .5s; }
.naughty-shelf { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.naughty-shelf h3 { margin: 0 0 10px; font-size: 1rem; }
.naughty-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.naughty-thumb { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; aspect-ratio: 380 / 508; background: rgba(0, 0, 0, .3); }
.naughty-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.naughty-thumb.veiled img { filter: blur(7px) brightness(.8); transform: scale(1.1); }
.nt-devil { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--emoji); font-size: 1.6rem; }
.naughty-thumb.locked { display: grid; place-items: center; opacity: .6; }
.nt-lock { font-family: var(--emoji); }
.nt-day { position: absolute; left: 4px; bottom: 4px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, .65); font-size: .7rem; font-weight: 800; }
.naughty-view .btn { margin-top: 14px; }
/* the AI label in the corner of every photo */
.ai-tag { position: absolute; z-index: 3; right: 6px; bottom: 6px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .62); color: #fff;
  font-size: .66rem; font-weight: 800; letter-spacing: .04em; pointer-events: none; backdrop-filter: blur(2px); }
.ai-tag.big { position: fixed; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); font-size: .78rem; padding: 4px 10px; }
.ai-tag.tiny { right: 3px; bottom: auto; top: 3px; padding: 0 4px; font-size: .55rem; border-radius: 4px; }
/* the age question */
.age-gate { text-align: center; }
.age-ic { font-family: var(--emoji); font-size: 3rem; margin: 0; }
.age-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.age-note { margin: 14px 0 0; color: var(--muted); font-size: .78rem; }

/* rewards and history */
.santa-file { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: 6px 0 14px; border-radius: 14px; background: #f3e7c9; color: #3a2604;
  background-image: repeating-linear-gradient(0deg, transparent 0 22px, rgba(122, 31, 46, .15) 22px 23px); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); rotate: -.6deg; }
.sf-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; color: var(--wine); }
.santa-file b { font-size: 1.15rem; }
.santa-file span:last-child { font-size: .86rem; }
.reward-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.reward-grid .reward { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .06); opacity: .6; }
.reward-grid .reward.have { opacity: 1; border-color: var(--line); background: linear-gradient(160deg, rgba(245, 199, 107, .14), rgba(0, 0, 0, .2)); }
.reward-grid .reward.ultimate.have { border-color: var(--gold); box-shadow: 0 0 18px rgba(245, 199, 107, .4); }
.r-ic { font-family: var(--emoji); font-size: 1.6rem; line-height: 1.2; }
.reward-grid .reward:not(.have) .r-ic { filter: grayscale(1); }
.reward-grid .reward b { font-size: .9rem; }
.reward-grid .reward small { color: var(--muted); font-size: .76rem; }
.code-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.code-form label { width: 100%; font-weight: 700; font-size: .9rem; }
.code-form input { flex: 1; min-width: 140px; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--text); font: inherit; letter-spacing: .12em; text-transform: uppercase; }
.code-out { width: 100%; margin: 4px 0 0; color: var(--muted); font-size: .86rem; min-height: 1.2em; }
.hist-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.hist-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .06); background: rgba(0, 0, 0, .22); text-align: left; }
.hist-item:hover { border-color: var(--line); }
.h-day { min-width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(245, 199, 107, .15); color: var(--gold); font-weight: 800; font-size: .86rem; }
.h-ic { font-family: var(--emoji); font-size: 1.3rem; }
.h-tx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.h-tx small { color: var(--muted); font-size: .76rem; }
.h-money { color: var(--gold); font-weight: 700; font-size: .86rem; white-space: nowrap; }

/* ---------------- the content of the windows: a quote, a joke, a rating ---------------- */
.quote { position: relative; margin: 8px 0 14px; padding: 16px 18px 14px 22px; border-radius: 16px; background: linear-gradient(160deg, rgba(122, 31, 46, .45), rgba(13, 20, 39, .6));
  border-left: 4px solid var(--gold); }
.quote::before { content: '“'; position: absolute; top: -18px; right: 10px; font-size: 5.5rem; line-height: 1; color: rgba(245, 199, 107, .22); font-weight: 800; }
.quote blockquote { margin: 0; font-size: clamp(1.15rem, 3.6vw, 1.4rem); font-weight: 700; font-style: italic; line-height: 1.35; }
.quote figcaption { margin-top: 8px; color: var(--gold); font-weight: 700; font-size: .9rem; }
.joke-card { padding: 16px 18px; border-radius: 16px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .07); }
.joke-setup { margin: 0 0 12px; font-size: clamp(1.05rem, 3.2vw, 1.2rem); font-weight: 600; line-height: 1.45; }
.joke-card .btn { margin-top: 2px; }
.joke-punch { margin: 0; font-size: clamp(1.15rem, 3.6vw, 1.35rem); font-weight: 800; color: var(--gold); line-height: 1.35; animation: punch .45s cubic-bezier(.2, 1.6, .4, 1); }
.rate { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; flex-wrap: wrap; }
.rate-q { color: var(--muted); font-size: .86rem; font-weight: 700; margin-right: 4px; }
.rate-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); font-family: var(--emoji); font-size: 1.5rem; line-height: 1;
  transition: transform .15s, background .2s, border-color .2s; }
.rate-btn:hover { transform: scale(1.1); }
.rate-btn.on { border-color: var(--gold); background: rgba(245, 199, 107, .2); transform: scale(1.08); }
.demands { padding-left: 1.2em; }
.demands li { margin: 6px 0; }
.demands-cast, .finale-cast { display: flex; justify-content: center; align-items: flex-end; gap: 10px; }
.demands-cast .art, .finale-cast .art { width: 90px; }
.finale-cast .art-tree { width: 120px; }
.finale-msg { margin-top: 16px; text-align: center; font-weight: 800; font-size: 1.2rem; }
.finale-msg .merry, .finale-lines .merry { color: var(--gold); font-size: 1.6em; }

/* ---------------- the trolls ---------------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 12, .7); animation: fade .15s; transition: opacity .25s; text-align: center; }
.overlay.out { opacity: 0; }
.overlay.dark { background: rgba(0, 0, 0, .93); }
.overlay.cinema { background: #000; }
.scare { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: scare .35s cubic-bezier(.2, 1.8, .4, 1); }
.scare-art { width: min(70vw, 340px); animation: shake-x .12s 6; }
.scare-text { margin: 0; font-weight: 800; font-size: clamp(1.4rem, 6vw, 2.6rem); color: #ff4057; text-shadow: 0 0 24px rgba(255, 0, 40, .6); letter-spacing: -.01em; }
.steal { width: min(420px, 90vw); padding: 22px; border-radius: 18px; background: #050a05; border: 1px solid #1d5c2e; font-family: ui-monospace, Menlo, Consolas, monospace; color: #6dff8a; text-align: left; }
.steal p { margin: 0 0 10px; font-weight: 700; }
.steal-bar { height: 16px; border: 1px solid #1d5c2e; border-radius: 4px; overflow: hidden; }
.steal-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, #2fd35a 0 8px, #1f9a40 8px 16px); transition: width .3s; }
.steal-pct { margin: 8px 0 0 !important; font-size: 1.3rem; }
.steal.denied { border-color: #8a1020; color: #ff4057; animation: shake-x .1s 4; }
.steal.denied .steal-bar span { background: #ff4057; }
.angry-santa { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.as-art { width: min(60vw, 260px); animation: rage .18s infinite alternate; }
.as-big { margin: 0; font-weight: 800; font-size: clamp(1.5rem, 6.4vw, 2.8rem); color: #ff4057; line-height: 1.05; }
.as-sub { margin: 0; font-weight: 800; font-size: clamp(1rem, 4vw, 1.4rem); }
.art-santa .steam { animation: steam 1s ease-out infinite; }
.errwin { position: fixed; z-index: 65; left: 50%; top: 32%; translate: -50% -50%; width: min(330px, calc(100vw - 24px)); background: #c0c0c0; color: #000; border: 2px solid; border-color: #fff #404040 #404040 #fff;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .5); font-family: Tahoma, Verdana, 'Segoe UI', sans-serif; font-size: 13px; animation: pop-in .2s; text-align: left; }
.errwin.placed { translate: none; }
.err-bar { display: flex; justify-content: space-between; align-items: center; padding: 3px 4px 3px 8px; background: linear-gradient(90deg, #000080, #1084d0); color: #fff; font-weight: 700; }
.err-x { width: 22px; height: 20px; padding: 0; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; color: #000; font-size: 11px; font-weight: 700; }
.err-body { display: flex; gap: 12px; padding: 14px 12px 6px; }
.err-ic { font-family: var(--emoji); font-size: 28px; }
.err-body p { margin: 4px 0 0; }
.err-btns { display: flex; justify-content: center; gap: 10px; padding: 8px 10px 12px; }
.err-btn { min-width: 92px; min-height: 30px; padding: 4px 10px; background: #c0c0c0; border: 2px solid; border-color: #fff #404040 #404040 #fff; color: #000; font-family: inherit; font-size: 12px; font-weight: 700; transition: translate .25s; }
.err-btn:active { border-color: #404040 #fff #fff #404040; }
.lie { display: flex; flex-direction: column; align-items: center; }
.lie-big { margin: 0 0 8px; font-weight: 800; font-size: clamp(1.6rem, 7vw, 3rem); color: #ff4057; animation: blink .3s steps(2) infinite; }
.shame { width: min(420px, 90vw); padding: 22px; border-radius: 20px; background: var(--panel); border: 1px solid rgba(232, 69, 90, .5); }
.shame-label { margin: 0; text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 800; color: var(--muted); }
.shame-pct { margin: 4px 0 10px; font-weight: 800; font-size: 3.2rem; color: #ff4057; line-height: 1; }
.shame-bar { height: 14px; border-radius: 8px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.shame-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); animation: grow .8s cubic-bezier(.2, .8, .2, 1); transform-origin: 0 50%; }
.retro { font-family: ui-monospace, Menlo, Consolas, monospace; color: #7dff8a; text-shadow: 0 0 8px #2fd35a; }
.retro p { margin: 6px 0; }
.retro-big { font-size: clamp(2rem, 9vw, 3.6rem); font-weight: 800; }
.finale-lines p { margin: 6px 0; font-weight: 800; font-size: clamp(1.3rem, 5.4vw, 2.6rem); letter-spacing: .02em; opacity: 0; animation: line-in .8s forwards; }
.finale-lines p:nth-child(1) { animation-delay: .2s; } .finale-lines p:nth-child(2) { animation-delay: 1.2s; } .finale-lines p:nth-child(3) { animation-delay: 2s; }
.finale-lines p:nth-child(4) { animation-delay: 3s; font-weight: 500; font-size: clamp(1rem, 3.6vw, 1.5rem); color: var(--muted); } .finale-lines p:nth-child(5) { animation-delay: 4.2s; }
/* a photo over the whole screen */
.overlay.zoom { padding: 0; background: rgba(0, 0, 0, .95); }
.lightbox { position: relative; width: 100vw; height: 100dvh; display: grid; place-items: center; touch-action: pan-y; }
.lightbox img { display: block; width: 100vw; height: 100dvh; object-fit: contain; cursor: zoom-out; user-select: none; -webkit-user-drag: none; }
.lightbox img.in { animation: zoom-in .25s cubic-bezier(.2, 1.2, .4, 1); }
.lb-btn { position: absolute; z-index: 2; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.6rem; line-height: 1; }
.lb-btn:hover { background: rgba(0, 0, 0, .8); border-color: var(--gold); }
.lb-close { top: calc(12px + env(safe-area-inset-top)); right: 12px; font-size: 1.1rem; }
.lb-prev, .lb-next { top: 50%; translate: 0 -50%; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb-count { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); translate: -50% 0; margin: 0; padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, .6); font-size: .85rem; font-weight: 700; }
.lb-count:empty { display: none; }
.peek-elf { position: fixed; z-index: 55; right: 18px; bottom: -120px; display: flex; flex-direction: column; align-items: center; transition: bottom .6s cubic-bezier(.2, 1.3, .4, 1); pointer-events: none; }
.peek-elf.in { bottom: -8px; }
.peek-elf span { font-family: var(--emoji); font-size: 3rem; }
.peek-elf p { margin: 0 0 6px; order: -1; padding: 6px 10px; border-radius: 10px; background: #fff7e6; color: #2a1a00; font-weight: 700; font-size: .82rem; }
.flyby { position: fixed; z-index: 55; top: 16%; left: -60%; font-family: var(--emoji); font-size: 2.4rem; white-space: nowrap; pointer-events: none; animation: flyby 7s linear forwards; }

/* chaos mode and the finale */
html.chaos body { animation: hue 1.2s linear infinite; }
html.chaos .door { animation: chaos-wob .4s ease-in-out infinite alternate; }
html.chaos h1 { animation: shake-x .2s infinite; }
html.finale body { background-color: #000; }
html.finale .app > :not(.board):not(.scene) { opacity: .25; transition: opacity .6s; }

/* ---------------- motion ---------------- */
.jiggle { animation: jiggle .45s; }
@keyframes shimmer { to { background-position: -200% 0; } }
/* the idle wobble moves `rotate`, so hover (transform) and the runaway prank (translate) still work during it */
@keyframes wob { 0%, 93%, 100% { rotate: var(--tilt, 0deg); } 95% { rotate: calc(var(--tilt, 0deg) - 2.5deg); } 97% { rotate: calc(var(--tilt, 0deg) + 2deg); } }
@keyframes jiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-4deg) scale(1.03); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-2deg); } }
@keyframes knock { 0%, 100% { transform: none; } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
@keyframes gold-run { to { background-position: -220% 0; } }
@keyframes twinkle { 0% { filter: brightness(1); } 50% { filter: brightness(1.35); } 100% { filter: brightness(1.1); } }
@keyframes glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
@keyframes pulse-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 69, 90, .5); } 50% { box-shadow: 0 0 0 6px rgba(232, 69, 90, 0); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes devil { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-6px) rotate(6deg) scale(1.06); } }
@keyframes shatter { 0% { opacity: 1; } 25% { opacity: 1; transform: scale(1.03); filter: brightness(1.5); } 100% { opacity: 0; transform: scale(1.22); filter: blur(4px); } }
@keyframes punch { from { opacity: 0; transform: scale(.7) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes hand { from { opacity: 0; transform: translateX(-60px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes bulb { from { opacity: .45; } to { opacity: 1; } }
@keyframes star { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(8deg); } }
@keyframes boom { to { transform: scale(0) rotate(40deg); opacity: 0; } }
@keyframes regrow { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dance { from { transform: rotate(-10deg) translateY(0); } to { transform: rotate(10deg) translateY(-14px); } }
@keyframes disco { to { filter: blur(10px) hue-rotate(360deg); } }
@keyframes sleigh { 0% { left: -45%; top: 22%; } 70% { left: 58%; top: 40%; } 100% { left: 66%; top: 58%; transform: rotate(40deg) scale(.6); opacity: 0; } }
@keyframes poof { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes crack { 40% { transform: rotate(-14deg) scale(1.1); } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes eq { from { height: 8px; } to { height: 58px; } }
@keyframes scare { from { transform: scale(2.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake-x { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-8px); } }
@keyframes rage { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(3deg) scale(1.04); } }
@keyframes steam { from { opacity: .9; transform: translateY(0); } to { opacity: 0; transform: translateY(-14px); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes line-in { from { opacity: 0; transform: translateY(14px); letter-spacing: .2em; } to { opacity: 1; transform: none; } }
@keyframes flyby { to { left: 110%; } }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes chaos-wob { from { transform: rotate(-6deg) scale(.96); } to { transform: rotate(6deg) scale(1.04); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .door { animation: none; }
  .door-leaf { transition: none; }
}
