/* ─── NoHit Music Global Styles ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1e1e2a;
  --text-primary: #f0f0f5;
  --text-secondary: #9494a8;
  --text-muted: #5a5a70;
  --accent: #1DB954;
  --accent-hover: #1ed760;
  --accent-dim: rgba(29, 185, 84, 0.15);
  --accent-glow: rgba(29, 185, 84, 0.3);
  --border: #2a2a3a;
  --border-light: #3a3a4a;
  --danger: #e74c3c;
  --gold: #f7c948;
  --silver: #b0b0c0;
  --bronze: #cd7f32;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(29, 185, 84, 0.2);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Background texture ─────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(29, 185, 84, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(29, 185, 84, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout ──────────────────────────────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container--wide { max-width: 900px; }

@media (max-width: 500px) {
  .container { padding: 0 20px; }
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header / Nav ────────────────────────────────────────────── */
.site-header {
  padding: 28px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.site-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.site-logo img,
.site-logo svg {
  height: 220px;
  width: auto;
  display: block;
  max-width: 100%;
  object-fit: contain;
  padding: 16px 24px;
}

@media (max-width: 600px) {
  .site-logo img,
  .site-logo svg {
    height: 130px;
    padding: 10px 16px;
  }
}

/* ─── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-secondary); }
.text-small { font-size: 0.85rem; }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-full { width: 100%; }

/* ─── Forms ───────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-label .required { color: var(--accent); }

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder { color: var(--text-muted); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

/* ─── Matchup Card ────────────────────────────────────────────── */
.matchup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.matchup-header {
  text-align: center;
  margin-bottom: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.matchup-songs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
}

.matchup-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0 2px;
}

/* ─── Song Choice (narrow card) ───────────────────────────────── */
.song-choice {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.song-choice.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 20px var(--accent-glow);
}

.song-choice.selected .choose-btn {
  background: var(--accent);
  color: #000;
  pointer-events: none;
}
.song-choice.selected .choose-btn::before {
  content: '✓ ';
  font-weight: 800;
}

.song-choice.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.song-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.song-seed {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(29, 185, 84, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.song-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.song-embed {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.song-embed iframe {
  width: 100%;
  min-height: 80px;
  border: none;
  border-radius: var(--radius-sm);
  display: block;
}

@media (max-width: 500px) {
  .song-embed iframe {
    min-height: 80px;
    height: 80px;
  }
}

.choose-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.choose-btn:hover {
  background: var(--accent);
  color: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.choose-btn:active { transform: translateY(0); }

/* Mobile: stack matchups vertically */
@media (max-width: 700px) {
  .matchup-songs {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .matchup-vs {
    padding: 4px 0;
    font-size: 0.85rem;
  }
  .matchup-card {
    padding: 16px 14px;
    margin-bottom: 16px;
  }
  .song-choice {
    padding: 12px;
  }
}

/* ─── Champion Seed ───────────────────────────────────────────── */
.champion-seed {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(247, 201, 72, 0.12);
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Round Progress ──────────────────────────────────────────── */
.round-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 24px 0;
  padding: 0 16px;
}

.round-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.round-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.round-dot.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.round-dot.complete {
  border-color: var(--accent);
  background: var(--accent);
  color: #000;
}

.round-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  transition: background 0.3s ease;
}
.round-line.complete { background: var(--accent); }

.round-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.round-label.active { color: var(--accent); }

@media (max-width: 400px) {
  .round-line { width: 24px; }
  .round-dot { width: 26px; height: 26px; font-size: 0.55rem; }
  .round-label { font-size: 0.5rem; }
}

/* ─── Transition Screen ───────────────────────────────────────── */
.transition-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.transition-content {
  text-align: center;
  animation: pulseIn 0.5s ease;
}

.transition-emoji { font-size: 3rem; margin-bottom: 16px; }

.transition-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.transition-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ─── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

.spinner-sm { width: 20px; height: 20px; border-width: 2px; margin: 0; }

/* ─── Hero Section ────────────────────────────────────────────── */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}

.hero h1 { margin-bottom: 16px; }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-steps {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 160px;
}

.hero-step-icon { font-size: 2rem; }

.hero-step-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── Bracket Header ──────────────────────────────────────────── */
.bracket-header {
  text-align: center;
  padding: 32px 0 16px;
}

.bracket-band-name {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bracket-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.bracket-round-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin: 8px 0 24px;
  color: var(--text-primary);
}

/* ─── Completion Page ─────────────────────────────────────────── */
.champion-section {
  text-align: center;
  padding: 40px 0;
}

.champion-trophy { font-size: 4rem; margin-bottom: 8px; }

.champion-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 8px;
}

.champion-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 4px;
}

.champion-band {
  color: var(--text-secondary);
  font-size: 1rem;
}

.stats-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 24px 0;
  flex-wrap: wrap;
}

.stat-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin: 24px 0;
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 1rem;
}

.playlist-section {
  text-align: center;
  margin: 32px 0;
}

.playlist-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 16px 0;
}

.playlist-embed iframe {
  width: 100%;
  border: none;
  border-radius: var(--radius-lg);
}

.spotify-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s;
}
.spotify-link:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ─── Footer ──────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ─── Animations ──────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeInUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.animate-in {
  animation: fadeInUp 0.5s ease both;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
.animate-in-delay-4 { animation-delay: 0.4s; }

/* ─── Equalizer Animation (Loading) ───────────────────────────── */
.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
  justify-content: center;
  margin: 24px 0;
}

.eq-bar {
  width: 6px;
  background: var(--accent);
  border-radius: 3px;
  animation: eqBounce 1.2s ease-in-out infinite;
}
.eq-bar:nth-child(1) { animation-delay: 0s; height: 20px; }
.eq-bar:nth-child(2) { animation-delay: 0.15s; height: 32px; }
.eq-bar:nth-child(3) { animation-delay: 0.3s; height: 16px; }
.eq-bar:nth-child(4) { animation-delay: 0.45s; height: 28px; }
.eq-bar:nth-child(5) { animation-delay: 0.6s; height: 24px; }

@keyframes eqBounce {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* ─── Error / Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-card);
  z-index: 200;
  transition: transform 0.3s ease;
  max-width: 90vw;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--accent); color: var(--accent); }

/* ─── Utility ─────────────────────────────────────────────────── */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.hidden { display: none !important; }
