/* ───────────────────────── 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 ───────────────────────── */
/* Nunito (variable, 500–900), self-hosted: no render-blocking request to Google, cached by the service worker */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 900; font-display: swap; src: url(../fonts/nunito-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 900; font-display: swap; src: url(../fonts/nunito-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 900; font-display: swap; src: url(../fonts/nunito-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

* { 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; }
/* no browser button face (Android Chrome paints it grey with an outset border); every button class sets its own look */
button { cursor: pointer; background: none; border: 0; padding: 0; }
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; }
/* emoji in a 1em box: the line box (Nunito metrics) pushed it ~2px up-left in round buttons */
.btn.fun span[aria-hidden] { display: block; width: 1em; height: 1em; line-height: 1; text-align: center; transform: translateY(1.5px); }
.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; }

.pick-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 40px; padding: 0 10px 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg-elev-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.pick-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .6; }
.pick-btn:hover { border-color: var(--accent); }
.pick-btn.mini { width: auto; height: 32px; font-size: 13px; padding: 0 8px 0 10px; }
.picker { max-width: 420px; display: flex; flex-direction: column; padding-bottom: 14px; }
.picker:not([open]) { display: none; }
.pick-q { width: 100%; height: 42px; padding: 0 14px; margin: 6px 0 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg-elev-2); color: var(--text); font: inherit; font-weight: 600; outline: none; }
.pick-q:focus { border-color: var(--accent); }
.pick-list { list-style: none; margin: 0 -10px; padding: 0; overflow: auto; min-height: 0; max-height: min(60vh, 520px); }
.pick-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.pick-list li:hover, .pick-list li:focus-visible { background: var(--bg-elev-2); outline: none; }
.pick-list li[aria-selected="true"] { color: var(--accent); }
.pick-list li[aria-selected="true"]::after { content: "✓"; }
.pick-list .name { flex: 1; min-width: 0; }
.pick-list .n { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.pick-list .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.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);
  width: max-content;   /* left:50% alone caps a shrink-to-fit box at half the map width */
}
.tour-bar[hidden] { display: none; }
.tour-bar.away #tour-step { color: var(--accent); }
.tour-bar.away .tour-dots i.cur { background: var(--line); transform: none; outline: 1.5px solid var(--accent-2); }
.tour-trail svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tour-trail svg circle { fill: currentColor; stroke: none; }
.tour-trail, .tour-repeat { opacity: .55; }
.tour-trail[aria-pressed="true"], .tour-repeat[aria-pressed="true"] { opacity: 1; color: var(--accent); }
/* shared line icons (js/icons.js): solid parts and the small sizes used inside lists */
svg.ic .fill { fill: currentColor; stroke: none; }
.tour-bar .icon-btn { width: 36px; height: 36px; }
@media (max-width: 380px) { .tour-bar .icon-btn { width: 31px; } }
.bar-ic { display: grid; place-items: center; }
.bar-ic svg { width: 22px; height: 22px; }
.bar-ic.rec { color: #ef4444; }
.play-mini svg, .tracklist .tn svg { width: 14px; height: 14px; vertical-align: -2px; }
.icon-btn.x svg, .x svg { width: 14px; height: 14px; }
#route-list .icon-btn svg { width: 16px; height: 16px; }
.tour-bar.under-replay { display: none; }   /* a replay borrows the spot while it runs */
.replay-bar { z-index: 8; }
.live-bar { top: 64px; }
.tour-bar.under-replay ~ .live-bar, .replay-bar[hidden] ~ .live-bar { top: 12px; }
.tour-bar:not([hidden]):not(.under-replay) ~ .live-bar, .replay-bar:not([hidden]) ~ .live-bar { top: 64px; }
.set-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.set-h:has(.set-all) { display: flex; align-items: center; gap: 6px; }
.set-h .set-all { margin-left: auto; }
.set-h .set-all[hidden] { display: none; }
.bk-ask { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line); }
.bk-ask p { margin: 0 0 8px; }
.bk-ask[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); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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); }
.tour-dots.long { width: 160px; }
.tour-dots.long i.prog { width: 100%; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p), var(--line) 0); }

/* ───────────────────────── Player ───────────────────────── */
.player {
  position: absolute; z-index: 9;
  left: 50%; bottom: calc(14px + var(--safe-b));
  width: min(1140px, 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; } }
@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: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
/* left (cover + title) and right (time + extras) take equal shares: prev / play / next stay in the exact middle */
.p-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.p-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.p-right > :first-child { margin-left: auto; }   /* right-aligned, but an overflow spills right where main.js can measure it */
/* too narrow to centre (side panels squeeze the bar): plain row, the title gives way */
@container (max-width: 420px) { .p-row { display: flex; } .p-left { flex: 1; } }
.p-art { width: 56px; height: 56px; border-radius: 14px; border: 0; padding: 0; overflow: hidden; flex: none; background: var(--bg-elev-2); }
.p-art { position: relative; }
.p-art canvas { width: 100%; height: 100%; display: block; position: relative; pointer-events: none; }   /* clicks reach the cover under it */
.p-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }   /* the cover; the viz draws a small equalizer over its bottom edge */
.p-art img[hidden] { display: none; }
/* album covers: a coloured tile until the image is known (--c = the genre colour) */
.cover { display: inline-block; flex: none; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--c, var(--accent)) 35%, var(--bg-elev-2)); vertical-align: middle; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* cover with the play button as a round badge on its corner: one column instead of two, more room for the title */
.now-art { position: relative; flex: none; width: 76px; height: 76px; }
.now-art .now-cover { width: 76px; height: 76px; border-radius: 14px; }
.now-art .now-play { position: absolute; right: -8px; bottom: -8px; width: 42px; height: 42px; border: 3px solid color-mix(in srgb, var(--g, var(--accent)) 12%, var(--bg-elev-2)); }
.now-art .now-play svg { width: 18px; height: 18px; }
.now.no-track .now-art { display: none; }
.quiz-cover { width: 120px; height: 120px; border-radius: 18px; box-shadow: var(--shadow); }
.set-hist .cover { width: 36px; height: 36px; border-radius: 9px; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 56px; height: 56px; border-radius: 14px; overflow: hidden; flex: none; background: var(--c, var(--bg-elev-2)); }
.mosaic .cover { width: 100%; height: 100%; border-radius: 0; }
.mosaic[data-n="1"] { grid-template-columns: 1fr; }
.mosaic[data-n="1"] .cover:not(:first-child) { display: none; }
.tour-card .mosaic { width: 52px; height: 52px; }
.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; }
/* auto-next: icon only (near / random / off), accent when on; the title + toast say which */
/* repeat: one SVG, a "1" (this track) or a note (this genre) drawn inside the arrows, accent when on */
#p-loop .lp-1, #p-loop .lp-g { display: none; }
#p-loop[data-mode="track"] .lp-1, #p-loop[data-mode="genre"] .lp-g { display: inline; }
#p-loop .lp-1, #p-loop .lp-g path { stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#p-loop .lp-g ellipse { fill: currentColor; stroke: none; }
#p-loop[data-mode="track"], #p-loop[data-mode="genre"] { color: var(--accent); }
.p-auto[aria-pressed="true"] { color: var(--accent); }
.p-auto g { display: none; }
.p-auto[data-mode="near"] .pa-near, .p-auto[data-mode="random"] .pa-random, .p-auto[data-mode="off"] .pa-off { display: inline; }
.p-auto .pa-near circle:first-child { fill: currentColor; }
.p-vol { display: flex; align-items: center; }
.p-vol input { width: 80px; accent-color: var(--g); }
/* in the bar the slider opens when you point at the speaker (saves ~80px so the extras fit without the ⋯ menu) */
.p-pop:not(:popover-open) .p-vol { position: relative; }
.p-pop:not(:popover-open) .p-vol input { position: absolute; z-index: 1; left: 50%; bottom: calc(100% + 18px); transform: translateX(-50%);
  writing-mode: vertical-lr; direction: rtl; width: 20px; height: 104px; margin: 0;   /* vertical, louder = up */
  opacity: 0; pointer-events: none; transition: opacity .15s; }
/* the pill behind it reaches down to the speaker button, so the pointer can travel up without leaving the hover */
.p-pop:not(:popover-open) .p-vol::before { content: ""; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); width: 40px; height: 144px;
  border-radius: 999px 999px 12px 12px; background: var(--bg-elev-2); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s; }
.p-pop:not(:popover-open) .p-vol:is(:hover, :focus-within) input { opacity: 1; pointer-events: auto; }
.p-pop:not(:popover-open) .p-vol:is(:hover, :focus-within)::before { opacity: 1; pointer-events: auto; }
#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: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); overflow: hidden; display: grid; }
.swatch .mosaic { width: 100%; height: 100%; border-radius: 0; }
.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)); }
/* the bars only take room while this genre plays; paused/other genre: folded away (no empty band on top of the card) */
.d-viz { width: 100%; height: 0; display: block; margin-bottom: 0; opacity: 0; transition: height .25s ease, margin .25s ease, opacity .2s; }
.now[data-playing="true"] .d-viz { height: 76px; margin-bottom: 10px; opacity: 1; }
.now[data-playing="true"] .d-viz.round { height: 150px; }   /* ring / particles / tunnel need a squarer stage */
.d-vizbox { position: relative; }
.d-vizmode { position: absolute; top: 0; right: 0; height: 26px; padding: 0 8px; display: none; align-items: center; gap: 5px; border: 0; border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 55%, transparent); color: var(--text-dim); font: 700 11.5px/1 inherit; cursor: pointer; opacity: .55; transition: opacity .15s; }
.d-vizmode svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.now[data-playing="true"] .d-vizmode { display: flex; }
.d-vizbox:hover .d-vizmode, .d-vizmode:focus-visible { opacity: 1; color: var(--text); }
.d-vizmode span:empty { display: none; }
.now.no-track .d-vizmode { display: none; }
.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; }   /* no overscroll containment: at the end, the wheel moves on to the dialog */
.set-favs .chip .x { margin-left: 2px; opacity: .55; font-size: 12px; padding: 0 2px; }
.set-favs .chip .x:hover { opacity: 1; }
.set-hist { max-height: 320px; overflow: auto; margin-top: 4px; }
.set-hist .name small { display: block; font-size: 12px; font-weight: 600; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-hist .name { min-width: 0; }
.set-songs li .x { margin-left: 2px; width: 32px; height: 32px; font-size: 13px; opacity: .7; }
.like-btn svg { fill: none; transition: fill .15s, transform .15s; }
.like-btn[aria-pressed="true"] { color: #ff4d6d; }
.like-btn[aria-pressed="true"] svg { fill: currentColor; }
.like-btn:active svg { transform: scale(1.25); }
.like-btn:disabled { opacity: .35; }
.quiz-credit .like-btn { width: 40px; height: 40px; vertical-align: middle; margin-left: 4px; }
.dj-now .dj-like { margin-left: 2px; flex: none; width: 44px; height: 44px; }
#set-hist-more { margin-top: 6px; }
.explored { cursor: pointer; }
.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-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.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; }
/* play/pause button whose background is a live mini visualizer (js/vizbtn.js) */
.vb { overflow: hidden; }
.vb-cv { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; }
.vb svg { position: relative; }
@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; }

/* follows the theme like every other floating bar; width: max-content, as left:50% alone caps a shrink-to-fit box at half the screen */
.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 40px + var(--safe-b)); transform: translateX(-50%); z-index: 100; background: var(--bg-elev); color: var(--text); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); width: max-content; max-width: calc(100% - 32px); text-align: center; }
/* a new build is ready: offered, never forced (music or a game may be running) */
.upd { position: fixed; left: 50%; bottom: calc(var(--player-h) + 40px + var(--safe-b)); transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--bg-elev); color: var(--text); border: 1.5px solid var(--accent); font-weight: 800; box-shadow: var(--shadow); max-width: calc(100% - 32px); white-space: nowrap; }
.upd .icon-btn { width: 32px; height: 32px; }
.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-removed { 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; }
  .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%); }
  /* two rows: [art · title · ⌃] then [loop · prev · play · next · mode] so no control gets dropped */
  .p-row { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: space-between; }
  .p-left, .p-right { display: contents; }
  .p-controls, .p-extra { display: contents; }
  .p-art { width: 44px; height: 44px; border-radius: 12px; order: 0; }
  .p-meta { order: 1; flex: 0 0 calc(100% - 44px - 40px - 20px); }
  #p-more { order: 2; }
  .p-meta { flex-basis: calc(100% - 44px - 40px - 20px); }
  #p-like { order: 3; } #p-prev { order: 4; } .p-play { order: 5; } #p-next { order: 6; } #p-menu { order: 7; }
  /* the row is space-between for the title row: the controls row centres itself as one group instead of hugging both edges */
  #p-like { margin-left: auto; } #p-menu { margin-right: auto; } #p-prev, #p-next { margin: 0 10px; }
  .p-time { display: none; }
  #p-prev { display: inline-grid; }   /* same as .icon-btn: the svg stays centred */
  .p-play { width: 48px; height: 48px; }
  .player[data-state="empty"] :is(.p-controls, .p-time, .p-extra) > *, .player[data-state="empty"] .p-time { display: none; }
  .player[data-state="empty"] .p-meta { flex: 1; }
  .p-title { font-size: 15px; }
  .p-sub { font-size: 12px; }
  .tour-bar { top: 8px; gap: 10px; left: 8px; right: 8px; transform: none; width: auto; max-width: none; border-radius: 22px; }
  .tour-info { flex: 1; }
  .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) {
  body.kids .p-play { width: 52px; height: 52px; }
  .p-row { gap: 8px 6px; }
  .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; }

/* ── passport ── */
.passport { max-width: 560px; text-align: center; }
.passport h2 { padding-right: 36px; text-align: left; }
#pp-canvas { display: block; margin: 8px auto 0; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 210px); aspect-ratio: 1080 / 1350; border-radius: 16px; box-shadow: var(--shadow-sm); }
.pp-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
/* ── genre path ── */
.path { max-width: 640px; }
.path-pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; margin-top: 10px; }
.path-field { text-align: left; padding: 10px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg-elev-2); min-width: 0; }
.path-field:hover { border-color: var(--accent); }
.path-field small { display: block; color: var(--text-dim); font-size: 12px; font-weight: 700; }
.path-field b { display: block; font-weight: 900; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.path-field b.empty { color: var(--text-faint); font-weight: 700; }
.path-pick .icon-btn { align-self: center; font-size: 18px; }
.path-pick #path-rand { grid-column: 1 / -1; }
.path-count { margin: 14px 0 8px; font-weight: 900; color: var(--text-dim); }
.path-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-height: 38vh; overflow: auto; padding: 2px; }
.path-chip { --chip-c: var(--accent); border-color: var(--chip-c); background: color-mix(in srgb, var(--chip-c) 14%, var(--bg-elev-2)); font-weight: 800; }
.path-chip .emo { font-size: 14px; line-height: 1; }
.path-arrow { color: var(--text-faint); }
.path-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.path-actions .btn:disabled { opacity: .45; pointer-events: none; }
/* my route */
.route { max-width: 520px; }
.route-head { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.route-name { flex: 1; min-width: 0; font: inherit; font-weight: 800; font-size: 16px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg-elev-2); color: inherit; }
.route-name:focus { outline: none; border-color: var(--accent); }
.route-list { list-style: none; margin: 0 -6px; padding: 0; max-height: 46vh; overflow: auto; }
.route-list li { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; }
.route-list li:hover { background: var(--bg-elev-2); }
.route-list .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.route-t { flex: 1; min-width: 0; }
.route-t b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-t small { display: block; color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-list .icon-btn { width: 32px; height: 32px; flex: none; }
.route-list .icon-btn:disabled { opacity: .3; pointer-events: none; }
.btn.danger { background: #c0392b; border-color: #c0392b; color: #fff; }
@media (max-width: 760px) { .path { padding: 22px 16px; } .path-actions .btn { flex: 1; } }
/* ── world map ── */
.world { max-width: 980px; height: min(820px, calc(100% - 24px)); flex-direction: column; gap: 8px; overflow: hidden;
  --wc-0: color-mix(in srgb, var(--line) 60%, var(--bg-elev)); --wc-1: color-mix(in srgb, var(--accent) 24%, var(--bg-elev-2));
  --wc-2: color-mix(in srgb, var(--accent) 42%, var(--bg-elev-2)); --wc-3: color-mix(in srgb, var(--accent) 62%, var(--bg-elev-2));
  --wc-4: color-mix(in srgb, var(--accent) 82%, var(--bg-elev-2)); --wc-5: var(--accent-2); }
.world[open] { display: flex; }
.world-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; flex: none; }
/* wide screens: map on the left, the country's genres in a column on the right */
@media (min-width: 900px) {
  .world { max-width: 1280px; width: calc(100% - 48px); flex-direction: row; gap: 18px; height: min(760px, calc(100% - 48px)); }
  .world .world-main { flex: 1; overflow: auto; }
  .world .world-extra { max-height: none; overflow: visible; }
  .world .world-sheet { flex: none; width: 340px; min-height: 0; border-top: 0; border-left: 1px solid var(--line); padding: 44px 0 0 16px; }
  .world-sheet .ws-list { grid-template-columns: 1fr; }
}
.world h2 { margin: 0; padding-right: 44px; flex: none; }
.world-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.world-tools p { margin: 0; }
.world-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: none; }
.world-legend .sp { width: 8px; }
.sw { display: inline-block; width: 16px; height: 10px; border-radius: 3px; background: var(--wc-0); }
.sw.w1 { background: var(--wc-1); } .sw.w2 { background: var(--wc-2); } .sw.w3 { background: var(--wc-3); }
.sw.w4 { background: var(--wc-4); } .sw.w5 { background: var(--wc-5); }
.sw.heard { background: transparent; border: 2px solid var(--good); }
.world-map { position: relative; flex: none; width: 100%; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.world-map svg { display: block; width: 100%; height: 100%; cursor: grab; user-select: none; -webkit-user-select: none; }
.world-zoom { position: absolute; right: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 4px; z-index: 1; }
.world-zoom .icon-btn { width: 32px; height: 32px; font-size: 18px; font-weight: 900; background: var(--bg-elev); border: 1px solid var(--line); }
.wc { fill: var(--wc-0); stroke: var(--bg); stroke-width: .6; vector-effect: non-scaling-stroke; outline: none; }
.wc.w1 { fill: var(--wc-1); } .wc.w2 { fill: var(--wc-2); } .wc.w3 { fill: var(--wc-3); } .wc.w4 { fill: var(--wc-4); } .wc.w5 { fill: var(--wc-5); }
.wc[role="button"] { cursor: pointer; }
.wc[role="button"]:hover { stroke: var(--text); stroke-width: 1.4; }
.wc.heard { stroke: var(--good); stroke-width: 1.8; }
.wc.sel, .wc:focus-visible { stroke: var(--text); stroke-width: 2.4; }
.wd { fill: none; stroke: none; }
.wd circle { fill: var(--wc-0); stroke: var(--bg); stroke-width: 1; vector-effect: non-scaling-stroke; }
.wd.w1 circle { fill: var(--wc-1); } .wd.w2 circle { fill: var(--wc-2); } .wd.w3 circle { fill: var(--wc-3); } .wd.w4 circle { fill: var(--wc-4); } .wd.w5 circle { fill: var(--wc-5); }
.wd.heard circle { stroke: var(--good); stroke-width: 2; } .wd.sel circle, .wd:focus-visible circle { stroke: var(--text); stroke-width: 2.4; }
.world-extra { flex: none; display: grid; gap: 4px; max-height: 84px; overflow: auto; }
.world-extra .chip { padding: 5px 10px; font-size: 13px; }
.world-sheet { flex: 1; min-height: 120px; overflow: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.world-hint { margin: 8px 0; }
.ws-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ws-name { display: block; font-size: 18px; font-weight: 900; line-height: 1.2; }
.ws-list { list-style: none; margin: 0 -8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ws-list li { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-weight: 700; min-width: 0; }
.ws-list li:hover, .ws-list li:focus-visible { background: var(--bg-elev-2); outline: none; }
.ws-list .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.ws-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-list .play-mini { font-size: 12px; color: var(--text-faint); }
@media (max-width: 760px) {
  .world { height: calc(100% - 16px); }
  .world-tools { flex-direction: column; align-items: stretch; }
  .world-tools p { display: none; }
  .ws-list { grid-template-columns: 1fr; }
}
/* ── more songs per genre ── */
.more-tracks { margin-top: 14px; }
.more-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tracklist { list-style: none; margin: 0 -8px; padding: 0 8px; display: grid; gap: 2px; max-height: 340px; overflow-y: auto; position: relative; align-content: start; }
.radio-pos { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.tracklist li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
.tracklist li:hover { background: color-mix(in srgb, var(--g, var(--accent)) 14%, transparent); }
.tracklist li.cur { background: color-mix(in srgb, var(--g, var(--accent)) 22%, transparent); }
.tracklist .tn { width: 22px; flex: none; text-align: center; font-size: 12px; color: var(--text-faint); font-weight: 800; }
.tracklist li.cur .tn { color: var(--text); }
.tracklist .tt { flex: 1; min-width: 0; display: grid; }
.tracklist b { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracklist small { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now.no-track .more-tracks { display: none; }

/* ── dj pad ── */
.dj { max-width: 560px; }
.dj-now { --dj-c: var(--accent); display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 6px 0 10px; padding: 8px 14px; border-radius: 16px; border: 2px solid var(--dj-c); background: color-mix(in srgb, var(--dj-c) 14%, var(--bg-elev-2)); }
.dj-emo { font-size: 28px; line-height: 1; }
.dj-name { font-size: 20px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dj-fam { margin-left: auto; color: var(--text-dim); font-weight: 700; white-space: nowrap; }
.dj-pad { --dj-c: var(--accent); position: relative; width: min(100%, calc(100dvh - 330px)); min-width: 220px; aspect-ratio: 1; margin: 0 auto; border-radius: 22px; border: 1.5px solid var(--line); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; outline-offset: 3px;
  background: linear-gradient(90deg, rgba(80, 190, 110, .16), rgba(130, 90, 255, .2)), var(--bg-elev-2); }
.dj-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dj-puck, .dj-target { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; pointer-events: none; will-change: transform; }
.dj-puck { background: radial-gradient(circle, #fff 0 22%, var(--dj-c) 24% 100%); box-shadow: 0 0 0 4px color-mix(in srgb, var(--dj-c) 35%, transparent), 0 0 22px 8px color-mix(in srgb, var(--dj-c) 70%, transparent); transform: translate3d(calc(50% - 18px), calc(50% - 18px), 0); }
.dj-pad.drag .dj-puck { box-shadow: 0 0 0 7px color-mix(in srgb, var(--dj-c) 35%, transparent), 0 0 30px 12px color-mix(in srgb, var(--dj-c) 75%, transparent); }
.dj-target { border: 3px solid var(--dj-c); background: color-mix(in srgb, var(--dj-c) 25%, transparent); }
.dj-ax { position: absolute; font-size: 12px; font-weight: 800; color: var(--text); background: color-mix(in srgb, var(--bg-elev) 78%, transparent); border-radius: 999px; padding: 2px 9px; pointer-events: none; white-space: nowrap; }
.dj-l { left: 6px; top: 50%; transform: translateY(-50%); }
.dj-r { right: 6px; top: 50%; transform: translateY(-50%); }
.dj-t { top: 6px; left: 50%; transform: translateX(-50%); }
.dj-b { bottom: 6px; left: 50%; transform: translateX(-50%); }
.dj-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.dj-foot p { margin: 0; }
@media (max-width: 760px) { .dj { padding: 18px 14px; } .dj-name { font-size: 18px; } .dj-ax { font-size: 11px; padding: 2px 7px; } }
/* ── guess the country ── */
.geo { max-width: 880px; text-align: center;
  --wc-0: color-mix(in srgb, var(--line) 60%, var(--bg-elev)); --gc: color-mix(in srgb, var(--accent) 34%, var(--bg-elev-2)); }
.geo .quiz-top { justify-content: space-between; }
.geo-bar { display: flex; align-items: center; gap: 14px; margin: 6px 0 2px; }
.geo-info { flex: 1; min-width: 0; }
.geo-info .quiz-stats { justify-content: space-between; margin: 0 0 6px; }
.geo-info .quiz-bar { max-width: none; }
.geo-play { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 0; position: relative; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent); }
.geo-play svg { width: 28px; height: 28px; fill: currentColor; stroke-width: 1.5; }
.geo-play .i-pause { display: none; fill: none; stroke-width: 3.2; }
.geo[data-playing="true"] .geo-play .i-play { display: none; }
.geo[data-playing="true"] .geo-play .i-pause { display: block; }
.dj-play { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; position: relative; display: grid; place-items: center; background: var(--dj-c); color: #fff; margin: -2px 0; }
.dj-play svg { width: 24px; height: 24px; fill: currentColor; stroke-width: 1.5; }
.dj-play .i-pause { display: none; fill: none; stroke-width: 3.2; }
.dj[data-playing="true"] .dj-play .i-play { display: none; }
.dj[data-playing="true"] .dj-play .i-pause { display: block; }
.geo .quiz-q { margin: 10px 0 2px; }
.geo-hint { margin: 0 0 8px; }
.geo-map { aspect-ratio: 5 / 4; touch-action: none; }
.geo-map svg { height: 100%; }
.gc { fill: var(--gc); stroke: var(--bg); stroke-width: .6; vector-effect: non-scaling-stroke; outline: none; cursor: pointer; }
.gd { fill: none; stroke: none; }
.gd circle { fill: var(--gc); stroke: var(--bg); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gc:hover:not(.ok):not(.bad), .gc:focus-visible { stroke: var(--text); stroke-width: 1.6; }
.gd:hover circle, .gd:focus-visible circle { stroke: var(--text); stroke-width: 1.6; }
.gc.ok { fill: var(--good); } .gd.ok circle { fill: var(--good); }
.gc.bad { fill: var(--bad); } .gd.bad circle { fill: var(--bad); }
.gc.opt:not(.ok):not(.bad) { stroke: var(--oc); stroke-width: 2.4; fill: color-mix(in srgb, var(--oc) 42%, var(--gc)); }
.gc.opt.hot:not(.ok):not(.bad) { stroke-width: 4.5; fill: color-mix(in srgb, var(--oc) 70%, var(--gc)); }
.gd.opt:not(.ok):not(.bad) circle { stroke: var(--oc); stroke-width: 2.4; fill: color-mix(in srgb, var(--oc) 60%, var(--gc)); }
.gd.opt.hot:not(.ok):not(.bad) circle { stroke-width: 4.5; fill: var(--oc); }
.geo-ring { fill: none; stroke: var(--oc); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-dasharray: 5 3; }
.geo-hint-g.hot .geo-ring { stroke-width: 5; stroke-dasharray: none; }
.geo-tag {font-size: var(--tag); font-weight: 900; fill: var(--text); stroke: var(--bg); stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.geo-hint-g.hot .geo-tag { fill: var(--oc); font-size: calc(var(--tag) * 1.2); }
.geo-sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: -1px; box-shadow: 0 0 0 2px var(--bg-elev-2); }
.geo-opt[data-result] .geo-sw { display: none; }
.geo-find { margin-top: 10px; text-align: left; scroll-margin-top: 8px; }
.geo-find[hidden] { display: none; }
.geo-find input { width: 100%; box-sizing: border-box; min-height: 52px; padding: 0 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg-elev-2); color: var(--text); font: inherit; font-size: 16px; font-weight: 700; }
.geo-find input:focus { outline: none; border-color: var(--accent); }
.geo-sug { display: grid; gap: 6px; margin-top: 8px; }
.geo-sug[hidden] { display: none; }
.geo-sug-i { min-height: 52px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg-elev-2); color: var(--text); font: inherit; font-size: 17px; font-weight: 800; text-align: left; }
.geo-sug-i:hover, .geo-sug-i:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev-2)); }
.geo-sug-none { padding: 12px 6px; opacity: .7; }
.geo.searching { padding-bottom: 55vh; }
.geo-line { stroke: var(--text); stroke-width: 2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.geo-pin { fill: none; stroke: var(--good); stroke-width: 3; vector-effect: non-scaling-stroke; }
.geo-opts { margin-top: 10px; }
.geo-opts[hidden] { display: none; }
.geo-opt { --c: var(--accent); }
.geo-opt[data-result] { opacity: 1; }
.geo-pts { font-size: 22px; font-weight: 900; color: var(--accent); }
.geo .quiz-credit .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.geo-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.geo[data-state="final"] .geo-game { display: none; }
.geo-final { display: none; padding: 30px 0 10px; }
.geo[data-state="final"] .geo-final { display: grid; gap: 8px; justify-items: center; }
.geo-stars { font-size: 52px; letter-spacing: 6px; color: #f5b301; line-height: 1; }
.geo-big { font-size: 40px; font-weight: 900; }
.geo-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 6px 0; }
.geo-dots i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 13px; background: var(--bg-elev-2); border: 2px solid var(--line); }
.geo-dots i[data-p="3"] { border-color: var(--good); background: color-mix(in srgb, var(--good) 25%, var(--bg-elev-2)); }
.geo-dots i[data-p="1"] { border-color: #f5b301; background: color-mix(in srgb, #f5b301 22%, var(--bg-elev-2)); }
@media (min-width: 761px) { .geo-map { aspect-ratio: 1000 / 434.7; } }
@media (max-width: 760px) { .geo { padding: 18px 12px; } .geo .quiz-top h2 { font-size: 19px; } .geo-map { aspect-ratio: 1 / 1; } }
/* ── artist search ── */
.suggest li.sug-h, .suggest li.sug-a { cursor: default; background: none; }
.suggest li.sug-h { padding: 8px 10px 2px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.suggest li.sug-a { padding: 6px 10px 2px; font-weight: 800; }
.suggest li.sug-g { padding-left: 22px; }
.results li.art-h { cursor: default; padding: 10px 0 2px; margin: 0; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); background: none; }
.results li.art-row { display: block; cursor: default; padding: 6px 0; margin: 0; background: none; }
.results li.art-row b { display: block; margin-bottom: 4px; }
.art-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.art-more { font-size: 12px; color: var(--text-faint); }
.d-art-line, .d-art-also p { margin: 0 0 8px; font-size: 13px; color: var(--text-dim); line-height: 1.45; }
.d-art-also { margin-top: 10px; }
.suggest li.sug-a > span:first-child, .suggest li.sug-g > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .suggest { position: fixed; top: 62px; left: 8px; right: 8px; }
}

/* games: own dialog (header 🎮), same look as explore */
.games .games-h, .explore .ex-title { margin: 0 40px 14px 0; font-size: 22px; }
.explore.first .ex-title { display: none; }   /* the welcome has its own heading */
/* the page itself never zooms: a pinch that lands partly on the header/player must not start a (laggy) browser zoom */
html, body { touch-action: pan-x pan-y; }
/* quiz: another song of the same genre */
.quiz-another { display: flex; margin: 10px auto 0; gap: 6px; align-items: center; }
.quiz-another small { color: var(--text-dim); font-weight: 600; }

/* settings: tabs + cards */
.set-tabs { display: flex; width: 100%; margin: 4px 0 12px; }
.set-tabs button { flex: 1 1 auto; padding: 8px 6px; white-space: nowrap; }
@media (max-width: 480px) { .settings { padding: 22px 14px; } .set-tabs button { padding: 7px 4px; font-size: 12.5px; letter-spacing: -.1px; } }
.set-pane { display: flex; flex-direction: column; gap: 10px; }
.set-pane[hidden] { display: none; }
.set-card { background: var(--bg-elev-2); border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px 12px; }
.set-card > .set-h:first-child { margin-top: 8px; }
.about-card { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.about-brand { display: flex; gap: 12px; align-items: center; }
.about-brand .brand-dot { width: 40px; height: 40px; flex: none; }
.about-brand b { display: block; font-size: 18px; }
.about-brand small { color: var(--text-dim); font-size: 13px; }
.gh-link { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.gh-link svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.credits { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.credits a { font-weight: 800; }

/* quiz: "back to the quiz" after "show on the map" (above the toast and the phone detail sheet) */
.quiz-back { position: fixed; left: 50%; translate: -50% 0;   /* not transform: .btn:active scales with transform and would drop the centring */ bottom: calc(var(--player-h) + 92px + var(--safe-b)); z-index: 101; box-shadow: var(--shadow); white-space: nowrap; }

/* guess the instrument (reuses .quiz) */
.instr-end { display: none; }
.instr[data-end="true"] .instr-play { display: none; }
.instr[data-end="true"] .instr-end { display: block; padding: 18px 0 6px; }
.instr-final { font-size: 64px; font-weight: 900; color: var(--accent); line-height: 1.1; }
.instr-opt { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 92px; }
.instr-opt i { font-style: normal; font-size: 30px; line-height: 1.1; }
.instr-opt span { font-size: 14px; line-height: 1.2; }
.instr-fact { font-size: 15px; font-weight: 700; line-height: 1.4; padding: 10px 12px; border-radius: 14px; background: var(--bg-elev-2); border: 1px solid var(--line); text-align: left; }
.instr-fact i { font-style: normal; }
/* ── artist page + artist links ── */
.art-link { color: inherit; font: inherit; font-weight: 800; padding: 0; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.art-link:hover { color: var(--accent); }
.results li.art-row .art-name { display: block; margin-bottom: 4px; text-align: left; }
.suggest li.sug-a { cursor: pointer; }
.artist { max-width: 560px; }
.artist h2 { padding-right: 36px; overflow-wrap: anywhere; }
.ag-list { list-style: none; margin: 0; padding: 0; max-height: min(52vh, 460px); overflow: auto; }
.ag-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.ag-play { appearance: none; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 4px; border-radius: 12px; }
.ag-play:hover, .ag-row.cur .ag-play { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ag-play .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.ag-t { min-width: 0; flex: 1; }
.ag-t b { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-t small { display: block; color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1em; }
.ag-top { font-size: 11px; font-weight: 800; color: var(--accent); flex: none; }
#artist-more { margin-top: 8px; }
/* ── artist bridge game ── */
.bridge { max-width: 680px; }
.bridge-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.bridge-levels .btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.bridge-goal { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.bridge-goal small { display: block; color: var(--text-dim); font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.bridge-trail { margin-bottom: 6px; }
.bridge-via { font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--bg-elev-2); border: 1px dashed var(--line); }
.path-chip.now { box-shadow: 0 0 0 2px var(--chip-c); }
.path-chip.hint, .bridge-a.hint { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warm) 70%, transparent); }
.bridge-q { margin: 12px 0 8px; font-weight: 900; }
.bridge-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.bridge-a { text-align: left; padding: 10px 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg-elev-2); min-width: 0; }
.bridge-a:hover { border-color: var(--accent); }
.bridge-a b { display: block; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bridge-a small { color: var(--text-dim); font-size: 12px; font-weight: 700; }
.bridge-genres { display: flex; flex-wrap: wrap; gap: 8px; }
.bridge-win { margin: 14px 0 2px; font-size: 18px; font-weight: 900; }
@media (max-width: 760px) { .bridge, .artist { padding: 22px 16px; } .bridge .path-actions .btn { flex: 1; } }

/* on-device frame meter (Settings: tap the version 5 times) */
.perf-hud { position: fixed; left: 6px; top: calc(env(safe-area-inset-top) + 70px); z-index: 9999; margin: 0; padding: 6px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.78); color: #7dffa8; font: 600 11px/1.35 ui-monospace, Menlo, monospace; white-space: pre; pointer-events: none; }

/* one-line genre explanation under the title (js/explain.js) */
.d-explain { margin: 4px 0 12px; font-size: 14.5px; line-height: 1.5; color: var(--text-dim); }
.d-explain:empty { display: none; }
/* facts carousel: the text keeps its place, ‹ 2/5 › sits under it on the right */
/* text left, ‹ 2/3 › on the right of its last line: no extra row, no reserved height */
.d-facts { margin: 4px 0 12px; display: flex; align-items: flex-end; gap: 6px; }
.d-facts .d-explain { margin: 0; flex: 1; min-width: 0; }
.fact-nav { display: flex; align-items: center; gap: 0; flex: none; margin-right: -6px; }
.fact-nav[hidden] { display: none; }
/* games: the answer's fact under the verdict */
.g-facts { display: flex; align-items: flex-end; gap: 6px; text-align: left; width: 100%; margin: 4px 0 8px; padding: 10px 6px 8px 12px; border-radius: 12px; background: var(--bg-elev-2); border: 1px solid var(--line); }
.g-facts[hidden] { display: none; }
.g-fact { margin: 0; flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
body.kids .g-fact { font-size: 17px; }
.fact-btn { width: 30px; height: 30px; }
.fact-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fact-n { font-size: 12px; font-weight: 800; color: var(--text-dim); min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
body.kids .d-explain { font-size: 19px; line-height: 1.55; color: inherit; }

/* artist photos (js/covers.js avatarEl): round, first letter on a colour until/unless a photo is known */
.avatar { --s: 32px; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; flex: none; display: inline-grid; place-items: center; vertical-align: middle;
  background: color-mix(in srgb, var(--accent) 30%, var(--bg-elev-2)); color: var(--text); font-weight: 900; font-size: calc(var(--s) * .45); line-height: 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.suggest li.sug-a { display: flex; align-items: center; gap: 8px; }
.art-name { display: inline-flex; align-items: center; gap: 8px; }
.artist h2 { display: flex; align-items: center; gap: 12px; }
.artist h2 .artist-av { --s: 56px; font-size: 28px; }
.quiz-opts.faces .quiz-opt { display: flex; align-items: center; gap: 10px; text-align: left; }
.quiz-opts.faces .quiz-opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }

/* image viewer (js/viewer.js): covers / artist photos full screen, pinch-zoom + pan */
img[data-zoom] { cursor: pointer; }
.quiz-opt img[data-zoom], .mosaic img[data-zoom] { cursor: inherit; }
dialog.changelog { max-width: 460px; }
.log-body { max-height: min(60vh, 520px); overflow-y: auto; margin: 6px 0 14px; padding-right: 4px; }
.log-day h3 { font-size: .85rem; color: var(--muted); font-weight: 600; margin: 14px 0 6px; }
.log-day:first-child h3 { margin-top: 4px; }
.log-day.new h3::after { content: "NEW"; margin-left: 8px; font-size: .65rem; padding: 2px 6px; border-radius: 6px; background: var(--accent); color: #fff; vertical-align: 1px; }
.log-day ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; }
dialog.iv { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .92); color: #fff; overflow: hidden; }
dialog.iv::backdrop { background: transparent; }
.iv-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; cursor: zoom-in; }
.iv-stage.zoomed { cursor: grab; }
.iv-img { max-width: min(92vw, 640px); max-height: 80dvh; width: min(92vw, 80dvh, 640px); aspect-ratio: 1; object-fit: contain; border-radius: 10px; will-change: transform; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.iv-img.round { border-radius: 50%; }
.iv-stage.zoomed .iv-img.round { border-radius: 10px; }
.iv-cap { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); margin: 0; text-align: center; font-weight: 800; font-size: 16px; pointer-events: none; text-shadow: 0 1px 4px #000; }
.iv-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; color: #fff; background: rgba(255, 255, 255, .14); }
.iv-close svg { stroke: currentColor; }

/* artist page: artists near this one on the map */
.artist-near { margin-top: 12px; }
.artist-near h3 { font-size: 13px; margin: 0 0 6px; color: var(--text-dim, var(--text)); font-weight: 700; }
.an-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.an-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--text);
  border-radius: 999px; padding: 4px 10px 4px 8px; font: inherit; font-size: 13px; cursor: pointer; max-width: 100%; }
.an-chip:hover { border-color: var(--accent); }
.an-chip .dot { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); flex: none; }
.an-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btn-artists[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev)); }

/* player ⋯ menu: loop, auto-advance, volume, mini player (labels come from each button's title, so they follow the
   current mode and language). Placed by main.js next to the ⋯ button. */
.p-pop { position: fixed; inset: auto; margin: 0; min-width: 230px; padding: 6px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.p-pop:popover-open { display: flex; flex-direction: column; gap: 2px; }
.p-pop:popover-open > .icon-btn, .p-pop:popover-open .p-vol { width: 100%; height: 40px; border-radius: 10px; justify-content: flex-start; gap: 10px; padding: 0 10px;
  display: flex !important; align-items: center; }
.p-pop > .icon-btn[hidden] { display: none !important; }
.p-pop:popover-open > .icon-btn::after { content: attr(title); font-size: 14px; font-weight: 600; white-space: nowrap; }
.p-pop:popover-open > .icon-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.p-pop:popover-open .p-vol { padding: 0 4px 0 0; }
.p-pop:popover-open #p-mute { display: inline-grid !important; flex: none; }
.p-pop:popover-open .p-vol input { display: block !important; flex: 1; width: auto; min-width: 0; }
/* roomy player: the extras sit in the bar as before and the ⋯ button goes away; main.js adds .p-compact when they
   would overflow the right side (measured), and the phone layout is always compact */
.player:not(.p-compact) #p-menu { display: none; }
.player:not(.p-compact) .p-extra > #p-like { order: 2; }
.player:not(.p-compact) .p-extra > #p-more { order: 3; }
.player:not(.p-compact) .p-pop:not(:popover-open) { display: flex; align-items: center; gap: 2px; position: static; inset: auto; width: auto; height: auto;
  min-width: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; color: inherit; }

#p-pip[aria-pressed="true"] { color: var(--accent); }
