/* =====================================================================
   Hưng Anh Audio — giao diện tối, xanh dương / tím, đĩa than xoay
   ===================================================================== */
@property --a1 { syntax: '<color>'; inherits: true; initial-value: #4f7cff; }
@property --a2 { syntax: '<color>'; inherits: true; initial-value: #9b5cff; }
@property --a3 { syntax: '<color>'; inherits: true; initial-value: #ff4fd8; }
@property --bg { syntax: '<color>'; inherits: true; initial-value: #06050d; }
@property --bg2 { syntax: '<color>'; inherits: true; initial-value: #140f33; }

:root {
  --a1: #4f7cff;
  --a2: #9b5cff;
  --a3: #ff4fd8;
  --bg: #06050d;
  --bg2: #140f33;
  --glass: rgba(18, 16, 38, .55);
  --glass-2: rgba(28, 25, 56, .6);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eeedff;
  --muted: #9b98c4;
  --dim: #6b6893;
  --ok: #3ee6a8;
  --err: #ff5c7a;
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 55%, var(--a3));
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --bass: 0;
  --topbar: 72px;
  --player: 104px;
  --radius: 22px;
  transition: --a1 1.2s ease, --a2 1.2s ease, --a3 1.2s ease, --bg 1.2s ease, --bg2 1.2s ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
img { display: block; }
svg { fill: currentColor; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--a2) 60%, transparent); }

/* -------------------------------------------------- scrollbar */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--a2) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--a2) 40%, transparent); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* =====================================================================
   NỀN
   ===================================================================== */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background:
  radial-gradient(1200px 800px at 70% -10%, color-mix(in srgb, var(--a2) 22%, var(--bg2)) 0%, transparent 60%),
  radial-gradient(900px 700px at -10% 110%, color-mix(in srgb, var(--a1) 18%, var(--bg2)) 0%, transparent 60%),
  linear-gradient(180deg, var(--bg2), var(--bg)); }
.fx { position: absolute; pointer-events: none; display: none; }
.blob { position: absolute; border-radius: 50%; opacity: .5; will-change: transform; }
.b1 { width: 60vmax; height: 60vmax; left: -15vmax; top: -20vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--a1) 55%, transparent) 0%, transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate; }
.b2 { width: 55vmax; height: 55vmax; right: -18vmax; top: 10vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--a2) 55%, transparent) 0%, transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate; }
.b3 { width: 45vmax; height: 45vmax; left: 25vw; bottom: -25vmax;
  background: radial-gradient(circle, color-mix(in srgb, var(--a3) 35%, transparent) 0%, transparent 65%);
  animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(18vw, 12vh) scale(1.25); } }
@keyframes drift2 { to { transform: translate(-22vw, 18vh) scale(.85); } }
@keyframes drift3 { to { transform: translate(-12vw, -20vh) scale(1.2); } }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .65) 100%); }
.noise { position: absolute; inset: 0; opacity: .06; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* =====================================================================
   GLASS
   ===================================================================== */
.glass {
  background: linear-gradient(160deg, color-mix(in srgb, var(--a2) 14%, rgba(20, 20, 32, .86)), color-mix(in srgb, var(--bg) 92%, transparent));
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* =====================================================================
   TOPBAR
   ===================================================================== */
.topbar { position: relative; z-index: 5; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-disc { width: 34px; height: 34px; border-radius: 50%; position: relative;
  background: radial-gradient(circle, #0b0b12 0 14%, transparent 15%), conic-gradient(from 0deg, var(--a1), var(--a2), var(--a3), var(--a1));
  box-shadow: 0 0 22px -2px var(--a2); animation: spin 6s linear infinite; }
.brand-disc::after { content: ''; position: absolute; inset: 4px; border-radius: 50%;
  background: radial-gradient(circle, transparent 0 32%, #0d0c16 33% 100%), repeating-radial-gradient(circle, rgba(255,255,255,.06) 0 1px, transparent 1px 3px);
  mask: radial-gradient(circle, transparent 0 32%, #000 33%); -webkit-mask: radial-gradient(circle, transparent 0 32%, #000 33%); }
.brand-name { font-weight: 300; font-size: 1.35rem; letter-spacing: .02em; }
.brand-name b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.admin-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 6px 12px 6px 9px; border-radius: 99px;
  background: rgba(62, 230, 168, .1); color: var(--ok); border: 1px solid rgba(62, 230, 168, .25); animation: popIn .5s var(--spring); }
.admin-badge svg { width: 14px; height: 14px; }

.icon-btn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--muted);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); transition: all .35s var(--ease); }
.icon-btn svg { width: 22px; height: 22px; transition: transform .6s var(--ease); }
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .09); border-color: var(--line-2); box-shadow: 0 0 24px -6px var(--a2); }
#btnSettings:hover svg { transform: rotate(120deg); }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 11px; }
.icon-btn.sm svg { width: 18px; height: 18px; }

/* =====================================================================
   LAYOUT
   ===================================================================== */
.layout { position: relative; z-index: 2; height: calc(100vh - var(--topbar) - var(--player) - 24px); height: calc(100dvh - var(--topbar) - var(--player) - 24px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 410px); gap: 28px; padding: 0 28px 0; }

/* =====================================================================
   STAGE + ĐĨA THAN
   ===================================================================== */
.stage { --avail: calc(100dvh - var(--topbar) - var(--player) - 24px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 3.2vh, 40px); min-height: 0; }
.turntable { position: relative; width: min(80vw, clamp(170px, calc((var(--avail) - 150px) / 1.28), 460px)); aspect-ratio: 1; flex: none; }
#viz { position: absolute; left: -22%; top: -22%; width: 144%; height: 144%; pointer-events: none; }

.disc-glow { position: absolute; inset: 2%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--a2) 55%, transparent) 0%, color-mix(in srgb, var(--a1) 22%, transparent) 42%, transparent 68%);
  opacity: .35; will-change: transform, opacity; }

.disc-wrap { position: absolute; inset: 8%; border-radius: 50%;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .05), 0 0 0 7px rgba(12, 11, 22, .9), 0 0 0 8px rgba(255, 255, 255, .06); }
.disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; will-change: transform; background: #0b0b10; }
.grooves { position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 34%, rgba(0,0,0,.6) 34.5%, transparent 36%),
    radial-gradient(circle, transparent 0 62%, rgba(255,255,255,.05) 62.4%, transparent 63.2%),
    radial-gradient(circle, transparent 0 80%, rgba(255,255,255,.05) 80.4%, transparent 81.2%),
    radial-gradient(circle, transparent 0 96%, rgba(255,255,255,.08) 97%, #050508 98%),
    repeating-radial-gradient(circle, #141419 0 1px, #0c0c11 1.2px 2.4px, #18181f 2.7px 3.2px); }
/* phản xạ ánh sáng cầu vồng nhẹ — xoay theo đĩa */
.rainbow { position: absolute; inset: 0; border-radius: 50%; mix-blend-mode: color-dodge; opacity: .22;
  background: conic-gradient(from 20deg, transparent 0 8%, color-mix(in srgb, var(--a1) 80%, transparent) 12%, transparent 18% 50%, color-mix(in srgb, var(--a3) 70%, transparent) 58%, transparent 64%);
  mask: radial-gradient(circle, transparent 0 35%, #000 36% 96%, transparent 97%); -webkit-mask: radial-gradient(circle, transparent 0 35%, #000 36% 96%, transparent 97%); }
.label { position: absolute; inset: 31%; border-radius: 50%; overflow: hidden; background: #222;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .7), 0 0 0 4px rgba(255,255,255,.06), inset 0 0 20px rgba(0,0,0,.6); }
.label img { width: 100%; height: 100%; object-fit: cover; }
.label-ring { position: absolute; inset: 31%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, transparent 0 60%, rgba(0,0,0,.35) 100%), radial-gradient(circle, transparent 0 10%, rgba(255,255,255,.25) 10.5%, transparent 12%); }
/* ánh sáng cố định (không xoay) => cảm giác đĩa xoay thật */
.sheen { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    conic-gradient(from 300deg, transparent 0 6%, rgba(255,255,255,.13) 11%, transparent 18% 50%, rgba(255,255,255,.1) 58%, transparent 66%),
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.08), transparent 45%);
  mask: radial-gradient(circle, transparent 0 31%, #000 32%); -webkit-mask: radial-gradient(circle, transparent 0 31%, #000 32%); }
.spindle { position: absolute; left: 50%; top: 50%; width: 4.2%; height: 4.2%; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #9aa0b8 40%, #3a3e52 75%); box-shadow: 0 2px 6px rgba(0, 0, 0, .8); }

/* cần đĩa */
.tonearm { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible;
  filter: drop-shadow(-6px 10px 8px rgba(0, 0, 0, .55)); }
.tonearm .arm { transform-box: view-box; transform-origin: 90px 10px; transform: rotate(var(--arm, -36deg));
  transition: transform 1.1s var(--ease); }

/* chuyển bài */
.disc-wrap.swap-out { animation: swapOut .45s var(--ease) forwards; }
.disc-wrap.swap-in { animation: swapIn .8s var(--spring) both; }
@keyframes swapOut { to { transform: translateX(-12%) scale(.82) rotate(-25deg); opacity: 0; filter: blur(6px); } }
@keyframes swapIn { from { transform: translateX(14%) scale(.82) rotate(30deg); opacity: 0; filter: blur(6px); } }

/* thông tin bài */
.now { text-align: center; max-width: min(640px, 92%); }
.now-tag { display: inline-flex; align-items: center; gap: 8px; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  padding: 6px 14px; border-radius: 99px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
body.is-playing .live-dot { background: var(--a3); box-shadow: 0 0 0 0 var(--a3); animation: pulseDot 1.6s infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--a3) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.now-title { margin: 14px 0 6px; font-size: clamp(1.35rem, 2.6vw, 2.15rem); font-weight: 800; line-height: 1.2; letter-spacing: -.01em;
  background: linear-gradient(100deg, #fff 0%, #dcd8ff 40%, color-mix(in srgb, var(--a2) 60%, #fff) 70%, #fff 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes shine { to { background-position: -200% 0; } }
.now-artist { margin: 0; color: var(--muted); font-size: clamp(.92rem, 1.4vw, 1.05rem); }
.now.changing .now-title, .now.changing .now-artist { animation: textIn .8s var(--ease) both; }
.now.changing .now-artist { animation: textIn .8s .08s var(--ease) both; }
@keyframes textIn { from { opacity: 0; transform: translateY(14px); filter: blur(8px); } }

/* =====================================================================
   PLAYLIST
   ===================================================================== */
.playlist { border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; animation: panelIn .9s .1s var(--ease) both; }
@keyframes panelIn { from { opacity: 0; transform: translateX(30px); } }
.pl-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.pl-head h2 { margin: 0; font-size: 1.12rem; font-weight: 700; }
.pl-sub { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 10px; border-radius: 99px; font-size: .82rem; font-weight: 600;
  background: var(--grad); background-size: 200% 100%; box-shadow: 0 8px 24px -8px var(--a2); transition: all .4s var(--ease); }
.chip-btn svg { width: 16px; height: 16px; }
.chip-btn:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 12px 30px -8px var(--a2); }

.search { display: flex; align-items: center; gap: 8px; margin: 0 20px 10px; padding: 0 14px; height: 42px; border-radius: 13px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); transition: all .3s var(--ease); }
.search:focus-within { border-color: color-mix(in srgb, var(--a2) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 15%, transparent); }
.search svg { width: 17px; height: 17px; color: var(--dim); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: .9rem; }
.search input::placeholder { color: var(--dim); }
.search.sm { margin: 0; height: 38px; flex: 1; }

.pl-list { list-style: none; margin: 0; padding: 4px 10px 16px; overflow-y: auto; flex: 1; }
.track { --i: 0; position: relative; display: grid; grid-template-columns: 30px 48px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 14px; cursor: pointer; transition: background .3s var(--ease), transform .3s var(--ease);
  animation: trackIn .6s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes trackIn { from { opacity: 0; transform: translateY(14px); } }
.track:hover { background: rgba(255, 255, 255, .05); }
.track:active { transform: scale(.985); }
.track.active { background: linear-gradient(100deg, color-mix(in srgb, var(--a1) 22%, transparent), color-mix(in srgb, var(--a2) 14%, transparent) 60%, transparent); }
.track.active::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--a2); }
.t-idx { text-align: center; font-size: .78rem; color: var(--dim); font-variant-numeric: tabular-nums; position: relative; height: 18px; }
.t-idx .num { transition: opacity .2s; }
.t-idx .bars, .t-idx .pi { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2px; opacity: 0; transition: opacity .2s; }
.t-idx .pi svg { width: 16px; height: 16px; color: #fff; }
.t-idx .bars i { width: 3px; height: 30%; border-radius: 2px; background: var(--grad); animation: eqBar .9s ease-in-out infinite alternate; animation-play-state: paused; }
.t-idx .bars i:nth-child(2) { animation-delay: -.3s; animation-duration: .7s; }
.t-idx .bars i:nth-child(3) { animation-delay: -.6s; animation-duration: 1.1s; }
.t-idx .bars i:nth-child(4) { animation-delay: -.15s; animation-duration: .8s; }
@keyframes eqBar { from { height: 20%; } to { height: 100%; } }
.track:hover .num { opacity: 0; }
.track:hover .pi { opacity: 1; }
.track.active .num, .track.active .pi { opacity: 0; }
.track.active .bars { opacity: 1; }
body.is-playing .track.active .bars i { animation-play-state: running; }
.t-cover { width: 48px; height: 48px; border-radius: 11px; object-fit: cover; box-shadow: 0 6px 16px -6px rgba(0,0,0,.8); transition: transform .4s var(--spring); background: #1a1830; }
.track:hover .t-cover { transform: scale(1.06) rotate(-2deg); }
.track.active .t-cover { border-radius: 50%; animation: spin 5s linear infinite; animation-play-state: paused; }
body.is-playing .track.active .t-cover { animation-play-state: running; }
.t-meta { min-width: 0; }
.t-title { font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track.active .t-title { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.t-artist { font-size: .78rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-dur { font-size: .78rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.pl-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.pl-empty small { color: var(--dim); }
.empty-disc { width: 90px; height: 90px; margin: 0 auto 14px; border-radius: 50%; opacity: .6;
  background: radial-gradient(circle, #0b0b12 0 10%, var(--a2) 11% 28%, #111 29%), repeating-radial-gradient(circle, #151520 0 2px, #0c0c12 2px 4px); animation: spin 8s linear infinite; }

/* =====================================================================
   PLAYER BAR
   ===================================================================== */
.player { position: fixed; z-index: 10; left: 20px; right: 20px; bottom: 16px; height: var(--player); border-radius: 26px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: 22px; padding: 0 22px;
  animation: barIn 1s var(--ease) both; }
@keyframes barIn { from { opacity: 0; transform: translateY(40px); } }
.player::before { content: ''; position: absolute; left: 10%; right: 10%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--a1), var(--a2), transparent); opacity: .7; }

.mini { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mini img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none; background: #1a1830; box-shadow: 0 8px 20px -8px #000; }
.mini-meta { min-width: 0; }
.mini-title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.center { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.controls { display: flex; align-items: center; gap: 10px; }
.ctl { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: all .3s var(--ease); }
.ctl svg { width: 22px; height: 22px; }
.ctl:hover { color: #fff; background: rgba(255,255,255,.07); }
.ctl:active { transform: scale(.9); }
.ctl.on { color: #fff; }
.ctl.on::after { content: ''; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--a3); box-shadow: 0 0 8px var(--a3); }
.ctl.sm { width: 36px; height: 36px; }
.ctl.sm svg { width: 20px; height: 20px; }
.rep-one { position: absolute; top: 6px; right: 5px; font-size: .58rem; font-weight: 800; width: 13px; height: 13px; border-radius: 50%; display: none; place-items: center; background: var(--a3); color: #fff; }
.ctl.one .rep-one { display: grid; }
.ctl.play { width: 54px; height: 54px; color: #fff; background: var(--grad); background-size: 180% 180%;
  box-shadow: 0 10px 30px -8px var(--a2), inset 0 1px 0 rgba(255,255,255,.3); }
.ctl.play:hover { transform: scale(1.07); background: var(--grad); background-size: 180% 180%; box-shadow: 0 14px 38px -8px var(--a2), 0 0 0 6px color-mix(in srgb, var(--a2) 18%, transparent); }
.ctl.play svg { width: 26px; height: 26px; position: absolute; transition: transform .45s var(--spring), opacity .25s; }
.ctl.play .i-pause { transform: scale(.3) rotate(-90deg); opacity: 0; }
body.is-playing .ctl.play .i-play { transform: scale(.3) rotate(90deg); opacity: 0; }
body.is-playing .ctl.play .i-pause { transform: none; opacity: 1; }
.play-ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--a1); border-right-color: var(--a3); opacity: 0; transition: opacity .3s; }
body.is-loading .play-ring { opacity: 1; animation: spin .9s linear infinite; }
@keyframes gradMove { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.progress-row { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 620px; }
.time { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; }

/* slider chung */
.slider { position: relative; flex: 1; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.s-track { position: relative; width: 100%; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .1); overflow: hidden; transition: height .25s var(--ease); }
.s-buffer { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 255, 255, .12); border-radius: inherit; }
.s-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--grad); box-shadow: 0 0 12px var(--a2); }
.s-thumb { position: absolute; left: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 40%, transparent), 0 0 16px var(--a2); transform: scale(0); transition: transform .3s var(--spring); }
.slider:hover .s-track, .slider.drag .s-track, .slider:focus-visible .s-track { height: 7px; }
.slider:hover .s-thumb, .slider.drag .s-thumb, .slider:focus-visible .s-thumb { transform: scale(1); }
.s-tip { position: absolute; bottom: 24px; left: 0; transform: translateX(-50%) translateY(6px); padding: 4px 8px; border-radius: 8px; font-size: .72rem; font-weight: 600;
  background: color-mix(in srgb, var(--a2) 14%, rgba(16, 16, 24, .96)); border: 1px solid var(--line-2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); white-space: nowrap; }
.slider:hover .s-tip, .slider.drag .s-tip { opacity: 1; transform: translateX(-50%); }

.right { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.vol { display: flex; align-items: center; gap: 4px; width: 170px; }
.ctl .i-mute { display: none; }
.ctl.muted .i-vol { display: none; }
.ctl.muted .i-mute { display: block; }
.eq-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px; border-radius: 13px; font-size: .82rem; font-weight: 700;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); transition: all .35s var(--ease); }
.eq-btn svg { width: 18px; height: 18px; color: var(--a1); }
.eq-btn em { font-style: normal; font-weight: 500; color: var(--muted); font-size: .74rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-btn:hover, .eq-btn.open { border-color: color-mix(in srgb, var(--a2) 60%, transparent); box-shadow: 0 0 24px -6px var(--a2); background: color-mix(in srgb, var(--a2) 12%, transparent); }

/* =====================================================================
   EQ PANEL
   ===================================================================== */
.eq-panel { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--player) + 30px); width: min(760px, calc(100vw - 32px)); border-radius: 26px; padding: 22px 24px 20px;
  transform: translate(-50%, 30px) scale(.96); opacity: 0; visibility: hidden; transition: all .5s var(--ease);
  background: linear-gradient(160deg, color-mix(in srgb, var(--a2) 18%, rgba(24, 24, 36, .86)), color-mix(in srgb, var(--bg) 92%, transparent)); }
.eq-panel.open { transform: translate(-50%, 0) scale(1); opacity: 1; visibility: visible; }
.eq-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.eq-head h3 { margin: 0; font-size: 1.08rem; }
.muted { color: var(--muted); font-size: .82rem; margin: 4px 0 0; line-height: 1.5; }
.eq-head-actions { display: flex; align-items: center; gap: 8px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .78rem; margin-right: 4px; }
.switch input { display: none; }
.switch span { width: 40px; height: 22px; border-radius: 22px; background: rgba(255,255,255,.12); position: relative; transition: background .3s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(18px); }
.eq-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; }
.preset { padding: 7px 13px; border-radius: 99px; font-size: .78rem; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line);
  transition: all .3s var(--ease); }
.preset:hover { color: #fff; border-color: var(--line-2); transform: translateY(-1px); }
.preset.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 6px 20px -6px var(--a2); }
.eq-body { position: relative; height: 230px; border-radius: 18px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); overflow: hidden; }
.eq-panel.off .eq-body { filter: grayscale(1); opacity: .5; }
#eqCurve { position: absolute; inset: 0; width: 100%; height: 100%; }
.eq-bands { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); height: 100%; padding: 12px 6px 10px; }
.band { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.band-val { font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; height: 16px; }
.vslider { position: relative; flex: 1; width: 34px; cursor: ns-resize; touch-action: none; outline: none; }
.vs-track { position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; border-radius: 4px; background: rgba(255,255,255,.1); }
.vs-track::before { content: ''; position: absolute; left: -5px; right: -5px; top: 50%; height: 1px; background: rgba(255,255,255,.25); }
.vs-fill { position: absolute; left: 0; right: 0; border-radius: 4px; background: linear-gradient(0deg, var(--a1), var(--a2), var(--a3)); box-shadow: 0 0 10px var(--a2); }
.vs-thumb { position: absolute; left: 50%; width: 22px; height: 12px; margin: -6px 0 0 -11px; border-radius: 6px; background: linear-gradient(180deg, #fff, #cfd0e8);
  box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 0 3px color-mix(in srgb, var(--a2) 35%, transparent); transition: transform .25s var(--spring), box-shadow .25s; }
.vslider:hover .vs-thumb, .vslider.drag .vs-thumb, .vslider:focus-visible .vs-thumb { transform: scale(1.18); box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 0 5px color-mix(in srgb, var(--a2) 40%, transparent), 0 0 20px var(--a2); }
.band-freq { font-size: .7rem; color: var(--muted); font-weight: 600; }
.eq-extra { margin-top: 14px; }
.knob-row { display: flex; align-items: center; gap: 14px; font-size: .8rem; color: var(--muted); }
.knob-row b { color: #fff; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.mini-slider { max-width: 360px; }
.mini-slider .s-thumb { transform: scale(1); }

.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(4, 3, 10, .35); opacity: 0; visibility: hidden; transition: all .4s var(--ease); }
.scrim.show { opacity: 1; visibility: visible; }

/* =====================================================================
   MODAL
   ===================================================================== */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(4, 3, 12, .72); opacity: 0; visibility: hidden; transition: all .4s var(--ease); }
.modal.open { opacity: 1; visibility: visible; }
.modal-card { position: relative; width: 100%; border-radius: 26px; padding: 28px; transform: translateY(24px) scale(.95); transition: transform .55s var(--spring);
  background: linear-gradient(160deg, color-mix(in srgb, var(--a2) 18%, rgba(26, 26, 38, .92)), color-mix(in srgb, var(--bg) 95%, transparent)); max-height: calc(100dvh - 32px); overflow: auto; }
.modal.open .modal-card { transform: none; }
.modal-x { position: absolute; top: 16px; right: 16px; }
.modal h3 { margin: 0; font-size: 1.25rem; }
.login-card { max-width: 400px; text-align: center; }
.login-disc { width: 84px; height: 84px; margin: 6px auto 18px; border-radius: 50%; position: relative;
  background: repeating-radial-gradient(circle, #16161f 0 2px, #0c0c12 2px 4px); box-shadow: 0 0 40px -6px var(--a2); animation: spin 4s linear infinite; }
.login-disc span { position: absolute; inset: 30%; border-radius: 50%; background: var(--grad); }
.login-disc span::after { content: ''; position: absolute; inset: 40%; border-radius: 50%; background: #0c0c12; }
.field { display: block; text-align: left; margin-top: 16px; }
.field span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.field input { width: 100%; height: 46px; padding: 0 14px; border-radius: 13px; background: rgba(0,0,0,.3); border: 1px solid var(--line); outline: none; transition: all .3s var(--ease); }
.field input:focus { border-color: color-mix(in srgb, var(--a2) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 18%, transparent); }
.form-err { min-height: 20px; margin: 10px 0 4px; font-size: .8rem; color: var(--err); }
.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 13px; font-weight: 600; font-size: .88rem; overflow: hidden; transition: all .35s var(--ease); }
.btn svg { width: 17px; height: 17px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--grad); background-size: 200% 100%; box-shadow: 0 10px 28px -10px var(--a2); }
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 14px 34px -10px var(--a2); transform: translateY(-1px); }
.btn.ghost { background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { background: rgba(255,255,255,.09); border-color: var(--line-2); }
.btn.danger { background: rgba(255, 92, 122, .12); color: #ff8aa1; border: 1px solid rgba(255, 92, 122, .3); }
.btn.danger:hover { background: rgba(255, 92, 122, .22); color: #fff; }
.btn.loading { pointer-events: none; color: transparent; }
.btn.loading::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .7s linear infinite; }

/* ADMIN */
.admin-card { max-width: 820px; padding: 24px 24px 20px; display: flex; flex-direction: column; height: min(720px, calc(100dvh - 32px)); overflow: hidden; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tabs { position: relative; display: flex; gap: 4px; margin: 18px 0 16px; padding: 4px; border-radius: 15px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.tab { position: relative; z-index: 1; flex: 1; height: 38px; border-radius: 11px; font-size: .85rem; font-weight: 600; color: var(--muted); transition: color .3s; }
.tab.active { color: #fff; }
.tab em { font-style: normal; font-size: .7rem; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.12); margin-left: 4px; }
.tab-ink { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 11px; background: var(--grad); box-shadow: 0 6px 18px -6px var(--a2); transition: transform .5s var(--spring), width .5s var(--spring); }
.tab-pane { display: none; flex: 1; min-height: 0; overflow: auto; }
.tab-pane.active { display: block; animation: fadeUp .45s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 38px 20px; border-radius: 20px; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--a2) 45%, transparent); background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--a2) 14%, transparent), transparent 70%); transition: all .35s var(--ease); }
.dropzone:hover, .dropzone.over { border-color: var(--a2); background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--a2) 28%, transparent), transparent 70%); transform: scale(1.01); }
.dropzone b { font-size: 1rem; margin-top: 8px; }
.dropzone span { color: var(--muted); font-size: .8rem; }
.dz-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--grad); box-shadow: 0 12px 30px -10px var(--a2); animation: floaty 3s ease-in-out infinite; }
.dz-icon svg { width: 30px; height: 30px; }
@keyframes floaty { 50% { transform: translateY(-6px); } }
.up-queue { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.up-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); animation: fadeUp .4s var(--ease); }
.up-name { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-status { font-size: .76rem; color: var(--muted); }
.up-item.done .up-status { color: var(--ok); }
.up-item.err .up-status { color: var(--err); }
.up-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.up-item.done .up-bar i { background: var(--ok); }
.up-item.err .up-bar i { background: var(--err); width: 100% !important; }

.admin-tools { display: flex; gap: 10px; margin-bottom: 12px; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.a-row { display: grid; grid-template-columns: 22px 54px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line); transition: background .3s, border-color .3s, transform .3s var(--ease), opacity .3s; animation: fadeUp .4s var(--ease) both; }
.a-row:hover { background: rgba(255,255,255,.06); }
.a-row.dragging { opacity: .4; }
.a-row.drop-before { box-shadow: 0 -3px 0 0 var(--a2); }
.a-row.drop-after { box-shadow: 0 3px 0 0 var(--a2); }
.a-row.removing { opacity: 0; transform: translateX(40px) scale(.95); }
.a-handle { cursor: grab; color: var(--dim); display: grid; place-items: center; }
.a-handle svg { width: 18px; height: 18px; }
.a-cover { position: relative; width: 54px; height: 54px; border-radius: 12px; overflow: hidden; cursor: pointer; }
.a-cover img { width: 100%; height: 100%; object-fit: cover; }
.a-cover::after { content: 'Đổi ảnh'; position: absolute; inset: 0; display: grid; place-items: center; font-size: .62rem; font-weight: 700; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .25s; }
.a-cover:hover::after { opacity: 1; }
.a-fields { display: grid; gap: 4px; min-width: 0; }
.a-fields input { width: 100%; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; outline: none; transition: all .25s; min-width: 0; }
.a-fields input:hover { background: rgba(0,0,0,.2); }
.a-fields input:focus { background: rgba(0,0,0,.35); border-color: color-mix(in srgb, var(--a2) 60%, transparent); }
.a-fields .a-title { font-weight: 600; font-size: .88rem; }
.a-fields .a-artist { font-size: .8rem; color: var(--muted); }
.a-file { font-size: .68rem; color: var(--dim); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-actions { display: flex; gap: 4px; }
.a-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); transition: all .25s var(--ease); }
.a-btn svg { width: 17px; height: 17px; }
.a-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.a-btn.save { color: var(--ok); display: none; }
.a-row.dirty .a-btn.save { display: grid; animation: popIn .4s var(--spring); }
.a-btn.del:hover { background: rgba(255, 92, 122, .15); color: var(--err); }

.pw-form { max-width: 420px; }
.pw-form h4 { margin: 4px 0 0; }
.logout-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 420px; }

.confirm-card { max-width: 380px; text-align: center; }
.confirm-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: var(--err);
  background: rgba(255, 92, 122, .12); border: 1px solid rgba(255, 92, 122, .3); animation: popIn .5s var(--spring); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.confirm-actions .btn { flex: 1; }

/* TOAST */
.toasts { position: fixed; z-index: 80; top: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 15px; font-size: .86rem; font-weight: 500;
  background: color-mix(in srgb, var(--a2) 14%, rgba(16, 16, 24, .96)); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0,0,0,.8); animation: toastIn .5s var(--spring); }
.toast i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--a2); box-shadow: 0 0 10px var(--a2); }
.toast.ok i { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.toast.err i { background: var(--err); box-shadow: 0 0 10px var(--err); }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* =====================================================================
   HIỆU ỨNG NỀN (data-fx trên <html>)
   ===================================================================== */
/* Thiên hà: dải sáng chéo + tinh vân xoay chậm */
[data-fx="galaxy"] .blob { opacity: .28; }
[data-fx="galaxy"] .fx-a { display: block; inset: -30%;
  background: linear-gradient(115deg, transparent 38%, color-mix(in srgb, var(--a1) 22%, transparent) 46%, color-mix(in srgb, var(--a3) 18%, transparent) 50%, color-mix(in srgb, var(--a2) 22%, transparent) 54%, transparent 62%);
  animation: galaxyBand 60s linear infinite; will-change: transform; }
[data-fx="galaxy"] .fx-b { display: block; width: 70vmax; height: 70vmax; left: 50%; top: 50%; margin: -35vmax 0 0 -35vmax; border-radius: 50%; opacity: .35;
  background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--a2) 40%, transparent), transparent 30%, color-mix(in srgb, var(--a1) 35%, transparent), transparent 60%, color-mix(in srgb, var(--a3) 30%, transparent), transparent);
  mask: radial-gradient(circle, #000 0 20%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 0 20%, transparent 70%);
  animation: spin 90s linear infinite; will-change: transform; }
@keyframes galaxyBand { 50% { transform: translate(4%, -3%) rotate(3deg); } 100% { transform: none; } }

/* Neon lưới: sàn lưới phối cảnh kiểu synthwave + mặt trời */
[data-fx="grid"] .blob { opacity: .3; }
[data-fx="grid"] .fx-a { display: block; left: -50%; right: -50%; bottom: -10%; height: 70%; overflow: hidden;
  transform: perspective(500px) rotateX(62deg); transform-origin: 50% 0; opacity: .4;
  mask: linear-gradient(180deg, transparent 0%, #000 45%); -webkit-mask: linear-gradient(180deg, transparent 0%, #000 45%); }
[data-fx="grid"] .fx-a::before { content: ''; position: absolute; left: 0; right: 0; top: -70px; bottom: 0; will-change: transform;
  background:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--a1) 70%, transparent) 0 2px, transparent 2px 70px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--a3) 70%, transparent) 0 2px, transparent 2px 70px);
  animation: gridMove 2.4s linear infinite; }
[data-fx="grid"] .fx-b { display: block; width: 46vmin; height: 46vmin; left: 50%; top: 18%; margin-left: -23vmin; border-radius: 50%; opacity: .55;
  background: linear-gradient(180deg, var(--a3), var(--a2) 60%, transparent 85%);
  mask: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 20px); -webkit-mask: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 20px);
  }
@keyframes gridMove { to { transform: translateY(70px); } }

/* Sóng: hai lớp sóng mềm cuộn dưới đáy */
[data-fx="waves"] .fx-a, [data-fx="waves"] .fx-b { display: block; width: 200vmax; height: 200vmax; left: 50%; margin-left: -100vmax; border-radius: 43%; }
[data-fx="waves"] .fx-a { top: 62vh; will-change: transform; background: color-mix(in srgb, var(--a1) 22%, transparent); animation: spin 28s linear infinite; }
[data-fx="waves"] .fx-b { top: 68vh; will-change: transform; border-radius: 40%; background: color-mix(in srgb, var(--a2) 26%, transparent); animation: spin 40s linear infinite reverse; }

/* Tia sáng: chùm tia xoay từ phía trên */
[data-fx="rays"] .blob { opacity: .35; }
[data-fx="rays"] .fx-a { display: block; width: 220vmax; height: 220vmax; left: 50%; top: -110vmax; margin-left: -110vmax; opacity: .28; will-change: transform;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--a1) 40%, transparent) 0deg 4deg, transparent 4deg 14deg, color-mix(in srgb, var(--a3) 30%, transparent) 14deg 17deg, transparent 17deg 30deg);
  mask: radial-gradient(circle, #000 0 8%, transparent 48%); -webkit-mask: radial-gradient(circle, #000 0 8%, transparent 48%);
  animation: spin 120s linear infinite; }
[data-fx="rays"] .fx-b { display: block; width: 60vmax; height: 40vmax; left: 50%; top: -20vmax; margin-left: -30vmax; border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--a3) 45%, transparent), transparent 70%); }

/* Tối giản */
[data-fx="minimal"] .blob { opacity: .14 !important; animation-duration: 80s; }
[data-fx="minimal"] .noise { opacity: .03; }

/* =====================================================================
   KIỂU ĐĨA (data-disc trên <html>)
   ===================================================================== */
[data-disc="color"] .disc { background: color-mix(in srgb, var(--a2) 55%, #000); }
[data-disc="color"] .grooves { opacity: .55; mix-blend-mode: multiply; }
[data-disc="color"] .disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--a1) 45%, transparent), transparent 55%), radial-gradient(circle at 70% 75%, color-mix(in srgb, var(--a3) 35%, transparent), transparent 50%); mix-blend-mode: screen; }

[data-disc="neon"] .disc-wrap { box-shadow: 0 40px 80px -20px rgba(0,0,0,.9), 0 0 0 3px var(--a1), 0 0 22px 2px var(--a1), 0 0 60px 6px color-mix(in srgb, var(--a2) 60%, transparent), inset 0 0 0 1px rgba(255,255,255,.1); }
[data-disc="neon"] .grooves { background:
    radial-gradient(circle, transparent 0 34%, rgba(0,0,0,.6) 34.5%, transparent 36%),
    radial-gradient(circle, transparent 0 55%, color-mix(in srgb, var(--a3) 70%, transparent) 55.4%, transparent 56.4%),
    radial-gradient(circle, transparent 0 75%, color-mix(in srgb, var(--a1) 70%, transparent) 75.4%, transparent 76.4%),
    repeating-radial-gradient(circle, #0b0b10 0 1px, #060608 1.2px 2.4px, #131319 2.7px 3.2px); }

[data-disc="gold"] .disc { background: #3a2a08; }
[data-disc="gold"] .grooves { background:
    radial-gradient(circle, transparent 0 34%, rgba(0,0,0,.5) 34.5%, transparent 36%),
    radial-gradient(circle, transparent 0 96%, rgba(255,240,180,.35) 97%, #2a1d04 98%),
    repeating-radial-gradient(circle, #b8892c 0 1px, #7a5612 1.2px 2.4px, #e3bc5c 2.7px 3.2px); }
[data-disc="gold"] .sheen { opacity: 1.6; }

[data-disc="clear"] .disc { background: color-mix(in srgb, var(--a1) 10%, rgba(255,255,255,.05)); }
[data-disc="clear"] .grooves { background:
    radial-gradient(circle, transparent 0 34%, rgba(255,255,255,.2) 34.5%, transparent 35.5%),
    radial-gradient(circle, transparent 0 96%, rgba(255,255,255,.35) 97%, transparent 98%),
    repeating-radial-gradient(circle, rgba(255,255,255,.07) 0 1px, transparent 1.2px 3.2px); }
[data-disc="clear"] .disc-wrap { box-shadow: 0 30px 70px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.18), inset 0 0 40px rgba(255,255,255,.06); }
[data-disc="clear"] .rainbow { opacity: .45; }

/* =====================================================================
   ĐĨA: NHẤN DỪNG / KÉO TUA KIỂU DJ
   ===================================================================== */
.disc-wrap { cursor: grab; touch-action: none; }
.disc-wrap.scratching { cursor: grabbing; }
.disc-wrap.scratching .disc { filter: brightness(1.15); }
.disc-wrap:active:not(.scratching) { transform: scale(.985); transition: transform .15s; }
.scratch-tip { position: absolute; left: 50%; top: -4%; transform: translate(-50%, 8px) scale(.9); z-index: 3; display: flex; align-items: baseline; gap: 8px;
  padding: 8px 14px; border-radius: 14px; pointer-events: none; opacity: 0; transition: all .3s var(--spring);
  background: color-mix(in srgb, var(--a2) 18%, rgba(14, 14, 22, .92)); border: 1px solid var(--line-2); box-shadow: 0 10px 30px -10px #000, 0 0 24px -6px var(--a2); }
.scratch-tip b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.scratch-tip span { font-size: .75rem; font-weight: 700; color: var(--a3); font-variant-numeric: tabular-nums; }
.scratch-tip.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.disc-hint { position: absolute; left: 50%; bottom: -2%; transform: translate(-50%, 6px); font-size: .7rem; color: var(--muted); white-space: nowrap;
  padding: 5px 12px; border-radius: 99px; background: rgba(0,0,0,.45); border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: all .35s var(--ease); }
.turntable:hover .disc-hint { opacity: 1; transform: translate(-50%, 0); }
.turntable.no-hint .disc-hint { opacity: 0 !important; }
.disc-flash { position: absolute; inset: 8%; border-radius: 50%; pointer-events: none; display: grid; place-items: center; z-index: 2; }
.disc-flash svg { width: 18%; height: 18%; color: #fff; filter: drop-shadow(0 0 20px var(--a2)); animation: flashIcon .7s var(--ease) forwards; }
@keyframes flashIcon { 0% { opacity: 0; transform: scale(.5); } 30% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.5); } }
html.no-viz #viz { display: none; }
/* chế độ mượt: dừng mọi chuyển động nền, giữ đĩa xoay + vòng sóng */
html.lite .blob, html.lite .fx, html.lite .fx::before, html.lite .brand-disc { animation: none !important; }
html.lite #stars, html.lite .noise { display: none; }
html.no-stars #stars { display: none; }

/* =====================================================================
   BẢNG GIAO DIỆN
   ===================================================================== */
.theme-card { max-width: 860px; padding: 24px 24px 18px; display: flex; flex-direction: column; height: min(760px, calc(100dvh - 32px)); overflow: hidden; }
.theme-scroll { flex: 1; overflow-y: auto; margin: 6px -8px 0; padding: 0 8px; }
.th-label { margin: 20px 0 10px; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.th-item { position: relative; border-radius: 18px; overflow: hidden; text-align: left; padding: 0; border: 2px solid transparent;
  background: rgba(255,255,255,.03); transition: transform .35s var(--spring), border-color .3s, box-shadow .3s; animation: fadeUp .5s var(--ease) both; }
.th-item:hover { transform: translateY(-3px); }
.th-item.active { border-color: var(--a2); box-shadow: 0 10px 30px -10px var(--a2); }
.th-item.active::after { content: '✓'; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .72rem; font-weight: 800; background: #fff; color: #000; animation: popIn .4s var(--spring); }
.th-prev { position: relative; height: 92px; overflow: hidden; }
.th-prev .pd { position: absolute; left: 14px; top: 50%; width: 62px; height: 62px; margin-top: -31px; border-radius: 50%;
  background: radial-gradient(circle, #111 0 9%, transparent 10%), radial-gradient(circle, var(--p3) 0 30%, transparent 31%), repeating-radial-gradient(circle, #1b1b22 0 1.5px, #0c0c10 1.5px 3px);
  box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 22px -2px var(--p2); }
.th-item:hover .pd { animation: spin 2.5s linear infinite; }
.th-prev .pb { position: absolute; left: 88px; right: 12px; height: 7px; border-radius: 7px; }
.th-prev .pb:nth-of-type(2) { top: 30px; background: linear-gradient(90deg, var(--p1), var(--p2), var(--p3)); }
.th-prev .pb:nth-of-type(3) { top: 46px; right: 34px; background: rgba(255,255,255,.18); }
.th-prev .pb:nth-of-type(4) { top: 60px; right: 52px; background: rgba(255,255,255,.1); }
.th-name { padding: 9px 12px 11px; font-size: .84rem; font-weight: 700; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.th-name small { font-weight: 500; font-size: .68rem; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { padding: 9px 15px; border-radius: 12px; font-size: .82rem; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: all .3s var(--ease); }
.seg button:hover { color: #fff; border-color: var(--line-2); }
.seg button.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 6px 20px -8px var(--a2); }
.custom-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.custom-colors label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 13px; background: rgba(255,255,255,.04); border: 1px solid var(--line); cursor: pointer; font-size: .8rem; }
.custom-colors input { width: 34px; height: 34px; border: 0; padding: 0; border-radius: 10px; background: none; cursor: pointer; flex: none; }
.custom-colors input::-webkit-color-swatch-wrapper { padding: 0; }
.custom-colors input::-webkit-color-swatch { border: 2px solid rgba(255,255,255,.2); border-radius: 10px; }
.custom-colors input::-moz-color-swatch { border: 2px solid rgba(255,255,255,.2); border-radius: 10px; }
.th-toggles { display: grid; gap: 12px; margin: 22px 0 8px; }
.th-toggles .switch { font-size: .86rem; margin: 0; }
.theme-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 600px) {
  .theme-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .th-prev { height: 76px; }
  .th-prev .pd { width: 50px; height: 50px; margin-top: -25px; left: 10px; }
  .th-prev .pb { left: 70px; }
  .theme-foot .btn { flex: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-height: 760px) and (min-width: 901px) {
  .now-title { -webkit-line-clamp: 1; margin-top: 8px; font-size: clamp(1.2rem, 2.2vw, 1.7rem); }
  .now-tag { padding: 4px 12px; }
}
@media (max-width: 1100px) {
  .player { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; }
  .vol { width: 130px; }
  .eq-btn em { display: none; }
}
@media (max-width: 900px) {
  :root { --topbar: 64px; --player: 132px; }
  body { overflow: auto; }
  .topbar { padding: 0 16px; }
  .layout { height: auto; display: flex; flex-direction: column; gap: 22px; padding: 0 16px calc(var(--player) + 36px); }
  .stage { padding-top: 6px; }
  .turntable { width: min(340px, 74vw); }
  .playlist { min-height: 360px; }
  .pl-list { overflow: visible; }
  .player { left: 10px; right: 10px; bottom: 10px; border-radius: 22px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 8px 10px; padding: 12px 14px; height: auto; }
  .mini { grid-column: 1; grid-row: 1; }
  .mini img { width: 44px; height: 44px; border-radius: 12px; }
  .right { grid-column: 2; grid-row: 1; gap: 6px; }
  .vol { width: auto; }
  .vol .slider { display: none; }
  .eq-btn { height: 36px; padding: 0 10px; }
  .center { grid-column: 1 / -1; grid-row: 2; flex-direction: column-reverse; gap: 4px; }
  .controls { gap: 6px; }
  .ctl.play { width: 50px; height: 50px; }
  .eq-panel { bottom: calc(var(--player) + 20px); padding: 18px 14px 16px; }
  .eq-body { height: 200px; }
  .vslider { width: 26px; }
  .admin-card { padding: 20px 16px 16px; }
  .a-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .a-handle { display: none; }
  .a-cover { width: 46px; height: 46px; }
}
@media (max-width: 480px) {
  .brand-name { font-size: 1.15rem; }
  .eq-presets { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-left: -2px; }
  .preset { flex: none; }
  .band-val { font-size: .62rem; }
  .band-freq { font-size: .62rem; }
  .a-actions { flex-direction: column; gap: 0; }
  .a-btn { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
