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

:root {
  --bg:          #0a0a0f;
  --surface:     #13131e;
  --surface-2:   #1c1c2e;
  --border:      rgba(255,255,255,0.07);
  --accent:      #7c3aed;
  --accent-2:    #a855f7;
  --accent-glow: rgba(124, 58, 237, 0.45);
  --gold:        #f59e0b;
  --text:        #f0f0f8;
  --muted:       rgba(240,240,248,0.45);
  --card-w:      360px;
  --card-h:      420px;
  --radius:      24px;
  --transition:  0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
}

/* ── Ambient orbs ───────────────────────────────────────────────────────── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: float 8s ease-in-out infinite alternate;
}
.orb-1 { width: 500px; height: 500px; background: #7c3aed; top: -150px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: #1d4ed8; bottom: -100px; right: -80px; animation-delay: -3s; }
.orb-3 { width: 300px; height: 300px; background: #a855f7; top: 40%; left: 50%; transform: translate(-50%,-50%); animation-delay: -5s; }

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(20px, 30px) scale(1.08); }
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 28px; }
.logo-text {
  font-size: 22px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* counter removed */

/* ── Stage ──────────────────────────────────────────────────────────────── */
.stage {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  height: calc(100vh - 160px);
}

/* ── Card deck ──────────────────────────────────────────────────────────── */
.card-deck {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  perspective: 1200px;
}

/* ── Individual card ────────────────────────────────────────────────────── */
.song-card {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(124,58,237,0.08),
    0 20px 60px rgba(0,0,0,0.6),
    0 0 80px rgba(124,58,237,0.08) inset;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
  padding: 40px 32px;
  cursor: grab;
  touch-action: pan-y;
  backface-visibility: hidden;
  will-change: transform, opacity;
  transition: box-shadow 0.2s ease;
}

.song-card:active { cursor: grabbing; }

/* States */
.song-card.is-active  { z-index: 5; }
.song-card.is-prev    { z-index: 4; }
.song-card.is-next    { z-index: 3; }
.song-card.is-hidden  { z-index: 1; opacity: 0; pointer-events: none; }

/* Active card glow when settled */
.song-card.is-settled {
  box-shadow:
    0 0 0 1px rgba(124,58,237,0.3),
    0 20px 60px rgba(0,0,0,0.6),
    0 0 60px var(--accent-glow);
}

/* Drag-state tilt glow feedback */
.song-card.drag-left  { box-shadow: -8px 0 40px rgba(239,68,68,0.35),  0 20px 60px rgba(0,0,0,0.5); }
.song-card.drag-right { box-shadow:  8px 0 40px rgba(34,197,94,0.35),  0 20px 60px rgba(0,0,0,0.5); }

/* Card inner content */
.card-number {
  font-size: 11px; font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--accent-2); opacity: 0.7;
}

.card-vinyl {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 50%, #1a1a2e 18%, #2a2a4e 22%, #111 24%, #1e1e3f 40%, #0a0a1a 100%);
  border: 2px solid rgba(124,58,237,0.3);
  box-shadow: 0 0 30px rgba(124,58,237,0.2);
  display: flex; align-items: center; justify-content: center;
  animation: spin 8s linear infinite paused;
  position: relative;
}
.card-vinyl::after {
  content: '';
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid rgba(124,58,237,0.4);
}

.song-card.is-active .card-vinyl { animation-play-state: running; }

@keyframes spin { to { transform: rotate(360deg); } }

.card-title {
  font-size: 26px; font-weight: 800;
  text-align: center; line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-artist {
  font-size: 14px; font-weight: 400; color: var(--muted);
  text-align: center; letter-spacing: 0.03em;
}

.card-divider {
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  opacity: 0.6;
}

/* Swipe indicator pills */
.swipe-indicator {
  position: absolute; top: 20px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  opacity: 0; transition: opacity 0.15s ease;
  pointer-events: none;
}
.swipe-indicator.left  { left: 20px;  background: rgba(239,68,68,0.25);  border: 1px solid rgba(239,68,68,0.5);  color: #f87171; }
.swipe-indicator.right { right: 20px; background: rgba(34,197,94,0.25);  border: 1px solid rgba(34,197,94,0.5);  color: #4ade80; }

/* ── Nav buttons ────────────────────────────────────────────────────────── */
.nav-btn {
  position: absolute;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s ease;
  z-index: 20; top: 50%; transform: translateY(-50%);
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 20px var(--accent-glow); }
.nav-prev { left: -72px; }
.nav-next { right: -72px; }

@media (max-width: 600px) {
  .nav-prev { left: 8px; }
  .nav-next { right: 8px; }
}

/* ── Hint ───────────────────────────────────────────────────────────────── */
.hint {
  position: fixed; bottom: 68px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--muted); letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 8px;
  opacity: 1; transition: opacity 0.5s ease;
  z-index: 10;
}
.hint.hidden { opacity: 0; pointer-events: none; }
.hint-arrow { font-size: 14px; animation: nudge 2s ease-in-out infinite; }
.hint-arrow:last-child { animation-delay: -1s; }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* ── Progress dots ──────────────────────────────────────────────────────── */
.dots {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px; z-index: 10;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all 0.3s ease;
  cursor: pointer;
}
.dot.active {
  background: var(--accent-2);
  width: 24px; border-radius: 4px;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; top: 28px; left: 50%; transform: translateX(-50%) translateY(-80px);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; font-weight: 600; font-size: 14px;
  padding: 12px 22px; border-radius: 100px;
  box-shadow: 0 8px 32px var(--accent-glow);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-icon { font-size: 16px; }
