/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --bg: #0b0d14;
  --bg-elev: #141824;
  --bg-elev-2: #1c2130;
  --bg-glass: rgba(20, 24, 36, 0.95);   /* solid-ish: backdrop blur was too heavy on phones */
  --line: #2a3043;
  --text: #eef0f6;
  --text-dim: #a3aabd;
  --text-faint: #6c7489;
  --accent: #8b7bff;
  --accent-2: #ff7ac6;
  --accent-ink: #ffffff;
  --good: #33d17a;
  --bad: #ff6b7a;
  --warm: #ffcf5a;
  --map-bg: #080a10;
  --map-grid: rgba(255, 255, 255, 0.035);
  --map-dim: rgba(140, 148, 170, 0.17);
  --map-halo: rgba(8, 10, 16, 0.78);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --panel-w: 320px;
  --detail-w: 370px;
  --top-h: 62px;
  --player-h: 84px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f5fb; --bg-elev: #ffffff; --bg-elev-2: #f0eff7; --bg-glass: rgba(255, 255, 255, 0.96);
    --line: #e2e0ee; --text: #191726; --text-dim: #575470; --text-faint: #8d8aa3;
    --accent: #6a52ff; --accent-2: #e8449d; --map-bg: #fcfbff; --map-grid: rgba(0, 0, 0, 0.045);
    --map-dim: rgba(90, 86, 120, 0.2); --shadow: 0 12px 40px rgba(40, 30, 90, 0.14); --shadow-sm: 0 4px 14px rgba(40, 30, 90, 0.1);
    --map-halo: rgba(252, 251, 255, 0.85);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f5fb; --bg-elev: #ffffff; --bg-elev-2: #f0eff7; --bg-glass: rgba(255, 255, 255, 0.96);
  --line: #e2e0ee; --text: #191726; --text-dim: #575470; --text-faint: #8d8aa3;
  --accent: #6a52ff; --accent-2: #e8449d; --map-bg: #fcfbff; --map-grid: rgba(0, 0, 0, 0.045);
  --map-dim: rgba(90, 86, 120, 0.2); --shadow: 0 12px 40px rgba(40, 30, 90, 0.14); --shadow-sm: 0 4px 14px rgba(40, 30, 90, 0.1);
  --map-halo: rgba(252, 251, 255, 0.85);
  color-scheme: light;
}

/* ───────────────────────── Base ───────────────────────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  overflow: hidden; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-elev-2); color: var(--text-dim); }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--text-faint); font-weight: 600; }
.small { font-size: 13px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

/* ───────────────────────── Buttons ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg-elev-2); font-weight: 800;
  color: var(--text); white-space: nowrap; transition: transform .08s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--text-faint); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.fun span[aria-hidden] { font-size: 17px; }
.toggle-kids[aria-pressed="true"] { background: color-mix(in srgb, var(--warm) 24%, var(--bg-elev-2)); border-color: var(--warm); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; color: var(--text-dim); flex: none;
}
.icon-btn:hover { background: var(--bg-elev-2); color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.link { background: none; border: 0; color: var(--accent); padding: 0; font-size: 13px; font-weight: 800; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-elev-2); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: 13px; color: var(--text-dim); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ───────────────────────── Top bar ───────────────────────── */
.topbar {
  height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: var(--bg-elev); position: relative; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 19px; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: conic-gradient(from 200deg, #ff6b6b, #ffd166, #06d6a0, #4cc9f0, #8b7bff, #ff7ac6, #ff6b6b);
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; min-width: 0; }
.search input {
  width: 100%; height: 42px; padding: 0 40px 0 42px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg-elev-2); outline: none; font-weight: 700;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-ico { position: absolute; left: 14px; top: 11px; color: var(--text-faint); }
.search .hint { position: absolute; right: 14px; top: 11px; pointer-events: none; }
.search input:focus ~ .hint, .search input:not(:placeholder-shown) ~ .hint { display: none; }
.suggest {
  position: absolute; top: 48px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; z-index: 50;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 60vh; overflow: auto;
}
.suggest li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--bg-elev-2); }
.suggest .sub { margin-left: auto; color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.suggest mark { background: none; color: var(--accent); font-weight: 900; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.explored { font-size: 13px; color: var(--text-dim); padding: 0 8px; white-space: nowrap; }
.explored b { color: var(--text); }

/* ───────────────────────── Layout ───────────────────────── */
.layout { display: flex; height: calc(100% - var(--top-h)); position: relative; }
.panel { width: var(--panel-w); flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg-elev); z-index: 20; }
.panel.collapsed { display: none; }
.panel-scroll { flex: 1; overflow: auto; padding: 4px 16px 16px; overscroll-behavior: contain; }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--line); }
.block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.block h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin: 0; font-weight: 900; }
.results-block h2 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg-elev-2); font-size: 13px; font-weight: 700; color: var(--text);
  transition: border-color .15s, background .15s, transform .08s;
}
.chip:hover { border-color: var(--text-faint); }
.chip:active { transform: scale(.96); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip .n { color: var(--text-faint); font-size: 11px; }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--chip-c, var(--accent)) 24%, var(--bg-elev-2)); border-color: var(--chip-c, var(--accent)); }
.fam-chips .chip .emo { font-size: 15px; line-height: 1; }

.select-wrap select, .mini-select { width: 100%; height: 40px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg-elev-2); outline: none; font-weight: 700; }
.mini-select { width: auto; height: 32px; font-size: 13px; }
.toggles { display: grid; gap: 10px; margin-top: 12px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-dim); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span { width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.toggle > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--bg-elev-2); border: 1px solid var(--line); color: var(--text-dim); font-weight: 800; }

.range { margin-bottom: 16px; }
.range-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.dual { position: relative; height: 24px; }
.dual::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 5px; border-radius: 5px; background: var(--line); }
.dual-fill { position: absolute; top: 10px; height: 5px; border-radius: 5px; background: linear-gradient(90deg, #4fb36a, var(--accent), var(--accent-2)); pointer-events: none; }
.dual input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.dual input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); cursor: grab; position: relative; z-index: 2; }
.dual input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); cursor: grab; }
.dual input::-moz-range-track { background: none; }

.results { list-style: none; margin: 0; padding: 0; }
.results li { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
.results li:hover, .results li.active { background: var(--bg-elev-2); }
.results .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.results .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .meta { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.results .heard { font-size: 11px; color: var(--good); }
.results .empty { color: var(--text-faint); cursor: default; padding: 20px 8px; text-align: center; display: block; }

/* ───────────────────────── Stage / map ───────────────────────── */
.stage { flex: 1; position: relative; overflow: hidden; background: var(--map-bg); min-width: 0; --right-inset: 0px; }
.stage canvas#map, .stage canvas#overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { touch-action: none; cursor: grab; }
#overlay.dragging { cursor: grabbing; }
#overlay.pointing { cursor: pointer; }
.axis {
  position: absolute; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-faint); pointer-events: none; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--map-bg) 75%, transparent); white-space: nowrap;
}
.axis-l { left: 10px; top: 45%; transform: translateY(-50%); }
.axis-r { right: calc(10px + var(--right-inset)); top: 45%; transform: translateY(-50%); }
.axis-t { top: 10px; left: 50%; transform: translateX(-50%); }
.axis-b { bottom: calc(var(--player-h) + 30px + var(--safe-b)); left: 50%; transform: translateX(-50%); }
.tooltip { position: absolute; pointer-events: none; z-index: 6; padding: 8px 12px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 13px; max-width: 300px; }
.tooltip b { display: block; font-size: 15px; font-weight: 900; }
.tooltip span { color: var(--text-dim); font-size: 12px; display: block; }
.map-ctrl {
  position: absolute; right: calc(14px + var(--right-inset)); top: 50px; display: grid; gap: 2px; padding: 4px; z-index: 5;
  background: var(--bg-glass);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.minimap {
  position: absolute; right: calc(14px + var(--right-inset)); bottom: calc(var(--player-h) + 30px + var(--safe-b)); z-index: 5;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-elev); box-shadow: var(--shadow-sm); cursor: pointer;
}
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--text-dim); font-size: 16px; z-index: 8; background: var(--map-bg); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }

.tour-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 7;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--line); box-shadow: var(--shadow); max-width: calc(100% - 24px);
}
.tour-bar[hidden] { display: none; }
.tour-emoji { font-size: 22px; }
.tour-info { display: grid; line-height: 1.2; min-width: 0; }
.tour-info b { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-info span { font-size: 12px; color: var(--text-dim); }
.tour-dots { display: flex; gap: 3px; max-width: 220px; flex-wrap: wrap; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dots i.done { background: var(--accent); }
.tour-dots i.cur { background: var(--accent-2); transform: scale(1.35); }

/* ───────────────────────── Player ───────────────────────── */
.player {
  position: absolute; z-index: 9;
  left: 50%; bottom: calc(14px + var(--safe-b));
  width: min(880px, calc(100% - 28px - var(--right-inset)));
  transform: translateX(calc(-50% - var(--right-inset) / 2));
  background: var(--bg-glass);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  padding: 10px 12px 10px 10px; --p: 0%; --g: var(--accent);
  container-type: inline-size;
}
@container (max-width: 720px) { .p-vol input { display: none; } }
@container (max-width: 600px) { .p-time { display: none; } #p-auto-label { display: none; } .p-auto { padding: 0 9px; border: 0; } }
@container (max-width: 480px) { #p-prev, #p-mute { display: none; } .p-row { gap: 8px; } }
@container (max-width: 380px) { #p-loop { display: none; } }
.p-seek { position: absolute; left: 18px; right: 18px; top: -7px; height: 14px; }
.p-seek input { position: absolute; inset: 0; width: 100%; margin: 0; -webkit-appearance: none; appearance: none; background: none; cursor: pointer; }
.p-seek::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 4px; border-radius: 4px; background: var(--line); }
.p-seek::after { content: ""; position: absolute; left: 0; width: var(--p); top: 5px; height: 4px; border-radius: 4px; background: var(--g); pointer-events: none; }
.p-seek input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--g); position: relative; z-index: 2; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.p-seek input::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--g); }
.p-seek input::-moz-range-track { background: none; }
.player[data-state="empty"] .p-seek, .player[data-state="empty"] .p-time, .player[data-state="empty"] .p-dot { visibility: hidden; }
.p-row { display: flex; align-items: center; gap: 12px; }
.p-art { width: 56px; height: 56px; border-radius: 14px; border: 0; padding: 0; overflow: hidden; flex: none; background: var(--bg-elev-2); }
.p-art canvas { width: 100%; height: 100%; display: block; }
.p-meta { flex: 1; min-width: 0; }
.p-title { font-weight: 900; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--text-dim); min-width: 0; white-space: nowrap; }
.p-sub #p-artist { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.p-genre { border: 0; background: none; padding: 0; font-weight: 900; font-size: 13px; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 55%; }
.p-genre:hover { text-decoration: underline; }
.p-controls { display: flex; align-items: center; gap: 4px; }
.p-play {
  width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; position: relative;
  background: var(--g); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--g) 45%, transparent); transition: transform .1s;
}
.p-play:active { transform: scale(.94); }
.p-play svg { width: 24px; height: 24px; fill: currentColor; stroke-width: 1.5; }
.p-play .i-pause { fill: none; stroke-width: 3.2; display: none; }
.player[data-playing="true"] .p-play .i-play { display: none; }
.player[data-playing="true"] .p-play .i-pause { display: block; }
.p-spin { position: absolute; inset: -4px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--g); animation: spin .8s linear infinite; display: none; }
.player[data-busy="true"] .p-spin { display: block; }
.p-time { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-dim); white-space: nowrap; }
.p-extra { display: flex; align-items: center; gap: 2px; }
.p-auto { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px; border-radius: 999px; border: 1.5px solid var(--line); background: none; font-size: 12px; font-weight: 800; color: var(--text-dim); }
.p-auto[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.p-auto svg { width: 16px; height: 16px; }
.p-vol { display: flex; align-items: center; }
.p-vol input { width: 80px; accent-color: var(--g); }
#p-mute[data-muted="true"] { color: var(--bad); }
.player[data-state="empty"] .p-title { font-size: 15px; }

/* ───────────────────────── Detail ───────────────────────── */
.detail { width: var(--detail-w); flex: none; border-left: 1px solid var(--line); background: var(--bg-elev); display: flex; flex-direction: column; z-index: 20; animation: slide-in .22s ease; }
.detail[hidden] { display: none; }
.sheet-handle { display: none; }
@keyframes slide-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-scroll { overflow: auto; padding: 18px; flex: 1; overscroll-behavior: contain; }
.detail-head { display: flex; gap: 12px; align-items: flex-start; }
.swatch { width: 48px; height: 48px; border-radius: 14px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.detail-title { flex: 1; min-width: 0; }
.detail h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.15; font-weight: 900; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--bg-elev-2); border: 1px solid var(--line); color: var(--text-dim); cursor: pointer; font-weight: 700; }
.tag:hover { border-color: var(--text-faint); color: var(--text); }

.now { margin: 16px 0; padding: 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--g, var(--accent)) 12%, var(--bg-elev-2)); border: 1px solid color-mix(in srgb, var(--g, var(--accent)) 35%, var(--line)); }
.d-viz { width: 100%; height: 76px; display: block; margin-bottom: 10px; }
.now-row { display: flex; align-items: center; gap: 12px; }
.now-play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--g, var(--accent)); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 6px 18px color-mix(in srgb, var(--g, var(--accent)) 40%, transparent); }
.now-play svg { width: 24px; height: 24px; fill: currentColor; stroke-width: 1.5; }
.now-play .i-pause { display: none; fill: none; stroke-width: 3.2; }
.now[data-playing="true"] .now-play .i-play { display: none; }
.now[data-playing="true"] .now-play .i-pause { display: block; }
.now-meta { flex: 1; min-width: 0; }
.now-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); font-weight: 900; }
.now-song { font-size: 17px; font-weight: 900; overflow-wrap: anywhere; line-height: 1.25; }
.now-artist { font-size: 14px; color: var(--text-dim); }
#d-fav[aria-pressed="true"] { color: var(--warm); }
#d-fav[aria-pressed="true"] svg { fill: var(--warm); }
.listen-on { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 12px; font-size: 13px; }
.listen-on span { color: var(--text-dim); }
.listen-on a { font-weight: 800; }
.audio-detail { margin-top: 10px; font-size: 13px; }
.audio-detail summary { cursor: pointer; color: var(--text-dim); font-weight: 800; }
.audio-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 10px 0 0; align-items: center; }
.audio-detail dt { color: var(--text-faint); }
.audio-detail dd { margin: 0; overflow-wrap: anywhere; }
.now.no-track .now-play, .now.no-track .listen-on, .now.no-track .audio-detail, .now.no-track .d-viz { display: none; }

.meters { display: grid; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--bg-elev-2); border: 1px solid var(--line); }
.meter-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.meter-bar { height: 7px; border-radius: 7px; background: linear-gradient(90deg, color-mix(in srgb, var(--line) 80%, #4fb36a), var(--line), color-mix(in srgb, var(--line) 70%, var(--accent))); position: relative; }
.meter-bar i { position: absolute; top: -5px; width: 17px; height: 17px; margin-left: -8px; border-radius: 50%; background: var(--g, var(--accent)); box-shadow: 0 0 0 3px var(--bg-elev-2); transition: left .35s; }
.approx { margin: 0; font-size: 12px; color: var(--text-faint); }
.d-sec { margin-top: 20px; }
.d-sec[hidden] { display: none; }
.d-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin: 0 0 10px; font-weight: 900; }
.d-sec h3 .muted { text-transform: none; letter-spacing: 0; }
.near { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.near li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
.near li:hover { background: var(--bg-elev-2); }
.near .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.near .name { flex: 1; }
.near .play-mini { font-size: 12px; color: var(--text-faint); }
.links { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; justify-items: start; }

/* ───────────────────────── Modals ───────────────────────── */
.modal {
  max-width: 680px; width: calc(100% - 24px); max-height: calc(100% - 32px); border: 1px solid var(--line); border-radius: 24px; padding: 26px;
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); line-height: 1.55;
}
.modal::backdrop { background: rgba(5, 4, 15, .62); }
.modal[open] { animation: pop .22s ease; }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { margin: 0 0 8px; font-size: 22px; font-weight: 900; }
.modal .close { position: absolute; right: 12px; top: 12px; }
.about ul { padding-left: 20px; }
.settings { max-width: 520px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; font-weight: 700; }
.set-h { margin: 18px 0 6px; font-size: 15px; font-weight: 900; }
.set-favs { max-height: 180px; overflow: auto; }
.set-favs .chip .x { margin-left: 2px; opacity: .55; font-size: 12px; padding: 0 2px; }
.set-favs .chip .x:hover { opacity: 1; }
.set-foot { margin-top: 18px; display: flex; justify-content: flex-end; }
#set-ver { font-size: 12px; }
.about li { margin-bottom: 8px; }

.welcome { text-align: center; padding: 4px 10px 6px; }
.welcome-art { font-size: 44px; letter-spacing: 6px; }
.welcome p { color: var(--text-dim); margin: 0 auto; max-width: 520px; }
.explore:not(.first) .welcome { display: none; }
.ex-h { margin: 20px 0 10px; font-size: 15px; font-weight: 900; }
.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tour-card, .game-card {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 18px;
  border: 1.5px solid var(--line); background: var(--bg-elev-2); transition: transform .1s, border-color .15s;
}
.tour-card:hover, .game-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tour-card .t-emoji, .game-card .g-emoji { font-size: 30px; line-height: 1; }
.tour-card b, .game-card b { display: block; font-weight: 900; font-size: 15px; }
.tour-card small, .game-card small { display: block; color: var(--text-dim); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.game-card { width: 100%; }
.ex-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 22px; }

.quiz { max-width: 520px; text-align: center; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 36px; flex-wrap: wrap; }
.quiz-stats { display: flex; gap: 14px; justify-content: center; font-size: 14px; color: var(--text-dim); margin: 6px 0 4px; flex-wrap: wrap; }
.quiz-stats b { color: var(--text); }
.quiz-play { width: 112px; height: 112px; border-radius: 50%; border: 0; margin: 16px auto 12px; position: relative; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.quiz-play svg { width: 44px; height: 44px; fill: currentColor; stroke-width: 1.5; position: relative; }
.quiz-play .i-pause { display: none; fill: none; stroke-width: 3.2; }
.quiz[data-playing="true"] .quiz-play .i-play { display: none; }
.quiz[data-playing="true"] .quiz-play .i-pause { display: block; }
.quiz-play .ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--accent); opacity: 0; }
.quiz[data-playing="true"] .ring { animation: ripple 1.8s ease-out infinite; }
.quiz[data-playing="true"] .ring.r2 { animation-delay: .9s; }
@keyframes ripple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.7); opacity: 0; } }
.quiz-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; max-width: 260px; margin: 0 auto; }
.quiz-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s linear; }
.quiz-q { font-weight: 900; font-size: 17px; margin: 16px 0 12px; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-opt { min-height: 58px; padding: 10px; border-radius: 16px; border: 2px solid color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 14%, var(--bg-elev-2)); font-weight: 900; font-size: 15px; color: var(--text); transition: transform .08s; overflow-wrap: anywhere; }
.quiz-opt:hover:not(:disabled) { transform: translateY(-2px); }
.quiz-opt:disabled { cursor: default; opacity: .55; }
.quiz-opt[data-result="right"] { opacity: 1; border-color: var(--good); background: color-mix(in srgb, var(--good) 25%, var(--bg-elev-2)); }
.quiz-opt[data-result="wrong"] { opacity: 1; border-color: var(--bad); background: color-mix(in srgb, var(--bad) 22%, var(--bg-elev-2)); }
.quiz-feedback { margin: 16px 0 12px; display: grid; gap: 8px; justify-items: center; }
.quiz-verdict { font-size: 20px; font-weight: 900; }
.quiz-credit { color: var(--text-dim); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 40px + var(--safe-b)); transform: translateX(-50%); z-index: 100; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
.scrim { position: fixed; inset: var(--top-h) 0 0 0; background: rgba(0,0,0,.45); z-index: 25; }

/* ───────────────────────── Kids mode ───────────────────────── */
body.kids { font-size: 17px; }
body.kids .adv { display: none; }
body.kids .chip { padding: 9px 14px; font-size: 15px; }
body.kids .fam-chips .chip .emo { font-size: 20px; }
body.kids .chip.kid-hidden { display: none; }
body.kids .p-title { font-size: 18px; }
body.kids .p-play { width: 58px; height: 58px; }
body.kids .detail h1 { font-size: 28px; }
body.kids .audio-detail, body.kids #d-everynoise { display: none; }

/* ───────────────────────── Responsive ───────────────────────── */
/* tablet: detail floats over the map instead of squeezing it */
@media (max-width: 1279px) {
  :root { --panel-w: 296px; --detail-w: 350px; }
  .detail { position: absolute; right: 12px; top: 12px; bottom: 12px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
  .layout.detail-open .stage { --right-inset: calc(var(--detail-w) + 24px); }
  .btn.fun .lbl { display: none; }
  .btn.fun { width: 40px; padding: 0; }
}
@media (max-width: 1023px) {
  .explored { display: none; }
  .toggle-kids .lbl { display: none; }
  .toggle-kids { width: 40px; padding: 0; }
  .p-vol input { display: none; }
}
/* phone */
@media (max-width: 760px) {
  :root { --top-h: 58px; --player-h: 72px; }
  body { font-size: 15px; }
  .topbar { gap: 6px; padding: 0 8px; }
  .brand-name, .search .hint { display: none; }
  .search input { padding-right: 12px; }
  .top-actions { gap: 2px; }
  .panel { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: min(88vw, 360px); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); z-index: 30; display: flex; }
  .panel.collapsed { display: flex; }
  .panel.open { transform: none; }
  .layout.detail-open .stage { --right-inset: 0px; }
  .detail {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 78vh; z-index: 35;
    border: 0; border-top: 1px solid var(--line); border-radius: 24px 24px 0 0; box-shadow: var(--shadow); animation: sheet-in .24s ease;
    padding-bottom: var(--safe-b);
  }
  .sheet-handle { display: block; width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 8px auto 0; flex: none; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .minimap { display: none; }
  .map-ctrl { top: auto; bottom: calc(var(--player-h) + 26px + var(--safe-b)); right: 10px; }
  .axis { font-size: 10px; }
  .axis-b { bottom: calc(var(--player-h) + 26px + var(--safe-b)); }
  .player { width: calc(100% - 16px); bottom: calc(8px + var(--safe-b)); padding: 8px; border-radius: 20px; transform: translateX(-50%); }
  .p-row { gap: 10px; }
  .p-art { width: 48px; height: 48px; border-radius: 12px; }
  .p-time, .p-vol, #p-prev, #p-auto-label { display: none; }
  .p-auto { padding: 0 9px; border: 0; }
  .p-extra { gap: 0; }
  .p-play { width: 46px; height: 46px; }
  .p-title { font-size: 15px; }
  .p-sub { font-size: 12px; }
  .tour-bar { top: 8px; gap: 8px; }
  .tour-dots { display: none; }
  .tour-grid { grid-template-columns: 1fr 1fr; }
  .tour-card { flex-direction: column; gap: 6px; padding: 12px; }
  .modal { padding: 20px 16px; border-radius: 22px; }
  .quiz-play { width: 96px; height: 96px; }
}
@media (max-width: 380px) {
  .tour-grid { grid-template-columns: 1fr; }
  .quiz-opts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
[hidden] { display: none !important; }
