:root {
  --bg: #05070d;
  --panel: rgba(9, 15, 28, 0.88);
  --panel-2: rgba(12, 20, 38, 0.88);
  --line: rgba(76, 234, 255, 0.2);
  --cyan: #41e9ff;
  --amber: #ffcb5c;
  --magenta: #ff4bd2;
  --lime: #b4ff5f;
  --red: #ff4f75;
  --orange: #ff8f43;
  --text: #ddf5ff;
  --dim: #7fa1b5;
  --shadow: 0 0 28px rgba(0, 0, 0, 0.3);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 700px at 50% -5%, rgba(255, 75, 210, 0.18), transparent 58%), radial-gradient(900px 600px at 100% 10%, rgba(65, 233, 255, 0.14), transparent 55%), linear-gradient(180deg, #0a0f1d 0%, var(--bg) 48%, #04060a 100%); color: var(--text); font-family: "IBM Plex Mono", ui-monospace, monospace; }
body { overflow-x: hidden; }
.noise,.scan { position: fixed; inset: 0; pointer-events: none; }
.noise { opacity: 0.08; background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.22) 0 1px, transparent 1px), radial-gradient(circle at 80% 40%, rgba(255,255,255,0.18) 0 1px, transparent 1px), radial-gradient(circle at 35% 65%, rgba(255,255,255,0.15) 0 1px, transparent 1px); background-size: 12px 12px, 14px 14px, 16px 16px; }
.scan { z-index: 5; background: repeating-linear-gradient(180deg, transparent 0 2px, rgba(0, 0, 0, 0.14) 2px 4px); }
.stage { width: min(1400px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0 28px; }
.marquee,.panel { border: 1px solid var(--line); background: linear-gradient(180deg, rgba(18, 25, 45, 0.94), rgba(8, 12, 22, 0.94)); box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.03); }
.marquee { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 16px 18px; border-radius: 20px; }
.back { color: var(--dim); text-decoration: none; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.back:hover { color: var(--cyan); }
.title-wrap { text-align: center; }
.eyebrow,.subtitle,.category,.host-name,.keys-top p,.rules li,.perk-list span,.label,.badge,.meter-title,.result,.colophon,.broadcast,.wheel-hud,.solve-panel label { letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow { margin: 0 0 6px; font-size: 10px; color: var(--magenta); }
.marquee h1 { margin: 0; font: 900 clamp(34px, 5vw, 64px) / 0.96 "Orbitron", sans-serif; text-transform: uppercase; color: #fff3d0; text-shadow: 0 0 14px rgba(255, 203, 92, 0.35), 0 0 26px rgba(255, 75, 210, 0.2); }
.subtitle { margin: 8px 0 0; font-size: 11px; color: var(--dim); }
.broadcast { display: inline-flex; align-items: center; gap: 9px; color: #ffd3de; font-size: 11px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b5a; box-shadow: 0 0 0 4px rgba(255, 59, 90, 0.18), 0 0 18px rgba(255, 59, 90, 0.8); animation: blink 1.2s infinite; }
@keyframes blink { 0%, 45%, 100% { opacity: 1; } 55% { opacity: 0.45; } }
.dashboard { margin-top: 16px; }
.score-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 12px; border-radius: 18px; }
.stat-block { min-height: 78px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.04); background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)); display: flex; flex-direction: column; justify-content: center; padding: 12px 14px; }
.stat-block strong { margin-top: 7px; font: 900 clamp(24px, 2.6vw, 34px) / 1 "Orbitron", sans-serif; }
.stat-block.amber strong { color: var(--amber); text-shadow: 0 0 14px rgba(255, 203, 92, 0.2); }
.stat-block.cyan strong { color: var(--cyan); text-shadow: 0 0 14px rgba(65, 233, 255, 0.2); }
.stat-block.magenta strong { color: var(--magenta); text-shadow: 0 0 14px rgba(255, 75, 210, 0.2); }
.stat-block.lime strong { color: var(--lime); text-shadow: 0 0 14px rgba(180, 255, 95, 0.2); }
.label { font-size: 10px; color: var(--dim); }
.main-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr); gap: 16px; align-items: start; }
.board-column,.control-column { display: flex; flex-direction: column; gap: 16px; }
.panel { border-radius: 20px; }
.board-frame { padding: 18px; }
.board-meta { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.category { margin: 0; font-size: 11px; color: var(--magenta); }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 10px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; background: rgba(255,255,255,0.02); }
.badge b { color: var(--text); }
.board { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; min-height: 186px; padding: 14px 10px 16px; background: radial-gradient(90% 130% at 50% 0%, rgba(65,233,255,0.08), transparent 75%), linear-gradient(180deg, rgba(6,11,20,0.72), rgba(7,12,24,0.95)); border: 1px solid rgba(65, 233, 255, 0.12); border-radius: 18px; }
.tile { width: 40px; height: 54px; border-radius: 12px; display: grid; place-items: center; border: 1px solid rgba(65, 233, 255, 0.18); background: linear-gradient(180deg, rgba(19, 37, 69, 0.95), rgba(8, 16, 29, 0.95)); font: 900 24px / 1 "Orbitron", sans-serif; color: #ffffff; text-shadow: 0 0 12px rgba(65, 233, 255, 0.75); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 18px rgba(0,0,0,0.18); }
.tile.space { width: 22px; background: transparent; border-color: transparent; box-shadow: none; }
.tile.hidden-letter { color: transparent; text-shadow: none; }
.tile.reveal { animation: flip 0.32s ease, glow 0.5s ease; }
@keyframes flip { from { transform: rotateX(84deg) scale(0.95); } to { transform: rotateX(0deg) scale(1); } }
@keyframes glow { from { box-shadow: 0 0 0 rgba(65,233,255,0); } 40% { box-shadow: 0 0 18px rgba(65,233,255,0.55); } to { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 18px rgba(0,0,0,0.18); } }
.meter-wrap { margin-top: 14px; }
.meter-title { display: flex; justify-content: space-between; font-size: 10px; color: var(--dim); margin-bottom: 6px; }
.meter { height: 14px; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); background: rgba(255,255,255,0.04); }
.meter i { display: block; height: 100%; width: 0%; border-radius: inherit; transition: width 0.22s ease; }
.meter.pain i { background: linear-gradient(90deg, var(--lime), var(--amber) 50%, var(--red) 100%); box-shadow: 0 0 12px rgba(255, 79, 117, 0.4); }
.meter.timer i { background: linear-gradient(90deg, var(--cyan), var(--magenta)); box-shadow: 0 0 10px rgba(65, 233, 255, 0.35); }
.host-row { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; }
.host-panel,.bonus-panel,.keys-panel,.wheel-panel,.solve-panel,.rules { padding: 18px; }
.host-panel { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: center; }
.host-head { position: relative; width: 110px; height: 110px; border-radius: 22px; border: 1px solid rgba(255, 75, 210, 0.2); background: radial-gradient(circle at 35% 38%, #ffd8a7 0 30px, transparent 31px), radial-gradient(circle at 68% 38%, #ffd8a7 0 28px, transparent 29px), radial-gradient(circle at 50% 58%, #ffb968 0 42px, #a94d12 43px 43px, transparent 44px), linear-gradient(180deg, #533b1c 0 22%, #1e1f2d 22% 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 0 22px rgba(255, 75, 210, 0.12); }
.eye { position: absolute; top: 38px; width: 12px; height: 12px; border-radius: 50%; background: #101727; box-shadow: 0 0 0 4px #fff0c9; }
.eye.left { left: 32px; }
.eye.right { right: 32px; }
.mouth { position: absolute; left: 50%; bottom: 24px; width: 38px; height: 16px; transform: translateX(-50%); border-radius: 0 0 28px 28px; background: #48121f; box-shadow: inset 0 -4px 0 rgba(255, 255, 255, 0.08); }
.host-name { margin: 0 0 8px; color: var(--amber); font-size: 10px; }
.host { margin: 0; min-height: 58px; color: var(--text); font-size: 13px; line-height: 1.7; }
.bonus-panel h2,.keys-panel h2,.rules h2 { margin: 0 0 10px; font: 900 16px / 1.1 "Orbitron", sans-serif; text-transform: uppercase; color: var(--amber); }
.perk-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.perk-list li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.04); background: rgba(255,255,255,0.02); }
.perk-list b { min-width: 42px; text-align: center; font: 900 20px / 1 "Orbitron", sans-serif; color: var(--cyan); }
.perk-list span { font-size: 10px; color: var(--dim); }
.keys-top { display: flex; justify-content: space-between; gap: 14px; align-items: end; }
.keys-top p { margin: 0; font-size: 10px; color: var(--dim); text-align: right; }
.keys { margin-top: 14px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.key { min-height: 46px; border-radius: 12px; border: 1px solid rgba(65,233,255,0.16); background: linear-gradient(180deg, rgba(20, 34, 59, 0.95), rgba(10, 18, 31, 0.95)); color: var(--text); font: 700 15px / 1 "Orbitron", sans-serif; cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease, filter 0.12s ease; }
.key:hover:not(:disabled),.controls button:hover:not(:disabled),.solve-actions button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(65,233,255,0.38); filter: brightness(1.06); }
.key.vowel { color: var(--amber); }
.key:disabled { opacity: 0.28; cursor: default; transform: none; filter: none; }
.wheel-panel { padding: 18px; }
.wheel-hud { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 10px; color: var(--dim); }
.result { color: var(--amber); text-align: right; }
.wheelwrap { position: relative; display: grid; place-items: center; margin-top: 12px; min-height: 420px; }
.pointer { position: absolute; top: 2px; left: 50%; width: 0; height: 0; transform: translateX(-50%); border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 0; border-bottom: 34px solid #ffd98b; filter: drop-shadow(0 0 10px rgba(255, 203, 92, 0.55)); z-index: 3; }
#wheel { width: min(100%, 470px); height: auto; filter: drop-shadow(0 0 28px rgba(65,233,255,0.16)); }
.wheel-core { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 90px; height: 90px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff4d8, #efae2c 60%, #6e390a 100%); color: #2b1300; font: 900 24px / 1 "Orbitron", sans-serif; text-transform: uppercase; box-shadow: inset 0 0 0 3px rgba(255,255,255,0.25), 0 0 26px rgba(255, 203, 92, 0.28); }
.controls { display: grid; grid-template-columns: 1fr; gap: 10px; }
.controls button,.solve-actions button { min-height: 50px; border-radius: 14px; border: 1px solid rgba(65,233,255,0.18); background: linear-gradient(180deg, rgba(22, 36, 62, 0.98), rgba(9, 16, 29, 0.98)); color: var(--text); font: 700 12px / 1 "IBM Plex Mono", monospace; letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; }
.controls button:first-child { border-color: rgba(255, 203, 92, 0.28); color: #fff1cf; }
.controls button:disabled,.solve-actions button:disabled { opacity: 0.35; cursor: default; }
.solve-panel { display: grid; gap: 12px; }
#solve-input { width: 100%; min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: rgba(5, 10, 20, 0.9); color: var(--text); font: inherit; padding: 0 14px; letter-spacing: 0.08em; }
#solve-input:focus { outline: none; border-color: rgba(65,233,255,0.48); }
.solve-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rules ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.rules li { color: var(--dim); font-size: 11px; line-height: 1.6; }
.rules b { color: var(--text); }
.colophon { margin-top: 16px; padding: 0 6px; text-align: center; font-size: 9px; color: var(--dim); opacity: 0.75; }
@media (max-width: 1100px) { .main-grid { grid-template-columns: 1fr; } .host-row { grid-template-columns: 1fr; } }
@media (max-width: 840px) { .stage { width: min(100%, calc(100% - 16px)); padding-top: 8px; } .marquee { grid-template-columns: 1fr; text-align: center; } .back { justify-self: start; } .broadcast { justify-self: center; } .score-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .board-meta,.keys-top { flex-direction: column; align-items: flex-start; } .keys-top p { text-align: left; } .host-panel { grid-template-columns: 90px 1fr; } }
@media (max-width: 620px) { .tile { width: 34px; height: 48px; font-size: 20px; } .tile.space { width: 16px; } .board { gap: 5px; min-height: 148px; } .keys { grid-template-columns: repeat(6, minmax(0, 1fr)); } .solve-actions { grid-template-columns: 1fr; } .wheelwrap { min-height: 340px; } }
@media (prefers-reduced-motion: reduce) { .live-dot,.tile.reveal { animation: none; } .key,.controls button,.solve-actions button,.meter i { transition: none; } }
[hidden] { display: none !important; }


/* Mobile arcade pass. */
@media (max-width: 840px) {
  .stage { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .main-grid { display: flex; flex-direction: column; }
  .board-column, .control-column, .host-row { display: contents; }
  .board-frame { order: 1; }
  .wheel-panel { order: 2; }
  .solve-panel { order: 3; }
  .keys-panel { order: 4; }
  .host-panel { order: 5; }
  .bonus-panel { order: 6; }
  .rules { order: 7; }
  .wheelwrap { min-height: 0; aspect-ratio: 1; }
  .controls { grid-template-columns: 1fr 1fr; }
  .controls #spin { grid-column: 1 / -1; min-height: 58px; }
  .controls button, .key, .solve-actions button { touch-action: manipulation; }
  .rules { display: none; }
}
@media (max-width: 620px) {
  .marquee { padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
  .marquee h1 { font-size: clamp(34px, 11vw, 48px); }
  .subtitle { font-size: 9px; line-height: 1.5; }
  .board-frame, .wheel-panel, .keys-panel, .host-panel, .bonus-panel, .solve-panel { padding: 12px; border-radius: 14px; }
  .board { min-height: 132px; padding-inline: 5px; }
  .tile { width: clamp(28px, 8vw, 34px); height: clamp(40px, 11vw, 48px); font-size: clamp(17px, 5vw, 20px); border-radius: 8px; }
  .tile.space { width: 10px; }
  .wheel-core { width: 68px; height: 68px; font-size: 18px; }
  .pointer { border-left-width: 12px; border-right-width: 12px; border-bottom-width: 26px; }
  .keys { gap: 6px; }
  .key { min-height: 50px; }
  .host-panel { grid-template-columns: 72px 1fr; }
  .host-head { width: 72px; height: 72px; transform: scale(.72); transform-origin: left center; margin-right: -20px; }
  .host { font-size: 11px; }
}
@media (max-width: 390px) {
  .score-strip { gap: 7px; padding: 8px; }
  .stat-block { min-height: 64px; padding: 8px; }
  .stat-block strong { font-size: 20px; }
  .keys { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ---------- arcade shell integration ---------- */
:root { --as-line: rgba(255, 210, 90, .25); --as-dim: #9a8f7a; --as-rail-bg: linear-gradient(180deg, #171226, #0a0713); }
@media (hover: none) {
  .stage { width: 100%; max-width: none; margin: 0; padding: 0; }
  .marquee { padding: 4px 10px; min-height: 0; }
  .marquee h1 { font-size: 16px; }
  .eyebrow, .subtitle { display: none; }
  .as-screen .dashboard { padding: 8px 10px max(12px, env(safe-area-inset-bottom)); }
  .main-grid { gap: 10px; }
}

/* landscape touch: board left, wheel+spin right — no scrolling to start */
@media (hover: none) and (orientation: landscape) {
  .as-screen .dashboard { padding: 4px 8px max(10px, env(safe-area-inset-bottom)); }
  .score-strip { padding: 6px 8px; gap: 6px; }
  .score-strip strong { font-size: 13px; }
  .main-grid { grid-template-columns: minmax(0, 1.15fr) minmax(240px, .85fr); gap: 8px; margin-top: 8px; }
  .host-panel, .bonus-panel, .keys-panel, .wheel-panel, .solve-panel { padding: 8px 10px; }
  .board-frame { padding: 8px 10px; }
  .board { min-height: 96px; gap: 4px; }
  .tile { width: 26px; height: 36px; font-size: 15px; }
  .tile.space { width: 12px; }
  .keys { margin-top: 8px; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
  .keys-top p { display: none; }
  .keys-top h2, .wheel-panel h2 { font-size: 11px; }
  .wheelwrap { min-height: 0; margin-top: 6px; }
  .wheelwrap canvas { width: min(180px, 100%); height: auto; }
  .pointer { transform: scale(.6); }
  .wheel-core { font-size: 10px; }
  .wheel-hud { font-size: 8px; }
  .controls { margin-top: 8px; gap: 6px; }
  .controls button { min-height: 40px; font-size: 9px; padding: 6px 8px; }
  .host-row, .bonus-panel { display: none; } /* host banter yields to playability */
}

/* ---------- desktop viewport fit ----------
   The dashboard scrolls inside the cabinet while the marquee and footer stay
   put. Short desktop windows also receive a compact first-screen board/wheel. */
@media (hover: hover) and (pointer: fine) {
  .stage {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding-bottom: 10px;
  }
  .as-play,
  .as-stage,
  .as-screen { min-height: 0; }
  .as-screen[data-fit="fill"] {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .colophon { flex: 0 0 auto; margin-top: 8px; }
}

@media (hover: hover) and (pointer: fine) and (max-height: 900px) {
  .stage { padding-top: 8px; padding-bottom: 6px; }
  .marquee { padding: 8px 14px; border-radius: 14px; }
  .eyebrow { margin-bottom: 3px; font-size: 8px; }
  .marquee h1 { font-size: clamp(30px, 4vw, 46px); }
  .subtitle { display: none; }
  .dashboard { margin-top: 8px; }
  .score-strip { gap: 7px; padding: 7px; border-radius: 13px; }
  .stat-block { min-height: 54px; padding: 8px 10px; border-radius: 10px; }
  .stat-block strong { margin-top: 4px; font-size: clamp(19px, 2vw, 26px); }
  .label { font-size: 8px; }
  .main-grid { gap: 10px; margin-top: 8px; }
  .board-column, .control-column { gap: 10px; }
  .panel { border-radius: 14px; }
  .board-frame, .keys-panel, .host-panel, .bonus-panel, .wheel-panel, .solve-panel, .rules { padding: 11px; }
  .board-meta { margin-bottom: 8px; }
  .board { min-height: 150px; gap: 5px; padding: 9px 7px 11px; border-radius: 13px; }
  .tile { width: 34px; height: 46px; border-radius: 9px; font-size: 20px; }
  .tile.space { width: 15px; }
  .meter-wrap { margin-top: 9px; }
  .wheel-panel { align-self: start; }
  .wheelwrap { min-height: 0; margin-top: 7px; }
  #wheel { width: min(100%, 40dvh, 360px); }
  .pointer { top: 0; border-left-width: 12px; border-right-width: 12px; border-bottom-width: 26px; }
  .wheel-core { width: 68px; height: 68px; font-size: 17px; }
  .controls { gap: 6px; margin-top: 6px; }
  .controls button, .solve-actions button { min-height: 40px; font-size: 10px; }
  .keys { margin-top: 8px; gap: 5px; }
  .key { min-height: 38px; font-size: 12px; }
  .host-row { gap: 10px; }
  .colophon { font-size: 7px; }
}
