:root {
  --bg: #0f0c0e; --bg2: #171216; --card: #211a1f; --card2: #2a2128; --line: #3a2e35;
  --burgundy: #6e1222; --burgundy2: #8a1830; --pumpkin: #d97a2b; --pumpkin2: #eb9448;
  --gold: #f0b84a; --green: #2e8b5e; --greenbg: #153a29; --text: #f5f0ee; --muted: #b9aeb2; --slate: #3f6a78;
  --radius: 16px; --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--text); overflow-x: hidden;
  background: radial-gradient(1100px 560px at 85% -10%, rgba(138, 24, 48, .3), transparent 60%), radial-gradient(800px 480px at -10% 110%, rgba(217, 122, 43, .1), transparent 60%), var(--bg);
  background-attachment: fixed; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--pumpkin2); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; } .gold { color: var(--gold); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.noanim *, .noanim *::before, .noanim *::after { animation: none !important; transition: none !important; }
.noanim #decor { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  background: linear-gradient(180deg, var(--pumpkin2), var(--pumpkin)); color: #241003; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .15s, box-shadow .2s, filter .2s; box-shadow: 0 6px 20px rgba(217, 122, 43, .22); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(217, 122, 43, .34); }
.btn:active { transform: translateY(1px); }
.btn:disabled { filter: grayscale(.8) brightness(.65); cursor: not-allowed; transform: none; box-shadow: none; }
.btn.big { min-height: 58px; font-size: 1.1rem; padding: 14px 30px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--pumpkin); }
.btn.red { background: linear-gradient(180deg, #b52440, var(--burgundy2)); color: #fff; box-shadow: 0 6px 20px rgba(138, 24, 48, .3); }
.btn.green { background: linear-gradient(180deg, #4fbf87, #2e8b5e); color: #06190f; }
.btn.sm { min-height: 40px; padding: 7px 16px; font-size: .92rem; }
.input, textarea.input, select.input { width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 12px; background: #140f13; border: 1px solid var(--line); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus, .btn:focus-visible, .cell:focus-visible, button:focus-visible { border-color: var(--pumpkin); box-shadow: 0 0 0 3px rgba(217, 122, 43, .28); outline: none; }
textarea.input { min-height: 96px; resize: vertical; }
label.field { display: block; margin: 14px 0; }
label.field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .9rem; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { flex: 1 1 140px; min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; }
.chip[aria-pressed="true"] { border-color: var(--pumpkin); background: rgba(217, 122, 43, .14); box-shadow: inset 0 0 0 1px var(--pumpkin); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; cursor: pointer; }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

#decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
#decor .bat { position: absolute; font-size: 26px; opacity: .35; top: 10%; animation: fly 24s linear infinite; }
#decor .bat.b2 { top: 66%; animation-duration: 32s; animation-delay: -12s; font-size: 20px; }
#decor .floater { position: absolute; font-size: 28px; opacity: .2; animation: floaty 7s ease-in-out infinite; }
@keyframes fly { 0% { transform: translate(-60px, 0); } 25% { transform: translate(25vw, -30px); } 50% { transform: translate(50vw, 20px); } 75% { transform: translate(75vw, -20px); } 100% { transform: translate(110vw, 10px); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(4deg); } }
#app, #topbar { position: relative; z-index: 1; }

#topbar { position: sticky; top: 0; z-index: 20; background: rgba(15, 12, 14, .97); border-bottom: 1px solid var(--line); }
.topbar-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; max-width: 1040px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .02em; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { height: 34px; max-width: 120px; object-fit: contain; }
.brand .wordmark { font-size: 1rem; white-space: nowrap; } .brand .wordmark b { color: var(--pumpkin); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a, .nav button { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; background: none; border: 0; cursor: pointer; }
.nav a.active, .nav a:hover, .nav button:hover { color: var(--text); background: var(--card); }
.toggles { display: flex; gap: 4px; }
.tgl { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.05rem; }
.tgl[aria-pressed="false"] { opacity: .55; }
@media (max-width: 760px) {
  .nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(15, 12, 14, .98); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; margin: 0; }
  .nav a, .nav button { display: flex; flex-direction: column; align-items: center; font-size: .72rem; padding: 6px 8px; gap: 2px; }
  .nav .ico { font-size: 1.25rem; }
  .toggles { margin-left: auto; }
  body.with-nav #app { padding-bottom: 84px; }
}
@media (min-width: 761px) { .nav .ico { margin-right: 4px; } }

.hero { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px 48px; }
.hero-inner { max-width: 760px; text-align: center; }
.hero-logo { min-height: 40px; margin-bottom: 10px; display: flex; justify-content: center; }
.hero-logo img { max-height: 64px; max-width: 220px; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 4rem); letter-spacing: .04em; margin: 0; background: linear-gradient(180deg, #fff 30%, var(--pumpkin2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .h2 { font-size: clamp(1.2rem, 4vw, 1.8rem); letter-spacing: .32em; color: var(--gold); font-weight: 800; margin: 4px 0 8px; }
.hero .subtitle { font-size: clamp(1rem, 3vw, 1.3rem); color: var(--muted); margin-bottom: 22px; }
.lab-shelf { display: flex; justify-content: center; align-items: flex-end; gap: 18px; margin: 0 0 18px; height: 92px; }
.lab-shelf svg { height: 100%; width: auto; overflow: visible; }
.bubble { animation: bubble 2.6s ease-in infinite; } .bubble:nth-of-type(2) { animation-delay: .8s; } .bubble:nth-of-type(3) { animation-delay: 1.6s; }
@keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: .9; } 100% { transform: translateY(-44px); opacity: 0; } }
.alert-box { text-align: left; position: relative; border: 1px solid rgba(138, 24, 48, .7); background: linear-gradient(180deg, rgba(110, 18, 34, .38), rgba(33, 26, 31, .92)); border-radius: 18px; padding: 24px 22px 16px; margin: 0 auto 26px; box-shadow: var(--shadow); }
.alert-box .siren { position: absolute; top: -14px; left: 18px; right: 18px; width: fit-content; max-width: calc(100% - 36px); background: var(--burgundy2); color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: .06em; padding: 5px 12px; border-radius: 999px; animation: pulse 1.8s infinite; }
.alert-box p { margin: .6em 0; } .alert-box .hl { font-weight: 700; font-size: 1.08rem; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(138, 24, 48, .7); } 50% { box-shadow: 0 0 0 10px rgba(138, 24, 48, 0); } }
.hero .foot { color: var(--muted); margin-top: 16px; font-size: .95rem; }

.login { max-width: 460px; margin: 5vh auto 40px; padding: 0 16px; }
.code-input { text-transform: uppercase; letter-spacing: .1em; font-weight: 700; text-align: center; font-size: 1.1rem; }
.form-error { color: #ff9b9b; min-height: 1.5em; margin: 6px 0; font-size: .95rem; }

.page { padding-block: 16px 40px; }
.welcome-line { font-size: clamp(1.15rem, 3.4vw, 1.5rem); font-weight: 800; margin: 0 0 12px; }
.hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.hud .card { padding: 12px 14px; }
.hud .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.hud .value { font-size: 1.6rem; font-weight: 800; } .hud .value.gold { color: var(--gold); }
.banner { border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--card); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.warn { border-color: rgba(240, 184, 74, .5); background: rgba(240, 184, 74, .08); }
.banner.test { border-color: rgba(79, 191, 135, .5); background: rgba(79, 191, 135, .08); }
.banner .grow { flex: 1; min-width: 200px; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--gold); }

.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(6px, 1.6vw, 14px); }
.cell { position: relative; aspect-ratio: 1 / 1.1; border-radius: clamp(10px, 2vw, 16px); border: 1px solid #342a2f; cursor: pointer; background: linear-gradient(160deg, #241c21, #1a1418); padding: clamp(6px, 1.4vw, 13px); text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transition: transform .18s, border-color .2s, box-shadow .25s; }
.cell:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, .4); border-color: var(--pumpkin); }
.cell:active { transform: scale(.98); }
.cell .num { position: absolute; top: 7px; right: 9px; font-size: .72rem; color: var(--muted); opacity: .8; font-weight: 700; }
.cell .emoji { font-size: clamp(1.4rem, 5vw, 2.2rem); line-height: 1; }
.cell .title { font-weight: 700; font-size: clamp(.66rem, 1.8vw, .94rem); line-height: 1.2; margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; hyphens: auto; overflow-wrap: anywhere; }
.cell .meta { display: flex; flex-direction: column; gap: 3px; font-size: clamp(.58rem, 1.5vw, .76rem); }
.cell .pts { color: var(--muted); }
.pill { display: inline-block; border-radius: 999px; padding: 2px 8px; font-weight: 700; white-space: nowrap; background: #33282e; color: var(--muted); width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cell.s-active { background: linear-gradient(160deg, #4d1120, #2a0d15); border-color: var(--burgundy2); } .s-active .pill { background: rgba(138, 24, 48, .5); color: #ffc2cc; }
.cell.s-returned { background: linear-gradient(160deg, #4d1120, #2a0d15); border: 1px dashed var(--pumpkin); } .s-returned .pill { background: rgba(217, 122, 43, .25); color: var(--pumpkin2); }
.cell.s-review { background: linear-gradient(160deg, #4a3812, #2c2210); border-color: #c99a34; } .s-review .pill { background: rgba(240, 184, 74, .22); color: var(--gold); }
.cell.s-partial { background: linear-gradient(160deg, #20343b, #17252a); border-color: var(--slate); } .s-partial .pill { background: rgba(63, 106, 120, .5); color: #b8e0ec; }
.cell.s-good { background: linear-gradient(160deg, #1b4a35, #112e21); border-color: var(--green); } .s-good .pill { background: rgba(46, 139, 94, .35); color: #9ff0c4; }
.cell.s-good .emoji::after { content: " ✓"; color: #6fe0a6; font-size: .55em; vertical-align: top; }
.cell.s-rejected { opacity: .6; } .cell.locked { cursor: not-allowed; filter: grayscale(.5) brightness(.75); }
.cell.in-line { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(240, 184, 74, .4); border-color: var(--gold); }
.cell.glow { animation: glowG 1.6s ease-out 1; }
@keyframes glowG { 0% { box-shadow: 0 0 0 0 rgba(79, 191, 135, .9); } 40% { box-shadow: 0 0 0 10px rgba(79, 191, 135, .35), 0 0 36px rgba(79, 191, 135, .8); } 100% { box-shadow: 0 0 0 0 rgba(79, 191, 135, 0); } }
.next-bingo { margin: 14px 0 6px; font-weight: 700; }
.line-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.line-chip { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.line-chip.done { border-color: var(--gold); color: var(--gold); background: rgba(240, 184, 74, .1); }
@media (max-width: 420px) { .cell .num { display: none; } }
@media (min-width: 761px) { .cell { aspect-ratio: auto; min-height: 150px; } }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 3vh 12px; background: rgba(5, 3, 4, .85); overflow-y: auto; }
.modal-card { position: relative; width: 100%; max-width: 780px; margin-bottom: 4vh; animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-card h2 { padding-right: 48px; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.3rem; z-index: 2; }
@media (max-width: 560px) { .modal { padding: 0; } .modal-card { border-radius: 0; min-height: 100vh; margin: 0; } }
.task-head { display: flex; gap: 14px; align-items: center; padding-right: 48px; margin-bottom: 8px; }
.task-head .emoji { font-size: 2.4rem; line-height: 1; }
.fold { margin: 6px 0 10px; } .fold summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }
.task-head h2 { margin: 0; font-size: clamp(1.15rem, 4vw, 1.5rem); }
.task-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; font-size: .82rem; }
.story { font-style: italic; color: #eadfe0; margin: 10px 0; }
.rules { margin: 8px 0 14px; padding: 12px 16px 12px 34px; background: #17111a; border: 1px solid var(--line); border-radius: 12px; font-size: .94rem; }
.rules li { margin: 4px 0; }
.result { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.result.ok { background: rgba(79, 191, 135, .12); border: 1px solid rgba(79, 191, 135, .4); }
.result.bad { background: rgba(138, 24, 48, .2); border: 1px solid rgba(138, 24, 48, .6); }
.result.info { background: rgba(240, 184, 74, .08); border: 1px solid rgba(240, 184, 74, .35); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.score-big { font-size: 2.4rem; font-weight: 900; color: var(--gold); line-height: 1; }
table.parts { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .94rem; }
table.parts td { padding: 6px 4px; border-bottom: 1px solid var(--line); } table.parts td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.parts .pen { color: #ff9b9b; }

.timer { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.timer .t { font-weight: 800; font-size: 1.2rem; min-width: 3.4em; } .timer .bar { flex: 1; height: 8px; border-radius: 8px; background: #2a2025; overflow: hidden; }
.timer .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--burgundy2), var(--pumpkin), var(--gold)); transition: width .25s linear; }
.timer.low .t { color: #ff8b8b; }
.round-head { color: var(--muted); font-weight: 700; }
.film-title { font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 900; margin: 4px 0 12px; color: var(--gold); }
.emoji-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.emo { min-height: 64px; font-size: 2rem; border-radius: 14px; border: 1px solid var(--line); background: #1a1418; cursor: pointer; }
.emo[aria-pressed="true"] { border-color: var(--gold); background: rgba(240, 184, 74, .14); box-shadow: inset 0 0 0 1px var(--gold); }
.picked { min-height: 56px; display: flex; gap: 8px; align-items: center; font-size: 2rem; padding: 6px 12px; border-radius: 12px; border: 1px dashed var(--line); margin: 12px 0; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; min-height: 56px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: #1a1418; cursor: pointer; font-size: 1.02rem; }
.opt:hover { border-color: var(--pumpkin); } .opt:active { background: rgba(217, 122, 43, .14); }

.code-display { font: 800 clamp(1.4rem, 6vw, 2.2rem) "Courier New", monospace; letter-spacing: .12em; text-align: center; padding: 16px 10px; border-radius: 12px; background: #e8dcc6; color: #2b2020; box-shadow: 0 5px 0 var(--burgundy); word-break: break-all; }
.hint-box { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(217, 122, 43, .12); border: 1px solid rgba(217, 122, 43, .45); }

.scene-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.scene-tools .stat { font-weight: 800; } .scene-tools .gold { color: var(--gold); }
.scene-scroll { border-radius: 14px; border: 1px solid var(--line); overflow: auto; max-height: 70vh; -webkit-overflow-scrolling: touch; background: #000; }
.scene { position: relative; cursor: crosshair; user-select: none; -webkit-user-select: none; transition: width .2s; }
.scene img { display: block; width: 100%; height: auto; pointer-events: none; }
.scene .mark { position: absolute; width: 9%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; border: 3px solid var(--gold); box-shadow: 0 0 18px var(--gold); animation: catchg .5s ease-out; }
.scene .miss { position: absolute; width: 6%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid rgba(255, 255, 255, .6); animation: ripple .6s forwards; pointer-events: none; }
@keyframes catchg { from { transform: translate(-50%, -50%) scale(2); opacity: 0; } } @keyframes ripple { to { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } }

.board-d { display: grid; gap: 14px; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { min-height: 108px; border-radius: 12px; border: 2px dashed var(--line); background: #150f13; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; cursor: pointer; text-align: center; }
.slot .time { color: var(--gold); font-weight: 800; font-size: .95rem; }
.slot.target { border-color: var(--pumpkin); background: rgba(217, 122, 43, .1); }
.chars { display: flex; flex-wrap: wrap; gap: 8px; }
.char { min-width: 92px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: #1f171c; cursor: pointer; text-align: center; font-weight: 700; }
.char .f { font-size: 1.9rem; display: block; }
.char.selected { border-color: var(--pumpkin); box-shadow: 0 0 0 2px var(--pumpkin); }
.char.culprit { border-color: #ff5d73; box-shadow: 0 0 0 2px #ff5d73; background: rgba(255, 93, 115, .12); }
.char .accuse { display: block; font-size: .72rem; margin-top: 4px; color: var(--muted); font-weight: 600; text-decoration: underline; cursor: pointer; background: none; border: 0; padding: 2px; }
.clue-card { padding: 10px 14px; border-left: 3px solid var(--gold); background: #1a1418; border-radius: 0 10px 10px 0; margin-bottom: 6px; }
.shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shelf .slot { min-height: 96px; }
.pack { padding: 10px 6px; border-radius: 8px; color: #2a1d20; font-weight: 900; font-size: .8rem; letter-spacing: .04em; text-align: center; background: linear-gradient(90deg, var(--pc, #9b1d2a) 0 12px, #f4ede6 12px); border: 1px solid #000; box-shadow: 0 3px 0 #0c0809; min-width: 84px; cursor: pointer; }
.pack.selected { box-shadow: 0 0 0 3px var(--pumpkin); }

.belt { position: relative; height: clamp(190px, 46vw, 260px); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: repeating-linear-gradient(90deg, #1c1519 0 40px, #211a1e 40px 80px); touch-action: manipulation; }
.belt::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: repeating-linear-gradient(90deg, #0d0a0b 0 18px, #1a1418 18px 36px); border-top: 3px solid #3a2e35; }
.box { position: absolute; top: 18%; width: clamp(78px, 17vw, 108px); height: clamp(74px, 15vw, 96px); margin-left: calc(-1 * clamp(39px, 8.5vw, 54px)); border: 0; border-radius: 8px; cursor: pointer; padding: 0; background: transparent; will-change: transform; }
.box svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.box.e svg .seal { display: block; } .box.pop-g { animation: popg .5s forwards; } .box.pop-b { animation: popb .5s forwards; }
@keyframes popg { to { transform: translateY(-40px) scale(1.2); opacity: 0; } } @keyframes popb { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } to { opacity: 0; } }
.conv-score { font-weight: 800; font-size: 1.1rem; }

.word-stage { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #17111a; margin-bottom: 12px; }
.word-stage h3 { font-size: 1.02rem; margin: 0 0 8px; }
.letters { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.lt { width: 48px; height: 56px; border-radius: 10px; display: grid; place-items: center; font: 800 1.5rem Georgia, serif; background: linear-gradient(180deg, #3a2a31, #271d22); border: 1px solid #54414a; color: var(--text); cursor: pointer; }
.lt.out { background: #140f13; border-style: dashed; cursor: default; }
.num-boxes { display: flex; gap: 8px; flex-wrap: wrap; }
.num-box { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; color: var(--gold); }
.num-box input { width: 46px; height: 54px; text-align: center; text-transform: uppercase; font: 800 1.4rem Georgia, serif; border-radius: 10px; border: 1px solid var(--line); background: #140f13; }
.alpha { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; font-size: .78rem; margin-top: 8px; }
.alpha span { padding: 4px 2px; text-align: center; background: #140f13; border-radius: 6px; } .alpha b { color: var(--gold); }
.shifter { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.wheel { font: 800 1.6rem "Courier New", monospace; letter-spacing: .25em; padding: 8px 14px; border-radius: 10px; background: #e8dcc6; color: #2b2020; }

.puzzle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: min(100%, 440px); margin: 0 auto; touch-action: manipulation; }
.ptile { aspect-ratio: 1; border-radius: 6px; border: 2px solid transparent; background-size: 300% 300%; cursor: pointer; background-color: #000; }
.ptile.selected { border-color: var(--pumpkin); box-shadow: 0 0 0 2px var(--pumpkin); } .ptile.over { border-color: var(--gold); }
.poster-full { max-width: min(100%, 440px); display: block; margin: 0 auto; border-radius: 8px; border: 2px solid var(--gold); }
.sudoku { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 340px; margin: 0 auto 12px; border: 3px solid #6b5258; border-radius: 8px; overflow: hidden; }
.sc { aspect-ratio: 1; display: grid; place-items: center; font-size: clamp(1.7rem, 8vw, 2.4rem); border: 1px solid #3a2e35; background: #17111a; cursor: pointer; padding: 0; }
.sc:nth-child(4n+2), .sc:nth-child(4n+4) { border-right-width: 1px; } .sc.r2 { border-bottom: 3px solid #6b5258; } .sc.c2 { border-right: 3px solid #6b5258; }
.sc.given { background: #2b2128; cursor: default; } .sc.sel { background: rgba(217, 122, 43, .25); box-shadow: inset 0 0 0 3px var(--pumpkin); }
.palette { display: flex; gap: 8px; justify-content: center; }
.palette button { width: 64px; height: 64px; font-size: 2rem; border-radius: 14px; border: 1px solid var(--line); background: #1a1418; cursor: pointer; }
.door-wrap { display: flex; justify-content: center; margin: 12px 0; perspective: 600px; }
.door { width: 150px; height: 200px; position: relative; background: radial-gradient(circle, #f0c35a, #3a2308 70%); border: 6px solid #4a3a3e; border-radius: 70px 70px 4px 4px; overflow: hidden; }
.door .leaf { position: absolute; inset: 0; background: linear-gradient(120deg, #5b3a2a, #2e1c14); border-radius: 62px 62px 0 0; transform-origin: left center; animation: dooropen 1.6s .3s forwards cubic-bezier(.5, -0.1, .3, 1.2); display: grid; place-items: center; font-size: 2.2rem; }
.door .leaf::after { content: ""; position: absolute; right: 14px; top: 52%; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
@keyframes dooropen { to { transform: rotateY(-110deg); } }
.door .inside { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; }

.form-f { margin: 12px 0; } .form-f .cnt { float: right; font-size: .75rem; color: var(--muted); }
.criteria { margin: 8px 0 0; padding-left: 20px; font-size: .92rem; color: var(--muted); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: center; padding: 14px; color: var(--muted); }
.drop:hover { border-color: var(--pumpkin); }
.media-prev { margin-top: 10px; position: relative; } .media-prev img, .media-prev video { max-width: 100%; max-height: 300px; border-radius: 10px; display: block; }
.submitted { padding: 14px; border-radius: 12px; background: #17111a; border: 1px solid var(--line); }
.submitted dt { color: var(--muted); font-size: .8rem; margin-top: 8px; } .submitted dd { margin: 2px 0 0; white-space: pre-line; }

#bingo { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(circle, rgba(110, 18, 34, .96), rgba(8, 4, 6, .98)); overflow: hidden; cursor: pointer; padding: 16px; }
#bingo .bingo-card { text-align: center; animation: zoom .6s cubic-bezier(.2, 1.6, .4, 1); }
#bingo h2 { font-size: clamp(2.4rem, 12vw, 6rem); margin: 0; color: var(--gold); text-shadow: 0 0 30px rgba(240, 184, 74, .8), 0 6px 0 #6e1222; letter-spacing: .04em; }
#bingo p { font-size: clamp(1.1rem, 4vw, 1.6rem); font-weight: 700; margin: 8px auto; }
.spark { position: absolute; top: -30px; color: var(--gold); text-shadow: 0 0 10px var(--gold); animation: fall linear forwards; pointer-events: none; }
@keyframes zoom { from { transform: scale(.3); opacity: 0; } } @keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.finale { text-align: center; }
.finale h2 { font-size: clamp(1.8rem, 8vw, 3.4rem); color: var(--gold); text-shadow: 0 0 24px rgba(240, 184, 74, .6); }

#toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: 96px; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { background: #2a2127; border: 1px solid var(--line); border-left: 4px solid var(--pumpkin); padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow); animation: pop .25s; pointer-events: auto; }
.toast.ok { border-left-color: var(--green); } .toast.bad { border-left-color: var(--burgundy2); }
@media (min-width: 761px) { #toasts { bottom: 24px; } }

.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; margin: 10px 0 18px; }
.podium .pl { text-align: center; padding: 16px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.podium .pl .medal { font-size: 2.2rem; } .podium .pl .nm { font-weight: 800; overflow-wrap: anywhere; } .podium .pl .sc { color: var(--gold); font-weight: 800; font-size: 1.3rem; }
.podium .p1 { border-color: var(--gold); box-shadow: 0 0 30px rgba(240, 184, 74, .25); padding-top: 26px; background: linear-gradient(180deg, rgba(240, 184, 74, .15), var(--card)); }
.podium .p2 { border-color: #c9c3c6; } .podium .p3 { border-color: #c27a3d; }
@media (max-width: 520px) { .podium { grid-template-columns: 1fr; } .podium .p1 { order: -1; } }
table.rating { width: 100%; border-collapse: collapse; }
table.rating th, table.rating td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.rating th { color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table.rating .n { text-align: right; font-variant-numeric: tabular-nums; }
table.rating tr.top td { background: rgba(240, 184, 74, .07); } table.rating tr.me td { background: rgba(217, 122, 43, .15); } table.rating td.score { color: var(--gold); font-weight: 800; }
@media (max-width: 560px) { table.rating .hide-sm { display: none; } table.rating th, table.rating td { padding: 9px 5px; font-size: .92rem; } }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.line-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.line-card.done { border-color: var(--gold); box-shadow: 0 0 20px rgba(240, 184, 74, .2); }
.line-cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lc { padding: 8px 4px; border-radius: 10px; text-align: center; background: #17111a; border: 1px solid var(--line); font-size: .8rem; }
.lc.ok { background: var(--greenbg); border-color: var(--green); } .lc .e { font-size: 1.4rem; display: block; } .lc b { display: block; }

.rules-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 720px) { .rules-grid { grid-template-columns: 1fr; } }
.rules-text h3 { margin: 14px 0 4px; color: var(--gold); font-size: 1.02rem; } .rules-text p { margin: 4px 0; }
.demo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 10px; border-radius: 12px; background: #140f13; border: 1px solid var(--line); }
.dc { aspect-ratio: 1; border-radius: 8px; background: #241c21; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; transition: background .4s, box-shadow .4s; border: 1px solid #342a2f; }
.dc.g { background: var(--greenbg); border-color: var(--green); color: #9ff0c4; } .dc.bad { background: #3a2c10; border-color: #c99a34; color: var(--gold); } .dc.line { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(240, 184, 74, .6); }
.demo-msg { min-height: 2.4em; text-align: center; font-weight: 800; margin-top: 8px; } .demo-msg.win { color: var(--gold); font-size: 1.15rem; } .demo-msg.no { color: #ffb4bd; }
.section { margin: 22px 0; }
