/* ============================================================================
   Votune — Muted Violet + Linear DNA
   ClashDisplay · GeneralSans · Dark-only
   ============================================================================ */

/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --bg:            #08080b;
  --surface:       #0f0f14;
  --surface-2:     #16161e;
  --surface-3:     #1e1e28;
  --border:        rgba(255,255,255,0.05);
  --border-mid:    rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.12);
  --text:          #ededf0;
  --text-2:        #8a8b98;
  --text-3:        #4a4b57;
  --accent:        #a594c8;
  --accent-dim:    rgba(165,148,200,0.10);
  --accent-hover:  #b8a9d6;
  --danger:        #e5534b;
  --danger-dim:    rgba(229,83,75,0.10);
  --warning:       #c69026;
  --warning-dim:   rgba(198,144,38,0.10);
  --radius:        8px;
  --radius-sm:     6px;
  --radius-xs:     4px;
  --font:          'ClashDisplay-Variable', 'Inter', -apple-system, system-ui, sans-serif;
  --font-body:     'GeneralSans-Variable', 'Inter', -apple-system, system-ui, sans-serif;
  --transition:    200ms ease-out;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top, 0);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 20px 140px;
  width: 100%;
  position: relative;
  z-index: 1;
}
.wrap--admin { max-width: 960px; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  padding: 48px 0 32px;
  margin-bottom: 8px;
}

.hero--center {
  text-align: center;
  padding: 48px 0 24px;
}

.hero__label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 12px;
}

.hero__title {
  font-family: var(--font);
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1;
  color: var(--text);
}

.hero__meta { margin-top: 16px; }

/* ── Admin Header ───────────────────────────────────────────────────────── */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.admin-header h1 {
  font-family: var(--font);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.admin-header__right { display: flex; gap: 12px; align-items: center; }

.subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 16px 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-mid);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card--accent {
  border-color: var(--border-mid);
}

/* ── Section Headings ───────────────────────────────────────────────────── */
h2 {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge--accent  { background: var(--accent-dim);  color: var(--accent);  border-color: rgba(165,148,200,0.15); }
.badge--warning { background: var(--warning-dim); color: var(--warning); border-color: rgba(198,144,38,0.15); }
.badge--danger  { background: var(--danger-dim);  color: var(--danger);  border-color: rgba(229,83,75,0.15); }
.badge--vote {
  font-size: 14px;
  font-weight: 600;
  padding: 5px 12px;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-mid);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
button, .btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-mid);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button:hover, .btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
button:active, .btn:active { opacity: 0.8; }
button:disabled { opacity: 0.3; cursor: not-allowed; }

/* Primary — light on dark (Linear style) */
button.primary, .btn--primary {
  background: var(--text);
  border: none;
  color: var(--bg);
  font-weight: 600;
}
button.primary:hover, .btn--primary:hover {
  background: #d4d4d8;
}

button.sm, .btn--sm { padding: 6px 12px; font-size: 12px; }

button.danger, .btn--danger {
  background: var(--danger-dim);
  border-color: rgba(229,83,75,0.12);
  color: var(--danger);
}
button.danger:hover, .btn--danger:hover {
  background: rgba(229,83,75,0.18);
  border-color: rgba(229,83,75,0.25);
}

button.ghost, .btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
button.ghost:hover, .btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

button.warning, .btn--warning {
  background: var(--warning-dim);
  border-color: rgba(198,144,38,0.12);
  color: var(--warning);
}

.btn--outline-accent {
  background: var(--accent-dim);
  border-color: rgba(165,148,200,0.15);
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn--outline-accent:hover {
  background: rgba(165,148,200,0.15);
  border-color: rgba(165,148,200,0.25);
}

/* ── Inputs ─────────────────────────────────────────────────────────────── */
input, textarea, select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { min-height: 76px; resize: vertical; }
select { cursor: pointer; }

/* Search bar */
.search-bar { display: flex; gap: 8px; }
.search-bar input {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
}
.search-bar button {
  padding: 12px 24px;
  font-size: 14px;
}

/* ── Track Rows ─────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 4px; }

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--transition);
}

.row:hover {
  background: var(--surface-2);
}

.row__img {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  flex-shrink: 0;
}
.row__img[src=""], .row__img:not([src]), .row__img.img-err {
  background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4b57' stroke-width='1.5'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E") center/60% no-repeat;
}
.row__info { flex: 1; min-width: 0; }
.row__title {
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__sub {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.row__actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.row__eta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Now Playing ────────────────────────────────────────────────────────── */
.now-playing {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-mid);
}

.now-playing__img {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  flex-shrink: 0;
}
.now-playing__img[src=""], .now-playing__img:not([src]), .now-playing__img.img-err {
  background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4b57' stroke-width='1.5'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E") center/60% no-repeat;
}
.now-playing__info { flex: 1; min-width: 0; }
.now-playing__label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.now-playing__title {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-playing__artist {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ── EQ Bars ────────────────────────────────────────────────────────────── */
.eq-bars { display: flex; gap: 3px; align-items: flex-end; height: 22px; flex-shrink: 0; }
.eq-bars span {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: eq 0.8s ease-in-out infinite;
}
.eq-bars span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.eq-bars span:nth-child(2) { height: 20px; animation-delay: 0.15s; }
.eq-bars span:nth-child(3) { height: 6px;  animation-delay: 0.3s; }
.eq-bars span:nth-child(4) { height: 14px; animation-delay: 0.1s; }

@keyframes eq { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(0.25)} }

/* ── Progress Bar ───────────────────────────────────────────────────────── */
.progress-wrap {
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-time {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}
.progress-time--end { text-align: right; }
.progress-bar {
  flex: 1;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s linear;
  min-width: 0;
}

/* Autoplay indicator */
.now-playing--autoplay {
  border-color: rgba(198,144,38,0.15);
}
.now-playing--autoplay .now-playing__label { color: var(--warning); }
.now-playing--autoplay .eq-bars span { background: var(--warning); }
.now-playing--autoplay .progress-bar__fill { background: var(--warning); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  border-radius: var(--radius-xs);
}
.tab:hover { color: var(--text); background: transparent; }
.tab.active {
  background: var(--surface-3);
  color: var(--text);
}

/* ── Duo ────────────────────────────────────────────────────────────────── */
.duo-area {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  margin-top: 14px;
  overflow: hidden;
}

.duo-deck { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duo-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 0;
  overflow: hidden;
}
.duo-card:hover {
  border-color: var(--accent);
}
.duo-card:active {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: scale(0.97);
}
@keyframes duoBounce {
  0%   { transform: scale(0.95); }
  50%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.duo-card--bounce {
  animation: duoBounce 300ms ease-out;
}
.duo-card__thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
}
.duo-card__thumb[src=""], .duo-card__thumb:not([src]), .duo-card__thumb.img-err {
  background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4b57' stroke-width='1.5'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E") center/40% no-repeat;
}
.duo-card__title {
  font-weight: 500;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.duo-card__artist { font-size: 11px; color: var(--text-2); }
.duo-card__pill {
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
  width: max-content;
}
.duo-actions { display: flex; gap: 8px; margin-top: 12px; }
.duo-actions button { flex: 1; }
.duo-actions--center { justify-content: center; }
.duo-actions--center button { flex: none; }
.duo-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.duo-status { text-align: center; font-size: 12px; color: var(--text-2); margin-top: 12px; }

/* Duo voting indicators */
.duo-card--voted {
  border-color: var(--accent) !important;
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}
.duo-card--winner {
  border-color: var(--accent) !important;
  box-shadow: 0 0 16px rgba(165, 148, 200, 0.25);
  pointer-events: none;
}
.duo-card--winner::after {
  content: "\25B6  S\0131radaki";
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
}
.duo-card--loser {
  opacity: 0.4;
  pointer-events: none;
}
.duo-card__vote-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.duo-card__vote-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 16px;
}
.duo-card--voted .duo-card__vote-count {
  color: var(--accent);
}
.duo-card__vote-icon {
  color: var(--text-3);
  transition: all var(--transition);
  flex-shrink: 0;
}
.duo-card__vote-icon--active {
  color: var(--accent);
  transform: scale(1.15);
}
.duo-card__vote-bar {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 4px;
}
.duo-card__vote-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.4s ease;
  min-width: 0;
}

/* ── Request Quota Banner ───────────────────────────────────────────────── */
.request-quota-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
}
.request-quota-banner--exhausted {
  background: color-mix(in srgb, var(--warning) 12%, var(--surface-2));
  color: var(--warning);
}
.request-quota-banner--exhausted svg { color: var(--warning); flex-shrink: 0; }
.request-quota-banner.hidden { display: none; }

/* ── Duo Quota Exhausted Overlay ────────────────────────────────────────── */
.duo-quota-exhausted {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}
.duo-quota-exhausted svg { color: var(--warning); }
.duo-quota-exhausted__sub { font-size: 11px; color: var(--text-3); opacity: 0.7; }

/* ── Playlist Covers ────────────────────────────────────────────────────── */
.pl-covers {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pl-covers::-webkit-scrollbar { display: none; }

.pl-cover {
  flex: 0 0 auto;
  width: 100px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
  padding: 8px;
  border: 2px solid transparent;
  background: transparent;
}
.pl-cover:hover {
  background: var(--surface-2);
  border-color: var(--border-mid);
}
.pl-cover--active {
  border-color: var(--accent) !important;
  background: var(--accent-dim) !important;
}
.pl-cover__img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  display: block;
  margin: 0 auto;
}
.pl-cover__img--all {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
}
.pl-cover__img--all .lucide { width: 24px; height: 24px; }
.pl-cover__img[src=""], .pl-cover__img:not([src]), .pl-cover__img.img-err {
  background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4b57' stroke-width='1.5'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E") center/40% no-repeat;
}
.pl-cover__name {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-cover__count {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Requested / Cooldown button states ────────────────────────────────── */
.btn--requested {
  background: var(--accent-dim) !important;
  border: 1px solid rgba(165,148,200,0.15) !important;
  color: var(--accent) !important;
  cursor: default;
  pointer-events: none;
}
.btn--cooldown {
  background: var(--surface-3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-3) !important;
  font-size: 11px !important;
  cursor: not-allowed;
}

/* ── Grid (admin) ───────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

.list.scrollable {
  max-height: 440px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(165,148,200,0.08) transparent;
}
.list.scrollable::-webkit-scrollbar { width: 4px; }
.list.scrollable::-webkit-scrollbar-track { background: transparent; }
.list.scrollable::-webkit-scrollbar-thumb { background: rgba(165,148,200,0.08); border-radius: 2px; }
.list.scrollable::-webkit-scrollbar-thumb:hover { background: rgba(165,148,200,0.15); }

/* ── Form ───────────────────────────────────────────────────────────────── */
.form-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.switch-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.input--narrow { max-width: 120px; }
.form-group { flex: 1; min-width: 0; }
.form-group label {
  display: block;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Empty States ───────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
  color: var(--text-3);
}
.empty__icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.25;
  display: block;
}

/* ── Nav Link ───────────────────────────────────────────────────────────── */
.nav-link {
  text-decoration: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover {
  color: var(--text);
  border-color: var(--border-mid);
  background: var(--surface-2);
}

/* ── Playback Controls ──────────────────────────────────────────────────── */
.playback-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Player State (admin) ───────────────────────────────────────────────── */
.player-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  font-size: 13px;
}
.player-state__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3);
}
.player-state__dot.playing {
  background: var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}
.player-state__dot.paused { background: var(--warning); }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.text-muted  { color: var(--text-2); font-size: 13px; }
.text-sm     { font-size: 12px; }
.flex        { display: flex; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm      { gap: 8px; }
.gap-md      { gap: 14px; }
.grow        { flex: 1; min-width: 0; }
.mt-sm       { margin-top: 10px; }
.mt-md       { margin-top: 16px; }
.mb-sm       { margin-bottom: 10px; }
.mb-md       { margin-bottom: 16px; }
.hidden      { display: none !important; }
.pulse       { animation: pulse 1.5s ease-in-out infinite; }

/* ── Spinner & Loading ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: -2px;
  flex-shrink: 0;
}
.btn--loading { opacity: 0.7; pointer-events: none; }

/* ── Connection Banner ─────────────────────────────────────────────────── */
.conn-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9998;
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.conn-banner.hidden { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.conn-banner--disconnected { background: rgba(229,83,75,0.15); color: var(--danger); border-bottom: 1px solid rgba(229,83,75,0.2); }
.conn-banner--connected { background: rgba(165,148,200,0.15); color: var(--accent); border-bottom: 1px solid rgba(165,148,200,0.2); }

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes pulse  { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.fade-in { animation: fadeIn 200ms ease-out forwards; }

/* ── Selection ──────────────────────────────────────────────────────────── */
::selection {
  background: var(--accent-dim);
  color: var(--text);
}

/* ── Stagger Delay Utils ───────────────────────────────────────────────── */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }

/* ── Search Clear Button ──────────────────────────────────────────────── */
.search-bar { position: relative; }
.search-clear {
  position: absolute;
  right: 110px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  transition: color 150ms, background 150ms;
}
.search-clear:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.search-clear.visible { display: flex; }

/* ── Pull-to-Refresh ──────────────────────────────────────────────────── */
.pull-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-50px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  transition: opacity 150ms;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.pull-indicator .lucide { width: 18px; height: 18px; color: var(--accent); }
.pull-indicator.pulling { opacity: 1; }
.pull-indicator.refreshing .lucide { animation: spin 0.8s linear infinite; }

/* ── Request Button Animations ─────────────────────────────────────────── */
@keyframes btnPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.btn--pop {
  animation: btnPop 300ms ease-out;
}

.check-anim {
  display: inline-block;
}

/* ── Announcement Banner (shadcn/ui Alert) ─────────────────────────────── */
.announcement-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--warning-dim);
  border: 1px solid rgba(198,144,38,0.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
  color: var(--warning);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  animation: fadeIn 300ms ease-out;
}
.announcement-banner::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23c69026' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 18-5v12L3 13v-2z'/%3E%3Cpath d='M11.6 16.8a3 3 0 1 1-5.8-1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* ── Karaoke / Lyrics Panel ────────────────────────────────────────────── */
.card--lyrics {
  max-height: 320px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lyrics-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  flex-shrink: 0;
}

.lyrics-header__icon { font-size: 20px; }

.lyrics-header__title {
  font-family: var(--font);
  font-weight: 500;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.lyrics-header__crowd {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lyrics-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(165,148,200,0.06) transparent;
  mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}
.lyrics-scroll::-webkit-scrollbar { width: 3px; }
.lyrics-scroll::-webkit-scrollbar-thumb { background: rgba(165,148,200,0.06); border-radius: 2px; }

.lyrics-line {
  padding: 5px 16px;
  font-size: 15px;
  color: var(--text-3);
  transition: color 0.3s ease, transform 0.3s ease, font-size 0.3s ease, opacity 0.3s ease;
  text-align: center;
  line-height: 1.65;
}

.lyrics-line--active {
  color: var(--accent);
  font-size: 19px;
  font-weight: 600;
  transform: scale(1.02);
}

.lyrics-line--past {
  opacity: 0.35;
}

.lyrics-line--future {
  color: var(--text-2);
  opacity: 0.6;
}

.lyrics-empty {
  text-align: center;
  color: var(--text-3);
  font-style: italic;
  padding: 28px 0;
  font-size: 13px;
}

/* ── Playlist Manager (Admin) ─────────────────────────────────────────── */
.playlist-manager {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: opacity 0.2s;
}
.playlist-item--disabled {
  opacity: 0.45;
}
.playlist-item__cover {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.playlist-item__cover--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-3);
}
.playlist-item__info {
  flex: 1;
  min-width: 0;
}
.playlist-item__title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-item__meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Skeleton Loader (shadcn/ui Skeleton) ──────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
.skeleton-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}
.skeleton-row__img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.skeleton-row__lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-row__line { height: 12px; border-radius: 3px; }
.skeleton-row__line--title { width: 65%; }
.skeleton-row__line--sub { width: 40%; }

/* ── Switch Toggle (shadcn/ui Switch) ──────────────────────────────────── */
.switch {
  width: 40px;
  height: 22px;
  background: var(--surface-3);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 200ms ease-out;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.switch::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 200ms ease-out, background 200ms;
}
.switch.active {
  background: var(--accent);
  border-color: var(--accent);
}
.switch.active::after {
  transform: translateX(18px);
  background: #fff;
}
.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}

/* ── Tooltip (shadcn/ui Tooltip) ───────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms, transform 150ms;
  z-index: 100;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Separator (shadcn/ui Separator) ───────────────────────────────────── */
.separator {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Focus-visible Ring (shadcn --ring pattern) ────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible, .btn--sm:focus-visible, .tab:focus-visible, .switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(165,148,200,0.15);
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  /* ── 1. Compact Hero ─────────────────────────────────────────────────── */
  .hero--center        { padding: 20px 0 10px; }
  .hero__label         { font-size: 9px; letter-spacing: 1.5px; margin-bottom: 6px; }
  .hero__title         { font-size: 28px; letter-spacing: -1px; }
  .hero__meta          { margin-top: 8px; }

  /* ── 2. Compact Now Playing ──────────────────────────────────────────── */
  .now-playing         { padding: 12px 14px; gap: 12px; }
  .now-playing__img    { width: 48px; height: 48px; }
  .now-playing__label  { margin-bottom: 3px; }
  .now-playing__title  { font-size: 15px; }

  /* ── 3. Collapsible Lyrics Panel ─────────────────────────────────────── */
  .card--lyrics                               { max-height: 45px; transition: max-height 0.3s ease; cursor: pointer; }
  .card--lyrics.lyrics-expanded               { max-height: 240px; }
  .card--lyrics .lyrics-scroll                { opacity: 0; transition: opacity 0.2s ease 0.1s; pointer-events: none; }
  .card--lyrics.lyrics-expanded .lyrics-scroll { opacity: 1; pointer-events: auto; }
  .lyrics-header__toggle                      { margin-left: 8px; transition: transform 0.3s ease; color: var(--text-3); }
  .card--lyrics.lyrics-expanded .lyrics-header__toggle { transform: rotate(180deg); }

  /* ── 4. Sticky Search Bar ────────────────────────────────────────────── */
  #searchCard          { transition: padding 0.2s ease, border-radius 0.2s ease; }
  #searchCard.stuck    { position: sticky; top: 0; z-index: 40;
                         margin: 0 -16px; padding: 10px 16px;
                         border-radius: 0; border-left: none; border-right: none;
                         background: rgba(8, 8, 11, 0.92);
                         backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  #searchCard.stuck h2          { display: none; }
  #searchCard.stuck #results    { max-height: 50vh; overflow-y: auto; }
  #searchCard.stuck .search-bar { margin-top: 0; }

  /* ── 5. Tighter Card Spacing ─────────────────────────────────────────── */
  .card                { padding: 14px; margin: 6px 0; }

  /* ── 6. Compact Empty State ─────────────────────────────────────────── */
  .empty               { padding: 14px 16px; font-size: 13px; }
  .empty__icon         { font-size: 20px; margin-bottom: 4px; }
  .empty__icon .lucide { width: 20px; height: 20px; }

  /* ── Existing mobile rules ───────────────────────────────────────────── */
  .row                 { padding: 8px 10px; gap: 10px; }
  .row__img            { width: 42px; height: 42px; }
  .form-row            { flex-direction: column; }
  .admin-header        { flex-direction: column; gap: 14px; align-items: flex-start; padding-left: 0; }
  .playback-controls   { gap: 6px; }
  .pl-cover            { width: 80px; padding: 6px; }
  .pl-cover__img       { width: 64px; height: 64px; }
  .pl-cover__name      { font-size: 10px; }
  .duo-deck            { gap: 8px; }
  .duo-card            { padding: 10px; }
  .duo-card__title     { font-size: 12px; }
  .duo-card__artist    { font-size: 10px; }
  .duo-actions         { gap: 6px; }
  .search-bar input    { padding: 10px 14px; font-size: 14px; }
  .search-bar button   { padding: 10px 18px; }
  .wrap                { padding: 0 16px 140px; }
  h2                   { font-size: 11px; }
  .lyrics-line--active { font-size: 17px; }
  .lyrics-line         { font-size: 13px; padding: 4px 12px; }
}

/* ── Analytics Summary ──────────────────────────────────────────────────── */
.analytics-summary__row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}
.analytics-summary__top {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
}

/* ── Lucide Icon Utilities ──────────────────────────────────────────────── */
.lucide {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  flex-shrink: 0;
}
.icon-sm .lucide, .lucide.icon-sm { width: 14px; height: 14px; }
.icon-lg .lucide, .lucide.icon-lg { width: 20px; height: 20px; }
.icon-xl .lucide, .lucide.icon-xl { width: 24px; height: 24px; }

h2 .lucide {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  opacity: 0.5;
}
.theme-toggle .lucide { width: 18px; height: 18px; }
.empty__icon .lucide  { width: 32px; height: 32px; stroke-width: 1.5; }
.lyrics-header__icon .lucide { width: 20px; height: 20px; }
.duo-card__vote-icon--active .lucide { fill: currentColor; }
