/* NUVEXET Escape Lab missions (Skyport, Word Vault). Big, bright, touch-first. */
.esc { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(circle at 20% 0%, #1e3a8a 0, #0b1026 55%, #050816 100%); color: #f8fafc; font-family: Inter, system-ui, sans-serif; overflow-x: hidden; }
#esc { min-height: 100dvh; display: flex; flex-direction: column; }
.esc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: rgba(2, 6, 23, .6); border-bottom: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.esc-brand { font-weight: 800; letter-spacing: .02em; }
.esc-stations { display: flex; gap: 6px; }
.esc-dot { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.1); color: #cbd5e1; }
.esc-dot.done { background: #22c55e; color: #052e16; }
.esc-dot.now { background: #f97316; color: #fff; box-shadow: 0 0 0 4px rgba(249,115,22,.3); }
.esc-right { display: flex; align-items: center; gap: 10px; }
.esc-level { background: rgba(250,204,21,.15); color: #fde047; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.esc-clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; }
.esc-clock.low { color: #fca5a5; }
.esc-rec { color: #f87171; font-weight: 800; font-size: 12px; animation: escBlink 1.4s infinite; }
.esc-adult { border: 1px solid rgba(255,255,255,.25); background: transparent; color: #e2e8f0; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.esc-exit { border-color: rgba(248,113,113,.7); color: #fecaca; font-weight: 700; padding: 8px 14px; font-size: 14px; }
.esc-exit:hover, .esc-exit:focus-visible { background: rgba(248,113,113,.18); }
.esc-main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 18px 16px 32px; box-sizing: border-box; }
.esc-card { background: rgba(15, 23, 42, .78); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.esc-h1 { font-size: clamp(26px, 5vw, 40px); font-weight: 900; margin: 0 0 6px; }
.esc-story { color: #bfdbfe; font-size: 18px; margin: 0 0 16px; }
.esc-prompt { font-size: clamp(20px, 3.6vw, 28px); font-weight: 700; line-height: 1.35; margin: 16px 0; }
.esc-skill { display: inline-block; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #93c5fd; }
.esc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.esc-btn { appearance: none; border: 0; border-radius: 18px; padding: 18px 20px; font-size: 22px; font-weight: 800; background: #f97316; color: #fff; cursor: pointer; box-shadow: 0 6px 0 #c2410c; transition: transform .08s; touch-action: manipulation; }
.esc-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c2410c; }
.esc-btn.alt { background: #334155; box-shadow: 0 6px 0 #1e293b; }
.esc-btn.pick { background: #1d4ed8; box-shadow: 0 6px 0 #1e3a8a; }
.esc-btn.chosen { background: #22c55e; box-shadow: 0 6px 0 #15803d; }
.esc-btn:disabled { opacity: .45; }
.esc-input { width: 100%; box-sizing: border-box; font-size: 34px; font-weight: 800; text-align: center; padding: 14px; border-radius: 16px; border: 3px solid #475569; background: #0f172a; color: #fff; letter-spacing: .12em; }
.esc-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; max-width: 360px; }
.esc-keypad .esc-btn { font-size: 28px; padding: 16px 0; }
.esc-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.esc-visual { margin: 10px 0 4px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.05); }
.esc-icons { font-size: 44px; line-height: 1.25; letter-spacing: 6px; }
.esc-bag { display: inline-flex; flex-direction: column; align-items: center; margin: 6px 10px; font-weight: 800; font-size: 20px; }
.esc-bag span:first-child { font-size: 46px; }
.esc-bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 24px; }
.esc-bar { flex: 1; background: linear-gradient(#f97316, #fb923c); border-radius: 10px 10px 0 0; position: relative; min-width: 34px; }
.esc-bar b { position: absolute; top: -26px; left: 0; right: 0; text-align: center; font-size: 18px; }
.esc-bar i { position: absolute; bottom: -26px; left: 0; right: 0; text-align: center; font-style: normal; color: #cbd5e1; font-size: 15px; }
.esc-tanks { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.esc-tank { width: 90px; height: 150px; border: 4px solid #cbd5e1; border-radius: 16px; position: relative; overflow: hidden; background: #0f172a; }
.esc-tank div { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#38bdf8, #0ea5e9); }
.esc-tank-l { text-align: center; font-weight: 800; margin-top: 6px; }
.esc-tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.esc-tile { width: 54px; height: 60px; display: grid; place-items: center; font-size: 32px; font-weight: 900; border-radius: 12px; background: #fde68a; color: #422006; box-shadow: 0 4px 0 #ca8a04; }
.esc-alpha { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: #cbd5e1; }
.esc-alpha span { background: rgba(255,255,255,.08); border-radius: 6px; padding: 3px 6px; }
.esc-clues { margin: 0; padding-left: 22px; font-size: 20px; line-height: 1.6; }
.esc-big-letter { font-size: 96px; font-weight: 900; color: #fde047; text-align: center; }
.esc-sparky { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; padding: 14px; border-radius: 18px; background: rgba(56,189,248,.12); border: 1px solid rgba(56,189,248,.3); }
.esc-sparky-face { font-size: 46px; line-height: 1; }
.esc-sparky p { margin: 0; font-size: 19px; }
.esc-kids { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.esc-kid { width: 130px; padding: 16px 8px; border-radius: 20px; text-align: center; background: rgba(255,255,255,.07); border: 3px solid transparent; color: #fff; font-size: 18px; font-weight: 800; cursor: pointer; }
.esc-kid .e { font-size: 50px; display: block; }
.esc-kid.in { border-color: #22c55e; }
.esc-kid small { display: block; font-weight: 600; color: #cbd5e1; font-size: 13px; }
.esc-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(2,6,23,.86); padding: 20px; }
.esc-overlay .esc-card { max-width: 560px; width: 100%; text-align: center; }
.esc-shake { animation: escShake .4s; }
.esc-confetti { position: fixed; top: -10px; width: 10px; height: 16px; z-index: 60; animation: escFall 1.8s linear forwards; }
.esc-door { font-size: 120px; text-align: center; animation: escPop .8s ease-out; }
@keyframes escShake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-10px) } 75% { transform: translateX(10px) } }
@keyframes escFall { to { transform: translateY(105vh) rotate(720deg); opacity: .8 } }
@keyframes escPop { from { transform: scale(.3); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes escBlink { 50% { opacity: .35 } }
.esc.quiet .esc-confetti, .esc.quiet .esc-shake { animation: none; }
.esc.quiet .esc-clock { visibility: hidden; }
@media (max-width: 640px) { .esc-brand { display: none } .esc-card { padding: 16px; border-radius: 18px } .esc-dot { width: 26px; height: 26px } }
.esc-toast { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; width: min(560px, calc(100vw - 32px)); animation: esc-drop .35s ease-out; }
.esc-toast .esc-sparky { margin-top: 0; background: #0c1f3d; border-color: #38bdf8; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
@keyframes esc-drop { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
body.quiet .esc-toast { animation: none; }
.esc-lounge { margin-top: 14px; text-align: left; }
.esc-lounge summary { cursor: pointer; font-weight: 700; color: #fdba74; }
.esc-qr { width: 180px; margin: 12px auto; background: #fff; padding: 6px; border-radius: 12px; }
.esc-qr svg { display: block; width: 100%; height: auto; }
/* ----- key ring (every mission) ----- */
.esc-keyring { display: flex; align-items: center; gap: 4px; }
.esc-keyring .k { font-size: 18px; margin-right: 2px; }
.esc-keyslot { width: 26px; height: 30px; border-radius: 8px; border: 2px dashed rgba(253,224,71,.45); display: grid; place-items: center; font-weight: 900; color: #422006; font-size: 16px; }
.esc-keyslot.got { border: 0; background: linear-gradient(#fde047, #f59e0b); box-shadow: 0 3px 0 #b45309; animation: escPop .5s ease-out; }
.esc-newkey { margin: 12px auto; display: grid; justify-items: center; gap: 6px; }
.esc-newkey small { font-size: 18px; color: #fde68a; font-weight: 700; }
.esc-newkey b { width: 86px; height: 96px; display: grid; place-items: center; font-size: 60px; border-radius: 18px; background: linear-gradient(#fde047, #f59e0b); color: #422006; box-shadow: 0 8px 0 #b45309, 0 0 40px rgba(253,224,71,.6); animation: escKey 1s ease-out; }
@keyframes escKey { 0% { transform: scale(.2) rotate(-200deg); opacity: 0; } 70% { transform: scale(1.15) rotate(10deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }

/* ----- read-aloud ----- */
.esc-prompt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.esc-prompt-row .esc-prompt { flex: 1 1 260px; }
.esc-speak { font-size: 18px; padding: 12px 16px; }
.esc-picture { font-size: 96px; text-align: center; line-height: 1.1; }
.esc-picture.small { font-size: 56px; }
.esc-hidden-word { font-size: 40px; font-weight: 900; text-align: center; letter-spacing: .1em; color: #94a3b8; }

/* ----- Runway Lights ----- */
.esc-lights { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 18px 8px 12px; border-radius: 16px; background: repeating-linear-gradient(90deg, #1f2937 0 40px, #374151 40px 60px); }
.esc-light { appearance: none; border: 0; cursor: pointer; display: grid; justify-items: center; gap: 6px; min-width: 76px; padding: 10px 12px; border-radius: 16px; background: #0f172a; color: #64748b; font: inherit; touch-action: manipulation; }
.esc-light .bulb { width: 26px; height: 26px; border-radius: 99px; background: #334155; box-shadow: inset 0 -3px 0 rgba(0,0,0,.4); }
.esc-light .snd { font-size: 40px; font-weight: 900; }
.esc-light small { font-size: 12px; }
.esc-light.on { color: #fef9c3; background: #1e293b; }
.esc-light.on .bulb { background: #fde047; box-shadow: 0 0 22px 6px rgba(253,224,71,.8); }
.esc-light.silent .snd { opacity: .55; }
.esc-lights.all .esc-light { animation: escPulse .6s ease-in-out 2; }
@keyframes escPulse { 50% { transform: translateY(-6px); } }
.esc-runway-plane { font-size: 54px; animation: escTakeoff 1.6s ease-in forwards; }
@keyframes escTakeoff { 0% { transform: translateX(-40vw); } 100% { transform: translate(40vw, -60px) rotate(-10deg); opacity: 0; } }
.esc-grid.pictures { display: none; }
.esc-grid.pictures.show { display: grid; animation: escPop .4s ease-out; }
.esc-btn.pic { font-size: 64px; padding: 14px; line-height: 1.1; }

/* ----- Cargo Builder ----- */
.esc-crates { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0 4px; }
.esc-crate { appearance: none; width: 84px; height: 84px; border-radius: 12px; border: 3px dashed #a16207; background: rgba(161,98,7,.12); color: #422006; font-size: 34px; font-weight: 900; cursor: pointer; }
.esc-crate.full { border: 0; background: linear-gradient(#d97706, #92400e); color: #fff7ed; box-shadow: 0 6px 0 #78350f; animation: escDrop .25s ease-out; }
@keyframes escDrop { from { transform: translateY(-30px); } to { transform: translateY(0); } }
.esc-bank { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
.esc-btn.tile { font-size: 30px; background: #b45309; box-shadow: 0 6px 0 #78350f; }
.esc-btn.tile.used { visibility: hidden; }

/* ----- Hangar Sort ----- */
.esc-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 64px; }
.esc-chip { appearance: none; border: 0; border-radius: 14px; padding: 12px 18px; font-size: 26px; font-weight: 800; background: #e2e8f0; color: #0f172a; cursor: pointer; box-shadow: 0 5px 0 #94a3b8; touch-action: manipulation; }
.esc-chip.picked { background: #fde047; box-shadow: 0 5px 0 #ca8a04, 0 0 0 4px rgba(253,224,71,.4); transform: translateY(-4px); }
.esc-chip.parked-chip { font-size: 18px; padding: 6px 10px; box-shadow: 0 3px 0 #94a3b8; }
.esc-hangars { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: 16px; }
.esc-hangar { border-radius: 20px 20px 10px 10px; padding: 14px; min-height: 150px; background: linear-gradient(#334155, #1e293b); border: 3px solid #475569; cursor: pointer; text-align: center; }
.esc-hangar.ready { border-color: #fde047; box-shadow: 0 0 0 4px rgba(253,224,71,.25); }
.esc-hangar .icon { font-size: 38px; }
.esc-hangar .label { font-weight: 800; font-size: 16px; color: #e2e8f0; }
.esc-hangar .parked { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }

/* ----- Rule Breakers (sky-write) ----- */
.esc-skywrite { text-align: center; }
.esc-red-word { font-size: clamp(64px, 16vw, 140px); font-weight: 900; color: #f87171; letter-spacing: .06em; text-shadow: 0 0 30px rgba(248,113,113,.5); animation: escGlow 1.6s ease-in-out infinite; }
@keyframes escGlow { 50% { text-shadow: 0 0 50px rgba(248,113,113,.9); } }
body.quiet .esc-red-word { animation: none; }

/* ----- final lock / vault ----- */
.esc-final { border-color: #fde047; box-shadow: 0 0 0 3px rgba(253,224,71,.25); }
.esc-vault { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.esc-vault-door { font-size: 90px; animation: escWobble 2.5s ease-in-out infinite; }
@keyframes escWobble { 50% { transform: rotate(-6deg); } }
.esc-message { background: #fef3c7; color: #422006; border-radius: 14px; padding: 14px 16px; transform: rotate(-1deg); box-shadow: 0 6px 0 #d97706; }
.esc-message small { font-weight: 700; display: block; }
.esc-message p { font-size: 26px; font-weight: 800; margin: 6px 0 0; line-height: 1.35; }
.esc-keys { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.esc-btn.pick.key { background: linear-gradient(#fde047, #f59e0b); color: #422006; font-size: 40px; box-shadow: 0 6px 0 #b45309; }
.esc-btn.pick.key.chosen { background: #22c55e; color: #fff; box-shadow: 0 6px 0 #15803d; }
.esc-vault-open { animation: escSpin 1.2s ease-out; }
@keyframes escSpin { from { transform: rotate(-360deg) scale(.3); } to { transform: rotate(0) scale(1); } }
@media (max-width: 560px) { .esc-vault { grid-template-columns: 1fr; text-align: center; } .esc-light .snd { font-size: 30px; } .esc-light { min-width: 60px; } .esc-crate { width: 64px; height: 64px; font-size: 26px; } }
body.quiet .esc-vault-door, body.quiet .esc-runway-plane, body.quiet .esc-newkey b { animation: none; }
/* ----- locks ----- */
.esc-lockwrap { display: grid; justify-items: center; gap: 14px; }
.esc-lockwrap .esc-keypad { width: min(100%, 420px); }
.esc-lockwrap > .esc-row { justify-content: center; }
.esc-lock { position: relative; padding-top: 58px; }
.esc-lock .shackle { position: absolute; left: 50%; top: 0; width: 120px; height: 90px; margin-left: -60px; border: 16px solid #94a3b8; border-bottom: 0; border-radius: 60px 60px 0 0; transition: transform .45s cubic-bezier(.3,1.6,.5,1); box-shadow: inset 0 4px 0 rgba(255,255,255,.3); }
.esc-lock .body { position: relative; display: flex; gap: 8px; padding: 18px 20px; border-radius: 22px; background: linear-gradient(#fbbf24, #b45309); box-shadow: 0 10px 0 #78350f, inset 0 3px 0 rgba(255,255,255,.4); }
.esc-lock.letters .body { background: linear-gradient(#60a5fa, #1d4ed8); box-shadow: 0 10px 0 #1e3a8a, inset 0 3px 0 rgba(255,255,255,.4); flex-wrap: wrap; justify-content: center; max-width: min(92vw, 640px); }
.esc-lock.open .shackle { transform: translateY(-34px) rotate(-18deg); transform-origin: 85% 100%; }
.esc-lock.rattle { animation: escRattle .45s; }
@keyframes escRattle { 20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); } }
.esc-wheel { display: grid; justify-items: center; gap: 4px; }
.esc-wheel .face { appearance: none; border: 0; width: 58px; height: 72px; border-radius: 12px; font-size: 42px; font-weight: 900; color: #0f172a; background: linear-gradient(#f8fafc 0%, #e2e8f0 45%, #cbd5e1 100%); box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); cursor: pointer; font-family: ui-monospace, monospace; }
.esc-lock.letters .esc-wheel .face { width: 48px; height: 62px; font-size: 34px; }
.esc-wheel .face.cur { outline: 4px solid #fde047; }
.esc-wheel .face.roll { animation: escRoll .25s ease-out; }
@keyframes escRoll { from { transform: translateY(-14px); opacity: .3; } to { transform: none; opacity: 1; } }
.esc-wheel .esc-btn { padding: 4px 14px; font-size: 18px; border-radius: 10px; background: #78350f; box-shadow: 0 3px 0 #451a03; }
.esc-alphapad { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 8px; width: 100%; }
.esc-alphapad .esc-btn { padding: 12px 0; font-size: 22px; }
.esc-pull { background: #16a34a; box-shadow: 0 6px 0 #14532d; }
.esc-typed { max-width: 220px; font-size: 18px !important; letter-spacing: .05em !important; }

/* ----- gates ----- */
.esc-gate { text-align: center; }
.esc-gate-area { display: grid; justify-items: center; gap: 12px; margin-top: 10px; }
.esc-gate-done .esc-gate-area { animation: escPop .6s; }
.esc-skip { font-size: 16px; padding: 10px 14px; }
.esc-maze { display: grid; width: min(86vw, 420px); aspect-ratio: 1; background: #0b1220; border: 6px solid #f97316; border-radius: 10px; }
.esc-maze .cell { display: grid; place-items: center; font-size: clamp(16px, 5vw, 30px); border: 0 solid #f97316; cursor: pointer; }
.esc-maze .cell.wn { border-top-width: 4px; } .esc-maze .cell.we { border-right-width: 4px; } .esc-maze .cell.ws { border-bottom-width: 4px; } .esc-maze .cell.ww { border-left-width: 4px; }
.esc-maze .cell.trail { background: rgba(56,189,248,.18); }
.esc-arrows { display: grid; grid-template-columns: repeat(3, 72px); grid-template-areas: ". up ." "left down right"; gap: 8px; }
.esc-arrows .a0 { grid-area: up; } .esc-arrows .a3 { grid-area: left; } .esc-arrows .a2 { grid-area: down; } .esc-arrows .a1 { grid-area: right; }
.esc-arrows .esc-btn { font-size: 30px; padding: 10px 0; }
.esc-uv { --x: 50%; --y: 50%; position: relative; width: min(92vw, 720px); height: 340px; border-radius: 18px; overflow: hidden; background: #1e1b4b; cursor: crosshair; touch-action: none; }
.esc-uv .shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle 95px at var(--x) var(--y), rgba(0,0,0,0) 0, rgba(0,0,0,0) 55%, rgba(3,3,12,.985) 100%); }
.esc-uv .scribble { position: absolute; font-size: 40px; color: #c084fc; text-shadow: 0 0 12px #a855f7; pointer-events: none; }
.esc-uv .uvstar { position: absolute; appearance: none; border: 0; background: none; font-size: 40px; cursor: pointer; filter: hue-rotate(220deg) saturate(3) drop-shadow(0 0 10px #a855f7); }
.esc-uv .uvstar.got { filter: drop-shadow(0 0 16px #fde047); z-index: 2; animation: escPop .5s; }
.esc-jigsaw { display: grid; width: min(92vw, 600px); gap: 4px; background: #451a03; padding: 4px; border-radius: 12px; }
.esc-jigsaw .piece { appearance: none; border: 0; background-repeat: no-repeat; cursor: pointer; border-radius: 6px; min-height: 0; }
.esc-jigsaw .piece.sel { outline: 5px solid #38bdf8; z-index: 1; transform: scale(1.04); }
.esc-jigsaw.whole { gap: 0; padding: 0; }
.esc-jigsaw.whole .piece { border-radius: 0; }
.esc-scene { position: relative; width: min(92vw, 760px); height: 380px; border-radius: 18px; overflow: hidden; background: linear-gradient(#bae6fd, #e0f2fe 60%, #a3a3a3 60%, #737373); }
.esc-scene .decoy { position: absolute; pointer-events: none; opacity: .95; }
.esc-scene .goldkey { position: absolute; appearance: none; border: 0; background: none; cursor: pointer; padding: 6px; line-height: 1; }
.esc-scene .goldkey.got { filter: drop-shadow(0 0 14px #fde047); transform: scale(1.6) !important; z-index: 2; transition: transform .2s; }
@media (max-width: 560px) { .esc-wheel .face { width: 46px; height: 60px; font-size: 32px; } .esc-uv, .esc-scene { height: 300px; } .esc-lock .shackle { width: 96px; margin-left: -48px; border-width: 12px; } }
body.quiet .esc-lock .shackle { transition: none; }
.esc-relay { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 18px 0 6px; }
.esc-runner { display: grid; justify-items: center; gap: 2px; min-width: 110px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1); }
.esc-runner .e { font-size: 34px; }
.esc-runner small { color: #94a3b8; }
.esc-runner.mine { border-color: rgba(56,189,248,.5); }
.esc-runner.baton { border-color: #f97316; background: rgba(249,115,22,.15); animation: escPulse 1.4s ease-in-out infinite; }
.esc-runner.baton small { color: #fdba74; font-weight: 700; }
.esc-wait { animation: escSpin 3s linear infinite; display: inline-block; }
body.quiet .esc-wait, body.quiet .esc-runner.baton { animation: none; }
.esc-coopbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; justify-content: center; }
.esc-seat { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1); opacity: .6; }
.esc-seat.on { opacity: 1; }
.esc-seat.me { border-color: #38bdf8; }
.esc-seat .ic { font-size: 22px; }
.esc-seat .t { display: grid; line-height: 1.15; text-align: left; }
.esc-seat small { color: #94a3b8; font-size: 12px; }
.esc-seat.on .t b::after { content: ' ●'; color: #22c55e; font-size: 10px; vertical-align: middle; }
.esc-role { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; margin: 10px 0 14px; background: rgba(56,189,248,.12); border: 2px solid rgba(56,189,248,.5); }
.esc-role .ic { font-size: 44px; }
.esc-role b { font-size: 22px; }
.esc-role p { margin: 2px 0 0; color: #cbd5e1; }
.esc-role-lock { background: rgba(249,115,22,.12); border-color: rgba(249,115,22,.6); }
.esc-role-visual { background: rgba(168,85,247,.12); border-color: rgba(168,85,247,.6); }
.esc-role-helper { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.6); }
.esc-kidform { display: grid; gap: 12px; justify-items: center; }
.esc-kidform .esc-input { max-width: 320px; text-align: center; }
.esc-kidform .esc-kid input:checked + .e { filter: drop-shadow(0 0 12px #fde047); }
.esc-kid:has(input:checked) { border-color: #22c55e; background: rgba(34,197,94,.15); }
.esc-err { color: #fca5a5; font-weight: 700; }
.esc-link { background: none; border: 0; color: #93c5fd; text-decoration: underline; cursor: pointer; font-size: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.esc-mission { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-top: 10px; border-radius: 16px; background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.1); color: inherit; text-decoration: none; }
.esc-mission .i { font-size: 40px; }
.esc-mission b { display: block; font-size: 20px; }
.esc-mission small { color: #94a3b8; }
.esc-mission .go { margin-left: auto; font-size: 26px; color: #f97316; }
.esc-mission.hot { border-color: #f97316; background: rgba(249,115,22,.15); animation: escPulse 1.4s ease-in-out infinite; }
.esc-live { font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(34,197,94,.18); color: #86efac; border: 1px solid rgba(34,197,94,.5); }
/* ----- explore rooms ----- */
.esc-explore { display: grid; gap: 10px; justify-items: center; }
.esc-explore-top { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; width: 100%; max-width: 1000px; }
.esc-driver { display: flex; align-items: center; gap: 6px; font-weight: 800; background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px 12px 4px 6px; }
.esc-driver .mini svg { display: block; }
.esc-roomname { font-size: 20px; }
.esc-stars { font-weight: 800; color: #fde047; }
.esc-room-scroll { max-width: 100%; overflow-x: auto; border-radius: 16px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.esc-room { position: relative; overflow: hidden; cursor: pointer; touch-action: manipulation; }
.esc-room-library { background: repeating-linear-gradient(90deg, #8b5a2b 0 calc(var(--t) * .5), #7a4e25 calc(var(--t) * .5) calc(var(--t) * .52)), #8b5a2b; }
.esc-room-library .esc-wall { background: linear-gradient(#1f4d3a, #163a2c); box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.esc-room-hangar { background: linear-gradient(90deg, transparent calc(50% - 2px), rgba(250,204,21,.35) calc(50% - 2px) calc(50% + 2px), transparent 0), #9ca3af; background-size: calc(var(--t) * 2) 100%; }
.esc-room-hangar .esc-wall { background: linear-gradient(#475569, #334155); box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.esc-wall { position: absolute; width: var(--t); height: var(--t); }
.esc-passage { position: absolute; background: #020617; box-shadow: inset 0 0 calc(var(--t) * .4) #000; }
.esc-obj { position: absolute; appearance: none; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; z-index: 5; }
.esc-obj .em { font-size: calc(var(--t) * .82); line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.esc-obj.next { animation: escGlowObj 1.4s ease-in-out infinite; }
.esc-obj.next .sparkle { position: absolute; top: -12%; right: -6%; font-size: calc(var(--t) * .5); animation: escTwinkle 1s ease-in-out infinite; }
@keyframes escGlowObj { 50% { filter: drop-shadow(0 0 calc(var(--t) * .35) #fde047); } }
@keyframes escTwinkle { 50% { transform: scale(1.4) rotate(20deg); opacity: .6; } }
.esc-obj.done:not(.open) { opacity: .75; }
.esc-obj .tick { position: absolute; bottom: 0; right: 0; background: #22c55e; color: #fff; border-radius: 99px; width: calc(var(--t) * .42); height: calc(var(--t) * .42); font-size: calc(var(--t) * .3); display: grid; place-items: center; font-weight: 900; }
.esc-obj.found::after { content: '⭐'; position: absolute; top: -8%; left: -8%; font-size: calc(var(--t) * .38); }
.esc-obj.bookshelf { background: #5b3412; border: calc(var(--t) * .08) solid #3f2309; border-radius: 4px; transition: transform 1.2s cubic-bezier(.5,0,.3,1); }
.esc-obj.bookshelf .books { position: absolute; inset: 6%; display: grid; gap: 8%; }
.esc-obj.bookshelf .shelfrow { background: repeating-linear-gradient(90deg, #dc2626 0 18%, #2563eb 18% 33%, #16a34a 33% 50%, #eab308 50% 64%, #7c3aed 64% 80%, #f97316 80% 100%); border-bottom: 3px solid #3f2309; }
.esc-obj.bookshelf.open { transform: translateY(-92%); }
.esc-obj.bookshelf.opening { animation: escShelf 1.6s cubic-bezier(.5,0,.3,1); }
@keyframes escShelf { from { transform: translateY(0); } 30% { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-92%); } }
.esc-ava { position: absolute; left: 0; top: 0; transition: transform .15s linear; pointer-events: none; display: grid; justify-items: center; }
.esc-ava svg { width: 100%; height: auto; display: block; }
.esc-ava.left svg { transform: scaleX(-1); }
.esc-ava .tag { position: absolute; top: -14px; font-size: 11px; font-weight: 800; background: rgba(2,6,23,.75); color: #fff; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.esc-ava.follow { opacity: .92; }
.esc-ava.walking svg { animation: escBob .3s ease-in-out infinite alternate; }
.esc-ava.walking .leg.l { animation: escLegA .3s ease-in-out infinite alternate; transform-origin: 26px 62px; }
.esc-ava.walking .leg.r { animation: escLegB .3s ease-in-out infinite alternate; transform-origin: 38px 62px; }
@keyframes escBob { to { transform: translateY(-3px); } }
.esc-ava.walking.left svg { animation-name: escBobL; }
@keyframes escBobL { from { transform: scaleX(-1); } to { transform: scaleX(-1) translateY(-3px); } }
@keyframes escLegA { from { transform: rotate(14deg); } to { transform: rotate(-14deg); } }
@keyframes escLegB { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.esc-say { width: 100%; max-width: 760px; }
.esc-say .esc-sparky { margin-top: 0; background: #0c1f3d; border-color: #38bdf8; }
.esc-explore-ctrl { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.esc-puzzle-panel { position: fixed; inset: 0; z-index: 40; overflow-y: auto; background: rgba(2,6,23,.92); padding: 70px 16px 24px; }
.esc-puzzle-panel > .esc-card { max-width: 900px; margin: 0 auto; }
.esc-back { font-size: 16px; padding: 10px 14px; margin-bottom: 10px; }
body.quiet .esc-obj.next, body.quiet .esc-obj.next .sparkle, body.quiet .esc-ava.walking svg, body.quiet .esc-ava.walking .leg { animation: none; }
.esc-room3d { position: relative; width: 100%; max-width: 1100px; height: min(68vh, 640px); min-height: 340px; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.55); background: #140c2b; touch-action: manipulation; }
.esc-room3d canvas { display: block; width: 100% !important; height: 100% !important; }
.esc3d-labels { position: absolute; inset: 0; pointer-events: none; }
.esc3d-tag { position: absolute; left: 0; top: 0; font-size: 12px; font-weight: 800; color: #fff; background: rgba(15,10,40,.75); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.esc3d-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #e9d5ff; background: radial-gradient(circle, #2e1065, #140c2b); }
.esc-driver .mini img { display: block; border-radius: 99px; background: rgba(255,255,255,.15); }
.esc-soundbtn { font-size: 14px; padding: 6px 12px; }
[hidden]{display:none !important}
/* co-op: friends' characters from other homes, and this device's job */
.esc3d-tag.remote { background: rgba(124,58,237,.8); }
.esc-ava.remote { opacity: .92; transition: transform .15s linear; }
.esc-ava.remote .tag { background: #7c3aed; }
.esc-jobchip { font-size: 13px; font-weight: 800; background: rgba(124,58,237,.18); color: inherit; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
/* backpack, story pages, lantern trail */
.esc-bagbtn { font-size: 15px; padding: 6px 12px; }
.esc-bagbtn.bump { animation: escPop .5s; }
.esc-bag { display: grid; gap: 8px; text-align: left; margin: 10px 0; }
.esc-bagitem { display: flex; gap: 12px; align-items: center; background: rgba(124,58,237,.14); border-radius: 14px; padding: 10px 12px; }
.esc-bagitem .ic { font-size: 34px; }
.esc-bagitem p { margin: 2px 0 0; font-size: 14px; opacity: .85; }
.esc-bagitem.missing { opacity: .55; }
.esc-pages { text-align: left; background: #fef3c7; color: #422006; border-radius: 14px; padding: 12px 14px; margin-top: 8px; }
.esc-pages p { margin: 6px 0 0; font-style: italic; }
.esc-page { background: linear-gradient(#fef9c3, #fde68a); color: #422006; border-radius: 12px; padding: 12px 16px; margin: 12px auto; max-width: 560px; text-align: left; box-shadow: 0 6px 18px rgba(0,0,0,.25); transform: rotate(-1deg); }
.esc-page small { font-weight: 800; display: block; }
.esc-page p { margin: 6px 0 0; font-style: italic; font-size: 17px; }
.esc-scene-intro .esc-story { opacity: 0; animation: escFadeIn .8s forwards; font-size: 19px; }
@keyframes escFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.esc-glowstep { position: absolute; pointer-events: none; background: radial-gradient(circle, rgba(253,230,138,.9) 0 18%, rgba(253,230,138,0) 40%); animation: escGlow 1.4s infinite; z-index: 3; }
@keyframes escGlow { 50% { opacity: .35; } }
.esc-uv.lantern .shade { opacity: .45; }
.esc-uv.lantern .uvstar { filter: drop-shadow(0 0 14px #fde047); }
.esc-prompt mark { background: #fde047; color: #1e1b4b; border-radius: 4px; padding: 0 3px; }
.esc-feather { border-color: #f97316; }
/* scratch paper */
.esc-scratch { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 60; overflow-y: auto; background: #fffbeb; color: #1e293b; padding: 14px 16px 24px; box-shadow: -12px 0 30px rgba(0,0,0,.35); font-size: 15px; animation: escSlideIn .25s; }
@keyframes escSlideIn { from { transform: translateX(40px); opacity: 0; } }
.esc-scratch-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 18px; }
.esc-scratch .esc-btn { font-size: 14px; padding: 6px 10px; min-height: 0; }
.esc-scratch-label { display: block; margin: 12px 0 4px; font-weight: 800; color: #7c2d12; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.esc-scratch-q { background: #fff; border: 2px dashed #fdba74; border-radius: 12px; padding: 10px; line-height: 1.9; font-size: 17px; margin: 0 0 6px; }
.esc-scratch-q .w { cursor: pointer; border-radius: 99px; padding: 1px 2px; }
.esc-scratch-q .w.on { outline: 3px solid #dc2626; outline-offset: 1px; background: #fef08a; }
.esc-scratch-box { display: block; margin-top: 8px; font-weight: 700; }
.esc-scratch-box textarea { display: block; width: 100%; margin-top: 4px; border: 2px solid #e2e8f0; border-radius: 10px; padding: 8px; font: inherit; font-weight: 400; background: #fff; color: #0f172a; resize: vertical; }
.esc-scratch-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.esc-pen { width: 34px; height: 34px; border-radius: 99px !important; padding: 0 !important; background: var(--pen, #fff) !important; }
.esc-pen.on { outline: 3px solid #f97316; outline-offset: 2px; }
.esc-scratch-canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; border: 2px solid #e2e8f0; touch-action: none; cursor: crosshair; display: block; }
.esc-numline .marks { position: relative; height: 46px; margin: 8px 12px 30px; border-bottom: 3px solid #334155; }
.esc-numline .marks span { position: absolute; bottom: -22px; transform: translateX(-50%); font-size: 11px; color: #475569; }
.esc-numline .marks span::before { content: ''; position: absolute; left: 50%; top: -9px; width: 2px; height: 8px; background: #334155; }
.esc-numline .frog { bottom: 4px !important; font-size: 26px !important; transition: left .25s; left: 0; }
.esc-numline .frog::before { display: none; }
.esc-numline b { font-size: 20px; margin-left: 6px; }
.esc-tally { font-size: 22px; letter-spacing: 2px; font-family: ui-monospace, monospace; }
.pad-focus { outline: 4px solid #fde047 !important; outline-offset: 3px; }
/* potion lab */
.esc-recipe { text-align: left; display: block; background: #fef3c7; color: #422006; border-radius: 14px; padding: 12px 16px; }
.esc-recipe b { display: block; margin-top: 6px; }
.esc-recipe .esc-story { color: #422006; margin: 4px 0; font-size: 17px; }
.esc-lab { display: grid; gap: 10px; }
.esc-bottles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.esc-bottle { display: grid !important; justify-items: center; gap: 4px; width: 98px; padding: 8px 4px !important; }
.esc-bottle .glass { position: relative; width: 46px; height: 62px; border-radius: 12px 12px 18px 18px; border: 3px solid rgba(255,255,255,.7); background: linear-gradient(to top, var(--c) 0 62%, rgba(255,255,255,.12) 62%); display: grid; place-items: center; }
.esc-bottle .glass::before { content: ''; position: absolute; top: -12px; width: 18px; height: 12px; background: #a16207; border-radius: 4px 4px 0 0; }
.esc-bottle .em { font-size: 22px; }
.esc-bottle .nm { font-size: 12px; font-weight: 700; }
.esc-bottle.pour .glass { animation: escPour .45s; }
@keyframes escPour { 40% { transform: rotate(-35deg) translateY(-6px); } }
.esc-labmid { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.esc-cauldron { position: relative; width: 150px; height: 120px; border-radius: 20px 20px 70px 70px; background: #1f2937; border: 5px solid #111827; overflow: hidden; box-shadow: inset 0 -10px 20px rgba(0,0,0,.5); }
.esc-cauldron .liquid { position: absolute; left: 0; right: 0; bottom: 0; height: 0; transition: height .3s, background .4s; opacity: .9; }
.esc-cauldron .rim { position: absolute; top: 0; left: -6px; right: -6px; height: 12px; background: #374151; border-radius: 99px; }
.esc-cauldron .bubbles { position: absolute; inset: 0; pointer-events: none; }
.esc-cauldron .bubbles.go { background: radial-gradient(circle at 30% 70%, rgba(255,255,255,.6) 0 4px, transparent 5px), radial-gradient(circle at 60% 60%, rgba(255,255,255,.5) 0 6px, transparent 7px), radial-gradient(circle at 45% 80%, rgba(255,255,255,.5) 0 3px, transparent 4px); animation: escBubble 1s 2; }
@keyframes escBubble { 50% { transform: translateY(-14px); opacity: .4; } }
.esc-cauldron.stirred .liquid { animation: escSwirl 2.4s linear infinite; }
@keyframes escSwirl { 50% { filter: brightness(1.25) hue-rotate(12deg); } }
.esc-poured { display: grid; gap: 6px; min-width: 200px; }
.esc-pourrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-left: 6px solid; background: rgba(255,255,255,.08); border-radius: 8px; padding: 4px 6px 4px 10px; font-weight: 700; }
.esc-pourrow .esc-btn { min-height: 0; padding: 2px 10px; }
.esc-who.locked { opacity: .55; }
.esc-who.locked .esc-apprentice { cursor: not-allowed; }
.esc-apprentices { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.esc-apprentice { display: grid !important; justify-items: center; gap: 2px; width: 118px; padding: 8px !important; position: relative; }
.esc-apprentice img { border-radius: 14px; background: rgba(255,255,255,.12); }
.esc-apprentice .pos { position: absolute; top: 4px; left: 8px; font-weight: 800; opacity: .7; }
.esc-apprentice .tags { font-size: 24px; letter-spacing: 2px; }
.esc-apprentice.frog { opacity: .6; filter: hue-rotate(80deg) saturate(.6); }
.esc-apprentice .frogface { position: absolute; top: 24px; font-size: 44px; z-index: 2; }
/* lightning circuit */
.esc-circuit { display: grid; gap: 8px; }
.esc-board { width: 100%; max-width: 720px; margin: 0 auto; display: block; touch-action: manipulation; user-select: none; }
.esc-board .bg { fill: #0f172a; stroke: #334155; stroke-width: .6; }
.esc-board .jar { fill: rgba(56,189,248,.18); stroke: #7dd3fc; stroke-width: .8; }
.esc-board .light { fill: #1e1b4b; stroke: #a78bfa; stroke-width: .8; }
.esc-board .sw { fill: #292524; stroke: #f59e0b; stroke-width: .8; }
.esc-board text { text-anchor: middle; fill: #e2e8f0; font-weight: 700; pointer-events: none; }
.esc-board .ic { font-size: 7px; }
.esc-board .ic.big { font-size: 9px; }
.esc-board .lbl { font-size: 3.6px; }
.esc-board .pm { font-size: 4.6px; fill: #fde047; }
.esc-board .dot { fill: #fde047; stroke: #78350f; stroke-width: .6; cursor: pointer; }
.esc-board .dot:hover, .esc-board .dot:focus { fill: #fff; outline: none; }
.esc-board .dot.sel { fill: #22d3ee; stroke: #fff; stroke-width: 1; r: 3.4; }
.esc-board .wire { fill: none; stroke: #f59e0b; stroke-width: 1.4; stroke-linecap: round; cursor: pointer; }
.esc-board .wire:hover { stroke: #ef4444; }
.esc-board.powering .wire { stroke: #67e8f9; filter: drop-shadow(0 0 1.5px #22d3ee); }
.esc-board.dim .light { fill: #312e81; }
body.esc-zapflash { animation: escZap .9s; }
@keyframes escZap { 0%, 30%, 60% { background-color: #e0f2fe; filter: invert(1); } 15%, 45%, 80% { filter: none; } }
.esc-zap { font-size: 64px; animation: escShake .3s 3; }
.esc-ava.skeleton svg { filter: grayscale(1) brightness(1.7) contrast(1.3) drop-shadow(0 0 4px #34d399); }
.esc-cambtn { font-weight: 700; }
.esc-cambtn.off { background: transparent; }
.esc-cambtn:not(.off) { background: #b91c1c !important; border-color: #fca5a5; color: #fff; }
/* crew chat */
.esc-chat { display: flex; flex-direction: column; }
.esc-chatlist { flex: 1; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 2px; }
.esc-msg { align-self: flex-start; max-width: 85%; background: #e0e7ff; border-radius: 14px 14px 14px 4px; padding: 6px 10px; }
.esc-msg.mine { align-self: flex-end; background: #fed7aa; border-radius: 14px 14px 4px 14px; }
.esc-msg small { display: block; font-weight: 800; font-size: 11px; color: #475569; }
.esc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.esc-chatrow { display: flex; gap: 6px; align-items: center; }
.esc-chatin { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px; border-radius: 12px; border: 2px solid #cbd5e1; background: #fff; color: #0f172a; }
.esc-mic.on { background: #dc2626 !important; color: #fff; animation: escGlow 1s infinite; }
.esc-chatwarn { background: #fee2e2; color: #991b1b; border-radius: 10px; padding: 8px 10px; font-weight: 700; margin: 8px 0 0; }
.esc-chatbtn.unread { background: #f97316 !important; color: #fff; animation: escPop .5s; }
/* wiring in the room */
.esc-wirehud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 8px auto 0; max-width: 1000px; background: rgba(14,165,233,.12); border: 2px solid rgba(56,189,248,.5); border-radius: 16px; padding: 8px 10px; }
.esc-wirehud .esc-btn { font-size: 15px; padding: 8px 12px; min-height: 0; }
.esc-wiretxt { font-weight: 800; font-size: 15px; }
.esc-choose { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.esc-choose .esc-btn { font-size: 15px; padding: 8px 12px; min-height: 0; }
/* teamwork */
.esc-teambtn.on { background: #7c3aed !important; color: #fff; }
.esc-teamchips { display: flex; gap: 6px; flex-wrap: wrap; }
.esc-teamchip { display: inline-flex !important; align-items: center; gap: 6px; font-size: 14px; padding: 4px 10px 4px 4px !important; min-height: 0; }
.esc-teamchip img { border-radius: 99px; background: rgba(255,255,255,.15); }
.esc-teamchip.on { outline: 3px solid #fde047; }
.esc-plate { position: absolute; display: grid; place-items: center; font-size: 22px; border-radius: 99px; background: radial-gradient(circle, rgba(96,165,250,.55), rgba(30,58,138,.2)); animation: escGlow 1.6s infinite; z-index: 2; pointer-events: none; }
.esc-plate.on { background: radial-gradient(circle, rgba(250,204,21,.85), rgba(59,130,246,.4)); animation: none; }
/* Grumblewick's sabotage */
.esc-alarm { margin: 8px auto 0; max-width: 1000px; text-align: center; font-weight: 800; font-size: 16px; color: #fff; background: linear-gradient(90deg, #991b1b, #c2410c); border-radius: 14px; padding: 8px 12px; animation: escAlarm 1.2s infinite; }
@keyframes escAlarm { 50% { filter: brightness(1.25); box-shadow: 0 0 18px rgba(239,68,68,.6); } }
.esc-sabspot { position: absolute; display: grid; place-items: center; font-size: 20px; border-radius: 99px; z-index: 3; pointer-events: none; animation: escGlow 1s infinite; }
.esc-sabspot.lights { background: radial-gradient(circle, rgba(251,191,36,.8), rgba(251,191,36,0) 70%); }
.esc-sabspot.slime { background: radial-gradient(circle, rgba(74,222,128,.9), rgba(22,163,74,.3) 70%); }
body.esc-dark .esc-room { filter: brightness(.35); }
/* score + leaderboard on the finish screen */
.esc-score { margin: 14px auto; max-width: 520px; text-align: left; }
.esc-scorebig { text-align: center; }
.esc-scorebig small { display: block; letter-spacing: .3em; font-weight: 800; color: #fde047; }
.esc-scorebig b { font-size: 56px; font-weight: 900; color: #fff; text-shadow: 0 0 24px rgba(253,224,71,.5); font-variant-numeric: tabular-nums; }
.esc-scorelines { background: rgba(255,255,255,.06); border-radius: 14px; padding: 8px 12px; margin-top: 8px; }
.esc-scorelines div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-weight: 700; }
.esc-scorelines .neg span:last-child { color: #fca5a5; }
.esc-scorelines .mult { border-top: 1px dashed rgba(255,255,255,.25); margin-top: 4px; padding-top: 6px; color: #fde047; }
.esc-board-mini { margin-top: 10px; background: rgba(124,58,237,.18); border-radius: 14px; padding: 8px 12px; }
.esc-board-mini b { display: block; margin-bottom: 4px; }
.esc-board-mini div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.esc-board-mini .me { color: #fde047; font-weight: 800; }
/* XP and tiers on the finish screen */
.esc-progress { max-width: 520px; margin: 10px auto; display: grid; gap: 8px; text-align: left; }
.esc-xp { background: rgba(255,255,255,.06); border-radius: 14px; padding: 8px 12px; }
.esc-xp.up { background: linear-gradient(90deg, rgba(250,204,21,.25), rgba(124,58,237,.25)); animation: escPop .6s; }
.esc-xp .bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.12); margin: 6px 0 4px; overflow: hidden; }
.esc-xp .bar span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #fde047); border-radius: 99px; transition: width 1.2s ease-out; }
.esc-xp small { opacity: .85; }
.esc-xp .unl { margin: 4px 0 0; color: #fde047; font-weight: 800; }
/* race */
.esc-racechip { font-size: 13px; font-weight: 800; background: rgba(239,68,68,.18); border: 1px solid rgba(239,68,68,.5); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.esc-sendbtn { font-size: 14px !important; padding: 6px 12px !important; min-height: 0; background: linear-gradient(90deg, #7c3aed, #dc2626) !important; color: #fff; animation: escAlarm 1.4s infinite; }
.esc-racebanner { margin: 10px auto; max-width: 520px; padding: 12px; border-radius: 16px; font-size: 22px; font-weight: 900; background: rgba(148,163,184,.2); }
.esc-racebanner.win { background: linear-gradient(90deg, #f59e0b, #fde047); color: #1e1b4b; animation: escPop .7s; }
/* teen version: quieter, sharper UI */
body.teen .esc-sparky { background: rgba(15,23,42,.85); border-color: rgba(148,163,184,.35); }
body.teen .esc-story, body.teen .esc-prompt { letter-spacing: .01em; }
body.teen .esc-say .esc-sparky-face { filter: grayscale(.4); }
body.teen .esc-alarm { background: linear-gradient(90deg, #111827, #7f1d1d); }

/* ---------- In the room: one screen, nothing below the fold (NVC-CHG-0098) ----------
   While a room is open the page is exactly one screen tall. The header, the top bar and the
   controls keep their size and the room takes whatever space is left. Short landscape screens
   put the controls beside the room instead of under it. */
body.esc-inroom { height: 100vh; height: 100dvh; overflow: hidden; }
body.esc-inroom #esc { height: 100vh; height: 100dvh; min-height: 0; }
body.esc-inroom .esc-top { padding: max(6px, env(safe-area-inset-top)) 12px 6px; gap: 8px; row-gap: 4px; }
body.esc-inroom .esc-main { flex: 1 1 auto; min-height: 0; max-width: 1180px; padding: 8px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); display: flex; flex-direction: column; }
body.esc-inroom .esc-explore { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
body.esc-inroom .esc-explore > * { flex: none; }
body.esc-inroom .esc-explore-top { gap: 6px 8px; }
body.esc-inroom .esc-explore-top .esc-btn { font-size: 15px; padding: 8px 12px; box-shadow: 0 3px 0 #1e293b; }
body.esc-inroom .esc-roomname { font-size: 16px; }
body.esc-inroom .esc-room3d { flex: 1 1 auto; height: auto; min-height: 120px; }
body.esc-inroom .esc-room-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; align-items: safe center; justify-content: safe center; box-shadow: none; }
body.esc-inroom .esc-room-scroll .esc-room { flex: none; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
body.esc-inroom .esc-explore-ctrl { gap: 10px; }
body.esc-inroom .esc-arrows { grid-template-columns: repeat(3, 56px); gap: 6px; }
body.esc-inroom .esc-arrows .esc-btn { font-size: 24px; padding: 6px 0; }
body.esc-inroom .esc-explore-ctrl > .esc-btn { font-size: 18px; padding: 12px 16px; }
/* Sparky's speech bubble floats over the top of the room instead of pushing the controls down. */
body.esc-inroom .esc-say { position: absolute; z-index: 6; top: 52px; left: 50%; transform: translateX(-50%); width: min(94%, 640px); }
.esc-fullbtn { white-space: nowrap; }
/* Phones held upright: less chrome in the header. */
@media (max-width: 600px) {
  body.esc-inroom .esc-level, body.esc-inroom .esc-live, body.esc-inroom .esc-rec { display: none; }
  body.esc-inroom .esc-adult { padding: 5px 9px; font-size: 12px; }
  body.esc-inroom .esc-explore-top .esc-roomname { display: none; }
}
/* Short landscape screens (phones on their side, small laptop windows): controls go beside the room. */
@media (orientation: landscape) and (max-height: 560px) {
  body.esc-inroom .esc-top { flex-wrap: nowrap; overflow-x: auto; }
  body.esc-inroom .esc-stations, body.esc-inroom .esc-level { display: none; }
  body.esc-inroom .esc-explore { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); grid-auto-flow: dense; align-items: stretch; justify-items: stretch; gap: 6px 10px; }
  body.esc-inroom .esc-explore > * { grid-column: 2; }
  body.esc-inroom .esc-explore > .esc-explore-top { grid-column: 1 / -1; grid-row: 1; }
  body.esc-inroom .esc-explore > .esc-room3d, body.esc-inroom .esc-explore > .esc-room-scroll { grid-column: 1; grid-row: 2 / span 20; min-height: 0; height: 100%; }
  body.esc-inroom .esc-explore > .esc-explore-ctrl { grid-row: 2 / span 20; }
  body.esc-inroom .esc-explore-ctrl { flex-direction: column; flex-wrap: nowrap; justify-content: center; align-self: center; gap: 8px; max-height: 100%; overflow-y: auto; }
  body.esc-inroom .esc-arrows { grid-template-columns: repeat(3, 48px); gap: 5px; }
  body.esc-inroom .esc-arrows .esc-btn { font-size: 20px; padding: 4px 0; box-shadow: 0 3px 0 #1e293b; }
  body.esc-inroom .esc-explore-ctrl > .esc-btn { font-size: 15px; padding: 9px 12px; box-shadow: 0 3px 0 #c2410c; }
  body.esc-inroom .esc-explore-ctrl > .esc-btn.alt { box-shadow: 0 3px 0 #1e293b; }
  body.esc-inroom .esc-explore-top .esc-btn { padding: 6px 10px; font-size: 14px; }
  body.esc-inroom .esc-explore-top .esc-roomname { display: none; }
}
/* Full screen where the browser can't do it (iPhone): hide the game's own header to give the room more space. */
body.esc-immersive .esc-top { display: none; }
/* Pop-ups (PIN keypad, pause, exit, add device) scroll when the screen is shorter than they are,
   and stay reachable from the top (plain centring cuts the top off). */
.esc-overlay { overflow-y: auto; place-items: safe center; overscroll-behavior: contain; }
@media (max-height: 560px) {
  .esc-overlay { padding: 10px; }
  .esc-overlay .esc-card { padding: 14px; }
  .esc-keypad .esc-btn { padding: 8px 0; font-size: 20px; }
}
