@font-face { font-family: "Anton"; src: url("../fonts/Anton-Regular.ttf") format("truetype"); font-display: swap; }
:root { --ink: #f3f1ea; --bg: #07060a; --acid: #8dff1f; --purple: #8b3dff; --orange: #ff7a1a; --line: #2a2438; --muted: #8e89a3; --soft: #cfcbe0; --display: "Anton", Impact, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; overscroll-behavior: none; }
#css3d { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#club { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; outline: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--acid); }

/* HUD */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 12px clamp(12px, 2vw, 24px); background: linear-gradient(#07060acc, #07060a00); pointer-events: none; opacity: 0; transform: translateY(-12px); transition: opacity .8s .3s, transform .8s .3s; }
.hud.show { opacity: 1; transform: none; }
.hud > * { pointer-events: auto; }
.brand { font: 400 1.5rem/1 var(--display); letter-spacing: .02em; color: var(--acid); text-decoration: none; flex: none; text-shadow: 0 0 14px #8dff1f66; }
.help { position: fixed; left: clamp(12px, 2vw, 24px); bottom: 14px; z-index: 9; font: .72rem/1.4 var(--mono); color: var(--muted); letter-spacing: .04em; padding: 8px 12px; background: #07060acc; border: 1px solid var(--line); pointer-events: none; opacity: 0; transition: opacity .8s 1s; }
.help b { color: var(--acid); font-weight: 600; }
body.ready .hud.show ~ .help { opacity: 1; }
.steps { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9; display: flex; gap: 8px; opacity: 0; transition: opacity .8s 1s; }
body.ready .hud.show ~ .steps { opacity: 1; }
.steps button { width: 46px; height: 40px; background: #0b0912cc; border: 1px solid var(--line); color: var(--ink); font-size: .9rem; backdrop-filter: blur(6px); transition: border-color .2s, color .2s; }
.steps button:hover { border-color: var(--acid); color: var(--acid); }
.tip { position: fixed; left: 0; top: 0; z-index: 12; max-width: 340px; padding: 7px 11px; font: .78rem/1.35 var(--mono); color: var(--ink); background: #07060af2; border: 1px solid var(--acid); box-shadow: 4px 4px 0 var(--purple); pointer-events: none; opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }

/* ZombAI panel */
.panel { position: fixed; right: clamp(12px, 2vw, 24px); top: 76px; z-index: 11; width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 120px); overflow: auto; padding: 22px 22px 18px; background: #0b0912f5; border: 1px solid var(--acid); box-shadow: 8px 8px 0 var(--purple); }
.panel[hidden] { display: none; }
.panel h2 { margin: 0 0 10px; font: 400 2rem/1 var(--display); text-transform: uppercase; }
.panel h2 em { font-style: normal; color: var(--acid); }
.panel p { margin: 0 0 12px; color: var(--soft); font-size: .92rem; line-height: 1.5; }
.panel .small { font: .74rem var(--mono); color: var(--muted); margin: 12px 0 0; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li { padding: 9px 0; border-top: 1px solid var(--line); font-size: .86rem; color: var(--soft); line-height: 1.4; }
.panel li b { display: inline-block; min-width: 92px; font: 600 .66rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.panel li.ok b { color: var(--acid); } .panel li.now b { color: var(--orange); }
#panel-x { position: absolute; right: 8px; top: 6px; background: none; border: 0; font-size: 1.6rem; color: var(--muted); }
#panel-x:hover { color: var(--ink); }

/* intro */
.intro { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 24px; background: radial-gradient(90% 80% at 50% 40%, #1a0f33cc, #07060af2 70%); transition: opacity .9s, transform .9s; }
.intro.gone { opacity: 0; transform: scale(1.06); pointer-events: none; }
.intro[hidden] { display: none; }
.intro img { width: min(420px, 62vw); height: auto; filter: drop-shadow(0 0 30px #8b3dff66); animation: bob 6s ease-in-out infinite; }
.intro h1 { margin: 6px 0 0; font: 400 clamp(2.6rem, 8vw, 5.4rem)/.92 var(--display); text-transform: uppercase; }
.intro h1 em { font-style: normal; color: var(--acid); text-shadow: 0 0 22px #8dff1f77; }
.intro p { margin: 0; max-width: 520px; color: var(--soft); line-height: 1.5; }
.intro small { color: var(--muted); font: .72rem var(--mono); letter-spacing: .06em; }
#enter { margin-top: 10px; font: 700 .9rem/1 var(--mono); letter-spacing: .12em; padding: 0 30px; min-height: 52px; background: var(--acid); color: #07060a; border: 0; box-shadow: 6px 6px 0 var(--purple); transition: transform .15s, box-shadow .15s, opacity .3s; }
#enter:disabled { opacity: .45; cursor: wait; box-shadow: none; }
#enter:not(:disabled):hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 var(--purple); }
.loadbar { width: min(320px, 70vw); height: 4px; background: var(--line); }
.loadbar i { display: block; height: 100%; width: 0; background: var(--acid); transition: width .3s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

.nogl { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; text-align: center; padding: 24px; background: var(--bg); }
.nogl[hidden] { display: none; }
.sr-list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.nogl:not([hidden]) ~ .sr-list { position: static; width: auto; height: auto; clip-path: none; overflow: auto; padding: 24px; background: var(--bg); position: relative; z-index: 41; }
.ns { position: fixed; top: 0; left: 0; right: 0; z-index: 50; margin: 0; padding: 16px; background: #1a1428; }

@media (max-width: 800px) {
  .brand { font-size: 1.15rem; } .hud { flex-wrap: wrap; gap: 6px 10px; }
  .help { display: none; } .steps { left: auto; right: 12px; transform: none; flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
  .vol { order: 4; flex: 1 1 100%; margin: 0; } .vol input { flex: 1; width: auto; }
  .panel { top: auto; bottom: 70px; }
}
@media (prefers-reduced-motion: reduce) { .intro img { animation: none; } .intro, .hud { transition: none; } }

#cross { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; z-index: 8; pointer-events: none; display: none; }
#cross::before, #cross::after { content: ""; position: absolute; background: #f3f1ea; box-shadow: 0 0 0 1px #07060a; }
#cross::before { left: 10px; top: 0; width: 2px; height: 22px; } #cross::after { top: 10px; left: 0; height: 2px; width: 22px; }
body.locked #cross { display: block; }
body.locked .hud, body.locked .steps { opacity: .35; }
.lockhint { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 9; padding: 10px 18px; font: 600 .78rem/1 var(--mono); letter-spacing: .06em; color: #07060a; background: var(--acid); box-shadow: 5px 5px 0 var(--purple); pointer-events: none; display: none; animation: bob 2.4s ease-in-out infinite; }
.lockhint b { font-weight: 800; }
body.entered:not(.locked):not(.nolock):not(.touch) .lockhint { display: block; }
body.entered:not(.locked):not(.nolock):not(.touch) .steps { display: none; }
body.touch .steps { left: auto; right: 12px; transform: none; }
body.touch .help, body.nolock .help { display: none; }

body.locked .steps { display: none; }

body.locked #club { cursor: none !important; }   /* the mouse hides only while it is locked to the view */

body.leaving { opacity: 0; transition: opacity .35s ease; }

/* "Places" buttons: touch screens only (desktop walks with the mouse and keys) */
.zones { display: none; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
body.touch .zones { display: flex; }
.zones button { font: 600 .62rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 0 9px; min-height: 32px; background: #0b0912cc; border: 1px solid var(--line); color: var(--muted); backdrop-filter: blur(6px); }
.zones button.on { color: #07060a; background: var(--acid); border-color: var(--acid); }

/* ===== X card / embed mode (480 x 480): only the scene, a tiny link, and the music controls on the wall ===== */
html.embed .hud, html.embed .help, html.embed .steps, html.embed .lockhint, html.embed #cross, html.embed .panel, html.embed .zones { display: none !important; }
html.embed #intro { background: #07060a; }
#openfull { display: none; }
html.embed #openfull { display: block; position: fixed; right: 8px; bottom: 8px; z-index: 30; padding: 8px 12px; font: 700 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: #07060a; background: var(--acid); box-shadow: 3px 3px 0 var(--purple); }
html.embed #openfull:hover, html.embed #openfull:focus-visible { background: #fff; }
html.embed .tip { max-width: 70vw; font-size: .66rem; }
@media (max-width: 520px) { html.embed .tip { display: none; } }

/* map (M) + memory counter (T) */
.map { position: fixed; left: clamp(12px, 2vw, 24px); top: 60px; z-index: 8; border: 1px solid var(--line); background: #07060acc; pointer-events: none; }
.map.hide, .stats.hide { display: none; } .map canvas { display: block; width: 340px; }
body.locked .map { opacity: .85; }
.stats { position: fixed; left: clamp(12px, 2vw, 24px); bottom: 54px; z-index: 9; font: .7rem var(--mono); color: var(--acid); background: #07060acc; border: 1px solid var(--line); padding: 6px 10px; pointer-events: none; }
html.embed .map, html.embed .stats { display: none !important; }
@media (max-width: 800px) { .map { transform: scale(.6); transform-origin: top left; top: 84px; } }

/* v7: search box for the RECORDS panel (a real input, so phones get their keyboard) */
.searchbox{position:fixed;z-index:60;left:50%;top:14%;transform:translateX(-50%);width:min(560px,92vw);padding:14px 16px 16px;background:rgba(10,7,18,.96);border:2px solid #8dff1f;box-shadow:0 0 40px rgba(141,255,31,.25);font-family:ui-monospace,Menlo,monospace}
.searchbox[hidden]{display:none}
.searchbox label{display:block;color:#8dff1f;font:22px Anton,Impact,sans-serif;letter-spacing:.04em;margin-bottom:8px}
.searchbox label em{font:12px ui-monospace,Menlo,monospace;color:#8e89a3;font-style:normal;margin-left:8px;letter-spacing:0}
.searchbox div{display:flex;gap:8px}
.searchbox input{flex:1;min-width:0;background:#120d20;border:2px solid #3a3158;color:#f3f1ea;font:20px ui-monospace,Menlo,monospace;padding:10px 12px;outline:none}
.searchbox input:focus{border-color:#8dff1f}
.searchbox button{background:#120d20;border:2px solid #3a3158;color:#f3f1ea;font:22px ui-monospace,Menlo,monospace;width:46px;cursor:pointer}
.searchbox button:hover{border-color:#ff7a1a;color:#ff7a1a}
