/* Maze Muncher: a neon cabinet in a dark room. Electric-blue tubes, warm lamp pellets, yellow muncher, jelly ghosts. */
:root {
  --bg: #050614; --surface: #0e1030; --surface-2: #171a48; --ink: #eef1ff; --ink-2: #8f97c9; --line: #23276a;
  --accent: #facc15; --accent-ink: #1a1400; --ok: #4ade80; --warn: #fb923c; --bad: #ff3b5c; --info: #38bdf8;
  --tube: #3b82f6; --tube-light: #93c5fd; --lamp: #fde68a; --muncher: #facc15; --ghost-red: #ff3b5c; --ghost-pink: #ff7ad9; --ghost-cyan: #2ee6ff; --ghost-orange: #ffb347; --fright: #3d4bff;
  --font-display: "Press Start 2P", "Rubik", system-ui, monospace; --font-ui: "Rubik", system-ui, sans-serif;
}
:root[data-theme="light"] { --bg: #eef2ff; --surface: #ffffff; --surface-2: #dfe6ff; --ink: #10123a; --ink-2: #4f5690; --line: #c3cbf2; --accent: #d97706; --accent-ink: #ffffff; --ok: #15803d; --warn: #c2410c; --bad: #be123c; --info: #0369a1; --tube: #1d4ed8; --tube-light: #3b82f6; --lamp: #b45309; --muncher: #f59e0b; }
body { background: radial-gradient(ellipse 90% 60% at 50% -10%, #1a1c5c 0%, transparent 60%), radial-gradient(ellipse 70% 40% at 50% 110%, #2a0f3a 0%, transparent 60%), var(--bg); background-attachment: fixed; font-family: var(--font-ui); }
:root[data-theme="light"] body { background: radial-gradient(ellipse 90% 60% at 50% -10%, #dfe6ff 0%, transparent 60%), radial-gradient(ellipse 70% 40% at 50% 110%, #fde2ff 0%, transparent 60%), var(--bg); background-attachment: fixed; }
/* home */
.arcade-home { gap: var(--s-4); }
.logo { display: flex; justify-content: center; margin-bottom: -4px; } .logo canvas { width: 224px; height: 72px; }
.title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 8vw, 2.6rem); line-height: 1.25; letter-spacing: .02em; color: var(--muncher); text-shadow: 0 0 10px rgba(250,204,21,.8), 0 0 30px rgba(250,204,21,.45), 0 0 70px rgba(59,130,246,.45); }
:root[data-theme="light"] .title { color: #b45309; text-shadow: 0 0 12px rgba(217,119,6,.25); }
.tagline { font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.modes { grid-template-columns: 1fr 1fr; }
.mode { min-height: 58px; padding: 9px 12px; background: color-mix(in oklab, var(--surface) 85%, transparent); border-color: color-mix(in oklab, var(--line) 70%, transparent); backdrop-filter: blur(6px); }
.mode b { font-family: var(--font-display); font-weight: 400; font-size: .72rem; letter-spacing: .02em; line-height: 1.4; } .mode span { font-size: .76rem; }
.mode[aria-pressed="true"] { border-color: var(--tube); box-shadow: 0 0 0 1px var(--tube), 0 0 18px rgba(59,130,246,.45); }
.seg-line [role="radio"] { font-family: var(--font-ui); font-weight: 700; font-size: .9rem; }
.cta { font-family: var(--font-display); font-weight: 400; font-size: .95rem; box-shadow: 0 0 24px rgba(250,204,21,.4); }
.btn { font-family: var(--font-ui); font-weight: 700; }
.best-line { font-weight: 500; }
/* play */
.play { background: radial-gradient(ellipse 100% 45% at 50% 0%, #12144a 0%, transparent 70%), var(--bg); }
:root[data-theme="light"] .play { background: radial-gradient(ellipse 100% 45% at 50% 0%, #dfe6ff 0%, transparent 70%), var(--bg); }
.play .stage { padding: calc(var(--hud-h) + 12px + env(safe-area-inset-top)) 6px calc(14px + env(safe-area-inset-bottom)); }
@media (pointer: coarse) { :root[data-touch="buttons"] .play .stage { padding-bottom: calc(176px + env(safe-area-inset-bottom)); } }
.play .stage-canvas { border-radius: 8px; box-shadow: 0 0 0 1px rgba(59,130,246,.2), 0 0 50px rgba(59,130,246,.18), 0 0 120px rgba(250,204,21,.06); }
:root[data-theme="light"] .play .stage-canvas { box-shadow: 0 0 0 1px rgba(29,78,216,.2), 0 8px 30px rgba(16,18,58,.15); }
.play .hud { gap: 5px; padding-left: 6px; padding-right: 6px; }
.play .hud .btn-icon { flex: none; }
.hud-pill { font-family: var(--font-display); font-weight: 400; font-size: .6rem; padding: 0 8px; gap: 5px; height: 32px; white-space: nowrap; background: color-mix(in oklab, #07081c 75%, transparent); }
:root[data-theme="light"] .hud-pill { background: color-mix(in oklab, #ffffff 82%, transparent); }
.hud-pill small { font-family: var(--font-ui); font-size: .58rem; letter-spacing: .12em; }
.hud-score { padding: 0 10px; }
.hud-lives { padding: 0 7px; } #hud-lives { display: inline-flex; gap: 3px; align-items: center; min-width: 10px; min-height: 10px; }
#hud-lives i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muncher); box-shadow: 0 0 8px rgba(250,204,21,.7); clip-path: polygon(0 0, 100% 0, 100% 35%, 45% 50%, 100% 65%, 100% 100%, 0 100%); }
#hud-lives i.inf { clip-path: none; width: auto; height: auto; background: none; box-shadow: none; font-style: normal; color: var(--muncher); }
#hud-lives-pill[data-danger="1"] { box-shadow: 0 0 0 1px var(--bad), 0 0 14px rgba(255,59,92,.55); animation: danger-pulse .9s ease-in-out infinite; }
@keyframes danger-pulse { 0%, 100% { box-shadow: 0 0 0 1px var(--bad), 0 0 8px rgba(255,59,92,.3); } 50% { box-shadow: 0 0 0 2px var(--bad), 0 0 20px rgba(255,59,92,.8); } }
:root[data-motion="reduced"] #hud-lives-pill[data-danger="1"] { animation: none; }
.hud-fruit { padding: 0 8px; } #hud-fruit { display: inline-flex; gap: 3px; align-items: center; min-height: 12px; }
#hud-fruit i { display: inline-block; width: 12px; height: 12px; border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%; background: var(--c, #f87171); box-shadow: 0 0 8px color-mix(in oklab, var(--c, #f87171) 70%, transparent); opacity: .5; }
#hud-fruit i.live { opacity: 1; animation: fruit-bounce .7s ease-in-out infinite alternate; }
@keyframes fruit-bounce { from { transform: translateY(1px); } to { transform: translateY(-2px); } }
:root[data-motion="reduced"] #hud-fruit i.live { animation: none; }
.power-bar { position: absolute; z-index: 3; left: 14px; right: 14px; top: calc(var(--hud-h) + 4px + max(8px, env(safe-area-inset-top))); height: 4px; border-radius: 4px; background: rgba(61,75,255,.25); overflow: hidden; pointer-events: none; }
.power-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #93c5fd, var(--fright)); box-shadow: 0 0 10px rgba(61,75,255,.9); transform-origin: left; }
.power-bar[data-flash="1"] i { background: #fff; }
.controls-row { display: flex; align-items: flex-end; justify-content: center; }
:root[data-touch="swipe"] #dpad { display: none !important; }
#dpad[data-layout="dpad"] { --tc: 52px; }
@media (pointer: coarse) { :root[data-touch="buttons"] #dpad[data-layout="dpad"] { display: grid; } }
.tc-btn { background: color-mix(in oklab, var(--surface) 78%, transparent); border-color: color-mix(in oklab, var(--tube) 55%, transparent); color: var(--tube-light); }
.tc-btn.on { background: var(--muncher); border-color: var(--muncher); color: var(--accent-ink); }
#ready { pointer-events: none; backdrop-filter: none; background: transparent; padding: inherit; place-items: center; }
#ready .stack { gap: 6px; padding: 10px 14px; border-radius: 12px; background: color-mix(in oklab, var(--bg) 82%, transparent); box-shadow: 0 0 0 1px color-mix(in oklab, var(--tube) 45%, transparent), 0 0 30px rgba(59,130,246,.25); max-width: 86%; }
.overlay h2 { font-family: var(--font-display); font-weight: 400; color: var(--muncher); text-shadow: 0 0 12px rgba(250,204,21,.8), 0 0 30px rgba(250,204,21,.4); }
#ready h2 { font-size: clamp(.9rem, 4.5vw, 1.3rem); letter-spacing: .02em; line-height: 1.4; }
#ready p { font-size: .84rem; color: var(--ink); font-weight: 500; }
:root[data-theme="light"] .overlay h2 { color: #b45309; text-shadow: none; }
#paused { background: color-mix(in oklab, var(--bg) 75%, transparent); backdrop-filter: blur(4px); }
#paused h2 { font-size: clamp(1.2rem, 6vw, 1.8rem); }
.result-verdict { text-align: center; color: var(--ink-2); font-weight: 500; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: var(--s-2); }
.result-actions .btn-primary { grid-column: 1 / -1; }
.sheet-title { font-family: var(--font-display); font-weight: 400; font-size: .95rem; line-height: 1.5; }
.score-total { font-family: var(--font-display); font-weight: 400; color: var(--muncher); text-shadow: 0 0 18px rgba(250,204,21,.5); }
:root[data-theme="light"] .score-total { color: #b45309; text-shadow: none; }
@container screen (min-width: 640px) { .arcade-home .modes { grid-template-columns: 1fr 1fr; } }
