/* Tinnitus — maximalist dark theme base */

:root {
  --bg: #08080f;
  --bg2: #0d0d1a;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.09);
  --txt: #eceaf4;
  --txt-dim: #8b88a3;
  --acc1: #7c5cff;   /* violet */
  --acc2: #22d3ee;   /* cyan */
  --acc3: #f472b6;   /* pink */
  --glow: rgba(124, 92, 255, 0.45);
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* animated ambient background */
body::before {
  content: "";
  position: fixed;
  inset: -40%;
  background:
    radial-gradient(circle at 20% 15%, rgba(124, 92, 255, 0.16), transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(34, 211, 238, 0.10), transparent 45%),
    radial-gradient(circle at 50% 95%, rgba(244, 114, 182, 0.10), transparent 50%);
  animation: drift 24s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
@keyframes drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
  100% { transform: translate3d(2%, 2%, 0) scale(1.06); }
}

/* ---------- header ---------- */
.top {
  position: relative;
  z-index: 1;
  padding: calc(var(--safe-top) + 22px) 24px 6px;
  text-align: center;
}
.top h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(100deg, var(--acc2), var(--acc1) 55%, var(--acc3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.top .sub { margin-top: 4px; font-size: 12.5px; color: var(--txt-dim); letter-spacing: 0.14em; text-transform: uppercase; }
.top .sub .ver { font-size: 10px; letter-spacing: 0.1em; opacity: 0.6; color: var(--acc2); }

/* ---------- stage ---------- */
.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 12px 18px calc(var(--safe-bottom) + 26px);
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- spectrum bar ---------- */
.bar-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px 14px 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
#spectrum {
  display: block;
  width: 100%;
  height: 210px;
  border-radius: 12px;
  touch-action: none;
  cursor: pointer;
}
.readout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.ro-pill {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.35);
  color: #cfc4ff;
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.18);
}
.ro-dash { color: var(--txt-dim); }
.bar-hint {
  text-align: center;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--txt-dim);
  letter-spacing: 0.08em;
}

/* ---------- controls ---------- */
.controls {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.play {
  flex: 1.35;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 18px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(120deg, var(--acc1), #5b3df0 60%, var(--acc2));
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 10px 34px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.play:active { transform: scale(0.97); }
.play.playing {
  background: linear-gradient(120deg, #1b1b2e, #23233d);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 0 28px rgba(34, 211, 238, 0.25);
}
.play .glyph { font-size: 17px; }
.mode {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 20px 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--txt-dim);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.2s ease;
}
.mode-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--acc1);
  box-shadow: 0 0 10px var(--acc1);
}
.mode.test {
  color: #ffd9ef;
  border-color: rgba(244, 114, 182, 0.45);
  background: rgba(244, 114, 182, 0.10);
  box-shadow: 0 0 24px rgba(244, 114, 182, 0.20);
}
.mode.test .mode-dot { background: var(--acc3); box-shadow: 0 0 10px var(--acc3); }

/* ---------- volume ---------- */
.volume-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 6px;
}
.vol-ico { font-size: 10px; letter-spacing: 0.18em; color: var(--txt-dim); font-weight: 700; }
.vol-val {
  width: 34px; text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--txt-dim); font-weight: 600;
}
#volume { flex: 1; -webkit-appearance: none; appearance: none; height: 34px; background: transparent; }
#volume::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.75), rgba(34, 211, 238, 0.45));
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.25);
}
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px; margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 16px var(--glow);
  border: none;
}
#volume::-moz-range-track {
  height: 6px; border-radius: 3px; background: rgba(124, 92, 255, 0.55);
}
#volume::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 16px var(--glow); border: none;
}
