/* Maze Escape. Every class is prefixed mz- so nothing leaks into the page shell. */
.mz { --mz-bg: #04060f; --mz-panel: #0b1328; --mz-line: #1c2b4a; --mz-text: #dfe9ff; --mz-muted: #8aa3c4; --mz-accent: #55d6ff; --mz-warm: #ffd166; --mz-pink: #ff6b81;
  display: flex; flex-direction: column; min-height: 0; color: var(--mz-text); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.mz-stage { position: relative; width: 100%; height: min(78vh, 680px); min-height: 380px; overflow: hidden; background: var(--mz-bg); border-radius: 12px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; outline: none; }
@media (max-width: 600px) { .mz-stage { height: auto; aspect-ratio: 4 / 5.6; max-height: 80vh; min-height: 0; } }
.stage.is-immersive .stage-body > .mz { min-height: 0; }
.stage.is-immersive .mz-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; border-radius: 0; }
.stage.is-immersive .mz-help { display: none; }
.mz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.mz [hidden] { display: none !important; }

.mz-hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px 34px; pointer-events: none;
  background: linear-gradient(rgba(4, 6, 15, 0.94), rgba(4, 6, 15, 0.7) 55%, rgba(4, 6, 15, 0)); }
.mz-hud > * { pointer-events: auto; }
.mz-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; pointer-events: none; }
.mz-name b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mz-name span { font-size: 13px; color: var(--mz-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mz-tools { display: flex; gap: 6px; flex: none; }
.mz-btn { flex: none; width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: 10px;
  border: 1px solid var(--mz-line); background: rgba(11, 19, 40, 0.86); color: var(--mz-text); cursor: pointer; font: inherit; }
.mz-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mz-btn:hover { border-color: var(--mz-accent); }
.mz-btn-wide { width: auto; min-width: 58px; padding: 0 10px; color: var(--mz-warm); }
.mz-btn-wide b { font-size: 15px; }
.mz-btn[disabled] { opacity: 0.4; cursor: default; }
.mz-btn[aria-pressed="true"] { color: var(--mz-muted); }
.mz-btn .mz-snd-off { display: none; }
.mz-btn[aria-pressed="true"] .mz-snd-on { display: none; }
.mz-btn[aria-pressed="true"] .mz-snd-off { display: inline; }
.mz-btn.is-on { border-color: var(--mz-accent); color: var(--mz-accent); }
@media (max-width: 520px) { .mz-wide-only { display: none; } }
.mz :is(button, [tabindex]):focus-visible { outline: 2px solid var(--mz-warm); outline-offset: 2px; }

.mz-status { position: absolute; left: 8px; top: 54px; display: flex; gap: 6px; align-items: center; pointer-events: none; flex-wrap: wrap; max-width: 70%; }
.mz-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 9px; border-radius: 999px; font-size: 12px; color: var(--mz-muted);
  background: rgba(11, 19, 40, 0.82); border: 1px solid var(--mz-line); }
.mz-keys i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; opacity: 0.35; }
.mz-keys i.is-held { opacity: 1; background: currentColor; box-shadow: 0 0 8px currentColor; }
.mz-floors { pointer-events: auto; padding: 2px 4px; gap: 2px; }
.mz-floors button { min-width: 40px; height: 40px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--mz-muted); font: 600 12px system-ui, sans-serif; cursor: pointer; }
.mz-floors button.is-view { border-color: var(--mz-accent); color: var(--mz-text); }
.mz-floors button.is-here::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 3px; border-radius: 50%; background: var(--mz-accent); vertical-align: middle; }

.mz-mini { position: absolute; left: 8px; bottom: 8px; border-radius: 8px; border: 1px solid var(--mz-line); background: rgba(4, 6, 15, 0.86); pointer-events: none; }

.mz-pad { position: absolute; right: 14px; bottom: 14px; width: 124px; height: 124px; touch-action: none; }
.mz-pad-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(85, 214, 255, 0.4); background: radial-gradient(circle, rgba(85, 214, 255, 0.10), rgba(11, 19, 40, 0.5)); }
.mz-pad-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(85, 214, 255, 0.5); border: 2px solid var(--mz-accent); pointer-events: none; }
.mz-stage.is-portrait .mz-pad { right: 50%; margin-right: -62px; bottom: 10px; }

.mz-toast { position: absolute; left: 50%; bottom: 18%; transform: translate(-50%, 8px); max-width: 86%; padding: 8px 14px; border-radius: 999px; font-size: 14px; text-align: center;
  background: rgba(11, 19, 40, 0.94); border: 1px solid var(--mz-line); color: var(--mz-text); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.mz-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.mz-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; background: rgba(4, 6, 15, 0.72); overflow: auto; }
.mz-overlay.is-clear { background: rgba(4, 6, 15, 0.5); }
.mz-panel { width: min(100%, 440px); max-height: 100%; overflow: auto; padding: 18px 18px 16px; border-radius: 16px; background: rgba(11, 19, 40, 0.96); border: 1px solid var(--mz-line);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6); text-align: center; }
.mz-panel.is-wide { width: min(100%, 560px); }
.mz-panel h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.1; letter-spacing: 0.01em; }
.mz-panel h2 em { font-style: normal; color: var(--mz-accent); }
.mz-panel p { margin: 6px 0 12px; color: var(--mz-muted); font-size: 14px; line-height: 1.45; }
.mz-panel p b { color: var(--mz-text); }
.mz-go { display: block; width: 100%; min-height: 52px; margin: 10px 0 8px; padding: 8px 14px; border: 0; border-radius: 12px; cursor: pointer; font: 700 18px system-ui, sans-serif; color: #04121c;
  background: linear-gradient(180deg, #7fe2ff, #37bfee); box-shadow: 0 6px 22px rgba(85, 214, 255, 0.3); }
.mz-go small { display: block; font-size: 12px; font-weight: 600; opacity: 0.75; }
.mz-go:hover { filter: brightness(1.08); }
.mz-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mz-alt { flex: 1 1 120px; min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--mz-line); background: rgba(255, 255, 255, 0.04); color: var(--mz-text); cursor: pointer; font: 600 14px system-ui, sans-serif; }
.mz-alt:hover { border-color: var(--mz-accent); }
.mz-alt small { display: block; font-size: 11px; font-weight: 500; color: var(--mz-muted); }
.mz-alt.is-on { border-color: var(--mz-accent); background: rgba(85, 214, 255, 0.14); color: #fff; }
.mz-alt[disabled] { opacity: 0.45; cursor: default; }
.mz-label { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mz-muted); text-align: left; }
.mz-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mz-pills .mz-alt { flex: none; min-height: 42px; padding: 4px 6px; font-size: 13px; }
.mz-pills.is-four { grid-template-columns: repeat(4, 1fr); }

.mz-chapter { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.mz-chapter .mz-btn { background: rgba(255, 255, 255, 0.04); }
.mz-chapter-name { flex: 1; min-width: 0; }
.mz-chapter-name b { display: block; font-size: 18px; }
.mz-chapter-name span { display: block; font-size: 12px; color: var(--mz-muted); }
.mz-levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.mz-level { min-height: 58px; padding: 4px 2px; border-radius: 10px; border: 1px solid var(--mz-line); background: rgba(255, 255, 255, 0.04); color: var(--mz-text); cursor: pointer; font: 700 17px system-ui, sans-serif; }
.mz-level:hover { border-color: var(--mz-accent); }
.mz-level.is-next { border-color: var(--mz-warm); box-shadow: 0 0 0 1px var(--mz-warm) inset; }
.mz-level small { display: block; margin-top: 2px; font-size: 12px; letter-spacing: 1px; color: var(--mz-warm); font-weight: 400; }
.mz-level small i { font-style: normal; color: #33466b; }

.mz-stars { display: flex; justify-content: center; gap: 10px; margin: 8px 0 4px; }
.mz-stars svg { width: 46px; height: 46px; fill: #22304f; stroke: #33466b; stroke-width: 1.2; }
.mz-stars svg.is-on { fill: var(--mz-warm); stroke: #fff2c4; filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.6)); animation: mz-pop 0.45s both; }
.mz-stars svg.is-on:nth-child(2) { animation-delay: 0.18s; }
.mz-stars svg.is-on:nth-child(3) { animation-delay: 0.36s; }
@keyframes mz-pop { from { transform: scale(0.2) rotate(-30deg); opacity: 0; } 70% { transform: scale(1.18); } to { transform: none; opacity: 1; } }
.mz-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 4px; }
.mz-facts div { padding: 7px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--mz-line); }
.mz-facts b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.mz-facts span { font-size: 11px; color: var(--mz-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.mz-how { margin: 8px 0 4px; padding: 0; list-style: none; text-align: left; font-size: 14px; line-height: 1.45; color: var(--mz-text); }
.mz-how li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; border-bottom: 1px solid rgba(28, 43, 74, 0.6); }
.mz-how li:last-child { border-bottom: 0; }
.mz-how i { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; color: #04121c; background: var(--mz-accent); }
.mz-how kbd, .mz-help kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid var(--mz-line); background: rgba(255, 255, 255, 0.06); font: 600 12px ui-monospace, Menlo, monospace; color: var(--mz-text); }

.mz-help { margin: 10px 2px 0; font-size: 13px; color: var(--mz-muted); text-align: center; line-height: 1.6; }
.mz-help-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .mz-help-kb { display: none; } .mz-help-touch { display: inline; } }
.mz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

@media (max-height: 460px) {
  .mz-panel { padding: 10px 14px; }
  .mz-panel h2 { font-size: 20px; }
  .mz-panel p { margin: 4px 0 6px; font-size: 13px; }
  .mz-go { min-height: 44px; margin: 6px 0; font-size: 16px; }
  .mz-stars svg { width: 34px; height: 34px; }
  .mz-level { min-height: 44px; }
  .mz-levels { grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 6px 0; }
  .mz-pills { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .mz-stars svg.is-on { animation: none; } .mz-toast { transition: none; } }
.mz-stage.is-short .mz-status { top: 9px; left: 50%; transform: translateX(-50%); flex-wrap: nowrap; max-width: 46%; }
.mz-stage.is-short #mz-kind { display: none; }
@media (min-width: 620px) {
  .mz-panel.is-wide .mz-pills { grid-template-columns: repeat(6, 1fr); }
  .mz-panel.is-wide .mz-pills.is-four { grid-template-columns: repeat(4, 1fr); }
  .mz-panel.is-wide .mz-levels { grid-template-columns: repeat(6, 1fr); }
}
.mz-stage:focus, .mz-stage:focus-visible { outline: none; }

/* narrow stages: one tidy row of chips under the HUD, and the tip sits clear of the thumb pad */
#mz-kind { display: inline-block; line-height: 22px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mz-stage.is-narrow.has-floors #mz-kind, .mz-stage.is-narrow.has-keys #mz-kind { display: none; }
.mz-stage.is-narrow .mz-status { max-width: 96%; flex-wrap: nowrap; }
.mz-stage.is-portrait.has-pad .mz-toast { bottom: 148px; }

.mz-stage.is-narrow .mz-label { margin: 8px 0 4px; }
.mz-stage.is-narrow .mz-pills .mz-alt { min-height: 40px; }

/* the site's "today's best" line on a daily result (filled in by the shell; hidden while empty) */
.mz-today { display: block; margin: -4px 0 8px; font-size: 13px; color: var(--mz-muted); text-align: center; }
.mz-today:empty { display: none; }
