/* ============================================================
   Hits — styles.css
   WarGames green phosphor CRT theme
   ============================================================ */

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

:root {
  --bg:             #000800;
  --bg-surface:     #000f00;
  --bg-elevated:    #001500;
  --bg-hover:       #001c00;
  --border:         #004000;
  --accent:         #00ff41;
  --accent-dim:     #00cc33;
  --accent-bright:  #80ff80;
  --accent-glow:    rgba(0, 255, 65, 0.12);
  --text-primary:   #00ff41;
  --text-secondary: #00cc33;
  --text-muted:     #006600;
  --glow-text:      0 0 8px rgba(0, 255, 65, 0.7);
  --glow-box:       0 0 16px rgba(0, 255, 65, 0.2);
  --radius-sm:      4px;
  --radius-md:      6px;
  --radius-lg:      8px;
  --shadow-card:    0 2px 12px rgba(0,0,0,0.8);
  --font-mono:      'Share Tech Mono', 'Courier New', monospace;
  --transition:     120ms ease;
  --header-h:       65px;
  --player-bar-h:   68px;
}

html { scroll-behavior: smooth; }

/* CRT scanlines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 20, 0, 0.18) 2px,
    rgba(0, 20, 0, 0.18) 4px
  );
}

/* CRT vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9001;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 8, 0, 0.55) 100%
  );
}

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  padding-bottom: calc(var(--player-bar-h) + 16px);
}

/* ── Header ───────────────────────────────────────────────── */

.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.4rem;
  color: var(--accent);
  text-shadow: var(--glow-text);
}
.logo-text {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--accent);
  text-shadow: var(--glow-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  min-width: 0;
  letter-spacing: 0.04em;
}

.breadcrumb-item {
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  transition: color var(--transition), text-shadow var(--transition);
}

.breadcrumb-item:hover { color: var(--accent); text-shadow: var(--glow-text); }
.breadcrumb-item.current { color: var(--text-secondary); cursor: default; }
.breadcrumb-sep { color: var(--text-muted); flex-shrink: 0; }

/* ── Main ─────────────────────────────────────────────────── */

.main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.section-label {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Alphabet navigation ──────────────────────────────────── */

.alpha-section {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.alpha-nav {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.alpha-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  cursor: pointer;
  min-width: 38px;
  text-align: center;
  letter-spacing: 0.05em;
  transition: color var(--transition), background var(--transition),
              border-color var(--transition), text-shadow var(--transition),
              box-shadow var(--transition);
}

.alpha-btn:hover {
  color: var(--accent);
  background: var(--bg-hover);
  border-color: var(--accent-dim);
  text-shadow: var(--glow-text);
}

.alpha-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--accent);
  text-shadow: var(--glow-text);
  box-shadow: var(--glow-box);
}

.alpha-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

.alpha-btn:disabled:hover {
  color: var(--text-muted);
  background: var(--bg-surface);
  border-color: var(--border);
  text-shadow: none;
  box-shadow: none;
}

/* ── Grid sections ────────────────────────────────────────── */

.grid-section {
  margin-bottom: 48px;
  animation: fadeIn 220ms ease;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

/* ── Cards ────────────────────────────────────────────────── */

.music-card {
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
}

.music-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.7), var(--glow-box);
  border-color: var(--accent-dim);
}

.music-card.active {
  border-color: var(--accent);
  box-shadow: var(--glow-box);
}

.card-art-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  background: var(--bg-elevated);
  overflow: hidden;
}

.card-art {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.7;
  filter: hue-rotate(80deg) sepia(0.5) saturate(1.8) brightness(0.6);
  transition: opacity 0.3s ease, transform var(--transition);
}

.card-art.loaded { opacity: 0.85; }
.music-card:hover .card-art { transform: scale(1.04); opacity: 1; }

.card-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 8, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.music-card:hover .card-overlay { opacity: 1; }

.card-play-icon {
  font-size: 2rem;
  color: var(--accent);
  text-shadow: var(--glow-text);
}

.card-info {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}

.card-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  letter-spacing: 0.02em;
  transition: color var(--transition), text-shadow var(--transition);
}

.music-card:hover .card-title {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0,255,65,0.5);
}

.card-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

/* ── Track list ───────────────────────────────────────────── */

.track-section {
  margin-bottom: 48px;
  animation: fadeIn 220ms ease;
}

.track-list {
  list-style: none;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.track-row:last-child { border-bottom: none; }
.track-row:hover { background: var(--bg-hover); }

.track-row.active {
  background: var(--accent-glow);
}

.track-row.active .track-name {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0,255,65,0.5);
}

.track-num {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}

.track-name {
  flex: 1;
  font-size: 0.87rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
  transition: color var(--transition), text-shadow var(--transition);
}

.track-row:hover .track-name { color: var(--accent); }

.track-play-btn {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  padding: 4px;
  transition: opacity var(--transition), color var(--transition);
  flex-shrink: 0;
}

.track-row:hover .track-play-btn,
.track-row.active .track-play-btn {
  opacity: 1;
  color: var(--accent);
}

/* ── Sticky player bar ────────────────────────────────────── */

.sticky-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  height: var(--player-bar-h);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,255,65,0.06);
  flex-wrap: wrap;
}

.sticky-art-wrap { flex-shrink: 0; }
.sticky-art {
  width: 46px; height: 46px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
  background: var(--bg-elevated);
  filter: hue-rotate(80deg) sepia(0.5) saturate(1.8) brightness(0.6);
  border: 1px solid var(--border);
}

.sticky-info { min-width: 0; flex: 0 0 200px; }
.sticky-title {
  font-size: 0.82rem;
  color: var(--text-primary);
  text-shadow: 0 0 6px rgba(0,255,65,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}
.sticky-artist {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.sticky-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ctrl-btn {
  font-size: 1rem;
  color: var(--text-secondary);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition),
              border-color var(--transition), text-shadow var(--transition);
  line-height: 1;
  font-family: inherit;
}

.ctrl-btn:hover {
  color: var(--accent);
  background: var(--bg-hover);
  border-color: var(--border);
  text-shadow: var(--glow-text);
}

.ctrl-btn--play {
  font-size: 1rem;
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 0 12px rgba(0,255,65,0.35);
}

.ctrl-btn--play:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0,255,65,0.5);
}

.sticky-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.time-cur, .time-dur {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.progress-bar, .volume-bar {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.progress-bar { flex: 1; }
.volume-bar   { width: 72px; }

.progress-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,255,65,0.6);
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.vol-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Loading state ────────────────────────────────────────── */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 64px 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-shadow: 0 0 8px rgba(0,255,65,0.2);
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  padding: 64px 0;
  text-align: center;
}

.hero-headline {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 400;
  color: var(--accent);
  text-shadow: var(--glow-text);
  margin-bottom: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
  letter-spacing: 0.04em;
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 16px 24px;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Animations ───────────────────────────────────────────── */

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

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

/* ── Mobile ───────────────────────────────────────────────── */

@media (max-width: 640px) {
  :root {
    --header-h: 55px;
    --player-bar-h: 60px;
  }

  .header-inner { padding: 10px 16px; gap: 10px; }
  .logo-text { font-size: 1.1rem; }

  .main { padding: 0 16px 48px; }

  .alpha-section { padding: 20px 0 16px; margin-bottom: 20px; }
  .alpha-nav { gap: 4px; }
  .alpha-btn { padding: 6px 9px; font-size: 0.78rem; min-width: 34px; }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .sticky-bar {
    padding: 8px 12px;
    gap: 10px;
    flex-wrap: nowrap;
    height: var(--player-bar-h);
  }

  .sticky-info { flex: 1; }
  .sticky-progress { display: none; }
  .volume-wrap { display: none; }

  .track-row { padding: 10px 14px; }
}
