/* Zombies: the page (index.html). The 3D view fills the window; the game's own HUD (zombies.js) draws in #hud; the walk's
   thumb pad and key legend are Frame's share page's (del-tools, 2026-10-02); the menu (start, pause, game over) is a quiet
   dark panel over the view, like the HUD's pills. Phone first: 16 px side gutters, nothing wider than the screen. */
:root {
  color-scheme: dark;
  --bg: #14161f; --panel: rgba(16, 17, 24, .92); --line: rgba(255, 255, 255, .14); --text: #fff; --muted: rgba(255, 255, 255, .62);
  --field: rgba(255, 255, 255, .08); --accent: #d23c3c; --accent-2: #e5544f; --mine: rgba(210, 60, 60, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.4 var(--font); overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- the 3D view and what sits on it while you play */
.stage { position: fixed; inset: 0; overflow: hidden; background: #e9eaf0; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud .zb-over { display: none !important; }            /* game over is the page's (the menu below): wave, kills, the leaderboard */
.help { position: absolute; left: 50%; top: calc(54px + env(safe-area-inset-top)); transform: translateX(-50%); background: rgba(20, 22, 32, .72); color: #fff;
  font-size: 12px; padding: 6px 12px; border-radius: 16px; pointer-events: none; white-space: nowrap; transition: opacity .6s; max-width: calc(100% - 32px);
  overflow: hidden; text-overflow: ellipsis; }
.help.gone { opacity: 0; }
.pad { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: calc(18px + env(safe-area-inset-bottom)); width: 120px; height: 120px; border-radius: 50%;
  background: rgba(20, 22, 32, .28); border: 2px solid rgba(255, 255, 255, .55); touch-action: none; z-index: 2; }
.knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgba(255, 255, 255, .85); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); pointer-events: none; }
.keys { position: absolute; left: 12px; bottom: 12px; max-width: min(560px, calc(100% - 24px)); background: rgba(20, 22, 32, .62); color: #fff;
  font-size: 12px; line-height: 1.9; padding: 6px 10px; border-radius: 10px; pointer-events: none; z-index: 2; }
.keys span { white-space: nowrap; margin-right: 8px; } .keys b { margin-right: 6px; }
kbd { display: inline-block; min-width: 18px; padding: 0 4px; margin-right: 2px; border: 1px solid rgba(255, 255, 255, .55); border-bottom-width: 2px;
  border-radius: 4px; font: 600 11px/16px var(--font); text-align: center; background: rgba(255, 255, 255, .12); color: #fff; }
.keys .lockedonly { display: none; } .keys.locked .lockedonly { display: inline; } .keys.locked .unlocked { display: none; }
/* Menu, music, sit: top left on a computer; on a touch screen just above the thumb pad (the HUD's top pill is in the middle) */
.corner { position: absolute; left: max(12px, env(safe-area-inset-left)); top: calc(10px + env(safe-area-inset-top)); display: flex; gap: 6px; z-index: 3; }
.stage.touch .corner { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); left: max(18px, env(safe-area-inset-left)); }
.stage.dim .corner, .stage:not(.walking) .corner, .stage.dim .keys, .stage.dim .pad { display: none; }
.corner button { min-width: 40px; height: 36px; padding: 0 11px; border: 0; border-radius: 18px; background: rgba(16, 17, 24, .62); color: #fff; font-size: 13px;
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.corner #musicBtn { font-size: 17px; }
[data-act=music].off { text-decoration: line-through; color: var(--muted); }

/* ---- the menu: start screen, pause, game over */
.menu { position: fixed; inset: 0; z-index: 10; display: flex; justify-content: center; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box; background: rgba(8, 9, 13, .5); }
.menu[data-mode="start"] [data-show]:not([data-show~="start"]),
.menu[data-mode="paused"] [data-show]:not([data-show~="paused"]),
.menu[data-mode="over"] [data-show]:not([data-show~="over"]) { display: none !important; }
.panel { margin: auto 0; width: min(520px, 100%); box-sizing: border-box; padding: 22px 20px 16px; border-radius: 16px; background: var(--panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.1; letter-spacing: .01em; }
h2 { margin: 0; font-size: 15px; }
.sub { margin: 0 0 16px; color: var(--muted); }
.sub b { color: var(--text); font-weight: 600; }
.stats { margin: 4px 0 4px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.result { margin: 0 0 14px; min-height: 1.4em; color: var(--muted); }
.name { display: block; margin: 0 0 12px; }
.name span { display: block; margin-bottom: 5px; font-size: 13px; color: var(--muted); }
.name input { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field);
  color: var(--text); font: 16px/1.2 var(--font); outline: none; }
.name input:focus { border-color: rgba(255, 255, 255, .45); }
.name input::placeholder { color: rgba(255, 255, 255, .38); }
.actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.btn { display: block; width: 100%; padding: 13px 0; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 17px;
  font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .2); }
.btn.primary { background: var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.btn.save { background: #2f8a4c; }
.btn.save:hover:not(:disabled) { background: #369a56; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, .seg button:focus-visible, .link:focus-visible, .corner button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- the leaderboard */
.board { border-top: 1px solid var(--line); padding-top: 14px; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: rgba(255, 255, 255, .08); }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: rgba(255, 255, 255, .16); color: var(--text); }
.board ol { list-style: none; margin: 10px 0 0; padding: 0; }
.board li { display: grid; grid-template-columns: 2em minmax(0, 1fr) auto 5.6em; align-items: baseline; gap: 8px; padding: 5px 8px; border-radius: 8px;
  font-variant-numeric: tabular-nums; }
.board li:nth-child(odd) { background: rgba(255, 255, 255, .04); }
.board li.me { background: var(--mine); }
.board li.new { box-shadow: inset 0 0 0 1px rgba(255, 140, 140, .7); }
.board .rk { color: var(--muted); text-align: right; }
.board .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .v { font-weight: 700; text-align: right; }
.board .w { color: var(--muted); font-size: 13px; text-align: right; }
.board .note { margin: 10px 0 0; color: var(--muted); }
.how { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 14px; }
.how summary { cursor: pointer; color: var(--text); font-weight: 600; }
.how ul { margin: 8px 0; padding-left: 18px; }
.how li { margin: 4px 0; }
.how p { margin: 6px 0 0; }
.for-touch { display: none; }
@media (pointer: coarse) { .for-touch { display: block; } .for-mouse { display: none; } }
.foot { margin: 12px 0 0; text-align: right; }
.link { border: 0; background: none; padding: 4px 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.link.off { text-decoration: none; }
@media (max-width: 400px) {
  .panel { padding: 18px 14px 14px; }
  h1 { font-size: 26px; }
  .board li { grid-template-columns: 1.6em minmax(0, 1fr) auto 5em; gap: 6px; padding: 5px 6px; }
}
