:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --surface2: #18181b;
  --border: #27272a;
  --text: #fafafa;
  --muted: #71717a;
  --accent: #22c55e;
  --accent-dim: #15803d;
  --accent-glow: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --yellow: #eab308;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar: 220px;
  --help-rail: 280px;
}

[data-theme^="aurora"] {
  --accent: var(--aurora-accent, #c084fc);
  --accent-dim: var(--aurora-accent-dim, #7c3aed);
  --accent-glow: var(--aurora-accent-glow, rgba(192, 132, 252, 0.22));
}

[data-theme="aurora"] {
  --aurora-accent: #c084fc;
  --aurora-accent-dim: #7c3aed;
  --aurora-accent-glow: rgba(192, 132, 252, 0.22);
  --aurora-btn: linear-gradient(135deg, #22c55e, #06b6d4, #a855f7, #f43f5e, #f59e0b);
  --aurora-text: linear-gradient(90deg, #4ade80, #22d3ee, #c084fc, #fb7185);
  --aurora-status: linear-gradient(90deg, #4ade80, #22d3ee, #c084fc);
  --aurora-glow-1: rgba(34, 197, 94, 0.12);
  --aurora-glow-2: rgba(6, 182, 212, 0.1);
  --aurora-glow-3: rgba(168, 85, 247, 0.12);
  --aurora-glow-4: rgba(244, 63, 94, 0.08);
}

[data-theme="aurora-cosmic"] {
  --aurora-accent: #a78bfa;
  --aurora-accent-dim: #6d28d9;
  --aurora-accent-glow: rgba(167, 139, 250, 0.24);
  --aurora-btn: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7, #ec4899, #818cf8);
  --aurora-text: linear-gradient(90deg, #818cf8, #c084fc, #f472b6, #a78bfa);
  --aurora-status: linear-gradient(90deg, #818cf8, #c084fc, #f472b6);
  --aurora-glow-1: rgba(99, 102, 241, 0.14);
  --aurora-glow-2: rgba(168, 85, 247, 0.12);
  --aurora-glow-3: rgba(236, 72, 153, 0.1);
  --aurora-glow-4: rgba(129, 140, 248, 0.1);
}

[data-theme="aurora-solar"] {
  --aurora-accent: #fbbf24;
  --aurora-accent-dim: #d97706;
  --aurora-accent-glow: rgba(251, 191, 36, 0.22);
  --aurora-btn: linear-gradient(135deg, #fde047, #fbbf24, #f97316, #ef4444, #fb923c);
  --aurora-text: linear-gradient(90deg, #fde047, #fbbf24, #fb923c, #f87171);
  --aurora-status: linear-gradient(90deg, #fbbf24, #fb923c, #f87171);
  --aurora-glow-1: rgba(251, 191, 36, 0.14);
  --aurora-glow-2: rgba(249, 115, 22, 0.12);
  --aurora-glow-3: rgba(239, 68, 68, 0.1);
  --aurora-glow-4: rgba(253, 224, 71, 0.08);
}

[data-theme="aurora-arctic"] {
  --aurora-accent: #67e8f9;
  --aurora-accent-dim: #0891b2;
  --aurora-accent-glow: rgba(103, 232, 249, 0.22);
  --aurora-btn: linear-gradient(135deg, #a5f3fc, #67e8f9, #22d3ee, #38bdf8, #06b6d4);
  --aurora-text: linear-gradient(90deg, #a5f3fc, #67e8f9, #22d3ee, #7dd3fc);
  --aurora-status: linear-gradient(90deg, #67e8f9, #22d3ee, #7dd3fc);
  --aurora-glow-1: rgba(103, 232, 249, 0.14);
  --aurora-glow-2: rgba(34, 211, 238, 0.12);
  --aurora-glow-3: rgba(56, 189, 248, 0.1);
  --aurora-glow-4: rgba(165, 243, 252, 0.08);
}

[data-theme="aurora-void"] {
  --aurora-accent: #8b5cf6;
  --aurora-accent-dim: #5b21b6;
  --aurora-accent-glow: rgba(139, 92, 246, 0.26);
  --aurora-btn: linear-gradient(135deg, #312e81, #6d28d9, #7c3aed, #06b6d4, #581c87);
  --aurora-text: linear-gradient(90deg, #a78bfa, #7c3aed, #22d3ee, #c084fc);
  --aurora-status: linear-gradient(90deg, #8b5cf6, #22d3ee, #c084fc);
  --aurora-glow-1: rgba(88, 28, 135, 0.16);
  --aurora-glow-2: rgba(124, 58, 237, 0.12);
  --aurora-glow-3: rgba(6, 182, 212, 0.08);
  --aurora-glow-4: rgba(49, 46, 129, 0.14);
}

[data-theme="aurora-synth"] {
  --aurora-accent: #f472b6;
  --aurora-accent-dim: #db2777;
  --aurora-accent-glow: rgba(244, 114, 182, 0.24);
  --aurora-btn: linear-gradient(135deg, #f472b6, #ec4899, #a855f7, #22d3ee, #06b6d4);
  --aurora-text: linear-gradient(90deg, #f472b6, #c084fc, #22d3ee, #67e8f9);
  --aurora-status: linear-gradient(90deg, #f472b6, #a855f7, #22d3ee);
  --aurora-glow-1: rgba(244, 114, 182, 0.12);
  --aurora-glow-2: rgba(168, 85, 247, 0.12);
  --aurora-glow-3: rgba(34, 211, 238, 0.1);
  --aurora-glow-4: rgba(236, 72, 153, 0.08);
}

[data-theme="aurora-emerald"] {
  --aurora-accent: #4ade80;
  --aurora-accent-dim: #059669;
  --aurora-accent-glow: rgba(74, 222, 128, 0.22);
  --aurora-btn: linear-gradient(135deg, #6ee7b7, #4ade80, #10b981, #14b8a6, #059669);
  --aurora-text: linear-gradient(90deg, #6ee7b7, #4ade80, #2dd4bf, #34d399);
  --aurora-status: linear-gradient(90deg, #4ade80, #2dd4bf, #6ee7b7);
  --aurora-glow-1: rgba(74, 222, 128, 0.14);
  --aurora-glow-2: rgba(16, 185, 129, 0.12);
  --aurora-glow-3: rgba(45, 212, 191, 0.1);
  --aurora-glow-4: rgba(110, 231, 183, 0.08);
}

[data-theme="aurora-blood"] {
  --aurora-accent: #fb7185;
  --aurora-accent-dim: #be123c;
  --aurora-accent-glow: rgba(251, 113, 133, 0.24);
  --aurora-btn: linear-gradient(135deg, #fca5a5, #f87171, #ef4444, #7c3aed, #991b1b);
  --aurora-text: linear-gradient(90deg, #fca5a5, #fb7185, #c084fc, #f87171);
  --aurora-status: linear-gradient(90deg, #fb7185, #ef4444, #c084fc);
  --aurora-glow-1: rgba(239, 68, 68, 0.12);
  --aurora-glow-2: rgba(251, 113, 133, 0.12);
  --aurora-glow-3: rgba(124, 58, 237, 0.1);
  --aurora-glow-4: rgba(153, 27, 27, 0.1);
}

html[data-theme^="aurora"] body {
  background: var(--bg);
  overflow-x: hidden;
}
html[data-theme^="aurora"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background:
    radial-gradient(ellipse 80% 50% at 10% 40%, var(--aurora-glow-1), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 20%, var(--aurora-glow-2), transparent 50%),
    radial-gradient(ellipse 65% 50% at 55% 90%, var(--aurora-glow-3), transparent 55%),
    radial-gradient(ellipse 50% 40% at 75% 55%, var(--aurora-glow-4), transparent 45%);
  animation: auroraPulse 14s ease-in-out infinite alternate;
}
html[data-theme^="aurora"] .cmd-btn.primary,
html[data-theme^="aurora"] .online-dot,
html[data-theme^="aurora"] .boot-bar-fill {
  background: var(--aurora-btn);
  background-size: 300% 300%;
  animation: auroraFlow 9s ease infinite;
  border-color: transparent;
  color: #fff;
}
html[data-theme^="aurora"] .prompt,
html[data-theme^="aurora"] .game-menu-title,
html[data-theme^="aurora"] .help-rail-title,
html[data-theme^="aurora"] .hero-name,
html[data-theme^="aurora"] .sidebar-title {
  background: var(--aurora-text);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: auroraFlow 8s linear infinite;
}
html[data-theme^="aurora"] .status-msg {
  background: var(--aurora-status);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes auroraPulse {
  0% { opacity: 0.4; }
  100% { opacity: 0.6; }
}
@keyframes auroraFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--accent-glow); color: var(--accent); }

/* ── Boot ── */
.boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  transition: opacity 0.4s, visibility 0.4s;
}

.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }

.boot-art {
  font-family: var(--mono);
  font-size: clamp(0.55rem, 2vw, 0.75rem);
  color: var(--accent);
  margin-bottom: 24px;
  line-height: 1.4;
}

.boot-log {
  width: min(520px, 100%);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 160px;
}

.boot-log .ok { color: var(--accent); }
.boot-log .line { margin-bottom: 6px; }

.boot-progress {
  width: min(520px, 100%);
  height: 2px;
  background: var(--border);
  margin-top: 20px;
}

.boot-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.15s linear;
}

.boot-skip {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  opacity: 0.6;
  animation: fadePulse 2s ease-in-out infinite;
}

@keyframes fadePulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.9; } }

/* ── Effects ── */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, #fff 2px, #fff 4px);
}

.progress-top {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 200;
  transition: width 0.08s linear;
}

/* ── Layout ── */
.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s var(--ease);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--accent); }
.sidebar-title { margin-left: 4px; }

.tree { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.tree-icon { font-size: 0.6rem; opacity: 0.5; }
.tree-item:hover { background: var(--surface2); color: var(--text); }
.tree-item.active { background: var(--accent-glow); color: var(--accent); }
.tree-item.active .tree-icon { opacity: 1; color: var(--accent); }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-btn {
  flex: 1 1 calc(50% - 8px);
  min-width: 72px;
  padding: 6px;
  font-family: var(--mono);
  font-size: 0.65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}

.mini-btn:hover { border-color: var(--accent); color: var(--accent); }

.menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.main {
  margin-left: var(--sidebar);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-right 0.3s var(--ease);
}

body.help-open .main { margin-right: var(--help-rail); }

/* ── Help rail (right) ── */
.help-rail {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: var(--help-rail);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 46;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
}
body.help-open .help-rail { transform: translateX(0); }

.help-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  flex-shrink: 0;
}
.help-rail-title { color: var(--accent); }

.help-rail-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1;
  padding: 2px 6px;
}
.help-rail-close:hover { color: var(--text); }

.help-search {
  margin: 10px 12px 0;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.68rem;
  outline: none;
  flex-shrink: 0;
}
.help-search:focus { border-color: var(--accent); }

.help-ref {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  min-height: 0;
  border-bottom: 1px solid var(--border);
}

.help-cmd-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.help-cmd-item:hover { background: var(--surface2); border-color: var(--border); }
.help-cmd-item.active { background: var(--accent-glow); border-color: var(--accent); }
.help-cmd-item.hidden { display: none; }

.help-cmd-name {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
}
.help-cmd-desc {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
}
.help-cmd-resp {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--muted);
  opacity: 0.75;
}

.help-log-head {
  padding: 8px 14px 4px;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.help-log {
  flex: 0 0 38%;
  min-height: 120px;
  max-height: 42vh;
  overflow-y: auto;
  padding: 6px 12px 12px;
  font-family: var(--mono);
  font-size: 0.65rem;
}

.help-entry {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.help-entry-cmd {
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 0.68rem;
}
.help-entry-out {
  color: var(--muted);
  margin: 2px 0 0;
  line-height: 1.45;
  word-break: break-word;
}
.help-entry-out.err { color: var(--red); }

.help-fab {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
body:not(.help-open) .help-fab { display: block; }

.dock-stack {
  position: fixed;
  bottom: 50px;
  right: 16px;
  z-index: 47;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transition: right 0.3s var(--ease);
}
body.help-open .dock-stack { right: calc(var(--help-rail) + 16px); }

/* ── Statusbar ── */
.statusbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(10, 10, 11, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  font-family: var(--mono);
  font-size: 0.72rem;
  flex-wrap: wrap;
  gap: 8px;
}

.status-left, .status-right, .status-center { display: flex; align-items: center; gap: 10px; }
.status-center {
  flex: 1;
  justify-content: center;
  min-width: 0;
  padding: 0 12px;
}
.quote-of-day {
  font-style: normal;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(420px, 42vw);
  quotes: '\201C' '\201D';
}
.quote-of-day::before { content: open-quote; color: var(--accent); opacity: 0.7; }
.quote-of-day::after { content: close-quote; color: var(--accent); opacity: 0.7; }
.dim { color: var(--muted); }
.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: ping 2s ease-in-out infinite;
}

@keyframes ping {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 4px transparent; }
}

.status-msg { color: var(--accent); }

/* ── Content ── */
.content { flex: 1; padding: 24px; padding-bottom: 80px; max-width: 820px; width: 100%; }

.pane {
  margin-bottom: 48px;
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.pane.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.pane.reveal.show { opacity: 1; transform: none; }

/* ── Window ── */
.window {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.window-bar button {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1;
}

.window-body { padding: 24px; }

/* ── Hero ── */
.prompt-line {
  font-family: var(--mono);
  font-size: 0.8rem;
  margin-bottom: 20px;
  color: var(--muted);
}

.prompt { color: var(--accent); }
.path { color: #60a5fa; }

.cursor-blink { animation: blink 1s step-end infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.hero-name {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 20px;
  min-height: 1.5em;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
}

.cmd-row { display: flex; flex-wrap: wrap; gap: 10px; }

.cmd-btn {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.cmd-btn:hover { border-color: var(--accent); color: var(--accent); }
.cmd-btn.primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.cmd-btn.primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stat {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.stat span { display: block; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat strong { font-size: 0.85rem; }
.stat .green { color: var(--accent); }

/* ── Code blocks ── */
.code-block, .env-block {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.code-block .k { color: var(--accent); }
.code-block .c { color: var(--muted); opacity: 0.6; }

.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.mini-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}

.mini-card h3 { font-size: 0.9rem; margin-bottom: 6px; }
.mini-card p { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
.mini-card a { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }
.link-pair { display: flex; gap: 12px; }
.link-pair a { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }

/* ── Proton referral ── */
.proton-offer {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
}
.proton-offer-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.proton-offer-title {
  font-size: 1.35rem;
  margin-bottom: 8px;
  line-height: 1.2;
}
.proton-offer-sub {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 14px;
  line-height: 1.55;
}
.proton-section-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin: 18px 0 12px;
}
.proton-cards { margin-bottom: 16px; }
.proton-perks {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.proton-perks li {
  font-size: 0.84rem;
  color: var(--muted);
  padding-left: 1.1em;
  position: relative;
  line-height: 1.45;
}
.proton-perks li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}
.proton-perks strong { color: var(--text); font-weight: 600; }

/* ── Skills ── */
.skill-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

.skill-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.skill-head strong { color: var(--accent); }

.skill-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.skill-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s var(--ease);
}

.skill.done .skill-bar i { width: calc(var(--v) * 1%); }

.tool-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tool-cloud span {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
}

/* ── Spec table ── */
.spec-table { width: 100%; font-family: var(--mono); font-size: 0.78rem; border-collapse: collapse; }
.spec-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.spec-table td:first-child { color: var(--accent); width: 72px; white-space: nowrap; }
.spec-table td:last-child { width: 80px; }
.spec-table.spec-plain td:last-child { width: auto; }

.rig-summary {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 20px;
  white-space: pre-wrap;
}
.rig-summary .k { color: var(--accent); }

.rig-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.rig-section { min-width: 0; }
.rig-wide { grid-column: 1 / -1; }
.rig-head {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.spec-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.spec-tag.upgrade {
  color: var(--yellow);
  border: 1px solid rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.1);
}
.rig-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}
.rig-foot strong { color: var(--text); }
.rig-foot .green { color: var(--accent); }

@media (max-width: 600px) {
  .rig-grid { grid-template-columns: 1fr; }
}

.bar-mini {
  display: block;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.bar-mini::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--accent);
  transition: width 1s var(--ease);
}

.bar-mini.done::after { width: calc(var(--v) * 1%); }

/* ── File list ── */
.file-list { font-family: var(--mono); font-size: 0.78rem; }

.file-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.file-item .name { color: var(--text); }
.file-item.active .name { color: var(--accent); }
.file-item .meta { font-size: 0.68rem; }
.file-item.active .meta { color: var(--accent); }

/* ── Links ── */
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.link-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.link-card:hover { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }

/* ── Footer ── */
.footbar {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Prompt bar ── */
.prompt-bar {
  position: fixed;
  bottom: 0;
  left: var(--sidebar);
  right: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.78rem;
  transition: right 0.3s var(--ease);
}
body.help-open .prompt-bar { right: var(--help-rail); }

.prompt-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* ── Music dock (bottom right) ── */
.music-dock {
  transition: opacity 0.2s;
}
.music-dock-shell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: rgba(17, 17, 19, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.music-dock-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.music-dock-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.music-dock.collapsed .music-dock-inner { display: none; }
.music-dock.collapsed .music-dock-shell { padding: 6px; }
.music-dock-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(420px, calc(100vw - var(--sidebar) - 80px));
}
.music-dock.off { opacity: 0.72; }
.music-dock.off .music-now-title { color: var(--muted); }
.music-ctrl {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.music-ctrl:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.music-now {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.music-now-kicker {
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.music-now-title {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-vol-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.music-vol-icon {
  font-size: 0.75rem;
  color: var(--muted);
}
.music-vol {
  width: 72px;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.yt-player-host {
  position: fixed;
  width: 320px;
  height: 180px;
  left: 0;
  bottom: 0;
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.yt-player-host iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Palette & Help ── */
.palette, .help-panel {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  max-width: 480px;
  width: calc(100% - 32px);
}

.palette::backdrop, .help-panel::backdrop { background: rgba(0,0,0,0.6); }

.palette-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.palette-head kbd {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.6rem;
}

#paletteInput {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
}

#paletteList {
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
}

#paletteList li {
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
}

#paletteList li:hover, #paletteList li.active { background: var(--accent-glow); color: var(--accent); }
#paletteList li.hidden { display: none; }

/* ── Theme picker ── */
.theme-picker {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  max-width: min(720px, 96vw);
  max-height: 88vh;
  width: 100%;
}
.theme-picker:not([open]) {
  display: none;
}
.theme-picker[open] {
  display: flex;
  flex-direction: column;
}
.theme-picker::backdrop { background: rgba(0, 0, 0, 0.65); }
.theme-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.theme-picker-head span { color: var(--accent); }
.theme-picker-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1;
  padding: 2px 6px;
}
.theme-picker-close:hover { color: var(--text); }
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
  max-height: min(58vh, 520px);
  scrollbar-width: thin;
}
.theme-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  text-align: left;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s, transform 0.12s;
}
.theme-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }
.theme-card.locked { opacity: 0.72; cursor: help; }
.theme-card.locked:hover { transform: none; }
.theme-card.rare.active { border-color: #c084fc; box-shadow: 0 0 12px rgba(192, 132, 252, 0.25); }
.theme-swatch {
  display: block;
  height: 32px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.theme-swatch.animated {
  background-size: 300% 300%;
  animation: auroraFlow 8s ease infinite;
}
.theme-swatch.mystery {
  background: linear-gradient(135deg, #18181b, #27272a, #18181b);
  position: relative;
  overflow: hidden;
}
.theme-swatch.mystery::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--muted);
}
.theme-name {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text);
  line-height: 1.3;
}
.theme-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.theme-dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
.theme-badge {
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c084fc;
  align-self: flex-start;
  padding: 2px 6px;
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 4px;
}
.theme-picker-foot {
  padding: 0 16px 14px;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.6;
}
.theme-picker-foot kbd {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.58rem;
}

.help-text {
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.8;
  color: var(--muted);
  white-space: pre-wrap;
}

/* ── Games ── */
.win-note { font-size: 0.6rem; opacity: 0.6; }

.games-body {
  padding: 16px;
  min-width: 0;
}

.games-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.game-menu {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.game-menu-active {
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-glow);
  font-family: var(--mono);
}
.game-menu-kicker {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.game-menu-title {
  display: block;
  font-size: 1rem;
  color: var(--accent);
  line-height: 1.2;
}
.game-menu-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: lowercase;
}

.game-category {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  overflow: hidden;
}
.game-category.has-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.game-category-title {
  margin: 0;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.game-menu-list {
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 4px;
}
.game-menu-item {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.game-menu-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.game-menu-item.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.game-stage {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.12);
  padding: 16px 12px;
  box-sizing: border-box;
}

.game-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.game-panel.active { display: flex; }

.game-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.game-info strong { color: var(--accent); }
.game-state { color: var(--yellow); }

.canvas-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #060607;
  line-height: 0;
}

#snakeCanvas {
  display: block;
  width: 320px;
  max-width: 78vw;
  height: auto;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  touch-action: none;
}

/* dpad (mobile) */
.dpad { display: none; flex-direction: column; align-items: center; gap: 6px; }
.dpad-mid { display: flex; gap: 6px; }
.dpad button {
  width: 48px;
  height: 48px;
  font-size: 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
.dpad button:active { border-color: var(--accent); color: var(--accent); }

.game-hint {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-align: center;
}

/* reaction */
.react-box {
  width: 100%;
  max-width: 360px;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  transition: background 0.05s, color 0.05s;
  user-select: none;
}
.react-box[data-state="wait"] { background: #7f1d1d; color: #fecaca; }
.react-box[data-state="go"] { background: var(--accent); color: #04140a; font-weight: 600; }
.react-box[data-state="result"] { background: var(--surface2); color: var(--accent); }
.react-box[data-state="early"] { background: #78350f; color: #fde68a; }

/* typing */
.game-panel[data-game="typing"] {
  width: 100%;
  max-width: min(640px, 100%);
  align-self: center;
  padding: 0 8px;
  box-sizing: border-box;
}

.type-modes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.mode-btn {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 5px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { border-color: var(--accent); color: var(--accent); }

.type-target-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
}

.type-target {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  width: 100%;
  max-width: 100%;
  min-height: 72px;
  max-height: 180px;
  overflow-x: hidden;
  overflow-y: auto;
  letter-spacing: 0.02em;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: normal;
  margin: 0;
}
.type-target.mode-rush {
  max-height: 220px;
  font-size: 0.8rem;
}
.type-target .type-word {
  display: inline;
  white-space: nowrap;
}
.type-target .type-space {
  white-space: pre-wrap;
}
.type-target .ok { color: var(--accent); }
.type-target .bad { color: var(--red); background: rgba(239,68,68,0.12); border-radius: 2px; }
.type-target .cur { background: var(--accent-glow); border-radius: 2px; box-shadow: inset 0 -2px 0 var(--accent); }

.type-input {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
}
.type-input:focus { border-color: var(--accent); }
.type-input:disabled { opacity: 0.5; }

.type-rush-stats strong { color: var(--accent); }
.game-panel[data-game="typing"].mode-rush .diff-row { opacity: 0.35; pointer-events: none; }

/* typing difficulty */
.diff-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.diff-btn {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 5px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}
.diff-btn:hover { color: var(--text); }
.diff-btn.active { border-color: var(--accent); color: var(--accent); }

/* aim trainer */
.aim-area {
  position: relative;
  width: 360px;
  max-width: 80vw;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
}
.aim-target {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translate(-50%, -50%) scale(0);
  animation: aimPop 0.12s var(--ease) forwards;
  cursor: pointer;
}
@keyframes aimPop { to { transform: translate(-50%, -50%) scale(1); } }

/* hi-lo */
.hilo-input {
  width: 100%;
  max-width: 200px;
  padding: 12px 14px;
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  outline: none;
}
.hilo-input:focus { border-color: var(--accent); }

/* tic-tac-toe */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 260px;
  max-width: 78vw;
  aspect-ratio: 1 / 1;
}
.ttt-cell {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.ttt-cell:hover:not(:disabled) { border-color: var(--accent); }
.ttt-cell.x { color: var(--accent); }
.ttt-cell.o { color: #60a5fa; }
.ttt-cell.win { background: var(--accent-glow); border-color: var(--accent); }
.ttt-cell:disabled { cursor: default; }

/* matrix overlay */
.matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: #000;
  pointer-events: auto;
}

/* ── Casino (shared) ── */
.js-balance { color: var(--accent); }

.bet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.bet-label { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.bet-input {
  width: 90px;
  padding: 8px 10px;
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
}
.bet-input:focus { border-color: var(--accent); }

.bet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 320px;
}
.bet-btn {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 9px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.bet-btn:hover { border-color: var(--accent); color: var(--accent); }
.bet-btn:disabled { opacity: 0.4; cursor: default; }

/* slots */
.slots-reels {
  display: flex;
  gap: 10px;
}
.reel {
  width: 72px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  user-select: none;
}

.bet-btn:hover { border-color: var(--accent); color: var(--accent); }
.bet-btn:disabled { opacity: 0.4; cursor: default; }
.bet-btn.rou-red { background: #7f1d1d; border-color: #ef4444; color: #fff; }
.bet-btn.rou-red:hover { background: #991b1b; border-color: #fca5a5; color: #fff; }
.bet-btn.rou-black { background: #18181b; border-color: #52525b; color: #fff; }
.bet-btn.rou-black:hover { background: #27272a; border-color: #a1a1aa; color: #fff; }

/* roulette */
.rou-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  max-width: 640px;
  align-items: flex-start;
  justify-content: center;
}
.rou-table-side {
  flex: 1 1 320px;
  min-width: 0;
}
.rou-controls {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}
.rou-controls .bet-row,
.rou-controls .cmd-row { justify-content: flex-start; }
.rou-controls .game-hint { text-align: left; margin: 0; }
.rou-bet-grid { max-width: none; width: 100%; }

.rou-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.rou-legend { display: flex; flex-direction: row; gap: 6px; flex-wrap: wrap; }
.rou-chip {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rou-chip.red { background: #7f1d1d; color: #fecaca; border: 1px solid #ef4444; }
.rou-chip.black { background: #18181b; color: #d4d4d8; border: 1px solid #52525b; }
.rou-chip.green { background: #14532d; color: #bbf7d0; border: 1px solid var(--accent); }

/* horizontal table: 0 on left, 12 cols × 3 rows */
.rou-board {
  display: grid;
  grid-template-columns: 24px repeat(12, 1fr);
  grid-template-rows: repeat(3, 24px);
  gap: 2px;
  width: 100%;
  margin: 0;
}
.rou-board .rou-zero {
  grid-row: 1 / span 3;
  grid-column: 1;
  aspect-ratio: auto;
  height: auto;
  font-size: 0.7rem;
}
.rou-num {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.52rem;
  font-weight: 600;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
  min-width: 0;
}
.rou-num.red { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
.rou-num.black { background: #18181b; color: #e4e4e7; border-color: #3f3f46; }
.rou-num.green { background: #14532d; color: #bbf7d0; border-color: #166534; }
.rou-num.flash { transform: scale(1.06); box-shadow: 0 0 10px rgba(255,255,255,0.35); z-index: 1; }
.rou-num.win {
  border-color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 14px var(--accent);
  transform: scale(1.08);
  z-index: 2;
}

.roulette-display {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  border: 3px solid var(--border);
  background: var(--surface2);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.roulette-display.red { background: #7f1d1d; border-color: #ef4444; color: #fff; box-shadow: 0 0 24px rgba(239,68,68,0.45); }
.roulette-display.black { background: #18181b; border-color: #71717a; color: #fff; box-shadow: 0 0 24px rgba(0,0,0,0.5); }
.roulette-display.green { background: #14532d; border-color: var(--accent); color: #fff; box-shadow: 0 0 24px var(--accent-glow); }
.roulette-display.spinning { color: var(--muted); background: var(--surface2); box-shadow: none; animation: rouSpin 0.35s linear infinite; }
@keyframes rouSpin { to { transform: rotate(360deg); } }

#rouMsg.win { color: var(--accent); }
#rouMsg.loss { color: var(--red); }

@media (max-width: 480px) {
  .rou-board {
    grid-template-columns: 18px repeat(12, minmax(14px, 1fr));
    grid-template-rows: repeat(3, 20px);
  }
  .rou-num { font-size: 0.45rem; }
  .roulette-display { width: 52px; height: 52px; font-size: 1.2rem; }
}

/* coinflip */
.coin-wrap { perspective: 600px; height: 100px; display: flex; align-items: center; justify-content: center; }
.coin {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  border: 3px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  user-select: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.coin[data-face="heads"] {
  background: linear-gradient(145deg, #fbbf24, #d97706);
  border-color: #f59e0b;
  color: #451a03;
  box-shadow: 0 0 20px rgba(245,158,11,0.35);
}
.coin[data-face="tails"] {
  background: linear-gradient(145deg, #94a3b8, #475569);
  border-color: #64748b;
  color: #0f172a;
  box-shadow: 0 0 20px rgba(100,116,139,0.35);
}
.coin.flipping { animation: coinFlip 0.55s ease-in-out; }
@keyframes coinFlip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(540deg) scale(1.08); }
  100% { transform: rotateY(1080deg); }
}
.cmd-btn.coin-heads { border-color: #f59e0b; color: #fbbf24; }
.cmd-btn.coin-heads:hover { background: rgba(245,158,11,0.15); }
.cmd-btn.coin-tails { border-color: #64748b; color: #94a3b8; }
.cmd-btn.coin-tails:hover { background: rgba(100,116,139,0.15); }
#coinMsg.win { color: var(--accent); }
#coinMsg.loss { color: var(--red); }

/* blackjack */
.card-table {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 420px;
}
.hand-row { display: flex; flex-direction: column; gap: 8px; }
.hand-label { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.hand-label em { color: var(--accent); font-style: normal; }
.cards { display: flex; gap: 6px; flex-wrap: wrap; min-height: 64px; }
.pcard {
  width: 46px;
  height: 64px;
  border-radius: 6px;
  background: #f5f5f4;
  color: #18181b;
  border: 1px solid #d6d3d1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  animation: cardIn 0.2s var(--ease);
}
.pcard.red-suit { color: #dc2626; }
.pcard.back {
  background: repeating-linear-gradient(45deg, #1e293b, #1e293b 6px, #0f172a 6px, #0f172a 12px);
  color: transparent;
  border-color: var(--border);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

#coinMsg.win { color: var(--accent); }
#coinMsg.loss { color: var(--red); }

/* dice */
.dice-row { display: flex; gap: 14px; }
.die {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}
.die.rolling { animation: dieShake 0.12s linear infinite; }
@keyframes dieShake { 50% { transform: rotate(8deg) scale(1.05); } }

/* rps */
.rps-arena { display: flex; align-items: center; gap: 16px; }
.rps-pick {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.rps-vs { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
#diceMsg.win, #rpsMsg.win { color: var(--accent); }
#diceMsg.loss, #rpsMsg.loss { color: var(--red); }

#brkCanvas, #pongCanvas, #penguinCanvas {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  image-rendering: pixelated;
  touch-action: none;
}

/* memory / simon */
.simon {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 260px;
  max-width: 78vw;
  aspect-ratio: 1 / 1;
}
.simon-pad {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  transition: background 0.1s, box-shadow 0.1s, transform 0.05s;
}
.simon-pad[data-pad="0"].lit { background: #22c55e; box-shadow: 0 0 24px #22c55e; }
.simon-pad[data-pad="1"].lit { background: #06b6d4; box-shadow: 0 0 24px #06b6d4; }
.simon-pad[data-pad="2"].lit { background: #f59e0b; box-shadow: 0 0 24px #f59e0b; }
.simon-pad[data-pad="3"].lit { background: #ef4444; box-shadow: 0 0 24px #ef4444; }
.simon-pad:active { transform: scale(0.97); }
.simon.locked .simon-pad { cursor: not-allowed; }

/* ── Output toasts ── */
.out-stack {
  position: fixed;
  bottom: 108px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.out-line {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  animation: slideIn 0.3s var(--ease);
  pointer-events: auto;
}

.out-line.err { border-left-color: var(--red); color: var(--red); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

/* ── Type FX / glitch / wasted ── */
.type-fx.typing-active::after {
  content: '█';
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}

.glitch-target {
  position: relative;
}
.glitch-target.glitch-fx {
  animation: glitchShake 0.52s steps(3) 1;
}
.glitch-target.glitch-fx::before,
.glitch-target.glitch-fx::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.glitch-target.glitch-fx::before {
  color: var(--cyan, #06b6d4);
  clip-path: inset(8% 0 62% 0);
  transform: translate(-3px, 0);
  opacity: 0.85;
}
.glitch-target.glitch-fx::after {
  color: var(--red);
  clip-path: inset(58% 0 8% 0);
  transform: translate(3px, 0);
  opacity: 0.85;
}
@keyframes glitchShake {
  0% { transform: translate(0); filter: none; }
  25% { transform: translate(-2px, 1px) skewX(-2deg); filter: hue-rotate(25deg); }
  50% { transform: translate(2px, -1px) skewX(2deg); }
  75% { transform: translate(-1px, 2px); }
  100% { transform: none; filter: none; }
}

body.ui-falling .sidebar,
body.ui-falling .main,
body.ui-falling .prompt-bar,
body.ui-falling .help-rail,
body.ui-falling .help-fab,
body.ui-falling .dock-stack {
  will-change: transform, opacity;
}
body.ui-falling .sidebar { animation: uiFall 1.35s 0s cubic-bezier(0.4, 0, 0.9, 1) forwards; }
body.ui-falling .main { animation: uiFall 1.45s 0.06s cubic-bezier(0.4, 0, 0.9, 1) forwards; }
body.ui-falling .prompt-bar { animation: uiFall 1.25s 0.12s cubic-bezier(0.4, 0, 0.9, 1) forwards; }
body.ui-falling .help-rail { animation: uiFall 1.5s 0.04s cubic-bezier(0.4, 0, 0.9, 1) forwards; }
body.ui-falling .help-fab { animation: uiFall 1.2s 0.08s cubic-bezier(0.4, 0, 0.9, 1) forwards; }
body.ui-falling .dock-stack { animation: uiFall 1.22s 0.1s cubic-bezier(0.4, 0, 0.9, 1) forwards; }
@keyframes uiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(115vh) rotate(14deg); opacity: 0.15; }
}

.wasted-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.wasted-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.wasted-screen {
  text-align: center;
  font-family: var(--sans);
  animation: wastedPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.wasted-label {
  font-size: clamp(3rem, 14vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9ca3af;
  text-shadow:
    3px 3px 0 #111,
    -1px -1px 0 rgba(255,255,255,0.08);
  margin: 0;
}
.wasted-reason {
  margin: 14px auto 0;
  max-width: 28rem;
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: #fca5a5;
}
.wasted-hint {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  animation: blink 1.2s step-end infinite;
}
@keyframes wastedPop {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Chip bonus popups ── */
.chip-popup {
  position: fixed;
  z-index: 9000;
  min-width: 108px;
  padding: 10px 12px 8px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: rgba(17, 17, 19, 0.92);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 20px var(--accent-glow);
  font-family: var(--mono);
  text-align: center;
  cursor: pointer;
  transform: scale(0.6) translateY(8px);
  opacity: 0;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
  overflow: hidden;
  touch-action: manipulation;
}
.chip-popup.show {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.chip-popup-out {
  transform: scale(0.85) translateY(12px);
  opacity: 0;
  pointer-events: none;
}
.chip-popup-amt {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
}
.chip-popup-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.58rem;
  color: var(--muted);
  text-transform: lowercase;
}
.chip-popup-bar {
  display: block;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.chip-popup-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
  animation: chipPopupDrain var(--vanish-ms, 4s) linear forwards;
}
@keyframes chipPopupDrain {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
.chip-popup--dust { border-color: #94a3b8; }
.chip-popup--dust .chip-popup-amt { color: #cbd5e1; }
.chip-popup--drop { border-color: var(--accent); }
.chip-popup--bag { border-color: #f59e0b; box-shadow: 0 0 18px rgba(245, 158, 11, 0.2); }
.chip-popup--bag .chip-popup-amt { color: #fbbf24; }
.chip-popup--vault { border-color: #a855f7; box-shadow: 0 0 22px rgba(168, 85, 247, 0.25); }
.chip-popup--vault .chip-popup-amt { color: #c084fc; }
.chip-popup--jackpot {
  border-color: #facc15;
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.35);
  animation: chipJackpotPulse 0.8s ease-in-out infinite alternate;
}
.chip-popup--jackpot .chip-popup-amt {
  color: #fde047;
  font-size: 1.2rem;
}
@keyframes chipJackpotPulse {
  from { box-shadow: 0 0 20px rgba(250, 204, 21, 0.25); }
  to { box-shadow: 0 0 36px rgba(250, 204, 21, 0.45); }
}

/* ── Fishing game ── */
.fish-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.fish-tab {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.fish-tab:hover { color: var(--text); border-color: var(--muted); }
.fish-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.fish-pane-note {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.fish-scene {
  position: relative;
  height: 160px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #060607;
  margin-bottom: 12px;
}
.fish-sky {
  height: 38%;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}
.fish-water {
  position: relative;
  height: 62%;
  background: linear-gradient(180deg, #0c4a6e 0%, #082f49 55%, #042f2e 100%);
  overflow: hidden;
}
.fish-water::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 24px,
    rgba(255, 255, 255, 0.03) 24px,
    rgba(255, 255, 255, 0.03) 48px
  );
  animation: fishWave 6s linear infinite;
}
@keyframes fishWave {
  from { transform: translateX(0); }
  to { transform: translateX(-48px); }
}
.fish-ripple {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  animation: fishRipple 1s ease-out infinite;
}
@keyframes fishRipple {
  from { transform: scale(0.4); opacity: 0.8; }
  to { transform: scale(1.6); opacity: 0; }
}
.fish-line {
  position: absolute;
  left: 50%;
  top: 18%;
  width: 2px;
  height: 0;
  background: rgba(250, 250, 250, 0.35);
  transform: translateX(-50%);
  transform-origin: top center;
  transition: height 0.35s var(--ease);
  pointer-events: none;
}
.fish-scene.casting .fish-line { height: 52%; }
.fish-scene.bite .fish-line { height: 58%; }
.fish-bobber {
  position: absolute;
  left: 50%;
  top: 68%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  color: var(--red);
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  transition: top 0.35s var(--ease), transform 0.12s;
  pointer-events: none;
}
.fish-scene.casting .fish-bobber { top: 72%; }
.fish-scene.bite .fish-bobber {
  top: 74%;
  animation: fishBob 0.35s ease-in-out infinite alternate;
}
@keyframes fishBob {
  from { transform: translate(-50%, -50%) translateY(0); }
  to { transform: translate(-50%, -50%) translateY(6px); }
}
.fish-catch-pop {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.75);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  white-space: nowrap;
  z-index: 2;
}
.fish-reel-wrap { margin-bottom: 10px; }
.fish-reel-bar {
  position: relative;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.fish-reel-zone {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 40%;
  width: 20%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  border: 1px solid var(--accent);
}
.fish-reel-marker {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 4px;
  left: 0;
  border-radius: 2px;
  background: var(--yellow);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}
.fish-reel-hint {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-align: center;
}
.fish-reel-hint kbd {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
}
.fish-shop-list,
.fish-market-list,
.fish-bag-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.fish-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 0.68rem;
}
.fish-row-icon {
  font-size: 1.25rem;
  width: 1.6rem;
  text-align: center;
  flex-shrink: 0;
}
.fish-row-body {
  flex: 1;
  min-width: 0;
}
.fish-row-name {
  color: var(--text);
  line-height: 1.3;
}
.fish-row-meta {
  color: var(--muted);
  font-size: 0.58rem;
  margin-top: 2px;
}
.fish-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.fish-row-actions .cmd-btn {
  padding: 5px 10px;
  font-size: 0.62rem;
}
.fish-row.rare .fish-row-name { color: #c084fc; }
.fish-row.epic .fish-row-name { color: #fbbf24; }
.fish-row.junk .fish-row-name { color: var(--muted); }
.fish-empty {
  padding: 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .pane.reveal { opacity: 1; transform: none; }
  .scanlines { display: none; }
}

/* ── Responsive ── */
@media (max-width: 1099px) {
  body.help-open .main { margin-right: 0; }
  body.help-open .prompt-bar { right: 0; }
  .help-rail { box-shadow: -12px 0 40px rgba(0,0,0,0.45); }
}

@media (max-width: 768px) {
  :root { --sidebar: 0px; }
  .sidebar { transform: translateX(-100%); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: block; }
  .main { margin-left: 0; }
  .prompt-bar { left: 0; }
  .dock-stack {
    left: 12px;
    right: 12px;
    align-items: stretch;
  }
  .help-fab { align-self: flex-end; }
  .music-dock-inner { max-width: none; }
  .music-vol { width: 56px; }
  .out-stack { bottom: 118px; right: 12px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .card-row, .link-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; padding-top: 56px; }
  .dpad { display: flex; }
  .games-layout { grid-template-columns: 1fr; }
  .game-menu {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .game-categories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .game-stage { padding: 12px 8px; overflow-x: auto; }
  .status-center { display: none; }
}

@media (max-width: 480px) {
  .status-right .dim:first-child { display: none; }
  .game-categories { grid-template-columns: 1fr; }
}
