/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #242432;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --green: #22c55e;
  --red: #ef4444;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #2e2e42;
  --radius: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-light);
  text-decoration: none;
}

main {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Setup Page ---- */
.setup-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.setup-card h1 { margin-bottom: 1.5rem; font-size: 1.8rem; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.2rem;
}

legend { padding: 0 0.5rem; color: var(--muted); font-size: 0.85rem; }

.genre-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.genre-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

.genre-label:has(input:checked) {
  border-color: var(--accent-light);
  background: rgba(124,58,237,0.15);
}

.field-row { display: flex; gap: 1rem; margin-bottom: 1.2rem; }
.field-row label, label { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1.2rem; font-size: 0.9rem; color: var(--muted); }
.field-row label { flex: 1; }

.game-mode-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.game-mode-label {
  font-size: 0.9rem;
  color: var(--muted);
  flex-shrink: 0;
}

.game-mode-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.game-mode-option {
  cursor: pointer;
}

.game-mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.game-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
}

.game-mode-option input:checked + .game-mode-card {
  border-color: var(--accent);
  background: rgba(124,58,237,0.15);
}

.game-mode-card:hover {
  border-color: var(--accent-light);
}

.game-mode-icon {
  font-size: 1.2rem;
}

.game-mode-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.game-mode-desc {
  font-size: 0.75rem;
  color: var(--muted);
}

input[type="number"], input[type="text"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s;
}

input[type="number"]:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-light);
}

.btn-primary {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-primary:hover { background: #6d28d9; }

.btn-secondary {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-secondary:hover { border-color: var(--accent-light); }

.error-banner {
  background: rgba(239,68,68,0.15);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  color: #fca5a5;
}

.success-banner {
  background: rgba(34,197,94,0.15);
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  color: #86efac;
}

/* ---- Score Bar ---- */
.score-bar {
  display: flex;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* ---- Result Toast ---- */
.result-toast {
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-weight: 600;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.result-toast.hidden { display: none; }

.result-toast.correct {
  background: rgba(34,197,94,0.15);
  border: 1px solid var(--green);
  color: #86efac;
}

.result-toast.correct, .result-toast.wrong {
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.result-toast.wrong {
  background: rgba(239,68,68,0.15);
  border: 1px solid var(--red);
  color: #fca5a5;
}

.wrong-reveal, .correct-reveal {
  font-size: 0.95rem;
  padding: 0.5rem;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  width: 100%;
}

.correct-reveal {
  font-weight: 600;
}

.wrong-reveal, .correct-reveal {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast-cover {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.toast-reveal-info {
  flex: 1;
}

.points-detail { font-weight: 400; font-size: 0.9rem; color: var(--muted); }

.toast-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toast-guess {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.8;
}

/* ---- Game Over Screen ---- */
.game-over-area {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 2rem;
}

.game-over-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.game-over-card h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.final-score-preview {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius);
}

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

.score-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--green);
}

.score-max {
  font-size: 0.85rem;
  color: var(--muted);
}

.game-over-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-large {
  padding: 0.875rem 1.5rem;
  font-size: 1.1rem;
}

@keyframes fadeout {
  from { opacity: 1; }
  to { opacity: 0; pointer-events: none; }
}

/* ---- Current Card ---- */
.current-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.card-art img, .art-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.card-info { flex: 1; }
.card-mystery { font-size: 1.3rem; font-weight: 700; color: var(--muted); }
.card-hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

.timer-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-light);
}

#timer-bar {
  height: 8px;
  width: 100%;
  max-width: 120px;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.1s linear;
}

audio { display: none; }

/* ---- YouTube Player (audio only — iframe hidden) ---- */
.audio-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.youtube-container {
  width: 0;
  height: 0;
  overflow: hidden;
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.youtube-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.youtube-iframe.hidden {
  display: none;
}

.youtube-placeholder {
  position: relative;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.btn-load-audio {
  font-size: 0.9rem;
}

.lazy-loading-text {
  font-size: 0.85rem;
  color: var(--muted);
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.player-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-play.playing {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-seek {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  font-variant-numeric: tabular-nums;
}

/* ---- Now Playing indicator ---- */
.now-playing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent-light);
  margin-top: 0.5rem;
}

.now-playing.hidden { display: none; }

.now-playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.now-playing-bars span {
  display: block;
  width: 3px;
  background: var(--accent-light);
  border-radius: 1px;
  animation: eq-bar 0.8s ease-in-out infinite;
}

.now-playing-bars span:nth-child(1) { height: 6px; animation-delay: 0s; }
.now-playing-bars span:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.now-playing-bars span:nth-child(3) { height: 8px; animation-delay: 0.3s; }
.now-playing-bars span:nth-child(4) { height: 14px; animation-delay: 0.45s; }

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

/* ---- Guess Form ---- */
.guess-form {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.guess-form label {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.bonus-hint {
  color: var(--accent-light);
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

/* ---- Timeline ---- */
.timeline-wrap h3 {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.timeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.slot-form {
  display: contents;
}

.slot {
  flex-shrink: 0;
  width: 36px;
  height: 80px;
  background: var(--surface2);
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot:hover {
  border-color: var(--accent-light);
  background: rgba(124,58,237,0.15);
  color: var(--accent-light);
}

.timeline-card {
  flex-shrink: 0;
  width: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
}

.timeline-art {
  width: 100%;
  height: 70px;
  object-fit: cover;
}

.timeline-art-placeholder {
  width: 100%;
  height: 70px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.timeline-card-info {
  padding: 0.4rem 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-year { font-size: 0.95rem; color: var(--accent-light); }
.card-title { font-size: 0.7rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-artist { font-size: 0.65rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Intro Overlay ---- */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 340px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.intro-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.intro-cover {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  object-fit: cover;
}

.intro-cover-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.intro-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.intro-year {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-light);
  line-height: 1;
}

.intro-title {
  font-size: 1.1rem;
  color: var(--text);
}

.intro-artist {
  font-size: 0.9rem;
  color: var(--muted);
}

.intro-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Results Page ---- */
.results-page { max-width: 900px; margin: 0 auto; }

.score-hero {
  text-align: center;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.score-hero h1 { margin-bottom: 0.5rem; }

.final-score {
  font-size: 4rem;
  font-weight: 900;
  color: var(--accent-light);
  line-height: 1;
  margin: 0.5rem 0;
}

.final-score-label { color: var(--muted); font-size: 1rem; }
.score-pct { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

.results-page h2 { margin: 1.5rem 0 0.75rem; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.results-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.results-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.row-correct td:nth-child(4) { color: var(--green); }
.row-wrong td:nth-child(4) { color: var(--red); }

.results-timeline {
  flex-wrap: wrap;
  height: auto;
  margin-bottom: 2rem;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color 0.15s;
}

.tab-btn.active {
  color: var(--accent-light);
  border-bottom: 2px solid var(--accent-light);
}

.tab-panel.hidden { display: none; }

/* ---- Playlist cards (home page) ---- */
.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.playlist-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

.playlist-cover {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.playlist-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9rem;
}

.playlist-play-form { margin: 0; }

/* ---- Import form ---- */
.import-form { margin-top: 1rem; }
.import-form label { margin-bottom: 0.5rem; }

/* ---- Playlist library grid ---- */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.playlist-card-full {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.playlist-cover-lg {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.playlist-card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.playlist-title { font-size: 0.95rem; }

.playlist-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.rounds-input {
  width: 60px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.btn-danger {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger:hover { background: rgba(239,68,68,0.3); }

/* ---- Compile progress ---- */
.compile-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.progress-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--surface2);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 5px;
  transition: width 0.3s ease;
}

.progress-bar-animated {
  width: 30% !important;
  animation: pulse-bar 1.5s ease-in-out infinite;
}

@keyframes pulse-bar {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.compile-log {
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-family: monospace;
  font-size: 0.8rem;
}

.compile-log-entry {
  padding: 2px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

/* ---- Player Name ---- */
.player-name-row {
  margin-bottom: 1.2rem;
}

.player-name-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0;
}

/* ---- Highscores (home page) ---- */
.highscores-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.highscores-section h3 {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.highscore-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.highscore-mini td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.hs-rank { color: var(--accent-light); font-weight: 600; width: 2rem; }
.hs-name { color: var(--text); }
.hs-score { color: var(--muted); text-align: right; }
.hs-pct { color: var(--green); text-align: right; font-weight: 600; width: 3rem; }

/* ---- Thumbs buttons ---- */
.toast-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.thumbs-buttons {
  display: inline-flex;
  gap: 0.25rem;
}

.btn-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}

.btn-thumb:hover { border-color: var(--accent-light); color: var(--text); }
.btn-thumb.thumb-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-thumb-sm { width: 24px; height: 24px; font-size: 0.85rem; }

/* ---- Score rank (results page) ---- */
.score-rank {
  color: var(--accent-light);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.row-highlight td {
  background: rgba(124,58,237,0.1);
}

.muted { color: var(--muted); font-size: 0.85rem; }

/* ---- Playlist status badges ---- */
.badge-compiling {
  font-size: 0.8rem;
  color: #fbbf24;
  animation: pulse-text 1.5s ease-in-out infinite;
}

.badge-error {
  font-size: 0.8rem;
  color: var(--red);
  cursor: help;
}

.compile-current-track {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  display: block;
}

/* ---- Filter checkboxes ---- */
.filter-row {
  margin-bottom: 1.2rem;
}

.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  color: white;
}

.loading-overlay.hidden {
  display: none;
}

.loading-message {
  margin-top: 1rem;
  font-size: 1.1rem;
  text-align: center;
  max-width: 300px;
}

.loading-progress {
  width: 100%;
  max-width: 300px;
  margin-top: 1rem;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: #1db954;
  transition: width 0.3s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #1db954;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* ---- Comment Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-content h3 {
  font-size: 1.1rem;
  margin: 0;
}

.modal-content textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}

.modal-content textarea:focus {
  outline: none;
  border-color: var(--accent-light);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-comment {
  font-size: 0.85rem;
}

/* ---- App Footer ---- */
.app-footer {
  margin-top: auto;
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  opacity: 0.6;
}

.app-footer-env {
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  background: var(--surface2);
}

.app-footer-env--local { color: var(--green); }
.app-footer-env--docker { color: #38bdf8; }
.app-footer-env--prod { color: var(--accent-light); }

