/* ═══════════════════════════════════════════════════
   REWIND — Full Stylesheet
   Aesthetic: warm, cozy, vintage, nostalgic
   Palette: cream, beige, dusty rose, warm brown
═══════════════════════════════════════════════════ */

/* ── CUSTOM PROPERTIES (Design Tokens) ── */
:root {
  --cream:        #f5f0e8;
  --cream-dark:   #ede6d6;
  --beige:        #d9cfc0;
  --warm-brown:   #7a5c44;
  --deep-brown:   #3d2b1f;
  --rose:         #c9848a;
  --rose-light:   #e8b4b8;
  --rose-muted:   #d4a0a5;
  --amber:        #c8895a;
  --amber-light:  #e6b88a;
  --text-main:    #3d2b1f;
  --text-soft:    #7a6655;
  --text-muted:   #a89080;

  /* Font families */
  --font-display:   'Playfair Display', Georgia, serif;
  --font-hand:      'Caveat', cursive;
  --font-body:      'Lora', Georgia, serif;

  /* Spacing & Radius */
  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  28px;
  --radius-xl:  48px;

  /* Shadows */
  --shadow-sm:  0 2px 12px rgba(61,43,31,0.10);
  --shadow-md:  0 8px 32px rgba(61,43,31,0.15);
  --shadow-lg:  0 16px 56px rgba(61,43,31,0.20);
  --glow-rose:  0 0 40px rgba(201,132,138,0.35);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(
    180deg,
    #fcebea 0%,
    #f6e3e1 40%,
    #efe1de 100%
  );
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    circle at 50% 20%,
    rgba(255, 220, 220, 0.35),
    transparent 60%
  );
  pointer-events: none;
  z-index: 0;
}

body.theme-pink {
  background: linear-gradient(#fcebea, #efe1de);
}

body.theme-brown {
  background: linear-gradient(#e7d3c3, #d6b8a5);
}

body.theme-dark {
  background: linear-gradient(#1a1a1a, #2b2b2b);
  color: #f5f5f5;
}

body.theme-pastel {
  background: linear-gradient(#e8f0ff, #fbe7f0);
}

body.theme-brown .cassette-body {
  background: linear-gradient(160deg, #3c2d24 0%, #24170f 60%, #140c06 100%);
}

body.theme-dark .cassette-body {
  background: linear-gradient(160deg, #1d1611 0%, #0d0906 60%, #060403 100%);
}

body.theme-pastel .cassette-body {
  background: linear-gradient(160deg, #3d2f2a 0%, #241814 60%, #160f0b 100%);
}

body.theme-brown .vinyl-label-area {
  background: linear-gradient(135deg, #efe2d4 0%, #d9c1a7 100%);
}

body.theme-dark .vinyl-label-area {
  background: linear-gradient(135deg, #2d2620 0%, #1f1a16 100%);
}

body.theme-pastel .vinyl-label-area {
  background: linear-gradient(135deg, #faf0f4 0%, #e7d5e0 100%);
}

.theme-selector {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  background: rgba(255,255,255,0.85);
  border: 1.5px solid var(--beige);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-selector:focus {
  border-color: var(--rose-muted);
  box-shadow: 0 0 0 3px rgba(201,132,138,0.12);
}

/* ── GRAIN OVERLAY — film grain texture ── */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  animation: grainShift 0.5s steps(2) infinite;
}
@keyframes grainShift {
  0%   { background-position: 0 0; }
  25%  { background-position: 10px 5px; }
  50%  { background-position: -5px 10px; }
  75%  { background-position: 8px -4px; }
  100% { background-position: 0 0; }
}

/* ── SPARKLES CONTAINER ── */
.sparkles-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* Individual sparkle — generated by JS */
.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose-light);
  opacity: 0;
  animation: sparkleFade var(--dur, 4s) ease-in-out var(--delay, 0s) infinite;
}
.sparkle::before {
  content: '✦';
  position: absolute;
  font-size: 10px;
  color: var(--rose-light);
  top: -3px;
  left: -3px;
  opacity: inherit;
}
@keyframes sparkleFade {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  30%  { opacity: 0.8; transform: translateY(-12px) scale(1); }
  60%  { opacity: 0.4; }
  100% { opacity: 0; transform: translateY(-40px) scale(0.3); }
}

/* ══════════════════════════════
   PAGE SYSTEM
══════════════════════════════ */

.page {
  min-height: 100vh;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 64px;
  animation: pageFadeIn 0.6s ease both;
}
.page.hidden { display: none !important; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PAGE NAV ── */
.page-nav {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}
.logo-small {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--rose);
  letter-spacing: 0.03em;
}

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--rose) 0%, var(--amber) 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  box-shadow: var(--shadow-md), 0 0 0 0 rgba(201,132,138,0);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg), var(--glow-rose);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary.full-width { width: 100%; justify-content: center; margin-top: 8px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--warm-brown);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 12px 24px;
  border: 1.5px solid var(--beige);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: rgba(255,255,255,0.6);
  backdrop-filter: blur(4px);
}
.btn-secondary:hover {
  border-color: var(--rose-muted);
  color: var(--rose);
  background-color: rgba(255,255,255,0.85);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.2s ease;
}
.btn-ghost:hover { color: var(--rose); }

.btn-icon {
  font-size: 0.75em;
  animation: spinStar 3s linear infinite;
}
@keyframes spinStar {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ══════════════════════════════
   HOME PAGE
══════════════════════════════ */

.home-content {
  text-align: center;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  z-index: 2;
}

.eyebrow {
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--rose-muted);
  letter-spacing: 0.04em;
  animation: floatUp 0.8s ease 0.1s both;
}

.home-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 1.15;
  color: var(--deep-brown);
  animation: floatUp 0.8s ease 0.2s both;
}
.home-title em {
  color: var(--rose);
  font-style: italic;
}

.home-sub {
  font-size: 1rem;
  color: var(--text-soft);
  line-height: 1.75;
  animation: floatUp 0.8s ease 0.35s both;
}

.home-note {
  font-family: var(--font-hand);
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: floatUp 0.8s ease 0.5s both;
}

@keyframes floatUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Decorative deco shapes on home */
.deco-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Faint vinyl in background */
.deco-vinyl {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  top: -60px;
  right: -80px;
  background: radial-gradient(circle, rgba(61,43,31,0.04) 30%, transparent 70%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 8px, rgba(61,43,31,0.03) 9px);
  border: 1px solid rgba(122,92,68,0.08);
  animation: slowRotate 30s linear infinite;
}

/* Faint cassette-like rectangle in background */
.deco-cassette {
  position: absolute;
  width: 220px;
  height: 140px;
  border-radius: 12px;
  bottom: 40px;
  left: -60px;
  border: 1px solid rgba(201,132,138,0.12);
  background: rgba(232,180,184,0.04);
  animation: breathe 5s ease-in-out infinite;
}

/* Wave divider at bottom of home */
.wave-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  color: rgba(122,92,68,0.1);
}
.wave-divider svg { width: 100%; height: 100%; }

/* ══════════════════════════════
   CREATE PAGE
══════════════════════════════ */

.create-container {
  width: 100%;
  max-width: 520px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: transparent;
}

.create-header { text-align: center; }
.create-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--deep-brown);
  line-height: 1.2;
}
.create-title em { color: var(--rose); font-style: italic; }
.create-sub {
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* The form card */
.form-card {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.9);
  padding: 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Field groups */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--warm-brown);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.required { color: var(--rose); font-size: 0.7em; }
.optional { font-weight: 400; color: var(--text-muted); font-size: 0.85em; text-transform: none; }

.field-input,
.field-textarea {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  background: rgba(245,240,232,0.8);
  border: 1.5px solid var(--beige);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: none;
}
.field-input::placeholder,
.field-textarea::placeholder { color: var(--text-muted); font-style: italic; }
.field-input:focus,
.field-textarea:focus {
  border-color: var(--rose-muted);
  box-shadow: 0 0 0 3px rgba(201,132,138,0.15);
  background: rgba(255,255,255,0.9);
}

.char-count {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

/* Format toggle */
.format-toggle {
  display: flex;
  gap: 12px;
}
.format-btn {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-soft);
  background: rgba(245,240,232,0.8);
  border: 1.5px solid var(--beige);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}
.format-btn.active {
  border-color: var(--rose);
  background: rgba(232,180,184,0.2);
  color: var(--rose);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(201,132,138,0.12);
}
.format-icon { font-size: 1.2em; }

.form-error {
  font-family: var(--font-hand);
  color: var(--rose);
  font-size: 0.95rem;
  text-align: center;
}
.form-error.hidden { display: none; }

/* ══════════════════════════════
   PLAYER PAGE
══════════════════════════════ */

.player-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

.player-eyebrow {
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--rose-muted);
  text-align: center;
  letter-spacing: 0.04em;
  animation: floatUp 0.6s ease 0.1s both;
}

/* ── TAPE WRAPPER — contains either cassette or vinyl ── */
.tape-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: floatUp 0.7s ease 0.2s both;
  /* Subtle floating / breathing animation when not playing */
}
.tape-wrapper:hover { animation-play-state: paused; }

.cassette,
.vinyl {
  position: relative;
  z-index: 1;
}

.cassette.hidden,
.vinyl.hidden {
  display: none;
}

/* ════════════════════════════════════════
   CASSETTE TAPE — detailed SVG-like CSS
════════════════════════════════════════ */

.cassette {
  position: relative;
  width: 320px;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 12px 32px rgba(61,43,31,0.22));
}
.cassette:hover { transform: scale(1.03) translateY(-4px); }

.cassette-body {
  background: linear-gradient(160deg, #2e2015 0%, #1c1309 60%, #0f0a05 100%);
  border-radius: 14px;
  padding: 18px 24px 22px;
  position: relative;
  border: 1.5px solid rgba(255,255,255,0.06);
}

/* The transparent window showing reels */
.cassette-window {
  background: linear-gradient(180deg, #111 0%, #1a1006 100%);
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.08);
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 24px;
  position: relative;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

/* Reels */
.reel {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #3a2a1a 0%, #1a0e06 70%);
  border: 1.5px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.1s;
}
/* Spinning animation — added by JS when playing */
.reel.spinning {
  animation: spin 2s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes reelSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.reel-inner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #555 0%, #222 100%);
  border: 1.5px solid rgba(255,255,255,0.15);
  position: relative;
  z-index: 2;
}

/* Spokes inside reel */
.reel-spoke {
  position: absolute;
  width: 2px;
  height: 20px;
  background: rgba(255,255,255,0.12);
  border-radius: 1px;
  left: calc(50% - 1px);
  top: calc(50% - 10px);
  transform-origin: center center;
}
.reel-spoke:nth-child(2) { transform: rotate(60deg); }
.reel-spoke:nth-child(3) { transform: rotate(120deg); }
.reel-spoke:nth-child(4) { transform: rotate(180deg); }

/* Tape bridge between reels */
.tape-bridge {
  flex: 1;
  height: 4px;
  background: linear-gradient(90deg, rgba(80,50,20,0.6) 0%, rgba(140,90,40,0.8) 50%, rgba(80,50,20,0.6) 100%);
  position: relative;
  top: 6px;
}

/* The label sticker in the center */
.cassette-label {
  background: linear-gradient(135deg, var(--cream) 0%, #ede0cc 100%);
  border-radius: 6px;
  padding: 12px 16px;
  text-align: center;
  border: 1px solid rgba(122,92,68,0.15);
  position: relative;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.label-side {
  font-family: var(--font-hand);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.label-song {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--deep-brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.label-artist {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: var(--rose);
}
.label-stripe {
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, var(--rose), var(--amber));
  border-radius: 1px;
  margin-top: 6px;
}

/* Screw holes at bottom */
.cassette-screws {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  margin-top: 14px;
}
.screw {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #555 0%, #2a2a2a 100%);
  border: 1px solid rgba(255,255,255,0.05);
}

/* ════════════════════════════════════════
   VINYL RECORD
════════════════════════════════════════ */

.vinyl {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 40px rgba(61,43,31,0.28));
}
.vinyl:hover .vinyl-disc { transform: scale(1.03); }

.vinyl-disc {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      #1a1006 0px,
      #1a1006 3px,
      #111006 4px,
      #1a1006 5px
    ),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 15%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1.5px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 10px rgba(255,255,255,0.03), 0 18px 40px rgba(0,0,0,0.18);
  transition: transform 0.3s ease;
}
.vinyl-disc::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 4px rgba(0,0,0,0.08);
  pointer-events: none;
}
/* Spinning when playing */
.vinyl-disc.spinning {
  animation: spin 3s linear infinite;
}

/* Center label on vinyl */
.vinyl-label-area {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cream) 0%, #dfc9b2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px solid rgba(61,43,31,0.18);
  box-shadow: 0 0 20px rgba(0,0,0,0.28);
  padding: 10px;
  z-index: 2;
  position: relative;
}
.vinyl-label-song {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--deep-brown);
  text-align: center;
  line-height: 1.2;
  max-width: 88px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.vinyl-label-artist {
  font-family: var(--font-hand);
  font-size: 0.55rem;
  color: var(--rose);
}
.vinyl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warm-brown);
}
/* Spindle hole in center */
.vinyl-spindle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 3;
}

/* ════════════════════════════════════════
   PLAYER CONTROLS
════════════════════════════════════════ */

.player-controls {
  width: 100%;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.9);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: floatUp 0.7s ease 0.35s both;
}

/* Progress bar */
.progress-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--beige);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rose), var(--amber));
  border-radius: 2px;
  transition: width 0.5s linear;
}

.time-row {
  display: flex;
  justify-content: space-between;
}
.time-stamp {
  font-family: var(--font-hand);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Playback buttons */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.ctrl-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(245,240,232,0.9);
  color: var(--warm-brown);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.ctrl-btn:hover {
  background: var(--rose-light);
  color: #fff;
  transform: scale(1.08);
}

.play-btn {
  width: 58px;
  height: 58px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--rose), var(--amber));
  color: #fff;
  box-shadow: var(--shadow-md), var(--glow-rose);
}
.play-btn:hover {
  background: linear-gradient(135deg, var(--amber), var(--rose));
  color: #fff;
  transform: scale(1.1);
}

/* Now playing text */
.now-playing {
  text-align: center;
  margin-top: 4px;
}
.np-song {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--deep-brown);
}
.np-artist {
  font-family: var(--font-hand);
  font-size: 0.9rem;
  color: var(--rose);
  margin-top: 2px;
}

/* ════════════════════════════════════════
   MESSAGE CARD
════════════════════════════════════════ */

.message-card {
  width: 100%;
  background: linear-gradient(135deg, #fffdf8 0%, #f7efe2 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(201,132,138,0.2);
  padding: 28px 32px;
  text-align: center;
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: floatUp 0.7s ease 0.5s both;
  /* Revealed by JS after play */
  opacity: 0.4;
  transition: opacity 0.8s ease, transform 0.6s ease;
}
.message-card.hidden-start {
  opacity: 0;
  transform: translateY(10px);
  animation: none;
}
.message-card.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}
.message-card.revealed {
  opacity: 1;
  animation: messageReveal 0.8s ease both;
}
@keyframes messageReveal {
  from { opacity: 0.4; transform: scale(0.98); }
  to   { opacity: 1;   transform: scale(1); }
}

.now-playing.hidden-start {
  opacity: 0;
  transform: translateY(10px);
}
.now-playing.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

.from-signature {
  margin-top: 10px;
  font-style: italic;
  font-family: var(--font-hand);
  opacity: 0.75;
  text-align: center;
  color: var(--text-muted);
}

/* Decorative top border */
.message-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--rose), var(--amber), var(--rose));
}

.message-label {
  font-family: var(--font-hand);
  font-size: 0.85rem;
  color: var(--rose-muted);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.message-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.5;
  opacity: 0.9;
  quotes: "\201C" "\201D";
}
.message-text::before { content: open-quote; color: var(--rose); margin-right: 2px; }
.message-text::after  { content: close-quote; color: var(--rose); margin-left: 2px; }

/* ════════════════════════════════════════
   ACTION ROW
════════════════════════════════════════ */

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  animation: floatUp 0.7s ease 0.65s both;
  padding-bottom: 24px;
}

/* ════════════════════════════════════════
   TOAST NOTIFICATION
════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--deep-brown);
  color: var(--cream);
  font-family: var(--font-hand);
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════
   ANIMATIONS (reused)
════════════════════════════════════════ */

@keyframes slowRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1) rotate(-2deg); opacity: 0.5; }
  50%       { transform: scale(1.04) rotate(-1deg); opacity: 0.7; }
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE
════════════════════════════════════════ */

@media (max-width: 480px) {
  .page { padding: 32px 16px 48px; }
  .page-nav { padding: 0 16px; }

  .cassette { width: 280px; }
  .cassette-window { height: 64px; padding: 10px 16px; }
  .reel { width: 44px; height: 44px; }

  .vinyl,
  .vinyl-disc { width: 240px; height: 240px; }

  .form-card { padding: 24px 20px; }
  .format-toggle { flex-direction: column; }

  .action-row { flex-direction: column; align-items: stretch; }
  .action-row .btn-secondary,
  .action-row .btn-primary { justify-content: center; }
}

/* ════════════════════════════════════════
   HIGHLIGHT ANIMATION — song title pulses
   when playing
════════════════════════════════════════ */
.np-song.highlighted {
  color: var(--rose);
  animation: songHighlight 1.5s ease-in-out infinite alternate;
}
@keyframes songHighlight {
  from { text-shadow: 0 0 0 transparent; }
  to   { text-shadow: 0 0 20px rgba(201,132,138,0.5); }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.06) 100%);
  mix-blend-mode: multiply;
}

.grain-overlay {
  opacity: 0.05;
}

.mood-section {
  margin-top: 32px;
  text-align: center;
}

.divider {
  opacity: 0.5;
  margin-bottom: 8px;
}

.mood-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mood-buttons button {
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  color: #5a4a4a;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mood-buttons button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.suggestions-box {
  margin-top: 14px;
}

.suggestion-item {
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.suggestion-item:hover {
  background: rgba(0,0,0,0.05);
}


/* ═══════════════════════════════════════════════════
   SEARCH BAR — autocomplete dropdown
═══════════════════════════════════════════════════ */
.search-wrap {
  position: relative;
}

.field-hint {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 6px;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--cream);
  border: 1px solid rgba(201, 132, 138, 0.35);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  display: none;
}

.search-results.open {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover,
.search-result-item.active {
  background: rgba(201, 132, 138, 0.18);
}

.search-result-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--beige);
}

.search-result-text {
  min-width: 0;
  flex: 1;
}

.search-result-title {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 0.82rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-empty {
  padding: 10px 12px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}


/* ═══════════════════════════════════════════════════
   LISTEN LINK — on player page
═══════════════════════════════════════════════════ */
.song-link {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 0.88rem;
  color: var(--rose);
  background: rgba(201, 132, 138, 0.12);
  border: 1px solid rgba(201, 132, 138, 0.35);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.song-link:hover {
  background: rgba(201, 132, 138, 0.22);
  transform: translateY(-1px);
}

.song-link.hidden {
  display: none;
}
