:root { color-scheme: dark; --accent: #ff8a00; font-family: Inter, "Segoe UI", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: #080808; color: #f7f7f7; letter-spacing: 0; }
body { -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; }
.maze-page.has-site-nav::before { display: none; }
.maze-page.has-site-nav > main { animation: mazeEnter 260ms ease-out; }
.maze-page.has-site-nav .topbar { margin-top: 0; }
@keyframes mazeEnter { from { opacity: 0; } to { opacity: 1; } }
.maze-page.is-page-leaving > main { animation: mazeLeave 180ms ease both; }
@keyframes mazeLeave { to { opacity: 0; transform: translateY(-8px); } }
.app-shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 0 24px; padding-bottom: env(safe-area-inset-bottom); }
.topbar { height: 104px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 32px; height: 32px; }
h1 { margin: 0; font-size: 26px; line-height: 1.1; font-weight: 560; }
h1 span { display: block; margin-top: 7px; font-size: 10px; font-weight: 600; color: #777; }
.stats { display: flex; align-items: center; gap: 34px; padding-right: 4px; }
.stats > div { min-width: 86px; display: grid; gap: 6px; }
.stat-label { font-size: 10px; color: #7f7f7f; font-weight: 600; }
.stat-value { font-family: ui-monospace, Consolas, monospace; font-size: 19px; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 24px; align-items: center; height: 66px; flex: 0 0 auto; border-top: 1px solid #252525; }
.difficulty { display: flex; border: 1px solid #333; border-radius: 6px; padding: 3px; gap: 3px; }
.difficulty button { width: 72px; height: 32px; border: 0; border-radius: 3px; color: #929292; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; transition: background 150ms, color 150ms; }
.difficulty button:hover { color: #fff; background: #222; }
.difficulty button[aria-pressed="true"] { color: #101010; background: #f0f0f0; }
.world-meta { display: flex; align-items: center; gap: 12px; font: 11px ui-monospace, Consolas, monospace; color: #878787; white-space: nowrap; }
.divider { height: 10px; width: 1px; background: #383838; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #aaa; cursor: pointer; transition: background 150ms, color 150ms; }
.icon-button:hover, .icon-button[aria-pressed="true"] { background: #1d1d1d; color: #fff; }
.icon-button svg, .luma-action__icon svg { width: 17px; height: 17px; stroke-width: 1.7; }
.tools .luma-action { margin-left: 12px; min-width: 104px; }
button:focus-visible, .viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.viewport { position: relative; flex: 1 1 0; min-height: 180px; overflow: hidden; border: 1px solid #303030; border-radius: 8px; background: #090909; isolation: isolate; outline: none; touch-action: none; }
.viewport canvas { display: block; position: absolute; width: 100%; height: 100%; inset: 0; background: #080808; }
body[data-maze-state="running"] .viewport { cursor: crosshair; }
body[data-pointer-locked="true"] .viewport { cursor: none; }
.stage-hud { position: absolute; left: 22px; top: 20px; display: flex; align-items: center; gap: 8px; font: 10px ui-monospace, Consolas, monospace; color: #a0a0a0; pointer-events: none; padding: 6px 8px; background: #090909d9; border-radius: 3px; }
.sound-control { position: absolute; top: 14px; right: 18px; z-index: 6; width: 36px; height: 36px; }
.sound-control .icon-button { width: 36px; height: 36px; background: #090909e6; border-color: #2a2a2a; color: #aaa; }
#soundIcon { display: grid; place-items: center; }
.sound-control .icon-button:hover, .sound-control .icon-button:focus-visible { color: #fff; background: #202020; }
.sound-control .icon-button[aria-pressed="true"] { color: #666; }
.sound-control .icon-button:disabled { cursor: default; opacity: 0.4; }
.sound-level { position: absolute; top: 44px; right: 0; width: 174px; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #383838; border-radius: 5px; background: #101010; box-shadow: 0 6px 24px #0005; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 120ms; }
.sound-control:hover .sound-level, .sound-control:focus-within .sound-level { opacity: 1; visibility: visible; pointer-events: auto; }
.sound-control::after { content: ""; position: absolute; inset: 36px 0 auto auto; width: 174px; height: 10px; }
.sound-level input { appearance: none; width: 100%; min-width: 0; height: 28px; margin: 0; background: transparent; cursor: pointer; }
.sound-level input::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--sound-volume, 65%), #404040 var(--sound-volume, 65%)); }
.sound-level input::-moz-range-track { height: 3px; border-radius: 2px; background: #404040; }
.sound-level input::-moz-range-progress { height: 3px; background: var(--accent); }
.sound-level input::-webkit-slider-thumb { appearance: none; height: 10px; width: 10px; margin-top: -3.5px; border: 0; border-radius: 50%; background: #eee; }
.sound-level input::-moz-range-thumb { height: 10px; width: 10px; border: 0; border-radius: 50%; background: #eee; }
.sound-level input:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.sound-level output { flex: 0 0 30px; color: #999; font: 9px ui-monospace, Consolas, monospace; text-align: right; }
.live-dot, .footer-dot { width: 5px; height: 5px; display: inline-block; border-radius: 50%; background: #727272; }
body[data-maze-state="running"] .live-dot { background: var(--accent); }
#coordinateValue { margin-left: 12px; color: #686868; }
.world-label { position: absolute; left: 0; top: 0; width: 100px; text-align: center; pointer-events: none; font: 600 10px ui-monospace, Consolas, monospace; color: #d3d3d3; will-change: transform; }
#finishMarker { color: var(--accent); }
.checkpoint-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.floor-status { position: absolute; left: 22px; bottom: 22px; z-index: 2; padding: 0 0 0 10px; border-left: 2px solid var(--accent); color: #eee; font: 13px ui-monospace, Consolas, monospace; pointer-events: none; }
.map-heading b { margin-right: 5px; font-weight: 500; color: var(--accent); }
.viewport.is-floor-transition .checkpoint-layer { will-change: opacity, transform; }
.checkpoint-flag { position: absolute; left: 0; top: 0; width: 80px; height: 90px; pointer-events: none; }
.checkpoint-flag svg { display: block; width: 100%; height: 100%; overflow: visible; }
.flag-ground { fill: #080808; stroke: #424242; stroke-width: 0.7; }
.flag-base { fill: #151515; stroke: #aaa; stroke-width: 0.8; }
.flag-base-glint { stroke: #777; stroke-width: 0.7; fill: none; }
.flag-cap { fill: #ddd; }
.flag-fabric { stroke: #ddd; stroke-width: 0.6; stroke-linejoin: round; }
.flag-highlight { stop-color: #d8d8d8; }
.flag-shadow { stop-color: #656565; }
.flag-fold { fill: none; stroke: #fff; stroke-opacity: 0.5; stroke-width: 0.65; }
.flag-emblem { fill: none; stroke: #303030; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.flag-ring { fill: none; stroke: var(--accent); stroke-width: 0.8; opacity: 0; }
.flag-sparks { stroke: var(--accent); stroke-width: 1; stroke-linecap: round; fill: none; opacity: 0; }
.flag-number { fill: #888; font: 6px ui-monospace, Consolas, monospace; text-anchor: middle; }
.checkpoint-flag.is-active .flag-highlight { stop-color: #ffb34f; }
.checkpoint-flag.is-active .flag-shadow { stop-color: #ff8a00; }
.checkpoint-flag.is-active .flag-fabric, .checkpoint-flag.is-active .flag-base { stroke: var(--accent); }
.checkpoint-flag.is-active .flag-cap, .checkpoint-flag.is-active .flag-number { fill: var(--accent); }
.checkpoint-flag.is-active .flag-emblem { opacity: 1; }
.checkpoint-flag.is-current .flag-base-glint { stroke: #fff; }
.checkpoint-status { position: absolute; top: 54px; left: 30px; z-index: 2; display: flex; align-items: center; gap: 7px; color: #686868; font: 9px ui-monospace, Consolas, monospace; pointer-events: none; }
.checkpoint-status svg { width: 12px; height: 12px; }
.checkpoint-status.is-saved { color: var(--accent); }
.checkpoint-toast { position: absolute; left: 50%; top: 24px; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 9px; max-width: calc(100% - 32px); padding: 10px 14px; border: 1px solid #ff8a005c; border-radius: 4px; background: #0b0b0bed; color: #eee; font: 11px ui-monospace, Consolas, monospace; text-align: center; pointer-events: none; }
.checkpoint-toast svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--accent); }
.world-label, .stage-hud, .minimap, .ready-dock { z-index: 2; }
.minimap { position: absolute; bottom: 22px; right: 22px; width: 180px; padding: 12px; border: 1px solid #343434; border-radius: 5px; background: #0b0b0bea; pointer-events: none; }
.minimap.is-left { right: auto; left: 22px; }
.map-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font: 9px ui-monospace, Consolas, monospace; color: #8c8c8c; }
.map-heading span:last-child { color: #dadada; }
.minimap svg { display: block; width: 100%; height: 102px; overflow: hidden; border: 1px solid #242424; background: #060606; }
.ready-dock { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); }
.ready-dock .luma-action { padding: 0 30px; font-size: 13px; min-width: 210px; height: 52px; }
.overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: #0008; }
[hidden] { display: none !important; }
.overlay-card { width: min(340px, 100%); border: 1px solid #444; border-radius: 8px; background: #101010f5; text-align: center; padding: 32px 24px; box-shadow: 0 20px 65px #0008; }
.overlay-eyebrow { font: 10px ui-monospace, Consolas, monospace; color: var(--accent); }
.overlay-card h2 { font-size: 32px; font-weight: 500; line-height: 1.2; margin: 14px 0 10px; }
.overlay-card p { margin: 0 0 26px; color: #aaa; font: 14px ui-monospace, Consolas, monospace; }
.overlay-card .luma-action { min-width: 160px; height: 48px; font-size: 13px; }
.overlay-card .sound-control { position: relative; top: auto; right: auto; width: 166px; height: 36px; display: flex; align-items: center; margin: 18px auto -8px; }
.overlay-card .sound-control .icon-button { flex: 0 0 36px; border-color: transparent; background: transparent; }
.overlay-card .sound-level { position: static; width: 130px; padding: 0 0 0 10px; border: 0; background: transparent; box-shadow: none; opacity: 1; visibility: visible; pointer-events: auto; }
.overlay-card .sound-control::after { display: none; }
.footer { height: 34px; flex: 0 0 auto; display: flex; gap: 18px; align-items: center; font: 9px ui-monospace, Consolas, monospace; color: #777; }
.footer > span:first-child { display: flex; gap: 7px; align-items: center; }
.footer > span:last-child { margin-left: auto; }
.viewport:fullscreen { border: 0; border-radius: 0; width: 100%; height: 100%; background: #080808; }
.viewport:fullscreen .stage-hud { top: 24px; left: 24px; }
.maze-page .site-nav { top: 10px; right: 24px; padding: 2px; border-color: #262626; backdrop-filter: none; background: #080808; box-shadow: none; }
.maze-page .site-nav a { height: 22px; font-size: 10px; }
.maze-page .site-nav a[aria-current="page"] { background: #242424; color: #fff; }
@media (max-width: 760px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .topbar { height: 114px; padding-top: 25px; gap: 12px; }
  .brand { gap: 9px; }
  .brand img { width: 25px; height: 25px; }
  h1 { font-size: 19px; }
  h1 span { font-size: 9px; }
  .stats { gap: 14px; }
  .stats > div { min-width: 64px; }
  .stat-value { font-size: 15px; }
  .stat-label { font-size: 9px; }
  .attempt-stat { display: none !important; }
  .toolbar { height: 102px; display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 8px 0; }
  .difficulty { justify-self: start; }
  .difficulty button { width: 60px; height: 29px; font-size: 11px; }
  .world-meta { justify-content: flex-end; font-size: 10px; gap: 8px; }
  .tools { grid-column: 1 / -1; width: 100%; margin: 0; justify-content: space-between; gap: 4px; }
  .icon-button { width: 42px; height: 40px; }
  .tools .luma-action { height: 38px; min-width: 106px; margin-left: auto; }
  .stage-hud { left: 10px; top: 10px; font-size: 9px; }
  .sound-control { top: 8px; right: 8px; }
  .checkpoint-status { left: 18px; top: 41px; font-size: 8px; }
  .floor-status { left: 12px; bottom: 12px; font-size: 11px; }
  .map-heading b { margin-right: 2px; }
  .checkpoint-toast { top: 65px; font-size: 10px; padding: 9px 11px; }
  #coordinateValue { margin-left: 5px; }
  .minimap { width: 128px; right: 12px; bottom: 12px; padding: 9px; }
  .minimap.is-left { left: 12px; }
  .minimap svg { height: 70px; }
  .map-heading { font-size: 8px; margin-bottom: 7px; }
  .ready-dock { bottom: 140px; }
  .footer { height: 30px; font-size: 8px; gap: 12px; }
  .maze-page .site-nav { right: 12px; top: 10px; }
}
@media (max-height: 500px) and (min-width: 600px) {
  .topbar { height: 66px; padding-top: 8px; }
  .toolbar { height: 50px; display: flex; padding: 0; }
  .stats { padding-right: 170px; }
  .attempt-stat { display: none !important; }
  .tools { width: auto; margin-left: auto; }
  .minimap { width: 112px; bottom: 12px; }
  .minimap svg { height: 58px; }
  .ready-dock { bottom: 18px; }
  .overlay-card { padding: 16px 20px; }
  .overlay-card h2 { font-size: 26px; margin: 8px 0 6px; }
  .overlay-card p { font-size: 12px; margin-bottom: 12px; }
  .overlay-card .luma-action { height: 40px; }
  .overlay-card .sound-control { margin: 8px auto -4px; }
}
@media (max-width: 360px) {
  .stats { gap: 8px; }
  .brand img { display: none; }
  h1 { font-size: 18px; }
  .world-meta .divider, .world-meta span:last-child { display: none; }
  #coordinateValue { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
