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

:root {
  --accent: 255, 255, 255;
}

body {
  background: #0d0d0d;
  color: #fff;
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Background ── */
.bg-layer {
  position: fixed;
  inset: -80px;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity 2.5s ease;
  z-index: 0;
  will-change: opacity;
}
.bg-layer.active { opacity: 1; }

.bg-layer.photo-mode {
  filter: blur(var(--bg-blur, 20px)) brightness(0.28) saturate(1.7);
}

/* Vignette + accent-tinted center glow over the photo */
.bg-layer.photo-mode::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 48%,
      rgba(var(--accent), 0.05) 0%,
      rgba(0, 0, 0, 0.35) 60%,
      rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
}

/* ── Z-stack ── */
#vinyl-stack, #track-info, #lyrics-stage,
#clock, #progress-bar-wrap { position: relative; z-index: 1; }

/* ── Track info ── */
#track-info {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.4s;
}
#track-info.visible { opacity: 0.55; }
#track-title  { font-weight: 600; }
#track-artist { color: #bbb; margin-top: 2px; }

/* ── Clock ── */
#clock {
  position: fixed;
  bottom: 28px;
  right: 32px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  opacity: 0.3;
  transition: opacity 1s ease;
}

/* ── Idle screen ── */
#idle-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
  z-index: 1;
}
#idle-screen.visible { opacity: 1; }

#idle-clock {
  font-size: clamp(6rem, 16vw, 11rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1;
}

#idle-date {
  margin-top: 20px;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.38;
}

/* ── Progress bar ── */
#progress-bar-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(var(--accent), 0.08);
  z-index: 2;
}
#progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(var(--accent), 0.65);
  box-shadow: 0 0 8px rgba(var(--accent), 0.4);
}

/* ── Lyrics stage ── */
#lyrics-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 780px;
  padding: 0 32px;
  text-align: center;
  animation: fadeIn 0.6s ease both;
}

.lyric-line {
  transition: opacity 0.5s ease, transform 0.5s ease, font-size 0.45s ease, color 0.35s ease;
  line-height: 1.3;
  will-change: opacity, transform, font-size;
}

#prev-line-2  { font-size: 1.4rem;  opacity: 0.25; color: #ccc; transform: translateY(10px); }
#prev-line    { font-size: 1.75rem; opacity: 0.45; color: #ddd; transform: translateY(6px); }
#current-line { font-size: 2.8rem;  font-weight: 600; opacity: 1; color: #fff; text-shadow: 0 0 50px rgba(var(--accent), 0.45), 0 0 100px rgba(var(--accent), 0.15); }
#next-line    { font-size: 1.75rem; opacity: 0.45; color: #ddd; transform: translateY(-6px); }
#next-line-2  { font-size: 1.4rem;  opacity: 0.25; color: #ccc; transform: translateY(-10px); }

/* ── Status ── */
#status {
  font-size: 0.9rem;
  opacity: 0.4;
  letter-spacing: 0.04em;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse    { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.5; } }
@keyframes fadeIn   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lyric-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.lyric-in { animation: lyric-in 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

/* ── Vinyl stack ── */
#vinyl-stack {
  position: fixed;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vsw {
  opacity: 0;
  transition: opacity 0.7s ease;
  position: relative;
  z-index: 0;
}
.vsw.visible { opacity: 0.48; }

#vinyl-next-wrap { margin-bottom: -26px; }
#vinyl-prev-wrap { margin-top:    -26px; }

.vinyl-side {
  width: 138px;
  height: 138px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, #0d0d0d 0%, #0d0d0d 2.5%, transparent 2.5%),
    repeating-radial-gradient(circle at 50% 50%,
      #111 0px, #1a1a1a 1px, #111 2.5px, #191919 3.5px, #111 5px);
  box-shadow: 0 0 0 1px #252525, 0 6px 24px rgba(0,0,0,0.6);
}

.vinyl-side-label {
  position: absolute;
  width: 44%; height: 44%;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #222 center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.05), inset 0 0 6px rgba(0,0,0,0.5);
}
.vinyl-side-label::after {
  content: '';
  position: absolute;
  width: 10%; height: 10%;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #0d0d0d;
  box-shadow: 0 0 0 1px #3a3a3a;
}

/* ── Main vinyl ── */
#vinyl-main-wrap {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#vinyl-main-wrap.visible { opacity: 1; }

#vinyl {
  width: 210px; height: 210px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, #0d0d0d 0%, #0d0d0d 2.5%, transparent 2.5%),
    repeating-radial-gradient(circle at 50% 50%,
      #111 0px, #1a1a1a 1px, #111 2.5px, #191919 3.5px, #111 5px);
  box-shadow: 0 0 0 1px #2a2a2a, 0 12px 50px rgba(0,0,0,0.75), 0 0 45px rgba(var(--accent), 0.12);
  animation: vinyl-spin 3.4s linear infinite;
  animation-play-state: paused;
}
#vinyl.playing { animation-play-state: running; }

#vinyl::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 32% 22%, rgba(255,255,255,0.07) 0%, transparent 55%);
  pointer-events: none;
}

#vinyl-label {
  position: absolute;
  width: 44%; height: 44%;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #222 center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), inset 0 0 8px rgba(0,0,0,0.4);
}
#vinyl-label::after {
  content: '';
  position: absolute;
  width: 10%; height: 10%;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #0d0d0d;
  box-shadow: 0 0 0 1px #444;
}

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

@media (max-width: 900px) { #vinyl-stack { display: none; } }
