/* ═══════════════════════════════════════════════════════════
   AI Winamp Revival — style.css
   ═══════════════════════════════════════════════════════════ */

/* SKIN VARIABLES */
:root {
  --bg: #0a0a0f;
  --s: #13131a;
  --s2: #1c1c28;
  --s3: #252535;
  --border: #2a2a3d;
  --a: #6c63ff;
  --a2: #ff6584;
  --g: #43e97b;
  --text: #e0e0f0;
  --text2: #9090b0;
  --text3: #5a5a7a;
  --player-bg: #0f0f1a;
  --pl-active: #1a1a35;
  --pl-hover: #151525;
  --eq-bar: var(--a);
  --viz-bg: #050510;
  --shadow: 0 4px 24px rgba(108,99,255,0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-head: 'Syne', sans-serif;
  --transition: 0.2s ease;
}

/* SKINS */
.skin-light {
  --bg: #f0f0fa; --s: #ffffff; --s2: #e8e8f5; --s3: #dcdcf0;
  --border: #d0d0e8; --text: #1a1a2e; --text2: #4a4a6a; --text3: #8888aa;
  --player-bg: #ffffff; --pl-active: #e0e0ff; --pl-hover: #f0f0fe;
  --viz-bg: #0a0a0f; --shadow: 0 4px 24px rgba(108,99,255,0.1);
}
.skin-classic {
  --bg: #1a1a2e; --s: #16213e; --s2: #0f3460; --s3: #1a3550;
  --border: #0f4c81; --a: #00ff88; --a2: #00ccff;
  --text: #e0ffe0; --text2: #88cc88; --player-bg: #0a1628;
  --pl-active: #0f3460; --eq-bar: #00ff88;
}
.skin-matrix {
  --bg: #000000; --s: #001100; --s2: #002200; --s3: #003300;
  --border: #004400; --a: #00ff00; --a2: #00cc00;
  --text: #00ff00; --text2: #009900; --text3: #005500;
  --player-bg: #001100; --pl-active: #002200; --pl-hover: #001800;
  --viz-bg: #000000; --eq-bar: #00ff00;
}
.skin-cyberpunk {
  --bg: #0d0221; --s: #130a2e; --s2: #1a0f3d; --s3: #21144c;
  --border: #3d0069; --a: #ff006e; --a2: #00f5ff;
  --text: #ffe0ff; --text2: #cc88cc; --text3: #884488;
  --player-bg: #08011a; --pl-active: #200040; --pl-hover: #180030;
  --viz-bg: #050010; --eq-bar: #ff006e;
}
.skin-synthwave {
  --bg: #1a0533; --s: #240744; --s2: #2e0a55; --s3: #380d66;
  --border: #5a1488; --a: #ff71ce; --a2: #01cdfe;
  --text: #ffe4ff; --text2: #cc88cc; --text3: #884488;
  --player-bg: #120230; --pl-active: #2e0a55; --pl-hover: #240744;
  --viz-bg: #0a0118; --eq-bar: #ff71ce;
}
.skin-winxp {
  --bg: #236cce; --s: #1d5fba; --s2: #2a7de0; --s3: #3390f0;
  --border: #4da6ff; --a: #ffffff; --a2: #ffdd00;
  --text: #ffffff; --text2: #c0d8ff; --text3: #80b0e0;
  --player-bg: #1d5fba; --pl-active: #1a4d9a; --pl-hover: #204fa5;
  --viz-bg: #0a1a3a; --eq-bar: #ffffff;
}
.skin-win98 {
  --bg: #c0c0c0; --s: #d4d0c8; --s2: #ece9d8; --s3: #f0ede0;
  --border: #808080; --a: #000080; --a2: #800000;
  --text: #000000; --text2: #444444; --text3: #888888;
  --player-bg: #d4d0c8; --pl-active: #000080; --pl-hover: #e0ddd0;
  --viz-bg: #000000; --eq-bar: #000080;
}

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
}
/* #app is the root flex column — everything must stay inside 100dvh */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, select { font-family: var(--font); }
ul { list-style: none; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--s); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--a); }

/* ════════ HEADER ════════ */
#app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--s);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 800; font-size: 1.1rem;
  white-space: nowrap;
}
.logo-icon { font-size: 1.3rem; }
.logo-sub { color: var(--a); margin-left: 4px; font-size: 0.8em; font-weight: 400; opacity: 0.9; }
.header-center { flex: 1; display: flex; justify-content: center; }
#status-bar {
  font-size: 0.8rem; color: var(--text2); font-family: var(--font-mono);
  background: var(--s2); border: 1px solid var(--border);
  padding: 4px 14px; border-radius: 20px; max-width: 400px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-actions { display: flex; gap: 6px; }
.hdr-btn {
  padding: 6px 12px; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.82rem;
  transition: all var(--transition);
}
.hdr-btn:hover { background: var(--a); color: #fff; border-color: var(--a); }
.hidden { display: none !important; }

/* ════════ MAIN LAYOUT ════════ */
#main-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  flex: 1;
  overflow: hidden;
  min-height: 0;   /* critical: allow grid to shrink in flex parent */
}
/* Grid items must have min-height:0 to respect the grid row height */
#player-panel, #center-panel, #tools-panel { min-height: 0; }

/* ════════ PLAYER PANEL ════════ */
#player-panel {
  background: var(--player-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--player-bg);
}

/* Now Playing */
#now-playing {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
#album-art-wrap {
  width: 110px; height: 110px;
  background: var(--s2); border-radius: 12px;
  overflow: hidden; position: relative;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
#album-art-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; opacity: 0.4;
}
#album-mini-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.3s;
}
#album-mini-canvas.active { opacity: 1; }
#track-info { width: 100%; }
.marquee-wrap { overflow: hidden; }
#track-title-text {
  display: inline-block; font-weight: 700; font-size: 0.95rem;
  white-space: nowrap; animation: marquee 12s linear infinite;
}
#track-artist { font-size: 0.8rem; color: var(--text2); margin-top: 2px; }
#track-time-display {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--a);
  margin-top: 4px;
}
.time-sep { opacity: 0.4; margin: 0 3px; }

@keyframes marquee {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(-60%); }
}

/* Progress Bar */
#progress-wrap { padding: 0 4px; }
#progress-bar {
  height: 6px; background: var(--s2); border-radius: 3px;
  cursor: pointer; position: relative; overflow: visible;
}
#progress-fill {
  height: 100%; background: var(--a); border-radius: 3px;
  width: 0%; transition: width 0.1s;
}
#progress-thumb {
  position: absolute; top: 50%; right: auto; width: 14px; height: 14px;
  background: var(--a); border-radius: 50%; transform: translate(-50%, -50%);
  left: 0%; opacity: 0; transition: opacity 0.2s;
  box-shadow: 0 0 6px var(--a);
}
#progress-bar:hover #progress-thumb { opacity: 1; }

/* Controls */
#player-controls {
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.ctrl {
  width: 38px; height: 38px;
  background: var(--s2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.ctrl:hover { background: var(--a); border-color: var(--a); color: #fff; transform: scale(1.05); }
.ctrl.active { background: var(--a); border-color: var(--a); color: #fff; }
.ctrl-main {
  width: 48px; height: 48px; font-size: 1.2rem;
  background: var(--a); border-color: var(--a); color: #fff;
  box-shadow: 0 0 16px rgba(108,99,255,0.4);
}
.ctrl-main:hover { transform: scale(1.1); box-shadow: 0 0 24px rgba(108,99,255,0.6); }

/* Volume */
#volume-row {
  display: flex; align-items: center; gap: 8px;
}
.ctrl-sm {
  background: none; border: none; color: var(--text2);
  font-size: 1rem; width: 28px; flex-shrink: 0;
}
#vol-slider {
  flex: 1; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--a) 0%, var(--a) 80%, var(--s3) 80%, var(--s3) 100%);
  border-radius: 2px; cursor: pointer;
}
#vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: var(--a); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 6px var(--a);
}
#vol-val { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text2); width: 32px; text-align: right; }

/* Equalizer */
#equalizer {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px;
}
.eq-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.eq-label { font-size: 0.75rem; font-weight: 700; color: var(--a); font-family: var(--font-mono); }
#eq-preset {
  flex: 1; background: var(--s3); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-size: 0.72rem; padding: 3px;
}
.eq-small-btn {
  background: var(--s3); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text2); font-size: 0.7rem; padding: 3px 6px;
}
.eq-small-btn:hover { color: var(--a); }
#eq-bands {
  display: flex; gap: 4px; justify-content: space-between;
  align-items: flex-end;
}
.eq-band {
  display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1;
}
.eq-slider {
  -webkit-appearance: slider-vertical; writing-mode: vertical-lr;
  width: 20px; height: 60px; cursor: pointer;
  accent-color: var(--eq-bar);
}
.eq-band label {
  font-size: 0.6rem; color: var(--text3); font-family: var(--font-mono);
}

/* ════════ PLAYLIST PANEL ════════ */
#playlist-panel {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  min-height: 0;
}
#pl-header {
  padding: 12px 14px 8px;
  background: var(--s);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#pl-title-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
#pl-title-row h2 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; }
#pl-count-info { font-size: 0.75rem; color: var(--text2); font-family: var(--font-mono); }
#pl-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px;
}
.pl-btn {
  padding: 5px 10px; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.75rem;
  transition: all var(--transition);
}
.pl-btn:hover { background: var(--a); border-color: var(--a); color: #fff; }
.pl-danger:hover { background: #e53e3e !important; border-color: #e53e3e !important; }
#pl-search-row {
  display: flex; gap: 6px;
}
#pl-search {
  flex: 1; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.8rem;
  padding: 6px 10px; outline: none;
}
#pl-search:focus { border-color: var(--a); }
#pl-sort {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.75rem;
  padding: 4px 6px;
}

/* Drop Zone */
#drop-zone {
  margin: 12px; border: 2px dashed var(--border); border-radius: var(--radius);
  text-align: center; padding: 24px 12px; transition: all var(--transition);
  flex-shrink: 0;
}
#drop-zone.drag-over {
  border-color: var(--a); background: rgba(108,99,255,0.1);
  transform: scale(1.01);
}
#drop-zone.has-files { display: none; }
.drop-icon { font-size: 2rem; margin-bottom: 6px; }
.drop-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.drop-sub { font-size: 0.75rem; color: var(--text2); }

/* Playlist */
#playlist {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 4px 8px;
  min-height: 0;
  /* always-visible scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--s);
}
#playlist::-webkit-scrollbar { width: 8px; }
#playlist::-webkit-scrollbar-track { background: var(--s); border-radius: 4px; }
#playlist::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
#playlist::-webkit-scrollbar-thumb:hover { background: var(--a); }
#playlist::-webkit-scrollbar-button { display: block; height: 16px; background: var(--s2); }
#playlist::-webkit-scrollbar-button:vertical:start:decrement {
  background: var(--s2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath d='M4 2l3 4H1z' fill='%236c63ff'/%3E%3C/svg%3E") center/8px no-repeat;
}
#playlist::-webkit-scrollbar-button:vertical:end:increment {
  background: var(--s2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath d='M4 6l3-4H1z' fill='%236c63ff'/%3E%3C/svg%3E") center/8px no-repeat;
}
.pl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition);
  border: 1px solid transparent;
  user-select: none;
}
.pl-item:hover { background: var(--pl-hover); }
.pl-item.active {
  background: var(--pl-active); border-color: var(--a);
  color: var(--a);
}
.pl-item.playing .pl-num { animation: blink 1s infinite; }
.pl-num {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text3); width: 28px; text-align: right; flex-shrink: 0;
}
.pl-item.active .pl-num { color: var(--a); }
.pl-info { flex: 1; min-width: 0; }
.pl-name {
  font-size: 0.83rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-artist { font-size: 0.72rem; color: var(--text2); }
.pl-duration { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text3); flex-shrink: 0; }
.pl-del {
  opacity: 0; background: none; border: none; color: var(--a2);
  font-size: 0.85rem; padding: 2px 6px; transition: opacity 0.2s;
}
.pl-item:hover .pl-del { opacity: 1; }
.pl-del:hover { color: #e53e3e; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ════════ TOOLS PANEL ════════ */
#tools-panel {
  background: var(--s);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  min-height: 0;
  gap: 0;
}

.tp-section {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tp-hdr {
  font-family: var(--font-head); font-weight: 700; font-size: 0.82rem;
  color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* Sleep presets */
.sleep-presets {
  display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px;
}
.sleep-preset {
  padding: 5px 10px; background: var(--s2); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text2); font-size: 0.78rem;
  transition: all var(--transition);
}
.sleep-preset:hover, .sleep-preset.active {
  background: rgba(108,99,255,.2); border-color: var(--a); color: var(--a);
}
.sleep-custom-row {
  display: flex; gap: 6px; align-items: center;
}
#sleep-minutes {
  width: 64px; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.82rem;
  padding: 6px 8px; outline: none; text-align: center;
}
#sleep-minutes:focus { border-color: var(--a); }
.sleep-start-btn {
  flex: 1; padding: 6px 10px; background: rgba(108,99,255,.18);
  border: 1px solid rgba(108,99,255,.4); border-radius: var(--radius-sm);
  color: var(--a); font-size: 0.8rem; transition: all var(--transition);
}
.sleep-start-btn:hover { background: var(--a); color: #fff; border-color: var(--a); }
.sleep-cancel-btn {
  padding: 6px 10px; background: rgba(255,101,132,.15);
  border: 1px solid rgba(255,101,132,.35); border-radius: var(--radius-sm);
  color: #ff6584; font-size: 0.78rem; transition: all var(--transition);
}
.sleep-cancel-btn:hover { background: #ff6584; color: #fff; }

/* Sleep ring */
.sleep-ring-wrap {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
}
.sleep-ring { display: block; flex-shrink: 0; }
.sleep-ring-bg { stroke: var(--border); }
.sleep-ring-arc { stroke: var(--a); transition: stroke-dashoffset 1s linear; }
.sleep-countdown {
  font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700;
  color: var(--a); letter-spacing: 0.05em;
}
.sleep-label {
  font-size: 0.72rem; color: var(--text3); margin-top: 6px; line-height: 1.4;
}

/* YT Audio info in tools panel */
.tp-yt-status {
  font-size: 0.8rem; color: var(--g); margin-bottom: 4px; font-family: var(--font-mono);
}
.tp-yt-note {
  font-size: 0.72rem; color: var(--text3); line-height: 1.4; margin-bottom: 8px;
}
.tp-yt-stop-btn {
  width: 100%; padding: 6px; background: rgba(255,101,132,.15);
  border: 1px solid rgba(255,101,132,.35); border-radius: var(--radius-sm);
  color: #ff6584; font-size: 0.78rem; transition: all var(--transition);
}
.tp-yt-stop-btn:hover { background: #ff6584; color: #fff; }

/* Keyboard shortcuts */
.tp-keys { display: flex; flex-direction: column; gap: 6px; }
.tp-key-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--text2);
}
.tp-key-row span { flex: 1; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--s2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; padding: 2px 6px; font-family: var(--font-mono);
  font-size: 0.68rem; color: var(--text); min-width: 22px; flex-shrink: 0;
}

/* YouTube action bar */
.yt-action-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--s); border-bottom: 1px solid var(--border);
  flex-shrink: 0; flex-wrap: wrap;
}
.yt-action-btn {
  padding: 6px 14px; background: rgba(108,99,255,.15);
  border: 1px solid rgba(108,99,255,.35); border-radius: 20px;
  color: var(--a); font-size: 0.78rem; transition: all var(--transition);
  white-space: nowrap;
}
.yt-action-btn:hover { background: var(--a); color: #fff; border-color: var(--a); }
.yt-action-btn--dl {
  background: rgba(67,233,123,.12); border-color: rgba(67,233,123,.3); color: var(--g);
}
.yt-action-btn--dl:hover { background: var(--g); color: #0a0a0f; border-color: var(--g); }
.yt-action-btn.audio-active {
  background: var(--a); color: #fff; border-color: var(--a);
}
.yt-cobalt-status {
  font-size: 0.72rem; color: var(--text3); font-family: var(--font-mono);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ════════ VISUALIZER ════════ */
#viz-section {
  flex-shrink: 0;
  height: 180px;
  background: var(--viz-bg);
  border-top: 1px solid var(--border);
  position: relative; display: flex; flex-direction: column;
}
#viz-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
}
#viz-select {
  background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.78rem; padding: 4px 8px;
}
#viz-freq-info {
  display: flex; gap: 12px; font-family: var(--font-mono); font-size: 0.68rem;
  color: rgba(255,255,255,0.5);
}
#btn-fullscreen {
  margin-left: auto; padding: 5px 12px;
  background: rgba(108,99,255,0.3); border: 1px solid rgba(108,99,255,0.4);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.78rem;
}
#btn-fullscreen:hover { background: var(--a); }
#viz-canvas {
  width: 100%; height: 100%; display: block;
}

/* ════════ FULLSCREEN VIZ ════════ */
#fullscreen-viz {
  position: fixed; inset: 0; z-index: 1000;
  background: #000;
}
#fs-canvas { width: 100%; height: 100%; display: block; }
#fs-hud {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
}
#fs-track { display: flex; flex-direction: column; gap: 4px; }
#fs-title { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: #fff; }
#fs-artist { font-size: 0.9rem; color: rgba(255,255,255,0.6); }
#fs-ctrls { display: flex; gap: 8px; align-items: center; }
#fs-viz-select {
  background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm); color: #fff; padding: 6px 10px; font-size: 0.8rem;
}
#btn-exit-fs {
  padding: 8px 16px; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm); color: #fff;
}
#btn-exit-fs:hover { background: rgba(255,255,255,0.25); }

/* ════════ MODALS ════════ */
.modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--s); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; max-width: 560px; width: 90%;
  max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.modal-hdr h3 { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
.modal-x {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--s2); color: var(--text); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: #e53e3e; color: #fff; }
.modal-ftr {
  display: flex; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
}
.modal-ftr button {
  padding: 8px 14px; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.82rem;
}
.modal-ftr button:hover { background: var(--a); border-color: var(--a); color: #fff; }

/* SKINS GRID */
#skins-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.skin-card {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; overflow: hidden; transition: all var(--transition);
  text-align: center; padding-bottom: 6px;
}
.skin-card:hover, .skin-card.active { border-color: var(--a); }
.skin-prev {
  height: 50px; background: var(--c1, #0a0a0f);
  border-bottom: 3px solid var(--c2, #6c63ff);
  margin-bottom: 4px;
}
.skin-card span { font-size: 0.72rem; color: var(--text2); }

/* SETTINGS */
.sett-group {
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.sett-group:last-child { border-bottom: none; }
.sett-group h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; color: var(--a); }
.sett-group label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; margin-bottom: 8px;
}
.sett-group input[type="number"],
.sett-group select {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); padding: 4px 8px; font-size: 0.8rem;
}
.sett-btn {
  margin-bottom: 6px; padding: 7px 12px;
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.8rem;
  display: block; width: 100%; text-align: left; transition: all var(--transition);
}
.sett-btn:hover { background: var(--a); border-color: var(--a); color: #fff; }
.btn-danger:hover { background: #e53e3e !important; border-color: #e53e3e !important; }

/* AI SKIN MODAL */
#ai-skin-body { display: flex; flex-direction: column; gap: 12px; }
#ai-skin-body p { font-size: 0.85rem; color: var(--text2); }
#ai-skin-prompt {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.9rem;
  padding: 10px 14px; outline: none; width: 100%;
}
#ai-skin-prompt:focus { border-color: var(--a); }
#btn-gen-skin {
  padding: 10px; background: var(--a); border-radius: var(--radius-sm);
  color: #fff; font-weight: 700;
}
#ai-skin-result { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#ai-skin-img { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius-sm); }
#btn-apply-ai-skin {
  padding: 8px 24px; background: var(--g); border-radius: var(--radius-sm); color: #000; font-weight: 700;
}
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--border);
  border-top-color: var(--a); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* TOAST */
#toasts {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--s); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 18px;
  font-size: 0.82rem; color: var(--text);
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.5s forwards;
  max-width: 320px; text-align: center;
}
.toast.success { border-color: var(--g); }
.toast.error { border-color: var(--a2); }
@keyframes toast-in { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform: translateY(10px); } }

/* ════════ MIXER BUTTON ════════ */
.mixer-open-btn {
  width: 100%; padding: 8px; margin-top: 4px;
  background: linear-gradient(135deg, var(--s2), var(--s3));
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.03em; transition: all var(--transition);
}
.mixer-open-btn:hover {
  background: var(--a); border-color: var(--a); color: #fff;
  box-shadow: 0 0 12px rgba(108,99,255,0.4);
}

/* ════════ MIXER PANEL (floating) ════════ */
#mixer-panel {
  position: fixed; right: 20px; bottom: 200px; z-index: 400;
  width: 300px;
  background: var(--s); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
#mixer-inner { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.mixer-hdr {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-head); font-weight: 700; font-size: 0.95rem;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.mixer-hdr button {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--s2); color: var(--text); font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.mixer-hdr button:hover { background: #e53e3e; color: #fff; }

.fx-row {
  display: flex; flex-direction: column; gap: 4px;
}
.fx-row.fx-sub { padding-left: 10px; }
.fx-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.77rem;
}
.fx-num {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--a);
  background: var(--s2); padding: 1px 6px; border-radius: 4px; min-width: 40px; text-align: center;
}
.fx-slider {
  width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--a) 0%, var(--a) 0%, var(--s3) 0%, var(--s3) 100%);
  border-radius: 2px; cursor: pointer; transition: height 0.1s;
}
.fx-slider:hover { height: 6px; }
.fx-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: var(--a); border-radius: 50%; cursor: pointer;
  box-shadow: 0 0 6px var(--a);
}

/* Toggle switch */
.fx-toggle { position: relative; display: inline-block; width: 34px; height: 18px; }
.fx-toggle input { opacity: 0; width: 0; height: 0; }
.fx-toggle-track {
  position: absolute; inset: 0; background: var(--s3);
  border-radius: 18px; cursor: pointer; transition: 0.3s;
  border: 1px solid var(--border);
}
.fx-toggle-track::before {
  content: ''; position: absolute; width: 12px; height: 12px;
  background: var(--text2); border-radius: 50%;
  top: 2px; left: 2px; transition: 0.3s;
}
.fx-toggle input:checked + .fx-toggle-track { background: var(--a); border-color: var(--a); }
.fx-toggle input:checked + .fx-toggle-track::before { transform: translateX(16px); background: #fff; }

.fx-presets {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.fx-preset-btn {
  padding: 4px 9px; background: var(--s2); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text2); font-size: 0.72rem;
  transition: all var(--transition);
}
.fx-preset-btn:hover { background: var(--a); border-color: var(--a); color: #fff; }
.fx-preset-btn.active { background: var(--a); border-color: var(--a); color: #fff; }
.fx-reset-btn {
  width: 100%; padding: 7px; background: var(--s2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text2); font-size: 0.78rem; transition: all var(--transition);
}
.fx-reset-btn:hover { background: #e53e3e22; border-color: #e53e3e; color: #e53e3e; }

/* ════════ RADIO PANEL ════════ */
#radio-panel {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; margin-top: 4px;
}
.radio-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; cursor: pointer;
}
.radio-label { font-size: 0.8rem; font-weight: 700; color: var(--text); }
#radio-body { padding: 0 8px 8px; }
#radio-body.collapsed { display: none; }

#radio-now-playing {
  display: flex; align-items: center; gap: 8px;
  background: var(--s3); border: 1px solid var(--a);
  border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 8px;
  font-size: 0.8rem; font-weight: 600;
}
.radio-live-dot {
  width: 8px; height: 8px; background: #e53e3e; border-radius: 50%;
  flex-shrink: 0; animation: pulse 1s infinite;
}
#radio-now-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#btn-radio-stop {
  background: none; color: var(--text2); font-size: 0.9rem; padding: 0 4px;
}
#btn-radio-stop:hover { color: #e53e3e; }

#radio-filter {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px;
}
.radio-cat {
  padding: 3px 8px; background: var(--s3); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text2); font-size: 0.7rem;
  transition: all var(--transition);
}
.radio-cat:hover, .radio-cat.active { background: var(--a); border-color: var(--a); color: #fff; }

#radio-list {
  max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin; scrollbar-color: var(--border) var(--s2);
}
.radio-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition);
  border: 1px solid transparent;
}
.radio-item:hover { background: var(--pl-hover); }
.radio-item.playing { background: var(--pl-active); border-color: var(--a); }
.radio-emoji { font-size: 1rem; flex-shrink: 0; width: 22px; text-align: center; }
.radio-info { flex: 1; min-width: 0; }
.radio-name { font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-genre { font-size: 0.68rem; color: var(--text2); }
.radio-quality { font-size: 0.65rem; color: var(--text3); font-family: var(--font-mono); flex-shrink: 0; }

/* ════════ DJ FULLSCREEN MODE (moved) ════════ */
.chat-toggle-btn {
  display: none; /* removed */
  position: absolute; top: 8px; left: 6px; z-index: 10;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--s2); border: 1px solid var(--border);
  color: var(--text2); font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.chat-toggle-btn:hover { background: var(--a); border-color: var(--a); color: #fff; }

/* ════════ DJ FULLSCREEN MODE ════════ */
/* When DJ tab active, cover entire viewport */
body.mode-dj #player-panel,
body.mode-dj #tools-panel,
body.mode-dj #app-header { display: none !important; }
body.mode-dj #main-layout { grid-template-columns: 1fr !important; }
body.mode-dj #center-tabs { display: none !important; }
body.mode-dj #dj-panel {
  position: fixed !important; inset: 0 !important; z-index: 300 !important;
  height: 100dvh !important; display: flex !important; flex-direction: column;
}

/* ════════ DJ CONSOLE — Pioneer RekordBox Style ════════ */
#dj-panel { background: #06060e; }
#dj-console {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden; background: #06060e;
}

/* ── TOP HEADER ── */
#dj-hdr {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; background: #090910;
  border-bottom: 1px solid #1e1e30;
  flex-shrink: 0; min-height: 52px;
}
.dj-hdr-logo { display: flex; align-items: center; gap: 10px; }
.dj-hdr-icon { font-size: 1.4rem; }
.dj-hdr-title-wrap { line-height: 1; }
.dj-hdr-title {
  display: block; font-family: var(--font-head); font-size: 0.85rem; font-weight: 800;
  color: #f7971e; letter-spacing: 0.12em;
}
.dj-hdr-sub { display: block; font-size: 0.5rem; color: #444; letter-spacing: 0.2em; margin-top: 2px; }
.dj-hdr-center {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 16px;
}
.dj-hdr-group { display: flex; align-items: center; gap: 6px; }
.dj-hdr-lbl { font-size: 0.58rem; color: #555; letter-spacing: 0.1em; text-transform: uppercase; }
.dj-hdr-bpm { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; min-width: 52px; text-align: center; }
.dj-hdr-unit { font-size: 0.58rem; color: #555; }
.dj-hdr-divider { width: 1px; height: 30px; background: #1e1e30; }
.dj-hdr-slider {
  width: 100px; height: 4px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, #43e97b 85%, #1a1a2e 85%);
  border-radius: 2px; cursor: pointer;
}
.dj-hdr-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: #fff; border-radius: 50%;
}
.dj-hdr-right { display: flex; align-items: center; gap: 8px; }
.dj-exit-btn {
  padding: 5px 12px; background: rgba(229,62,62,.1); border: 1px solid #e53e3e;
  border-radius: 4px; color: #e53e3e; font-size: 0.72rem; font-weight: 700;
  transition: all var(--transition);
}
.dj-exit-btn:hover { background: #e53e3e; color: #fff; }

/* ── MAIN 3-COL ── */
#dj-main {
  flex: 1; display: grid; grid-template-columns: 1fr 148px 1fr;
  overflow: hidden; min-height: 0;
}

/* ── DECK PANELS ── */
.dj-deck {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 12px; overflow-y: auto; overflow-x: hidden;
  background: linear-gradient(170deg, #09090f 0%, #06060e 100%);
  border-right: 1px solid #1a1a28;
  scrollbar-width: thin; scrollbar-color: #1a1a28 #06060e;
}
.dj-deck--b { border-right: none; border-left: 1px solid #1a1a28; }

/* color helpers */
.dj-col-a { color: #4fc3f7; }
.dj-col-b { color: #43e97b; }

.dj-deck-topbar {
  display: flex; align-items: center; gap: 8px;
}
.dj-deck-id {
  font-family: var(--font-mono); font-size: 1.1rem; font-weight: 800;
  letter-spacing: 0.05em; flex-shrink: 0;
  text-shadow: 0 0 12px currentColor;
}
.dj-track-info { flex: 1; min-width: 0; }
.dj-track-info--right { text-align: right; }
.dj-track-name {
  font-size: 0.78rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e0e0f0;
}
.dj-track-meta { font-size: 0.62rem; color: #444; }

.dj-load-btn {
  padding: 4px 10px; background: #12121e; border: 1px solid #2a2a40;
  border-radius: 4px; color: #888; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.04em; flex-shrink: 0; transition: all var(--transition);
}
.dj-load-btn:hover { background: #f7971e; border-color: #f7971e; color: #000; }

/* Waveform */
.dj-wave-wrap { position: relative; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.dj-waveform {
  width: 100%; height: 58px; display: block; background: #050510; cursor: pointer;
}
.dj-time-bar {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.72rem;
}
.dj-time-bar--right { flex-direction: row-reverse; }
.dj-time-cur { font-weight: 700; }
.dj-time-dur { color: #444; }

/* Hot Cues */
.dj-hot-cue-row {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.dj-hot-cue-row--right { flex-direction: row-reverse; }
.dj-hcue {
  width: 28px; height: 22px; border-radius: 3px; font-size: 0.65rem; font-weight: 800;
  border: 1px solid; transition: all var(--transition); text-align: center;
}
.dj-hc1 { background: rgba(255,71,87,.15); border-color: #ff4757; color: #ff4757; }
.dj-hc2 { background: rgba(255,165,2,.15);  border-color: #ffa502; color: #ffa502; }
.dj-hc3 { background: rgba(46,213,115,.15); border-color: #2ed573; color: #2ed573; }
.dj-hc4 { background: rgba(30,144,255,.15); border-color: #1e90ff; color: #1e90ff; }
.dj-hcue:hover, .dj-hcue-set { filter: brightness(1.4); box-shadow: 0 0 6px currentColor; }
.dj-hcue-hint { font-size: 0.55rem; color: #333; flex: 1; text-align: right; white-space: nowrap; }

/* Jog + Side */
.dj-jog-area {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; justify-content: center;
}
.dj-jog-area--right { flex-direction: row-reverse; }
.dj-jog { border-radius: 50%; cursor: grab; }
.dj-jog:active { cursor: grabbing; }
.dj-side-panel { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dj-side-panel--right { align-items: flex-end; }

.dj-main-btns { display: flex; gap: 4px; }
.dj-btn-play {
  flex: 2; padding: 8px; background: rgba(108,99,255,.2); border: 1px solid var(--a);
  border-radius: 4px; color: var(--a); font-size: 1.1rem; transition: all var(--transition); text-align: center;
}
.dj-btn-play:hover, .dj-btn-play.dj-play-on {
  background: var(--a); color: #fff; box-shadow: 0 0 14px rgba(108,99,255,.5);
}
.dj-btn-cue {
  flex: 1.5; padding: 8px 4px; background: rgba(247,151,30,.12); border: 1px solid #f7971e;
  border-radius: 4px; color: #f7971e; font-size: 0.65rem; font-weight: 800;
  letter-spacing: 0.05em; transition: all var(--transition); text-align: center;
}
.dj-btn-cue:hover { background: #f7971e; color: #000; }
.dj-btn-tap {
  flex: 1.5; padding: 8px 4px; background: rgba(67,233,123,.1); border: 1px solid #43e97b;
  border-radius: 4px; color: #43e97b; font-size: 0.62rem; font-weight: 700;
  transition: all var(--transition); text-align: center;
}
.dj-btn-tap:hover { background: #43e97b; color: #000; }
.dj-btn-sync {
  width: 100%; padding: 5px; background: rgba(247,151,30,.08); border: 1px solid #f7971e;
  border-radius: 4px; color: #f7971e; font-size: 0.65rem; font-weight: 800;
  transition: all var(--transition);
}
.dj-btn-sync:hover { background: #f7971e; color: #000; }

/* Loop controls */
.dj-loop-section { display: flex; flex-direction: column; gap: 3px; }
.dj-loop-row1, .dj-loop-row2 { display: flex; gap: 3px; }
.dj-btn-loop-io {
  flex: 1; padding: 4px; background: rgba(108,99,255,.1); border: 1px solid var(--a);
  border-radius: 3px; color: var(--a); font-size: 0.6rem; font-weight: 700;
  transition: all var(--transition);
}
.dj-btn-loop-io:hover { background: var(--a); color: #fff; }
.dj-btn-loop-mod {
  flex: 1; padding: 4px; background: rgba(255,101,132,.1); border: 1px solid var(--a2);
  border-radius: 3px; color: var(--a2); font-size: 0.6rem; font-weight: 700;
  transition: all var(--transition);
}
.dj-btn-loop-mod:hover { background: var(--a2); color: #fff; }
.dj-btn-loop-bar {
  flex: 1; padding: 4px 2px; background: #12121e; border: 1px solid #2a2a40;
  border-radius: 3px; color: #666; font-size: 0.6rem; font-weight: 700;
  transition: all var(--transition);
}
.dj-btn-loop-bar:hover, .dj-fx-on .dj-btn-loop-bar { border-color: #43e97b; color: #43e97b; background: rgba(67,233,123,.1); }
.dj-btn-loop-cancel {
  flex: 1; padding: 4px; background: rgba(229,62,62,.1); border: 1px solid #e53e3e;
  border-radius: 3px; color: #e53e3e; font-size: 0.6rem;
}

/* Pitch */
.dj-pitch-section { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dj-pitch-inner { flex: 1; display: flex; align-items: center; gap: 6px; }
.dj-pitch-inner--right { flex-direction: row-reverse; }
.dj-pitch-slider {
  flex: 1; height: 3px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, #4fc3f7, #1a1a2e 50%, #43e97b);
  border-radius: 2px; cursor: pointer;
}
.dj-pitch-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px;
  background: #eee; border-radius: 50%;
}
.dj-pitch-val { font-family: var(--font-mono); font-size: 0.65rem; color: var(--a); min-width: 38px; }
.dj-pitch-scale { font-size: 0.55rem; color: #444; min-width: 28px; }

/* Channel strip: EQ + VOL + VU */
.dj-channel-strip {
  display: flex; align-items: flex-end; gap: 6px; flex-shrink: 0; justify-content: flex-start;
}
.dj-channel-strip--right { flex-direction: row-reverse; }
.dj-eq-group { display: flex; gap: 5px; align-items: flex-end; }
.dj-knob-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dj-eq-slider, .dj-vol-fader {
  -webkit-appearance: slider-vertical; writing-mode: vertical-lr;
  width: 16px; height: 54px; cursor: pointer; accent-color: #f7971e;
}
.dj-vol-fader { height: 62px; accent-color: #e0e0f0; }
.dj-knob-val { font-family: var(--font-mono); font-size: 0.52rem; color: #555; }
.dj-knob-lbl { font-size: 0.55rem; color: #444; letter-spacing: 0.06em; }
.dj-vu { background: #050510; border-radius: 2px; }

/* FX Strip */
.dj-fx-strip { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.dj-fx-strip--right .dj-fx-btns { flex-direction: row-reverse; }
.dj-fx-btns { display: flex; gap: 3px; }
.dj-fx-btn {
  flex: 1; padding: 5px 2px; background: #0e0e1c; border: 1px solid #252535;
  border-radius: 3px; color: #555; font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.04em; transition: all var(--transition); text-align: center;
}
.dj-fx-btn:hover { border-color: var(--a); color: var(--a); background: rgba(108,99,255,.08); }
.dj-fx-btn.dj-fx-on {
  background: rgba(108,99,255,.2) !important; border-color: var(--a) !important;
  color: var(--a) !important; box-shadow: 0 0 6px rgba(108,99,255,.4);
}
.dj-fx-depth-row { display: flex; align-items: center; gap: 6px; }
.dj-fx-depth {
  flex: 1; height: 3px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--a) 50%, #1a1a2e 50%);
  border-radius: 2px; cursor: pointer;
}
.dj-fx-depth::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px;
  background: var(--a); border-radius: 50%;
}

/* Section labels */
.dj-section-lbl { font-size: 0.55rem; color: #444; letter-spacing: 0.1em; text-transform: uppercase; flex-shrink: 0; }

/* ── MIXER CENTER ── */
#dj-mixer {
  background: #070710; border-left: 1px solid #1a1a28; border-right: 1px solid #1a1a28;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 10px 8px; overflow-y: auto;
  scrollbar-width: thin;
}
.dj-mix-header {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  color: #f7971e; letter-spacing: 0.2em; text-align: center;
  background: rgba(247,151,30,.08); border: 1px solid rgba(247,151,30,.2);
  border-radius: 3px; padding: 3px 8px; width: 100%;
}
.dj-mix-sync { display: flex; flex-direction: column; gap: 3px; width: 100%; }
.dj-mix-sync-btn {
  padding: 5px 6px; background: rgba(247,151,30,.08); border: 1px solid #3a2a10;
  border-radius: 3px; color: #f7971e; font-size: 0.6rem; font-weight: 800;
  transition: all var(--transition); width: 100%;
}
.dj-mix-sync-btn:hover { background: #f7971e; color: #000; border-color: #f7971e; }
.dj-mix-vu-row {
  display: flex; gap: 6px; justify-content: center;
}
.dj-vu-mix { background: #050510; border-radius: 2px; }

/* Crossfader */
.dj-cf-wrap { width: 100%; display: flex; flex-direction: column; gap: 3px; }
.dj-cf-top { display: flex; justify-content: space-between; font-size: 0.62rem; }
.dj-cf-lbl { font-weight: 700; }
.dj-cf-center { font-family: var(--font-mono); font-size: 0.68rem; color: #888; }
.dj-cf-bot { display: flex; justify-content: space-between; font-size: 0.5rem; color: #333; }
.dj-cf-slider {
  width: 100%; height: 10px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, #4fc3f755 0%, #ffffff33 50%, #43e97b55 100%);
  border-radius: 5px; border: 1px solid #1e1e30; cursor: pointer;
}
.dj-cf-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  background: linear-gradient(135deg, #d0d0d0, #888);
  border-radius: 4px; border: 2px solid #555;
  box-shadow: 0 2px 8px rgba(0,0,0,.6);
}

/* Record button */
.dj-rec-btn {
  width: 100%; padding: 6px; background: rgba(229,62,62,.1);
  border: 1px solid #e53e3e; border-radius: 4px; color: #e53e3e;
  font-size: 0.65rem; font-weight: 700; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.dj-rec-btn:hover, .dj-rec-on { background: #e53e3e !important; color: #fff !important; }
.dj-rec-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 0.8s infinite; }

.dj-mix-brand { margin-top: auto; text-align: center; }
.dj-mix-brand-name {
  font-family: var(--font-head); font-size: 0.6rem; font-weight: 800;
  color: #f7971e; letter-spacing: 0.15em;
}
.dj-mix-brand-model { font-size: 0.5rem; color: #333; letter-spacing: 0.12em; margin-top: 2px; }

/* DJ tab accent */
.main-tab[data-tab="dj"]                     { color: #f7971e; }
.main-tab[data-tab="dj"].main-tab--active     { color: var(--text); }
.main-tab[data-tab="dj"].main-tab--active::after { background: #f7971e; }

/* ════════ STREAMING — YouTube & Spotify ════════ */

#youtube-panel, #spotify-panel {
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
  background: var(--bg);
}

/* Shared header */
.stream-header {
  padding: 10px 12px; background: var(--s);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.stream-search-row { display: flex; gap: 6px; }
.stream-input {
  flex: 1; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.83rem;
  padding: 8px 12px; outline: none; transition: border-color var(--transition);
}
.stream-input:focus { border-color: var(--a); }
.stream-go {
  padding: 8px 16px; background: var(--a); border-radius: var(--radius-sm);
  color: #fff; font-size: 0.82rem; font-weight: 600; flex-shrink: 0;
  transition: opacity var(--transition);
}
.stream-go:hover { opacity: 0.85; }

.stream-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.yt-chip, .sp-chip {
  padding: 4px 10px; background: var(--s3); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text2); font-size: 0.72rem;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.yt-chip:hover { background: #ff0000; border-color: #ff0000; color: #fff; }
.sp-chip:hover { background: #1db954; border-color: #1db954; color: #fff; }

.sp-hint { font-size: 0.72rem; color: var(--text2); line-height: 1.5; }
.stream-error {
  background: rgba(229,62,62,.1); border: 1px solid rgba(229,62,62,.3);
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.78rem; color: #e53e3e;
}

/* Nav */
.stream-nav {
  display: flex; gap: 0; flex-shrink: 0;
  background: var(--s); border-bottom: 1px solid var(--border);
}
.yt-nav-btn, .sp-nav-btn {
  padding: 8px 14px; background: none; color: var(--text2);
  font-size: 0.78rem; font-weight: 600; position: relative;
  transition: color var(--transition);
}
.yt-nav-btn::after, .sp-nav-btn::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: #ff0000; transform: scaleX(0); transition: transform var(--transition);
}
.sp-nav-btn::after { background: #1db954; }
.yt-nav-btn.active { color: var(--text); }
.yt-nav-btn.active::after { transform: scaleX(1); }
.sp-nav-btn.active { color: var(--text); }
.sp-nav-btn.active::after { transform: scaleX(1); }

/* YouTube now bar */
.yt-now-bar {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  background: rgba(255,0,0,.08); border-bottom: 1px solid rgba(255,0,0,.2);
  flex-shrink: 0;
}
.yt-now-info { flex: 1; min-width: 0; }
.yt-now-title {
  font-size: 0.82rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yt-now-author { font-size: 0.72rem; color: var(--text2); }
.yt-status { font-size: 0.68rem; color: var(--text3); font-family: var(--font-mono); }
.yt-now-actions { flex-shrink: 0; }
.yt-icon-btn {
  width: 30px; height: 30px; border-radius: 50%; background: var(--s2);
  border: 1px solid var(--border); font-size: 0.9rem; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.yt-icon-btn:hover { border-color: var(--a2); background: rgba(255,101,132,.15); }

/* YouTube player area */
#yt-player-area { flex-shrink: 0; background: #000; }
.yt-iframe-wrap {
  width: 100%; aspect-ratio: 16/9; background: #000;
  position: relative; overflow: hidden;
}
.yt-iframe-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}
.yt-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text2); text-align: center; padding: 16px;
}
.yt-ph-icon { font-size: 2.5rem; opacity: 0.4; }
.yt-ph-text { font-size: 0.88rem; font-weight: 600; }
.yt-ph-sub  { font-size: 0.72rem; opacity: 0.6; }
.sp-ph-icon { font-size: 2.5rem; opacity: 0.5; }

/* Progress bar */
.yt-prog-bar {
  height: 4px; background: var(--s3); position: relative; cursor: pointer;
}
.yt-prog-bar:hover { height: 6px; }
.yt-prog-fill {
  height: 100%; background: #ff0000; width: 0%;
  transition: width 0.2s; position: relative; z-index: 1;
}
.yt-prog-thumb {
  position: absolute; top: 50%; left: 0%; width: 12px; height: 12px;
  background: #ff0000; border-radius: 50%; transform: translate(-50%,-50%);
  opacity: 0; transition: opacity 0.2s; z-index: 2;
}
.yt-prog-bar:hover .yt-prog-thumb { opacity: 1; }
.yt-time-row {
  display: flex; justify-content: space-between; padding: 3px 8px;
  font-size: 0.68rem; color: var(--text2); font-family: var(--font-mono);
  background: #000; flex-shrink: 0;
}

/* Result views */
.yt-view { flex: 1; overflow-y: auto; min-height: 0; padding: 8px; }
.sp-view { flex: 1; overflow-y: auto; min-height: 0; }

/* YouTube result cards — 2-col grid */
.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.yt-card {
  background: var(--s); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition); overflow: hidden;
  display: flex; flex-direction: column;
}
.yt-card:hover { border-color: #ff0000; transform: translateY(-1px); }
.yt-card-thumb {
  position: relative; aspect-ratio: 16/9; background: #111; overflow: hidden;
}
.yt-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-card-dur {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,.85); color: #fff; font-size: 0.68rem;
  padding: 1px 5px; border-radius: 3px; font-family: var(--font-mono);
}
.yt-card-play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4); color: #fff; font-size: 1.5rem;
  opacity: 0; transition: opacity 0.2s;
}
.yt-card:hover .yt-card-play-overlay { opacity: 1; }
.yt-card-body { padding: 6px 8px; flex: 1; }
.yt-card-title {
  font-size: 0.76rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 3px;
}
.yt-card-ch { font-size: 0.68rem; color: var(--text2); }
.yt-card-actions {
  display: flex; gap: 4px; padding: 4px 8px 6px;
  justify-content: flex-end;
}
.yt-btn-fav, .yt-btn-play {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--s2); border: 1px solid var(--border);
  font-size: 0.75rem; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.yt-btn-play { background: var(--a); border-color: var(--a); color: #fff; }
.yt-btn-play:hover { background: #ff0000; border-color: #ff0000; }
.yt-btn-fav:hover, .yt-btn-fav.active { border-color: var(--a2); color: var(--a2); }

.yt-loading {
  display: flex; align-items: center; gap: 8px; padding: 20px;
  color: var(--text2); font-size: 0.85rem; grid-column: 1/-1;
}
.yt-spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: #ff0000; border-radius: 50%; animation: spin 0.7s linear infinite;
}
.yt-empty {
  padding: 20px; color: var(--text2); font-size: 0.82rem;
  text-align: center; grid-column: 1/-1;
}

/* Spotify embed */
.sp-embed-wrap {
  position: relative; min-height: 80px;
  background: #121212;
}
.sp-embed-wrap iframe { display: block; }

.sp-info { padding: 10px 14px; flex-shrink: 0; }
.sp-info-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--s); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px;
}
.sp-info-thumb {
  width: 48px; height: 48px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
}
.sp-info-title { font-size: 0.82rem; font-weight: 700; margin-bottom: 3px; }
.sp-info-sub { font-size: 0.7rem; color: #1db954; }

/* Spotify history */
.sp-hist-list { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.sp-hist-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--s); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
}
.sp-hist-item:hover { border-color: #1db954; }
.sp-hist-icon { font-size: 1.1rem; flex-shrink: 0; }
.sp-hist-info { flex: 1; min-width: 0; }
.sp-hist-type { font-size: 0.7rem; color: #1db954; text-transform: capitalize; display: block; }
.sp-hist-id { font-size: 0.75rem; color: var(--text); font-family: var(--font-mono); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-hist-play {
  padding: 4px 10px; background: #1db954; border-radius: 20px;
  color: #000; font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}

/* YouTube tab accent = red */
.main-tab[data-tab="youtube"]         { color: var(--text2); }
.main-tab[data-tab="youtube"].main-tab--active { color: var(--text); }
.main-tab[data-tab="youtube"].main-tab--active::after { background: #ff0000; }
/* Spotify tab accent = green */
.main-tab[data-tab="spotify"]         { color: var(--text2); }
.main-tab[data-tab="spotify"].main-tab--active { color: var(--text); }
.main-tab[data-tab="spotify"].main-tab--active::after { background: #1db954; }

/* ════════ VIDEO PLAYER ════════ */
#video-panel {
  background: #000;
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}

#video-container {
  flex: 1; position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000; overflow: hidden; cursor: pointer;
}

#video-el {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  max-height: 100%;
}

/* HUD overlay on hover */
#video-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.7) 0%, transparent 25%,
    transparent 70%, rgba(0,0,0,0.85) 100%
  );
  opacity: 1; transition: opacity 0.3s;
  pointer-events: none;
}
.video-overlay--hidden { opacity: 0; pointer-events: none; }
#video-overlay-title {
  padding: 12px 16px;
  font-family: var(--font-head); font-size: 0.95rem; font-weight: 700;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#video-overlay-ctrls {
  padding: 10px 14px;
  display: flex; justify-content: flex-end; gap: 8px;
  pointer-events: all;
}
#video-overlay-ctrls button {
  padding: 6px 12px; background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius-sm);
  color: #fff; font-size: 0.8rem; backdrop-filter: blur(4px);
  transition: background var(--transition);
}
#video-overlay-ctrls button:hover { background: rgba(255,255,255,0.3); }
#video-overlay { pointer-events: none; }
#video-overlay-ctrls { pointer-events: all; }

/* Info bar below video */
#video-info-bar {
  background: var(--s); border-top: 1px solid var(--border);
  padding: 8px 14px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
}
#video-track-name {
  flex: 1; font-weight: 700; font-size: 0.88rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#video-track-meta { font-size: 0.75rem; color: var(--text2); }
#video-track-res  { font-size: 0.7rem; color: var(--text3); font-family: var(--font-mono); }

/* Compact playlist under video */
#video-playlist-wrap {
  flex-shrink: 0; max-height: 180px; overflow: hidden;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border); background: var(--bg);
}
.video-pl-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 12px; font-size: 0.75rem; font-weight: 700;
  color: var(--text2); background: var(--s); flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.video-playlist {
  flex: 1; overflow-y: auto; padding: 2px 0;
  scrollbar-width: thin; scrollbar-color: var(--border) var(--bg);
}
.vpl-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px; cursor: pointer; transition: background var(--transition);
  border-radius: 0;
}
.vpl-item:hover { background: var(--pl-hover); }
.vpl-item--active { background: var(--pl-active); color: var(--a); }
.vpl-icon { font-size: 0.85rem; width: 18px; text-align: center; flex-shrink: 0; }
.vpl-name {
  flex: 1; font-size: 0.78rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vpl-dur { font-size: 0.7rem; color: var(--text3); font-family: var(--font-mono); flex-shrink: 0; }

/* Video items in main playlist */
.pl-item--video .pl-num { color: var(--a2); }
.pl-item--video.active .pl-name::before { content: '🎬 '; }

/* Video tab accent */
.main-tab--video { color: var(--a2) !important; }
.main-tab--video.main-tab--active { color: var(--text) !important; }
.main-tab--video.main-tab--active::after { background: var(--a2); }

/* ════════ CENTER PANEL & TABS ════════ */
#center-panel {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden; background: var(--bg); min-height: 0;
}

#center-tabs {
  display: flex; gap: 0; flex-shrink: 0;
  background: var(--s); border-bottom: 2px solid var(--border);
}
.main-tab {
  padding: 10px 18px; background: none; border: none;
  color: var(--text2); font-size: 0.85rem; font-weight: 600;
  font-family: var(--font-head); cursor: pointer; position: relative;
  transition: color var(--transition);
}
.main-tab::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--a); transform: scaleX(0); transition: transform var(--transition);
}
.main-tab--active { color: var(--text); }
.main-tab--active::after { transform: scaleX(1); }
.main-tab:hover { color: var(--text); }

.tab-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
#playlist-panel {
  background: transparent; border-right: none;
}

/* Chip accent for radio queries in AI panel */
.chip--radio {
  background: rgba(255,99,132,0.15);
  border-color: rgba(255,99,132,0.4);
  color: var(--a2);
}
.chip--radio:hover { background: var(--a2); border-color: var(--a2); color: #fff; }

/* ════════ RADIO EXPLORER ════════ */
#radio-explorer {
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}

/* Filters */
.re-filters {
  background: var(--s); border-bottom: 1px solid var(--border);
  padding: 10px 12px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.re-search-row {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.re-search-wrap {
  flex: 1; min-width: 160px; position: relative; display: flex; align-items: center;
}
.re-search-icon {
  position: absolute; left: 10px; font-size: 0.85rem; pointer-events: none;
}
.re-search {
  width: 100%; padding: 7px 30px 7px 32px;
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.82rem;
  outline: none; transition: border-color var(--transition);
}
.re-search:focus { border-color: var(--a); }
.re-search-clear {
  position: absolute; right: 8px; background: none;
  color: var(--text3); font-size: 0.8rem; padding: 2px 4px;
}
.re-search-clear:hover { color: var(--text); }
.re-sel {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.75rem; padding: 6px 8px;
}
.re-filter-btn {
  padding: 6px 10px; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2); font-size: 0.75rem;
  white-space: nowrap; transition: all var(--transition);
}
.re-filter-btn:hover, .re-filter-btn--active {
  background: var(--a); border-color: var(--a); color: #fff;
}

.re-chips-row {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.re-chips-lbl {
  font-size: 0.7rem; color: var(--text3); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0;
}
.re-chip {
  padding: 3px 10px; background: var(--s3); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text2); font-size: 0.72rem;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.re-chip:hover { border-color: var(--a); color: var(--a); }
.re-chip--active { background: var(--a); border-color: var(--a); color: #fff; }

.re-active-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.re-active-tag {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 8px; background: var(--a); border-radius: 12px;
  font-size: 0.7rem; color: #fff;
}
.re-tag-close {
  background: none; color: rgba(255,255,255,0.7); font-size: 0.7rem; padding: 0 2px;
}
.re-tag-close:hover { color: #fff; }

/* Now Playing Bar */
.re-now-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: var(--pl-active);
  border-bottom: 1px solid var(--a); flex-shrink: 0;
  transition: all 0.2s;
}
.re-now-bar--hidden { display: none; }
.re-live-dot {
  width: 8px; height: 8px; background: #e53e3e; border-radius: 50%;
  flex-shrink: 0; animation: pulse 1s infinite;
}
.re-now-icon {
  width: 26px; height: 26px; border-radius: 4px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--s3); font-size: 0.9rem; flex-shrink: 0;
}
.re-now-icon img { width: 100%; height: 100%; object-fit: cover; }
.re-now-name {
  flex: 1; font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.re-now-stop {
  background: none; color: var(--text2); font-size: 0.95rem; padding: 0 6px;
  flex-shrink: 0;
}
.re-now-stop:hover { color: #e53e3e; }

/* Loading bar */
.re-loading-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 0.8rem; color: var(--text2);
  flex-shrink: 0; border-bottom: 1px solid var(--border);
}
.re-spinner-small {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--a); border-radius: 50%; animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Result info row */
.re-result-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 12px; font-size: 0.78rem; color: var(--text2);
  background: var(--s); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.re-clear-btn {
  padding: 3px 8px; background: var(--s2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text2); font-size: 0.7rem; transition: all var(--transition);
}
.re-clear-btn:hover { background: var(--a); border-color: var(--a); color: #fff; }

/* Home sections (horizontal scroll) */
.re-home {
  flex: 1; overflow-y: auto; padding: 8px 0;
  scrollbar-width: thin; scrollbar-color: var(--border) var(--s);
}
.re-loading-msg {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 14px; color: var(--text2); font-size: 0.85rem;
}
.re-empty { padding: 24px 14px; color: var(--text3); font-size: 0.85rem; text-align: center; }

.re-home-section { margin-bottom: 4px; }
.re-section-title {
  padding: 6px 14px 4px;
  font-size: 0.8rem; font-weight: 700; font-family: var(--font-head);
  color: var(--text); letter-spacing: 0.03em;
}
.re-section-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 10px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  -ms-overflow-style: none;
}
.re-section-row::-webkit-scrollbar { height: 4px; }
.re-section-row::-webkit-scrollbar-track { background: transparent; }
.re-section-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Station Cards */
.re-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--s);
  cursor: pointer; transition: all var(--transition);
  flex-shrink: 0; min-width: 220px; max-width: 280px;
  user-select: none;
}
.re-section-row .re-card { min-width: 200px; max-width: 240px; }
.re-card:hover { background: var(--s2); border-color: var(--a); transform: translateY(-1px); }
.re-card--playing { background: var(--pl-active); border-color: var(--a); box-shadow: 0 0 12px rgba(108,99,255,0.2); }

/* Full list cards (larger) */
.re-list .re-card {
  min-width: unset; max-width: unset;
  border-radius: 0; border-left: none; border-right: none;
  border-top: none; border-bottom-color: var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}

/* Art thumbnail */
.re-art {
  width: 44px; height: 44px; border-radius: 6px; overflow: hidden;
  position: relative; background: var(--s2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.re-art-bg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; opacity: 0.5;
}
.re-art-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}

/* Playing animation (equalizer bars) */
.re-art-eq {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 2px;
}
.re-art-eq span {
  width: 3px; background: var(--a); border-radius: 1px;
  animation: eq-bar 0.8s ease-in-out infinite alternate;
}
.re-art-eq span:nth-child(1) { height: 8px; animation-delay: 0s; }
.re-art-eq span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.re-art-eq span:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.re-art-eq span:nth-child(4) { height: 6px; animation-delay: 0.1s; }
@keyframes eq-bar { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }

/* Card info */
.re-info { flex: 1; min-width: 0; }
.re-info-name {
  font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.re-info-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.re-tag {
  display: inline-block; padding: 1px 6px;
  background: var(--s3); border-radius: 10px;
  font-size: 0.62rem; color: var(--text2); white-space: nowrap;
}
.re-tag-c { background: rgba(108,99,255,0.15); color: var(--a); }
.re-tag-b { background: rgba(67,233,123,0.1); color: var(--g); }
.re-info-votes { font-size: 0.62rem; color: var(--text3); margin-top: 2px; font-family: var(--font-mono); }

/* Card buttons */
.re-card-btns { display: flex; gap: 4px; flex-shrink: 0; }
.re-fav-btn, .re-play-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; background: var(--s3); border: 1px solid var(--border);
  transition: all var(--transition); flex-shrink: 0;
}
.re-fav-btn:hover { color: var(--a2); border-color: var(--a2); background: rgba(255,101,132,0.1); }
.re-fav-btn--on { color: var(--a2); border-color: var(--a2); background: rgba(255,101,132,0.15); }
.re-play-btn:hover, .re-play-btn--on {
  background: var(--a); border-color: var(--a); color: #fff;
  box-shadow: 0 0 10px rgba(108,99,255,0.4);
}

/* Virtual scroll list */
.re-list-wrap {
  flex: 1; overflow-y: auto; min-height: 0; padding: 8px;
  scrollbar-width: thin; scrollbar-color: var(--border) var(--s);
}
.re-list { display: flex; flex-direction: column; gap: 4px; }
.re-sentinel { height: 1px; }

/* ════════ AI RADIO SECTION ════════ */
.re-ai-section {
  flex-shrink: 0; border-top: 1px solid var(--border);
  background: var(--s); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
  max-height: 280px;
}
.re-ai-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.82rem; font-weight: 700; color: var(--a);
}
.re-ai-hint { font-size: 0.7rem; color: var(--text3); font-weight: 400; }
.re-ai-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.re-ai-chip {
  padding: 4px 10px; background: var(--s2); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text2); font-size: 0.72rem;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.re-ai-chip:hover { background: var(--a); border-color: var(--a); color: #fff; }

.re-ai-input-row { display: flex; gap: 6px; }
.re-ai-input {
  flex: 1; background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.8rem;
  padding: 7px 10px; outline: none;
}
.re-ai-input:focus { border-color: var(--a); }
.re-ai-send {
  width: 36px; height: 36px; background: var(--a); border-radius: var(--radius-sm);
  color: #fff; font-size: 0.9rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.re-ai-send:hover { opacity: 0.85; }

.re-ai-messages {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  min-height: 40px; max-height: 120px;
  scrollbar-width: thin; scrollbar-color: var(--border) var(--s);
}
.re-ai-msg { display: flex; }
.re-ai-msg.user { justify-content: flex-end; }
.re-ai-msg-body {
  background: var(--s2); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 10px; font-size: 0.78rem;
  line-height: 1.5; max-width: 90%; white-space: pre-wrap;
}
.re-ai-msg.user .re-ai-msg-body { background: var(--a); border-color: var(--a); color: #fff; }
.re-ai-msg.bot.thinking .re-ai-msg-body { opacity: 0.7; }
.re-ai-thinking::after {
  content: '●●●'; animation: thinking 1.2s infinite;
  font-size: 0.5em; letter-spacing: 3px;
}

/* ════════ RESPONSIVE ════════ */
@media (max-width: 1100px) {
  #main-layout { grid-template-columns: 250px 1fr 280px; }
}
@media (max-width: 900px) {
  #app { height: auto; min-height: 100dvh; }
  #main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
    height: auto;
  }
  #player-panel { border-right: none; border-bottom: 1px solid var(--border); min-height: unset; overflow: visible; }
  #center-panel { min-height: 400px; border-right: none; border-bottom: 1px solid var(--border); }
  #tools-panel { min-height: 300px; }
  #viz-section { flex-shrink: 0; }
  .re-ai-section { max-height: none; }
}
@media (max-width: 600px) {
  #app-header { padding: 8px 12px; }
  .logo-text { font-size: 0.95rem; }
  .header-center { display: none; }
  #viz-section { height: 120px; }
  #skins-grid { grid-template-columns: repeat(2, 1fr); }
  .main-tab { padding: 8px 12px; font-size: 0.78rem; }
  .re-search-row { flex-wrap: wrap; }
  .re-filter-btn { display: none; }
  #re-btn-home, #re-btn-favs, #re-btn-hist { display: flex; }
}
