/* Melissa's Mixtape - MTV 1985-1995 broadcast look.
   Husky purple base, gold + neon pink/cyan, hard sticker shadows,
   CRT scanlines, glitch verdicts, lower-third video credits. */

:root {
  --bg: #150a2d;
  --surface: #261347;
  --surface-2: #36205f;
  --border: #4b2e83;
  --text: #ffffff;
  --text-dim: #c4b6e8;
  --purple: #4b2e83;
  --purple-bright: #8a6fc8;
  --gold: #ffc700;
  --pink: #ff2d95;
  --cyan: #19e3ff;
  --red: #ef476f;
  --spotify: #1db954;
  --radius: 12px;
  --display: 'Bungee', 'Arial Black', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 45, 149, 0.18) 0%, transparent 55%),
    radial-gradient(700px 500px at -10% 30%, rgba(25, 227, 255, 0.10) 0%, transparent 55%),
    radial-gradient(1200px 600px at 50% 110%, #3a2566 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---- CRT scanlines + flicker ------------------------------------- */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.14) 2px 4px
  );
  animation: flicker 6s infinite;
  mix-blend-mode: multiply;
}
@keyframes flicker {
  0%, 100% { opacity: 0.55; }
  92% { opacity: 0.55; }
  93% { opacity: 0.85; }
  94% { opacity: 0.45; }
  95% { opacity: 0.7; }
  96% { opacity: 0.55; }
}

/* ---- Memphis shapes floating behind everything --------------------- */
.shapes { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.shapes span { position: absolute; opacity: 0.5; animation: drift 14s ease-in-out infinite; }
.shape-tri {
  width: 0; height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-bottom: 44px solid var(--pink);
  top: 16%; left: 6%;
  transform: rotate(-12deg);
}
.shape-ring {
  width: 54px; height: 54px;
  border: 8px solid var(--cyan);
  border-radius: 50%;
  top: 64%; right: 7%;
  animation-delay: -4s;
}
.shape-zig {
  width: 90px; height: 30px;
  top: 38%; right: 12%;
  background: linear-gradient(135deg, transparent 0 8px, var(--gold) 8px 14px, transparent 14px 22px) 0 0 / 22px 30px repeat-x;
  transform: rotate(8deg);
  animation-delay: -8s;
}
.shape-cross {
  width: 34px; height: 34px;
  bottom: 12%; left: 10%;
  background:
    linear-gradient(var(--gold), var(--gold)) 50% 0 / 8px 100% no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 50% / 100% 8px no-repeat;
  transform: rotate(18deg);
  animation-delay: -2s;
}
.shape-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--pink);
  top: 8%; right: 28%;
  animation-delay: -6s;
}
@keyframes drift {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -18px; }
}

/* ---- Top bar / wordmark -------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 3px solid var(--gold);
  position: relative;
  z-index: 1;
  background: rgba(21, 10, 45, 0.6);
}

.logo {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-m {
  height: 3.2em;
  width: auto;
  display: block;
  filter: drop-shadow(4px 4px 0 var(--pink));
  transform: rotate(-3deg);
}
.logo-stack { display: flex; flex-direction: column; line-height: 1; }
.logo-text {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-shadow: 3px 3px 0 #000;
}
.logo-text em { font-style: normal; color: var(--gold); }
.logo-sub {
  margin-top: 4px;
  align-self: flex-start;
  background: #fff;
  color: #000;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: lowercase;
  letter-spacing: 0.22em;
  padding: 1px 7px;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
}

/* ---- Cards: sticker look -------------------------------------------- */
.card {
  background: var(--surface);
  border: 3px solid var(--purple-bright);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.card h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
}

.hidden { display: none !important; }

.fine-print { color: var(--text-dim); font-size: 0.85rem; }

.how-list { padding-left: 20px; margin: 0 0 10px; }
.how-list li { margin-bottom: 6px; }

/* ---- Buttons: chunky, hard shadows ----------------------------------- */
.btn {
  border: 3px solid #000;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }

.btn-primary { background: var(--gold); color: #14092b; }
.btn-primary:hover { background: #ffd84d; }

.btn-spotify { background: var(--spotify); color: #04130a; }
.btn-spotify:hover { background: #2ee46a; }

.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: #46307a; }

.btn-small { padding: 6px 12px; font-size: 0.72rem; box-shadow: 3px 3px 0 #000; }
.btn-big { padding: 14px 22px; font-size: 1rem; font-family: var(--display); font-weight: 400; }

.user-chip { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 0.9rem; }

/* ---- Scoreboard ------------------------------------------------------- */
.stats-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.stat {
  flex: 1;
  background: var(--surface);
  border: 3px solid var(--purple-bright);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}
.stat-num {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1.15;
  text-shadow: 2px 2px 0 var(--pink);
}
.stat-streak .stat-num { color: var(--gold); text-shadow: 2px 2px 0 #000; }
.stat-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 700;
}
.stat-best { display: block; font-size: 0.7rem; color: var(--text-dim); }

.stat-num.pop { animation: pop 0.45s ease; }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45) rotate(-3deg); }
  100% { transform: scale(1); }
}

/* ---- Mode nav --------------------------------------------------------- */
.mode-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 32px;
}
.mode-title {
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-shadow: 2px 2px 0 #000;
}

/* ---- Mode cards (home): each gets its own neon ------------------------ */
.mode-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 3px solid var(--purple-bright);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  color: var(--text);
  cursor: pointer;
  position: relative;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.15s;
  animation: rise 0.35s ease both;
  font: inherit;
}
.mode-card:hover { transform: translate(-2px, -2px) rotate(-0.5deg); }
.mode-card[data-mode="browse"]:hover { border-color: var(--cyan); box-shadow: 8px 8px 0 var(--cyan); }
.mode-card[data-mode="gameshow"]:hover { border-color: var(--pink); box-shadow: 8px 8px 0 var(--pink); }
.mode-card[data-mode="tune"]:hover { border-color: var(--gold); box-shadow: 8px 8px 0 var(--gold); }
.mode-icon { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.mode-name {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 #000;
}
.mode-card[data-mode="browse"] .mode-name { color: var(--cyan); }
.mode-card[data-mode="gameshow"] .mode-name { color: var(--pink); }
.mode-card[data-mode="tune"] .mode-name { color: var(--gold); }
.mode-desc { display: block; color: var(--text-dim); font-size: 0.9rem; margin-top: 4px; }
.mode-best {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #000;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--gold);
}

/* ---- Category grid ----------------------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.cat-card {
  background: var(--surface-2);
  border: 3px solid #000;
  border-radius: 10px;
  padding: 14px 6px;
  text-align: center;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}
.cat-card:hover {
  transform: translate(-2px, -2px) rotate(-1.5deg);
  box-shadow: 6px 6px 0 var(--pink);
  background: #46307a;
}
.cat-card .cat-icon { display: block; font-size: 1.5rem; margin-bottom: 4px; }

/* ---- Round header ------------------------------------------------------ */
.round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
}
.round-progress {
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 var(--pink);
}
.round-score { color: var(--gold); font-family: var(--display); font-size: 0.85rem; text-shadow: 2px 2px 0 #000; }

/* ---- Results ------------------------------------------------------------ */
.results-card { text-align: center; padding: 28px 18px; border-color: var(--gold); }
.results-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 800;
}
.results-score {
  font-family: var(--display);
  font-size: 3.2rem;
  color: var(--gold);
  line-height: 1.1;
  margin: 8px 0;
  text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 rgba(0, 0, 0, 0.4);
}
.results-line { color: var(--text-dim); margin-bottom: 16px; }
.results-actions { display: flex; gap: 12px; justify-content: center; }

/* ---- Search -------------------------------------------------------------- */
.search-row { display: flex; gap: 10px; }
.search-row input {
  flex: 1;
  background: #1c0f38;
  border: 3px solid var(--purple-bright);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 16px;
  font-size: 0.95rem;
  outline: none;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.4);
  transition: border-color 0.15s;
}
.search-row input::placeholder { color: var(--text-dim); }
.search-row input:focus { border-color: var(--cyan); }

.results { list-style: none; margin: 12px 0 0; padding: 0; }
.results li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 2px dashed var(--border);
  border-radius: 8px;
  transition: background 0.12s;
}
.results li:hover { background: var(--surface-2); }
.results li:last-child { border-bottom: none; }
.results img { width: 48px; height: 48px; border-radius: 6px; border: 2px solid #000; flex-shrink: 0; }
.result-meta { flex: 1; min-width: 0; }
.result-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-artist { color: var(--text-dim); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Player: music video frame + lower-third credits --------------------- */
#player-panel { position: relative; border-color: var(--cyan); }

.live-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: uppercase;
}
.live-badge::before {
  content: '\25CF ';
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.now-playing { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 14px; }
.now-playing img {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55);
}

/* The MTV lower third: white bold lines with hard shadow and a side bar */
.np-credits {
  border-left: 6px solid var(--gold);
  padding-left: 10px;
}
.np-kicker {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--cyan);
  font-weight: 800;
}
.np-title {
  font-weight: 800;
  font-size: 1.15rem;
  text-shadow: 2px 2px 0 #000;
}
.np-artist { color: #fff; font-size: 0.95rem; font-weight: 700; text-shadow: 2px 2px 0 #000; }
.np-album { color: var(--text-dim); font-size: 0.82rem; font-style: italic; }

.controls { display: flex; gap: 10px; }

/* ---- Lyrics --------------------------------------------------------------- */
.lyrics-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lyrics-head h2 { margin: 0; }

.lyrics-box {
  background: #1c0f38;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-height: 90px;
  max-height: 420px;
  overflow-y: auto;
  transition: filter 0.3s;
  /* Reading size for eyes in their reading-glasses years. */
  font-size: 1.08rem;
  line-height: 1.75;
}
.lyrics-box p { white-space: pre-wrap; margin: 0; }
.lyrics-box.blurred {
  filter: blur(9px);
  user-select: none;
  pointer-events: none;
}

.score-row { display: flex; gap: 12px; margin-top: 14px; }

/* ---- Name That Tune -------------------------------------------------------- */
.nt-stage { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.nt-art {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  background: #1c0f38;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.nt-art span {
  font-family: var(--display);
  font-size: 2.4rem;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--pink);
  animation: drift 3s ease-in-out infinite;
}
.nt-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.nt-art.revealed span { display: none; }
.nt-art.revealed img { display: block; }
.nt-stage-meta { flex: 1; border-left: 6px solid var(--gold); padding-left: 10px; }
.nt-stage-meta .btn { margin-top: 8px; }

.nt-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.nt-choice {
  background: var(--surface-2);
  border: 3px solid #000;
  border-radius: 10px;
  padding: 16px 14px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}
.nt-choice:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--cyan);
}
.nt-choice:disabled { cursor: default; opacity: 0.92; }
.nt-choice .nt-choice-artist { display: block; color: var(--text-dim); font-weight: 400; font-size: 0.9rem; }
.nt-choice.correct {
  background: rgba(255, 199, 0, 0.25);
  border-color: var(--gold);
  box-shadow: 4px 4px 0 var(--gold);
}
.nt-choice.wrong {
  background: rgba(239, 71, 111, 0.25);
  border-color: var(--red);
  box-shadow: 4px 4px 0 var(--red);
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
#nt-next { margin-top: 14px; }

/* ---- Verdict banner: VHS glitch --------------------------------------------- */
.verdict {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 95;
}
.verdict span {
  font-family: var(--display);
  font-size: clamp(2rem, 8.5vw, 4.2rem);
  letter-spacing: 0.02em;
  padding: 0.25em 0.6em;
  border-radius: 12px;
  border: 4px solid #000;
  animation: verdict-pop 1.4s ease forwards, glitch 0.18s steps(2) 6;
}
.verdict.hit span {
  color: #14092b;
  background: var(--gold);
  box-shadow: 8px 8px 0 var(--pink), 0 0 70px rgba(255, 199, 0, 0.5);
}
.verdict.miss span {
  color: #fff;
  background: var(--red);
  box-shadow: 8px 8px 0 var(--cyan), 0 0 70px rgba(239, 71, 111, 0.5);
}
@keyframes verdict-pop {
  0% { opacity: 0; transform: scale(0.5) rotate(-4deg); }
  15% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  25% { transform: scale(1) rotate(-1deg); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.02); }
}
@keyframes glitch {
  0% { text-shadow: 3px 0 var(--cyan), -3px 0 var(--pink); }
  50% { text-shadow: -3px 0 var(--cyan), 3px 0 var(--pink); }
  100% { text-shadow: 2px 0 var(--cyan), -2px 0 var(--pink); }
}

/* ---- Confetti canvas ---------------------------------------------------------- */
.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 85;
}

/* ---- Known songs ---------------------------------------------------------------- */
.known-count { color: var(--text-dim); font-family: inherit; font-size: 0.8rem; }
.known-head { display: flex; align-items: center; justify-content: space-between; }
.known-head h2 { margin: 0; }
.known-search {
  width: 100%;
  margin: 12px 0 6px;
  background: #1c0f38;
  border: 3px solid var(--purple-bright);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.9rem;
  outline: none;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.4);
}
.known-search::placeholder { color: var(--text-dim); }
.known-search:focus { border-color: var(--gold); }
.known-date { color: var(--text-dim); font-size: 0.75rem; flex-shrink: 0; }
.known-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.known-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 6px;
  border-bottom: 2px dashed var(--border);
  font-size: 0.95rem;
}
.known-meta { flex: 1; min-width: 0; }
.known-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, transform 0.08s;
}
.known-remove:hover { border-color: var(--red); color: var(--red); }
.known-remove:active { transform: scale(0.9); }
.known-list li:last-child { border-bottom: none; }
.known-list .artist { color: var(--text-dim); }

/* ---- Reset ------------------------------------------------------------------------ */
.reset-row { text-align: center; margin: 8px 0 16px; }
.reset-row .btn { opacity: 0.7; }
.reset-row .btn:hover { opacity: 1; border-color: var(--red); color: var(--red); }

/* ---- Head-to-head + playlist rounds ------------------------------------------------ */
.versus-row { display: flex; gap: 8px; margin-bottom: 14px; }

.handoff { text-align: center; padding: 22px 0 14px; }
.handoff-name {
  font-family: var(--display);
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 14px;
  text-shadow: 2px 2px 0 #000;
}

.playlist-list { margin-top: 14px; display: grid; gap: 8px; }
.playlist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 2px solid var(--purple-bright);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.playlist-row:hover { border-color: var(--gold); }
.playlist-count { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }

/* ---- Mobile ----------------------------------------------------------------------- */
@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; }
  .logo-m { height: 2.6em; }
  .logo-text { font-size: 1rem; }
  .stats-bar { flex-wrap: wrap; gap: 8px; }
  .stat { min-width: 42%; }
  .stat-num { font-size: 1.2rem; }
  .controls .btn, .score-row .btn { flex: 1; }
  .now-playing img { width: 72px; height: 72px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .nt-choices { grid-template-columns: 1fr; }
  .shapes { display: none; }
}
