/* ─── Vera Music — app.css v6 (vergoboy design system) ──────────────────── */

/* ─── Fonts (local) ─────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 400;
  font-display: swap;
  src: url('/register/static/fonts/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 500 600;
  font-display: swap;
  src: url('/register/static/fonts/Vazirmatn-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 700 900;
  font-display: swap;
  src: url('/register/static/fonts/Vazirmatn-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrainsMono';
  font-weight: 400;
  font-display: swap;
  src: url('/register/static/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

/* ─── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --purple:    #833AB4;
  --red:       #FD1D1D;
  --gold:      #FCB045;

  --grad-hero: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCB045 100%);
  --grad-warm: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
  --grad-card: linear-gradient(145deg, rgba(255,255,255,0.09) 0%, rgba(255,255,255,0.02) 100%);

  --bg-deep:     #0d0a14;
  --surface:     rgba(255,255,255,0.06);
  --border:      rgba(255,255,255,0.11);

  --text-bright: #ffffff;
  --text-main:   #e8dff5;
  --text-muted:  #a08abf;
  --text-dim:    #6b5580;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --mono: 'JetBrainsMono', monospace;
  --font: 'Vazirmatn', Tahoma, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Body + bg ─────────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  direction: rtl;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 10% 20%,  rgba(131,58,180,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 80%,  rgba(253,29,29,0.13)  0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 55% 50%,  rgba(252,176,69,0.08) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none; z-index: 0;
}

/* ─── Scrollbars ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(#833AB4, #FD1D1D);
  border-radius: 99px;
}
::selection { background: rgba(131,58,180,0.4); color: #fff; }

/* ─── Utilities ─────────────────────────────────────────────────────────── */
.screen { display: none; width: 100vw; height: 100vh; position: relative; z-index: 1; }
.screen.active { display: flex; }
.hidden { display: none !important; }

.gradient-text {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative; overflow: hidden;
  backdrop-filter: blur(12px);
  transition: border-color 0.28s ease;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-hero);
  opacity: 0.3;
}
.card:hover { border-color: rgba(131,58,180,0.32); }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--grad-hero);
  color: #fff;
  box-shadow: 0 6px 30px rgba(253,29,29,0.35);
  border-radius: var(--radius-md);
  padding: 11px 22px;
  font-family: var(--font); font-weight: 700; font-size: 14px;
  border: none; cursor: pointer; width: 100%;
  transition: transform .18s, filter .18s;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-family: var(--font); font-size: 14px;
  cursor: pointer; transition: border-color .2s, color .2s;
}
.btn-secondary:hover { border-color: rgba(131,58,180,0.5); color: #fff; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font); font-size: 12px;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: rgba(131,58,180,0.5); color: var(--text-main); }

.btn-ghost-sm {
  background: none; border: none;
  color: var(--text-dim);
  font-family: var(--font); font-size: 11px;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.btn-ghost-sm:hover { color: var(--text-muted); background: var(--surface); }

.btn-accent {
  background: var(--grad-hero);
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-family: var(--font); font-size: 12px; font-weight: 700;
  padding: 9px 16px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(131,58,180,0.35);
  transition: filter .15s, transform .15s;
}
.btn-accent:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-accent-sm {
  background: rgba(131,58,180,0.2);
  border: 1px solid rgba(131,58,180,0.35);
  border-radius: var(--radius-sm);
  color: #c084f5; font-family: var(--font); font-size: 12px;
  padding: 7px 13px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn-accent-sm:hover { background: rgba(131,58,180,0.35); border-color: rgba(131,58,180,0.6); }

/* ─── Inputs ────────────────────────────────────────────────────────────── */
input[type=text], input[type=password] {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font); font-size: 13px;
  padding: 10px 14px; outline: none; width: 100%;
  direction: ltr;
  transition: border-color .2s, box-shadow .2s;
}
input:focus {
  border-color: rgba(131,58,180,0.6);
  box-shadow: 0 0 0 3px rgba(131,58,180,0.15);
}
input::placeholder { color: var(--text-dim); }

.error-msg { color: #ff6b6b; font-size: 12px; min-height: 16px; }

/* Toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(20,14,32,0.95);
  border: 1px solid rgba(131,58,180,0.4);
  color: var(--text-main); font-size: 13px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(131,58,180,0.15);
  opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 999;
  white-space: nowrap;
}
#toast.show { opacity: 1; }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #833AB4;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block; vertical-align: middle; margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── LOGIN SCREEN ──────────────────────────────────────────────────────── */
#screen-login {
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}

.login-card {
  position: relative; z-index: 2;
  width: 400px; max-width: calc(100vw - 32px);
  background: rgba(13,10,20,0.85);
  backdrop-filter: blur(28px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(131,58,180,0.1);
}
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-hero); opacity: 0.5; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 42px; height: 42px;
  background: var(--grad-hero);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: #fff;
  box-shadow: 0 4px 20px rgba(131,58,180,0.4);
}
.logo-text { display: flex; flex-direction: column; }
.logo-name {
  font-size: 18px; font-weight: 700; letter-spacing: -0.5px;
  background: var(--grad-hero);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.logo-sub { font-size: 11px; color: var(--text-dim); line-height: 1; }
.login-sub { color: var(--text-muted); font-size: 13px; }
.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-group label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ─── ROOM SELECT ───────────────────────────────────────────────────────── */
#screen-room { flex-direction: column; }

.room-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 66px;
  background: rgba(13,10,20,0.78);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 10;
}
.logo-sm { display: flex; align-items: center; gap: 10px; }
.logo-sm .logo-icon { width: 34px; height: 34px; font-size: 16px; }
.logo-sm .logo-name { font-size: 16px; }
.user-badge { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; }

.room-picker {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px; padding: 40px;
  position: relative; z-index: 1;
}
.room-picker h2 { font-size: 26px; font-weight: 700; }
.hint { color: var(--text-muted); font-size: 13px; }
.link-input-wrap { display: flex; gap: 10px; width: 100%; max-width: 600px; flex-wrap: wrap; }
.link-input-wrap input { flex: 1; min-width: 200px; }
.link-input-wrap .btn-primary { width: auto; padding: 10px 28px; }

.room-info {
  display: flex; flex-direction: column; gap: 14px; align-items: center;
  padding: 22px; background: var(--grad-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 520px; position: relative; overflow: hidden;
  backdrop-filter: blur(12px);
}
.room-info::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-hero); opacity: 0.3;
}
.room-preview { display: flex; align-items: center; gap: 16px; width: 100%; }
.room-icon { font-size: 38px; }
.room-name-txt { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.room-meta-txt { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.room-info .btn-primary { width: auto; padding: 10px 36px; }

/* ─── PLAYER LAYOUT ─────────────────────────────────────────────────────── */
#screen-player { flex-direction: row; height: 100vh; overflow: hidden; }

.player-left {
  width: 330px; min-width: 270px; max-width: 370px;
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: rgba(13,10,20,0.7);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  /* کلید اسکرول: height:100% + overflow-y:auto */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.player-right {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: rgba(13,10,20,0.4);
  backdrop-filter: blur(8px);
  min-width: 0; position: relative; z-index: 1;
}

/* ─── NOW PLAYING CARD ──────────────────────────────────────────────────── */
.now-playing-card {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.now-playing-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-hero); opacity: 0.4;
}

.np-cover {
  width: 100%; aspect-ratio: 1;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.np-cover img { width: 100%; height: 100%; object-fit: cover; }
.np-cover-placeholder { font-size: 56px; color: var(--text-dim); }

.np-info { text-align: center; }
.np-title {
  font-size: 15px; font-weight: 700; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-bright);
}
.np-artist { font-size: 13px; color: var(--text-muted); }
.np-album { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.dj-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; justify-content: center; }
.dj-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.dj-badge.dj {
  background: var(--grad-hero);
  color: #fff;
  box-shadow: 0 2px 12px rgba(131,58,180,0.4);
}
.dj-badge.guest {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.dj-info { font-size: 11px; color: var(--text-muted); }

/* Bot pill */
.bot-pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  padding: 4px 14px; border-radius: 20px;
  align-self: center;
  transition: all .3s;
}
.bot-pill.live {
  background: rgba(76,255,159,.10);
  color: #4cff9f;
  border: 1px solid rgba(76,255,159,.28);
  box-shadow: 0 0 12px rgba(76,255,159,.12);
}
.bot-pill.paused {
  background: rgba(252,176,69,.1);
  color: #FCB045;
  border: 1px solid rgba(252,176,69,.25);
}
.bot-pill.offline {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* Progress */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.time-label { font-family: var(--mono); font-size: 10px; color: var(--text-dim); min-width: 30px; white-space: nowrap; }
.progress-bar {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; position: relative; cursor: pointer;
}
.progress-fill {
  height: 100%;
  background: var(--grad-hero);
  border-radius: 2px; width: 0%;
  transition: width .5s linear;
}
.progress-thumb {
  position: absolute; top: 50%; right: 0;
  transform: translate(50%,-50%);
  width: 12px; height: 12px; border-radius: 50%; background: #fff;
  opacity: 0; transition: opacity .15s;
  box-shadow: 0 0 8px rgba(131,58,180,0.5);
}
.progress-bar:hover .progress-thumb { opacity: 1; }

/* Controls */
.controls {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: nowrap; min-height: 52px;
}
.ctrl-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: clamp(14px,3vw,18px);
  cursor: pointer; padding: 7px;
  border-radius: 50%;
  transition: color .15s, background .15s;
  line-height: 1; flex-shrink: 0;
}
.ctrl-btn:hover { color: var(--text-bright); background: var(--surface); }
.ctrl-btn.active { color: #c084f5; }
.ctrl-main { font-size: clamp(16px,3.5vw,22px); color: var(--text-main); }
.ctrl-play {
  font-size: clamp(16px,3.5vw,20px); color: #fff;
  background: var(--grad-hero);
  width: clamp(40px,7vw,48px); height: clamp(40px,7vw,48px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(253,29,29,0.35); flex-shrink: 0;
}
.ctrl-play:hover { filter: brightness(1.1); transform: scale(1.06); }
.ctrl-play:disabled { opacity: 0.35; cursor: not-allowed; transform: none; filter: none; }
.ctrl-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.controls-sm { display: flex; justify-content: center; }
.ctrl-btn-sm {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-dim);
  font-family: var(--font); font-size: 11px;
  padding: 5px 14px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ctrl-btn-sm:hover { color: #ff6b6b; border-color: rgba(255,107,107,.4); }
.ctrl-btn-sm:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── UPLOAD CARD ───────────────────────────────────────────────────────── */
.upload-card {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; flex-direction: column; gap: 9px;
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.upload-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-hero); opacity: 0.2;
}
.upload-card h3 { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.upload-drop {
  border: 2px dashed rgba(131,58,180,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 12px; cursor: pointer; text-align: center;
  transition: border-color .2s, background .2s;
}
.upload-drop:hover, .upload-drop.drag-over {
  border-color: rgba(131,58,180,0.7);
  background: rgba(131,58,180,0.07);
}
.upload-drop-inner { pointer-events: none; }
.upload-icon { font-size: 24px; margin-bottom: 6px; }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.upload-formats { font-size: 10px; color: var(--text-dim); font-family: var(--mono); }

.upload-progress {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted);
}
.upload-progress-bar {
  flex: 1; height: 3px; background: rgba(255,255,255,0.06);
  border-radius: 2px; position: relative; overflow: hidden;
}
.upload-progress-bar::after {
  content: ''; position: absolute; inset: 0;
  background: var(--grad-hero);
  animation: progress-slide 1s ease-in-out infinite;
}
@keyframes progress-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ─── UPLOADED FILES BROWSER ────────────────────────────────────────────── */
.uploaded-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
}
.uploaded-header h3 { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Search local */
.local-search-wrap {
  display: flex; gap: 6px; align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  margin-bottom: 4px;
}
.local-search-wrap input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-main); font-family: var(--font); font-size: 12px;
  direction: rtl; padding: 0;
}
.local-search-wrap input::placeholder { color: var(--text-dim); }
.local-search-wrap .search-icon { color: var(--text-dim); font-size: 12px; flex-shrink: 0; }

.uploaded-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 220px; overflow-y: auto;
}
.uploaded-list::-webkit-scrollbar { width: 4px; }

/* Track row style (same for search + local) */
.uploaded-item, .search-track {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s;
}
.uploaded-item:hover, .search-track:hover {
  background: rgba(255,255,255,0.05);
}

.track-cover {
  width: 40px; height: 40px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
}
.track-icon, .uploaded-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: rgba(131,58,180,0.15);
  border: 1px solid rgba(131,58,180,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  color: #c084f5;
}
.uploaded-icon { font-size: 16px; }

.track-info, .uploaded-info { flex: 1; overflow: hidden; min-width: 0; }
.track-title, .uploaded-title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-bright);
}
.track-artist, .uploaded-artist {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-dur, .uploaded-size {
  font-family: var(--mono); font-size: 10px; color: var(--text-dim);
}

.track-actions, .uploaded-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Play / Add buttons (same style for all rows) */
.btn-play-now {
  background: var(--grad-hero);
  border: none; border-radius: 7px; color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 10px rgba(131,58,180,0.3);
  transition: filter .15s, transform .12s;
}
.btn-play-now:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-add-track {
  background: rgba(131,58,180,0.15);
  border: 1px solid rgba(131,58,180,0.25);
  border-radius: 7px; color: #c084f5;
  font-size: 11px; font-weight: 600;
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn-add-track:hover { background: rgba(131,58,180,0.3); border-color: rgba(131,58,180,0.5); }

/* Add to playlist button */
.btn-add-pl {
  background: rgba(252,176,69,0.12);
  border: 1px solid rgba(252,176,69,0.22);
  border-radius: 7px; color: #FCB045;
  font-size: 11px; font-weight: 600;
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.btn-add-pl:hover { background: rgba(252,176,69,0.25); }

/* Source badges */
.src-badge {
  font-size: 9px; font-family: var(--mono);
  padding: 1px 5px; border-radius: 4px; margin-right: 4px; vertical-align: middle;
}
.src-badge.local {
  background: rgba(111,221,255,.10); color: #6fddff;
  border: 1px solid rgba(111,221,255,.22);
}
.src-badge.url {
  background: rgba(76,255,159,.08); color: #4cff9f;
  border: 1px solid rgba(76,255,159,.20);
}

/* ─── ADD URL CARD ──────────────────────────────────────────────────────── */
.add-url-card {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px;
  display: flex; flex-direction: column; gap: 9px;
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.add-url-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--grad-hero); opacity: 0.2;
}
.add-url-card h3 { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.url-row { display: flex; flex-direction: column; gap: 6px; }
.url-row input { font-size: 12px; padding: 8px 12px; }

/* URL track preview card */
.url-preview {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: none;
  flex-direction: column; gap: 6px;
}
.url-preview.visible { display: flex; }
.url-preview-row { display: flex; align-items: center; gap: 10px; }
.url-preview-cover {
  width: 44px; height: 44px; border-radius: 8px;
  background: rgba(131,58,180,0.15);
  border: 1px solid rgba(131,58,180,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #c084f5; flex-shrink: 0;
}
.url-preview-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.url-preview-info { flex: 1; min-width: 0; }
.url-preview-title { font-size: 13px; font-weight: 600; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.url-preview-artist { font-size: 11px; color: var(--text-muted); }

/* ─── ROOM BADGE BAR ────────────────────────────────────────────────────── */
.room-badge-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--grad-card);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.room-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4cff9f; box-shadow: 0 0 6px #4cff9f; flex-shrink: 0;
}
.room-badge-bar span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── SEARCH SECTION ────────────────────────────────────────────────────── */
.search-section {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 14px;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: rgba(131,58,180,0.5); }
.search-icon { color: var(--text-dim); font-size: 14px; flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; color: var(--text-main);
  font-family: var(--font); font-size: 13px; outline: none;
  direction: rtl; min-width: 0; padding: 0;
}
.search-bar input::placeholder { color: var(--text-dim); }

.search-results {
  margin-top: 8px; display: flex; flex-direction: column; gap: 2px;
  max-height: 260px; overflow-y: auto;
}

/* ─── PLAYLIST WIDGET ───────────────────────────────────────────────────── */
.playlist-widget {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.playlist-widget-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.playlist-widget-header h3 { font-size: 13px; font-weight: 700; color: var(--text-bright); }
.playlist-widget-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 160px; overflow-y: auto;
}

.pw-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
  cursor: default;
}
.pw-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(131,58,180,0.2); }
.pw-name { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main); }
.pw-count { font-size: 10px; color: var(--text-dim); font-family: var(--mono); flex-shrink: 0; }
.pw-play { flex-shrink: 0; }

/* ─── QUEUE SECTION ─────────────────────────────────────────────────────── */
.queue-section {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  padding: 0 18px 18px;
}
.queue-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 8px;
}
.queue-header h3 { font-size: 14px; font-weight: 700; color: var(--text-bright); }
.queue-count {
  display: inline-block;
  background: rgba(131,58,180,0.18); color: #c084f5;
  font-size: 10px; padding: 1px 7px; border-radius: 10px;
  margin-right: 4px; font-family: var(--mono);
}
.queue-actions { display: flex; gap: 6px; }

.queue-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}

.queue-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s;
  border: 1px solid transparent;
}
.queue-item:hover { background: rgba(255,255,255,0.04); }
.queue-item.current {
  background: rgba(131,58,180,0.10);
  border-color: rgba(131,58,180,0.22);
}
.queue-item.current .q-title {
  background: var(--grad-hero);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Playing bar animation */
.playing-bar { display: none; align-items: flex-end; gap: 2px; height: 14px; width: 20px; flex-shrink: 0; }
.queue-item.current.playing .playing-bar { display: flex; }
.queue-item.current.playing .q-num { display: none; }
.bar { width: 3px; background: var(--grad-hero); border-radius: 2px; animation: bounce-bar .7s ease infinite alternate; }
.bar:nth-child(1) { height: 6px; }
.bar:nth-child(2) { height: 12px; animation-delay: .15s; }
.bar:nth-child(3) { height: 8px;  animation-delay: .3s; }
@keyframes bounce-bar { to { height: 3px; } }

.q-num { font-family: var(--mono); font-size: 10px; color: var(--text-dim); width: 20px; text-align: center; flex-shrink: 0; }
.q-drag { cursor: grab; color: var(--text-dim); font-size: 16px; padding: 0 4px; user-select: none; flex-shrink: 0; }
.q-drag:active { cursor: grabbing; }
.q-cover { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.q-cover-placeholder {
  width: 34px; height: 34px; border-radius: 6px;
  background: rgba(131,58,180,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; color: #c084f5;
}
.q-info { flex: 1; overflow: hidden; min-width: 0; }
.q-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.q-artist { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-duration { font-family: var(--mono); font-size: 10px; color: var(--text-dim); flex-shrink: 0; min-width: 32px; text-align: left; }
.q-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 13px; cursor: pointer; padding: 3px 6px;
  border-radius: 4px; transition: color .12s, background .12s;
}
.q-btn:hover { color: var(--text-main); background: var(--surface); }
.q-btn.danger:hover { color: #ff6b6b; }
.queue-item[draggable=true] { cursor: grab; }
.queue-item.drag-over { background: rgba(131,58,180,0.18); border-color: rgba(131,58,180,0.35); }

/* ─── EMPTY STATE ───────────────────────────────────────────────────────── */
.empty-state { color: var(--text-dim); font-size: 13px; text-align: center; padding: 20px; }

/* ─── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #screen-player { flex-direction: column; overflow-y: auto; }
  .player-left { width: 100%; min-width: unset; max-width: unset; border-left: none; border-bottom: 1px solid var(--border); overflow-y: visible; }
  .player-right { flex: none; min-height: 50vh; overflow: visible; }
  .np-cover { max-height: 200px; aspect-ratio: 1; width: auto; margin: 0 auto; }
  .controls { gap: 2px; }
  .ctrl-btn { font-size: 16px; padding: 5px; }
  .ctrl-main { font-size: 20px; }
  .ctrl-play { width: 44px; height: 44px; font-size: 20px; }
  html, body { overflow: auto; }
  .screen { height: auto; min-height: 100vh; }
  body::after { display: none; }
}

@media (max-width: 400px) {
  .ctrl-btn { font-size: 14px; padding: 4px; }
  .ctrl-main { font-size: 18px; }
  .ctrl-play { width: 40px; height: 40px; font-size: 18px; }
  .player-left { padding: 10px; }
}

/* ─── Playlist manager page styles ──────────────────────────────────────── */
.pm-track-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: background .12s;
}
.pm-track-row:hover { background: rgba(255,255,255,0.04); }

/* ── Source badges (search results) ── */
.src-deezer {
  background: rgba(30,215,96,0.12);
  color: #1ed760;
  border: 1px solid rgba(30,215,96,0.25);
  font-size: 9px; padding: 1px 6px; border-radius: 4px;
  margin-right: 4px; vertical-align: middle;
}
.src-itunes {
  background: rgba(252,60,68,0.12);
  color: #fc3c44;
  border: 1px solid rgba(252,60,68,0.25);
  font-size: 9px; padding: 1px 6px; border-radius: 4px;
  margin-right: 4px; vertical-align: middle;
}
.src-vayrex {
  background: rgba(131,58,180,0.15);
  color: #c084f5;
  border: 1px solid rgba(131,58,180,0.3);
  font-size: 9px; padding: 1px 6px; border-radius: 4px;
  margin-right: 4px; vertical-align: middle;
}
