:root {
  --bg: #06090f; --panel: #0e1420; --panel2: #141c2c; --line: #24314a;
  --fg: #d8e6ff; --muted: #7f93b8; --accent: #ffcc33; --red: #ff5a5a; --green: #5adf7a; --blue: #5ad1ff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: 'Courier New', monospace; }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); }
button { font-family: inherit; background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #201400; border-color: var(--accent); font-weight: bold; }
input { font-family: inherit; background: #0a0f18; color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; }
label { display: block; font-size: 11px; color: var(--muted); margin: 8px 0 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }

nav.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
nav.top .brand { font-weight: bold; letter-spacing: 0.08em; color: var(--accent); text-decoration: none; }
nav.top .nl { color: var(--muted); text-decoration: none; font-size: 13px; }
nav.top .nl.active, nav.top .nl:hover { color: var(--fg); }
nav.top .spacer { flex: 1; }
nav.top .who { font-size: 12px; color: var(--muted); }

main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 16px; }

#stage { position: relative; width: 384px; }
canvas { display: block; image-rendering: pixelated; background: #0e2a52; }

.screen { display: none; width: 384px; }
.screen.on { display: block; }

#title.screen.on { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#title h1 { color: var(--accent); font-size: 26px; letter-spacing: 0.1em; margin: 6px 0 0; text-align: center; }
#title .sub { color: var(--muted); font-size: 12px; text-align: center; }
#title canvas { border: 2px solid var(--line); }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-picker { display: flex; gap: 10px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.roster-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.roster-row .ready { color: var(--green); }
.roster-row .notready { color: var(--muted); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; width: 280px; }

.toast-wrap { position: fixed; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel2); border: 1px solid var(--accent); border-radius: 6px; padding: 8px 12px; font-size: 12px; max-width: 240px; }
.toast .t { font-weight: bold; color: var(--accent); }

#hud { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 2px; }
#hud .lives, #hud .loops { color: var(--blue); }
#hud .score { color: var(--accent); }

.overlay { position: absolute; inset: 0; background: rgba(3,6,12,0.88); color: var(--fg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; }
.overlay h2 { color: var(--accent); margin: 0; letter-spacing: 0.08em; }
.overlay table { font-size: 12px; border-collapse: collapse; }
.overlay td, .overlay th { padding: 2px 8px; text-align: right; }
.overlay th { color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ach { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ach.locked { opacity: 0.4; }
.ach .name { font-weight: bold; }
.ach .desc { font-size: 11px; color: var(--muted); }
