/* Outside the Box prototype. */
:root { --bg: #15171B; --box: #1F2228; --line: #F1F2F4; --soft: #3A3F49; --text: #F1F2F4; --muted: #B4BAC6; --accent: #FFD166; --on: #15171B; }
@media (prefers-color-scheme: light) {
  :root { --bg: #F3F1EC; --box: #FFFFFF; --line: #1B1D22; --soft: #CFCCC4; --text: #1B1D22; --muted: #565B65; --accent: #8A5A00; --on: #FFFFFF; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 500 17px/1.5 "Space Grotesk", system-ui, sans-serif; }
[hidden] { display: none !important; }
.game { width: min(560px, 100% - 32px); margin: 0 auto; padding: 22px 0 28px; display: flex; flex-direction: column; gap: 16px; }
.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.03em; line-height: 1.15; }
.meta { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.box { display: flex; flex-direction: column; gap: 12px; min-height: 300px; justify-content: center; padding: 30px 26px; background: var(--box); border: 3px solid var(--line); text-align: center; }
h2 { margin: 0; font-size: clamp(1.7rem, 6vw, 2.5rem); letter-spacing: -0.03em; line-height: 1.1; }
.box p { margin: 0; }
#text { color: var(--muted); }
.ink { color: var(--box); }
.ink::selection { background: var(--accent); color: var(--on); }
.code { font-size: 1.1rem; color: var(--accent); word-break: break-all; }
input { width: 100%; min-height: 48px; margin-top: 4px; padding: 0 14px; border: 2px solid var(--soft); border-radius: 8px; background: var(--bg); color: var(--text); font: 500 1.05rem "Space Grotesk", system-ui, sans-serif; text-align: center; }
input:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.said { min-height: 1.5em; color: var(--accent); }
#extra .btn { margin: 4px auto 0; }
.handle { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn { min-height: 46px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--text); color: var(--bg); font: 700 1rem "Space Grotesk", system-ui, sans-serif; cursor: pointer; }
.btn.alt { background: transparent; color: var(--text); border: 1px solid var(--soft); }
.hintText { margin: 0; min-height: 1.5em; text-align: center; color: var(--accent); }
#far { padding: 2400px 0 40vh; text-align: center; }
.big { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.note { margin: 0; text-align: center; color: var(--muted); font-size: .85rem; }

/* chapters, hidden letters and locks */
#room { position: relative; }
.letter { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; background: none; color: var(--muted); opacity: .4; font: 700 15px "Space Grotesk", system-ui, sans-serif; cursor: pointer; }
.letter:hover, .letter:focus-visible { opacity: 1; color: var(--accent); }
#extra .btn.alt { display: block; }
#extra .btn { display: block; }
.tray { font-size: 1.6rem; font-weight: 700; letter-spacing: .2em; color: var(--accent); }

/* the Christmas door: only offered while the site wears its Christmas theme */
html:not([data-season="christmas"]) .xm-only { display: none !important; }
.snowsky { position: relative; height: 270px; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .08); box-shadow: inset 0 -26px 0 -14px #FFFFFF; touch-action: manipulation; }
.snowsky .flake { position: absolute; top: -50px; width: 48px; height: 48px; margin-left: -4px; padding: 7px; border: 0; border-radius: 50%; background: transparent; color: #FFFFFF; cursor: pointer; animation: otb-flake linear forwards; }
.snowsky .flake svg { display: block; width: 100%; height: 100%; }
.snowsky .flake:focus-visible { outline: 3px solid #FFD166; }
.snowsky .flake.got { color: #FFD166; animation: otb-got .35s ease-out forwards; }
@keyframes otb-flake { from { transform: translateY(0) rotate(0); } to { transform: translateY(330px) rotate(200deg); } }
@keyframes otb-got { to { transform: scale(1.9) rotate(60deg); opacity: 0; } }
.snowtally { font-weight: 700; font-size: 1.15rem; }
/* fairy lights */
.fairy { display: flex; justify-content: center; gap: 6px; padding: 18px 4px 6px; background: linear-gradient(transparent 17px, #1E4D33 17px, #1E4D33 20px, transparent 20px); }
.fairy .bulb { width: 40px; height: 54px; padding: 0; border: 0; border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); cursor: pointer; position: relative; transition: background .2s, transform .2s; }
.fairy .bulb::before { content: ""; position: absolute; left: 50%; top: -9px; width: 14px; height: 11px; margin-left: -7px; border-radius: 3px; background: #1E4D33; }
.fairy .bulb.on { background: var(--c); box-shadow: 0 0 18px var(--c), inset 0 -8px 0 rgba(0, 0, 0, .15); transform: translateY(2px); }
.fairy .bulb:focus-visible { outline: 3px solid #FFD166; outline-offset: 2px; }
/* Santa's visit */
.giftspot { min-height: 170px; display: grid; place-items: center; }
.giftspot .sleep { font-size: 2rem; font-weight: 700; letter-spacing: .3em; opacity: .7; animation: otb-zz 2.4s ease-in-out infinite; }
@keyframes otb-zz { 50% { transform: translateY(-8px); opacity: .35; } }
.gift { width: 150px; height: 150px; padding: 0; border: 0; background: none; cursor: pointer; transform: scale(calc(1 + var(--rip, 0) * .06)); }
.gift svg { width: 100%; height: 100%; display: block; }
.gift.wiggle { animation: otb-wiggle .45s ease-out; }
@keyframes otb-wiggle { 25% { rotate: -9deg; } 55% { rotate: 7deg; } 80% { rotate: -3deg; } }
/* the doorman, poked */
.voice__face { cursor: pointer; transform-origin: 50% 90%; }
.voice__face:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 50%; }
.voice__face.poked { animation: otb-poke .4s ease-out; }
@keyframes otb-poke { 30% { transform: rotate(-14deg) scale(.92); } 65% { transform: rotate(8deg); } }
.voice__face rect { transition: transform .5s cubic-bezier(.3, 1.6, .5, 1), opacity .5s; }
.voice__face.hatless rect { transform: translate(14px, -20px) rotate(35deg); opacity: 0; }
/* the barrel roll */
#room.roll { animation: otb-roll 1.1s cubic-bezier(.5, 0, .3, 1); }
@keyframes otb-roll { to { transform: rotate(360deg); } }
.best { margin: -4px 0 0; color: var(--accent); font-weight: 700; }
.bauble { margin: 0; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { #room.roll, .voice__face.poked, .gift.wiggle, .giftspot .sleep { animation: none; } }
.track { position: relative; height: 34px; margin: 6px 0 12px; background: var(--bg); border: 2px solid var(--soft); border-radius: 8px; overflow: hidden; }
.track .zone { position: absolute; top: 0; bottom: 0; background: var(--accent); opacity: .55; }
.track .pin { position: absolute; top: 0; bottom: 0; width: 5px; margin-left: -2px; background: var(--text); }
.pads { display: grid; grid-template-columns: repeat(2, 76px); justify-content: center; gap: 10px; margin: 6px 0 12px; }
.pad { height: 76px; border: 2px solid var(--soft); border-radius: 12px; background: var(--bg); color: var(--muted); font: 700 1.3rem "Space Grotesk", system-ui, sans-serif; cursor: pointer; }
.pad.lit { background: var(--accent); color: var(--on); border-color: var(--accent); }
.wires { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0; }
.wires > div { display: grid; gap: 8px; }
.wire, .label-wire { min-height: 46px; border: 2px solid var(--soft); border-radius: 8px; background: var(--bg); color: var(--text); font: 700 .95rem "Space Grotesk", system-ui, sans-serif; cursor: pointer; }
.wire.picked { border-color: var(--text); outline: 2px solid var(--text); }
.wire:disabled, .label-wire:disabled { opacity: .3; cursor: default; }
.w-red { border-left: 12px solid #E5484D; } .w-blue { border-left: 12px solid #3E9BF0; } .w-green { border-left: 12px solid #30A46C; } .w-yellow { border-left: 12px solid #F5C518; }
.i-red { color: #E5484D; } .i-blue { color: #3E9BF0; } .i-green { color: #30A46C; } .i-yellow { color: #C99A00; }
.wire:focus-visible, .label-wire:focus-visible, .pad:focus-visible, .letter:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* chapter colors, room shapes and the door */
#room { --wall: #123B3A; --glow: #2DD4BF; background: var(--wall); transition: background .4s ease; overflow: hidden; }
#room[data-ch="1"] { --wall: #40290F; --glow: #FFC53D; }
#room[data-ch="2"] { --wall: #15304F; --glow: #7FAEFF; }
#room[data-ch="3"] { --wall: #4A1B2E; --glow: #FF7A9B; }
@media (prefers-color-scheme: light) {
  #room { --wall: #D3F0EC; --glow: #0B9488; }
  #room[data-ch="1"] { --wall: #FBE7BF; --glow: #A86B00; }
  #room[data-ch="2"] { --wall: #D8E6FB; --glow: #1F5FBF; }
  #room[data-ch="3"] { --wall: #FADCE6; --glow: #B3144F; }
}
#room > *:not(.decor):not(#letterLayer) { position: relative; z-index: 1; }
#letterLayer { position: static; }
#room #text { color: var(--text); opacity: .82; }
#room .said { color: var(--glow); }
#room .ink { color: var(--wall); }
.letter { z-index: 2; }
.decor i { position: absolute; display: block; background: var(--glow); opacity: .13; pointer-events: none; }
.decor .d1 { width: 130px; height: 130px; left: -34px; bottom: -40px; border-radius: 50%; }
.decor .d2 { width: 96px; height: 96px; right: -14px; top: -18px; transform: rotate(18deg); }
.decor .d3 { width: 110px; height: 96px; right: 16%; bottom: -30px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.doorway { width: 74px; height: 108px; margin: 6px auto 0; background: #0B0D10; border-radius: 6px 6px 0 0; perspective: 300px; }
.doorway i { display: block; width: 100%; height: 100%; background: var(--glow); border-radius: 6px 6px 0 0; transform-origin: left center; animation: swing .55s ease forwards; }
@keyframes swing { to { transform: rotateY(-78deg); } }
@media (prefers-reduced-motion: reduce) { .doorway i { animation: none; transform: rotateY(-78deg); } #room { transition: none; } }
.swatches { display: flex; justify-content: center; gap: 12px; margin: 4px 0 10px; }
.swatches i { display: block; width: 84px; height: 84px; border-radius: 12px; border: 3px solid rgba(255, 255, 255, .55); }
.pots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pot, .tile, .knob, .block, .lamp { border: 0; cursor: pointer; font: 700 .9rem "Space Grotesk", system-ui, sans-serif; }
.pot { min-height: 54px; border-radius: 10px; color: #111; }
.p-red { background: #FF8A80; } .p-green { background: #7BDCA0; } .p-blue { background: #8DC4FF; }
.tiles { display: grid; grid-template-columns: repeat(5, 44px); justify-content: center; gap: 6px; margin: 4px 0; }
.tile { width: 44px; height: 44px; padding: 6px; border-radius: 8px; background: rgba(0, 0, 0, .28); }
svg { display: block; width: 100%; height: 100%; }
.keys { display: flex; justify-content: center; gap: 22px; margin: 4px 0 12px; }
.keys span { width: 92px; height: 92px; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .28); }
.keys .hole { filter: grayscale(.2); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55); }
.knobs { display: grid; grid-template-columns: repeat(4, 62px); justify-content: center; gap: 10px; margin: 4px 0; }
.knob { width: 62px; height: 62px; border-radius: 50%; background: var(--c); color: #111; font-size: 1.8rem; line-height: 1; transition: transform .18s ease; }
.rainbow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0; }
.block { height: 74px; border-radius: 8px; }
.block.picked { outline: 4px solid var(--text); outline-offset: 2px; }
.lamps { display: grid; grid-template-columns: repeat(3, 64px); justify-content: center; gap: 8px; margin: 4px 0; }
.lamp { width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .35); }
.lamp.on { background: #FFD166; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .15); }
.scatter { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 2px 0 10px; }
.scatter span { height: 38px; padding: 3px; }
.row.center { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tile:focus-visible, .knob:focus-visible, .block:focus-visible, .lamp:focus-visible, .pot:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }

/* a unique card for every door */
#room { color: var(--text); }
#room.scene .decor { display: none; }
#room#room > .art { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.a { position: absolute; width: 104px; height: 104px; opacity: .92; }
.a-tl { left: 10px; top: 10px; } .a-tr { right: 10px; top: 10px; }
.a-bl { left: 10px; bottom: 10px; } .a-br { right: 10px; bottom: 10px; }
.a-l { left: 6px; top: 50%; margin-top: -52px; } .a-r { right: 6px; top: 50%; margin-top: -52px; }
.a-t { left: 0; right: 0; top: 0; width: 100%; height: 44px; }
.a-b { left: 0; right: 0; bottom: 0; width: 100%; height: 44px; }
.plate { align-self: center; margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--glow); color: var(--bg); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#room.scene { min-height: 340px; padding-top: 52px; padding-bottom: 52px; }
#room.scene h2 { text-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
@media (max-width: 520px) { .a { width: 68px; height: 68px; } .a-l, .a-r { margin-top: -34px; } .a-t, .a-b { width: 100%; height: 34px; } }

/* keep door art clear of the words and controls */
.a:not(.a-t):not(.a-b) { width: 88px; height: 88px; }
.a-l, .a-r { top: auto; bottom: 10px; margin-top: 0; }
.a-l { left: 10px; } .a-r { right: 10px; }
#room.scene:has(.a-bl, .a-br, .a-l, .a-r) { padding-bottom: 108px; }
@media (max-width: 520px) {
  .a:not(.a-t):not(.a-b) { width: 64px; height: 64px; }
  .a-l, .a-r { margin-top: 0; }
  #room.scene:has(.a-bl, .a-br, .a-l, .a-r) { padding-bottom: 84px; }
}

/* the cards come alive (html.fx is only set when animation is allowed) */
.trail { display: flex; gap: 3px; margin: 8px 0 10px; }
.trail i { flex: 1; height: 5px; border-radius: 3px; background: rgba(128, 128, 128, .28); transition: background .3s; }
.trail .done { background: #2DD4BF; }
.trail .now { background: #FFC53D; }
.art canvas.weather { position: absolute; inset: 0; width: 100%; height: 100%; }
.fxtop { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 40; pointer-events: none; }
.depth { position: fixed; right: 16px; bottom: 16px; margin: 0; padding: 8px 14px; border-radius: 999px; background: #7FD1FF; color: #0A1A33; font-weight: 700; z-index: 30; }
.depth[hidden] { display: none; }
.charge { position: absolute; left: 0; bottom: 0; height: 8px; width: 0; background: var(--glow); z-index: 4; }

html.fx #room.scene { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .14s ease-out, background .4s ease; }
html.fx #room.scene::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), var(--glare, rgba(255, 255, 255, .13)), transparent 48%); }
html.fx #room[data-door="select"] { --glare: rgba(247, 240, 82, .15); }
html.fx .a:not(.a-t):not(.a-b):not(.held) { translate: calc(var(--px, 0) * var(--d, 8px)) calc(var(--py, 0) * var(--d, 8px)); transition: translate .18s ease-out; }
.a.held { transition: translate .08s linear; z-index: 2; }
.ink.uv { color: transparent; background: radial-gradient(circle 80px at var(--ux, -300px) var(--uy, -300px), #F7F052 40%, var(--wall) 100%); -webkit-background-clip: text; background-clip: text; }
.ink.uv::selection { background: #F7F052; color: #111; }

html.fx #room.deal { animation: deal .5s cubic-bezier(.2, .9, .3, 1.15); }
html.fx #room.deal .plate { animation: stamp .42s .16s cubic-bezier(.3, 1.6, .5, 1) backwards; }
html.fx #room.deal h2 { animation: rise-in .4s .1s ease-out backwards; }
html.fx #room.deal #text { animation: rise-in .4s .18s ease-out backwards; }
html.fx #room.deal #extra { animation: rise-in .4s .26s ease-out backwards; }
html.fx #room.shake { animation: shake .36s linear; box-shadow: inset 0 0 0 4px #FF5A5A; }
html.fx #room.flinch { animation: flinch .4s ease-out; }
html.fx #room.slam { animation: slam .5s ease-out; }
@keyframes deal { from { opacity: 0; transform: perspective(900px) rotateY(-62deg) translateX(-50px) scale(.9); } }
@keyframes stamp { from { opacity: 0; transform: scale(2.4) rotate(-10deg); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes shake { 20% { transform: translateX(-9px) rotate(-.8deg); } 40% { transform: translateX(8px) rotate(.8deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes flinch { 25% { transform: scale(.975) rotate(-.7deg); } 60% { transform: scale(1.012) rotate(.5deg); } }
@keyframes slam { 30% { transform: scale(1.04); } }

#room#room > .swing { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: var(--glow); perspective: 800px; overflow: hidden; }
.swing b { color: var(--on); font-size: clamp(2.2rem, 9vw, 3.4rem); letter-spacing: -.02em; animation: stamp .36s .22s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.swing i { position: absolute; top: 0; bottom: 0; width: 50%; }
.swing i::after { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--glow); }
.swing .l { left: 0; transform-origin: left center; border-right: 2px solid rgba(0, 0, 0, .35); animation: leaf-l .62s .07s ease-in forwards; }
.swing .l::after { right: 12px; }
.swing .r { right: 0; transform-origin: right center; border-left: 2px solid rgba(255, 255, 255, .18); animation: leaf-r .62s .07s ease-in forwards; }
.swing .r::after { left: 12px; }
@keyframes leaf-l { to { transform: rotateY(-108deg); } }
@keyframes leaf-r { to { transform: rotateY(108deg); } }

html.fx .m-bob { animation: bob 2.6s ease-in-out infinite; }
html.fx .m-bounce { animation: bounce 1.1s ease-in-out infinite; }
html.fx .m-bounce2 { animation: bounce 1.1s .55s ease-in-out infinite; }
html.fx .m-pulse { animation: pulse 2.2s ease-in-out infinite; }
html.fx .m-wobble { animation: wobble 3s ease-in-out infinite; }
html.fx .m-rock { animation: rock 5s ease-in-out infinite; }
html.fx .m-sway { animation: rock 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
html.fx .m-spin { animation: spin 7s linear infinite; }
html.fx .m-compass { animation: compass 4s ease-in-out infinite; }
html.fx .m-drift { animation: drift 7s ease-in-out infinite; }
html.fx .m-knock { animation: knock 1.5s ease-in-out infinite; transform-origin: 80% 80%; }
html.fx .m-snooze { animation: snooze 3.2s ease-in-out infinite; }
html.fx .m-blink { animation: blink 4s linear infinite; }
html.fx .m-blinkhard { animation: blinkhard 1.2s steps(1) infinite; }
html.fx .m-flicker { animation: flicker 2.4s steps(1) infinite; }
html.fx .m-scribble { animation: scribble .9s ease-in-out infinite; }
html.fx .m-snip { animation: snip .8s ease-in-out infinite; }
html.fx .m-shiver { animation: shiver .28s linear infinite; }
html.fx .m-ooze { animation: ooze 3.4s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes bounce { 50% { transform: translateY(-12px); } }
@keyframes pulse { 50% { transform: scale(1.1); } }
@keyframes wobble { 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes rock { 50% { transform: rotate(9deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes compass { 20% { transform: rotate(50deg); } 45% { transform: rotate(-30deg); } 70% { transform: rotate(16deg); } }
@keyframes drift { 50% { transform: translateX(22px); } }
@keyframes knock { 0%, 40%, 100% { transform: rotate(0); } 15% { transform: rotate(-16deg); } 28% { transform: rotate(-16deg) translateX(2px); } }
@keyframes snooze { 50% { transform: translateY(-9px) scale(1.06); opacity: .55; } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes blinkhard { 50% { opacity: .25; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 12% { opacity: .3; } 16% { opacity: 1; } 44% { opacity: .5; } 47% { opacity: 1; } }
@keyframes scribble { 25% { transform: translate(-4px, 3px) rotate(-5deg); } 75% { transform: translate(4px, -3px) rotate(5deg); } }
@keyframes snip { 50% { transform: scaleX(.8); } }
@keyframes shiver { 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
@keyframes ooze { 50% { transform: scaleY(1.28); } }
html.fx #room[data-door="back"] .a-b path { animation: road .5s linear infinite; }
@keyframes road { to { stroke-dashoffset: 60; } }
html.fx #room[data-door="offline"] > .art { animation: brownout 5.5s steps(1) infinite; }
@keyframes brownout { 0%, 100% { opacity: 1; } 62% { opacity: .35; } 64% { opacity: 1; } 67% { opacity: .5; } 69% { opacity: 1; } }

.note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* the doorman */
.voice { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0 0 10px; }
.voice__face { flex: none; width: 40px; height: 40px; }
.voice__line { margin: 0; font-size: .95rem; line-height: 1.35; text-align: left; opacity: .92; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* gold letters, switches and game-parts-as-doors */
.letter.gold { color: #FFC53D; font-weight: 700; }
.switchrow { display: flex; justify-content: center; margin: 8px 0; }
.toggle { position: relative; width: 44px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .22); cursor: pointer; transition: background .2s; }
.toggle i { position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle.on { background: #2DD4BF; } .toggle.on i { left: 23px; }
.meter { height: 12px; border-radius: 999px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; background: var(--glow); }
#hint.flee { transition: translate .16s ease-out; position: relative; z-index: 20; }
.liar { cursor: pointer; color: #FFC53D; text-decoration: underline dotted; text-underline-offset: 3px; }
.wake { animation: wakeup 1s ease-in-out infinite; }
@keyframes wakeup { 50% { box-shadow: 0 0 0 4px rgba(217, 199, 255, .5); } }
.trail { position: relative; }
.trail.pulling { cursor: grab; touch-action: none; border-radius: 4px; }
.trail.pulling i { height: 22px; }
.trail.pulling::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--pull, 0%); border-radius: 4px; background: #FFC53D; box-shadow: 2px 0 0 #fff; pointer-events: none; }
.trail.pulling:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.crash { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; padding: 24px; background: #F1F3F4; color: #3C4043; font-family: system-ui, sans-serif; text-align: left; }
.crash__in { max-width: 460px; width: 100%; }
.crash__in h2 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 500; color: #202124; }
.crash__in p { margin: 0 0 8px; }
.crash__face { font-size: 3rem; line-height: 1; color: #5F6368; }
.crash__code { font-size: .8rem; color: #5F6368; }
.crash__btns { display: flex; gap: 8px; margin-top: 16px; }
.crash__btns button { padding: 8px 16px; border: 1px solid #DADCE0; border-radius: 4px; background: #fff; color: #1A73E8; font: inherit; cursor: pointer; }
.crash__btns .crash__reload { background: #1A73E8; border-color: #1A73E8; color: #fff; }
.crash__trace { margin-top: 16px; padding: 12px; background: #fff; border: 1px solid #DADCE0; font: .85rem/1.7 monospace; }
.crash__trace[hidden] { display: none; }
.crash__exit { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: text; }
.crash__exit:hover { color: #1A73E8; }

.quiz { display: flex; flex-direction: column; gap: 8px; }
.quiz__q { font-weight: 700; }
.mirror { transform: scaleX(-1); }
.numgrid { display: grid; grid-template-columns: repeat(3, 64px); justify-content: center; gap: 8px; }
.num { height: 64px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .9); color: #2B1650; font: 700 1.5rem "Space Grotesk", system-ui, sans-serif; cursor: pointer; }
.num.hit { background: var(--glow); opacity: .55; }
.cellarbox { position: relative; height: 220px; border-radius: 10px; background: #2B2720; overflow: hidden; touch-action: none; }
.cellarbox::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle 62px at var(--x, -200px) var(--y, -200px), transparent 55%, #000 100%); }
.cellarswitch { position: absolute; width: 26px; height: 38px; padding: 0; border: 2px solid #C9B37A; border-radius: 4px; background: #5A4A2A; cursor: pointer; }

.rank { margin: 0; font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 700; color: #FFC53D; }
.rankWhy { margin: 0; opacity: .8; }
.goldTray { color: #FFC53D; font-weight: 700; }
.secretBox { display: flex; flex-direction: column; gap: 8px; }
.secretBox[hidden] { display: none; }

@media (min-width: 521px) { #room.scene { padding-top: 66px; } }

/* the sticker book */
.stickers { padding: 18px; border: 2px solid var(--soft); border-radius: 14px; }
.stickers__title { margin: 0 0 12px; font-size: 1.25rem; text-align: center; }
.stickers__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.sticker { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 12px; border: 1px dashed var(--soft); text-align: center; opacity: .55; }
.sticker.got { opacity: 1; border-style: solid; border-color: var(--accent); background: rgba(255, 209, 102, .08); }
.sticker__icon { font-size: 1.9rem; line-height: 1.2; }
.sticker:not(.got) .sticker__icon { font-weight: 700; color: var(--muted); }
.sticker b { font-size: .95rem; }
.sticker small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.sticker-toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: .95rem; line-height: 1.25; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transform: translateX(-50%); animation: otb-toast .45s cubic-bezier(.3, 1.5, .5, 1); }
.sticker-toast.out { opacity: 0; transform: translate(-50%, 16px); transition: opacity .4s, transform .4s; }
.sticker-toast__icon { font-size: 1.8rem; }
@keyframes otb-toast { from { transform: translate(-50%, 30px) scale(.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sticker-toast { animation: none; } }
