/* The old site's look (src/AetherTrance.Web: Layout, Header, HUD, play overlay), dark only. */
:root {
  --bg: #000;
  --text: #fff;
  --muted: rgba(224, 224, 224, 0.6);
  --panel: rgba(10, 10, 20, 0.7);
  --solo: #ffb000;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Monaco, 'Courier New', monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  height: 100vh;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.viz { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }

/* Header */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem; pointer-events: none;
}
.header-left { display: flex; flex-direction: column; gap: 0.5rem; }
.top-bar h1 {
  margin: 0; font-size: 1.5rem; letter-spacing: 0.3em; text-transform: uppercase; color: #fff;
  text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5), 0 0 40px rgba(var(--primary-rgb), 0.2);
}
.station-nav { display: flex; gap: 0.5rem; align-items: center; font-size: 0.8rem; pointer-events: auto; }
.station-link {
  color: var(--link-color); opacity: 0.4; text-decoration: none; letter-spacing: 0.2em;
  transition: all 0.2s; padding: 0.2rem 0.5rem;
}
.station-link:hover { opacity: 0.8; text-shadow: 0 0 10px rgba(var(--link-rgb), 0.5); }
.station-link.active { opacity: 1; text-shadow: 0 0 10px rgba(var(--link-rgb), 0.8); font-weight: bold; }
.separator { color: rgba(255, 255, 255, 0.3); }

/* Play overlay */
.play-overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.8);
}
.play-btn {
  font-size: 2rem; padding: 1em 2em; background: transparent;
  border: 2px solid var(--primary); color: var(--primary); border-radius: 0.5em;
  cursor: pointer; letter-spacing: 0.2em; transition: all 0.3s;
}
.play-btn:hover { background: rgba(var(--primary-rgb), 0.2); transform: scale(1.05); }
body:not([data-mode="stopped"]) .play-overlay, body.entered .play-overlay { display: none; }

/* HUD */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; font-family: var(--mono); }
.panel {
  position: fixed; background: var(--panel);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  border-radius: 0.5rem; padding: 1rem; pointer-events: auto;
}
.top-left { top: 6.5rem; left: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 12rem; }
.top-right { top: 1.25rem; right: 1.5rem; display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.bottom-center {
  bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 1rem;
}
.section-pill {
  padding: 0.4em 0.9em; border-radius: 1em; font-weight: bold; font-size: 0.85rem;
  letter-spacing: 0.1em; text-align: center; text-transform: uppercase;
  background: rgba(var(--primary-rgb), 0.2); color: var(--primary);
}
.info-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.info-label { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.05em; }
.info-value { font-size: 0.85rem; color: #fff; font-weight: bold; font-variant-numeric: tabular-nums; }
.energy { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.2rem; }
.energy-bg { width: 100%; height: 0.3rem; background: rgba(255, 255, 255, 0.1); border-radius: 0.15rem; overflow: hidden; }
.energy-fill {
  --v: 0; height: 100%; width: calc(var(--v) * 100%); transition: width 0.5s ease;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.status { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; letter-spacing: 0.08em; color: #e0e0e0; }
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(255, 255, 255, 0.3); }
body[data-mode="radio"] .dot { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
body[data-mode="solo"] .dot { background: var(--solo); box-shadow: 0 0 8px var(--solo); }
body[data-mode="solo"] .status { color: var(--solo); }
.listeners { font-size: 0.75rem; color: #e0e0e0; opacity: 0.8; }
.text-btn {
  background: none; border: 1px solid rgba(var(--primary-rgb), 0.3); border-radius: 0.3rem;
  color: var(--primary); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.15em;
  padding: 0.3rem 0.6rem; cursor: pointer;
}
.text-btn:hover, .text-btn[aria-expanded="true"] { background: rgba(var(--primary-rgb), 0.15); }

.round-btn {
  width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
  border: 1px solid rgba(var(--primary-rgb), 0.5); background: rgba(var(--primary-rgb), 0.1); color: var(--primary);
}
.volume { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: #e0e0e0; }
.volume span { opacity: 0.7; }
.volume input { width: 80px; accent-color: var(--primary); }

/* Lab drawer */
.lab {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 15;
  width: min(420px, 100vw); overflow-y: auto; padding: 1rem 1.25rem 2rem;
  background: rgba(8, 8, 16, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-left: 1px solid rgba(var(--primary-rgb), 0.2);
  font-family: var(--mono); font-size: 0.75rem; color: #e0e0e0;
}
.lab-head { display: flex; align-items: center; gap: 0.75rem; padding-bottom: 0.75rem; }
.lab-title { color: var(--primary); font-weight: bold; letter-spacing: 0.2em; }
.hint { color: var(--muted); flex: 1; }
.lab-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-bottom: 0.75rem; }
.lab-actions button {
  background: transparent; border: 1px solid rgba(var(--primary-rgb), 0.3); border-radius: 0.3rem;
  padding: 0.35rem 0.7rem; cursor: pointer; font-family: var(--mono); font-size: 0.72rem; color: #e0e0e0;
}
.lab-actions button:hover { border-color: var(--primary); color: var(--primary); }
.lab-group { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 0.2rem 0 0.6rem; }
.lab-group > summary {
  cursor: pointer; padding: 0.5rem 0; color: var(--primary); letter-spacing: 0.15em; text-transform: uppercase;
}
.lab-row { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 3.5rem; gap: 0.6rem; align-items: center; padding: 0.15rem 0; }
.lab-row input[type="range"] { width: 100%; accent-color: var(--primary); }
.lab-row output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.lab-row input[type="checkbox"] { justify-self: start; accent-color: var(--primary); }
.lab-strip { border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 0.4rem; margin: 0.5rem 0; padding: 0.2rem 0.7rem 0.5rem; }
.lab-strip legend { color: var(--primary); letter-spacing: 0.15em; text-transform: uppercase; padding: 0 0.4rem; }
.lab-strip .lab-row { grid-template-columns: 3rem 1fr 3rem; }

/* ?debug readout */
.debug { display: none; }
body.show-debug .debug {
  display: block; position: fixed; left: 1.5rem; bottom: 1.5rem; z-index: 11;
  font-family: var(--mono); font-size: 0.65rem; color: var(--muted); max-width: 30vw;
}
body[data-offline] .debug { display: block; position: fixed; inset: auto 1rem 1rem; color: #ccc; }

@media (max-width: 640px) {
  .top-bar { padding: 0.75rem 1rem; }
  .top-bar h1 { font-size: 1.05rem; letter-spacing: 0.2em; }
  .station-nav { font-size: 0.68rem; gap: 0.2rem; }
  .station-link { padding: 0.2rem 0.25rem; letter-spacing: 0.12em; }
  .top-left { top: auto; bottom: 5.25rem; left: 1rem; right: 1rem; min-width: 0; gap: 0.35rem 1rem;
    display: grid; grid-template-columns: 1fr 1fr; padding: 0.75rem; }
  .section-pill, .energy { grid-column: 1 / -1; }
  .top-right { top: 4.4rem; right: 1rem; flex-direction: row; align-items: center; padding: 0.4rem 0.6rem; }
  .bottom-center { left: 1rem; right: 1rem; bottom: 1rem; transform: none; padding: 0.5rem 0.75rem; justify-content: center; }
  .volume input { width: 64px; }
  .play-btn { font-size: 1.2rem; }
  .lab-row { grid-template-columns: 1fr 3rem; }
  .lab-row .lab-name { grid-column: 1 / -1; }
}
