@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

:root {
  --bg: #f5f1e6;
  --bg-alt: #ece4d2;
  --surface: #ffffff;
  --surface-2: #f4eee1;
  --border: #ddceac;
  --gold: #93711f;
  --gold-soft: #7a5c17;
  --gold-line: #c7a24e;
  --silver: #5a5f68;
  --text: #221e18;
  --text-muted: #6c6255;
  --shadow-accent: rgba(147, 113, 31, 0.22);
  --card-shadow: 0 1px 2px rgba(40, 30, 10, 0.08), 0 8px 24px rgba(40, 30, 10, 0.06);
  --danger: #a83b3b;
  --ok: #3f7a4f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0a09; --bg-alt: #121110; --surface: #18150f; --surface-2: #1f1b14;
    --border: #3a3120; --gold: #cda45e; --gold-soft: #e8caa0; --gold-line: #c7a24e;
    --silver: #b7bcc4; --text: #ede8db; --text-muted: #a29a8a;
    --shadow-accent: rgba(201, 162, 77, 0.28);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    --danger: #e08b8b; --ok: #8fcf9f;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0a09; --bg-alt: #121110; --surface: #18150f; --surface-2: #1f1b14;
  --border: #3a3120; --gold: #cda45e; --gold-soft: #e8caa0; --gold-line: #c7a24e;
  --silver: #b7bcc4; --text: #ede8db; --text-muted: #a29a8a;
  --shadow-accent: rgba(201, 162, 77, 0.28);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  --danger: #e08b8b; --ok: #8fcf9f;
}
:root[data-theme="light"] {
  --bg: #f5f1e6; --bg-alt: #ece4d2; --surface: #ffffff; --surface-2: #f4eee1;
  --border: #ddceac; --gold: #93711f; --gold-soft: #7a5c17; --gold-line: #c7a24e;
  --silver: #5a5f68; --text: #221e18; --text-muted: #6c6255;
  --shadow-accent: rgba(147, 113, 31, 0.22);
  --card-shadow: 0 1px 2px rgba(40, 30, 10, 0.08), 0 8px 24px rgba(40, 30, 10, 0.06);
  --danger: #a83b3b; --ok: #3f7a4f;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px 80px; }

h1, h2, h3 { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif; text-wrap: balance; margin: 0; }

.label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.topbar {
  padding: 40px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.logo { max-width: 160px; height: auto; margin-bottom: 4px; }
.logo-hero { max-width: 240px; }
.brand-title {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  letter-spacing: 0.03em;
  color: var(--text);
}
.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}
.brand-rule {
  width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  margin-top: 6px;
}

.intro { text-align: center; color: var(--text-muted); font-size: 0.95rem; max-width: 480px; margin: 0 auto 32px; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.cta-banner {
  background: var(--surface-2);
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 0 0 32px;
  text-align: center;
}
.cta-banner p { margin: 0; color: var(--text); font-size: 0.95rem; }
.cta-banner p.cta-note { margin: 10px 0 0; color: var(--text-muted); font-size: 0.8rem; }
.jump-pills { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
.jump-pill {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 1px solid var(--gold-line);
  color: var(--gold);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  text-decoration: none;
}
.jump-pill:hover { background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }

@keyframes invite-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 65%, transparent);
  }
  50% {
    transform: scale(1.22);
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--gold) 0%, transparent);
  }
}
.play-btn.needs-attention {
  animation: invite-pulse 1.1s ease-in-out infinite;
  background: var(--gold);
  color: var(--surface);
}

@keyframes card-highlight {
  0%, 100% { box-shadow: var(--card-shadow); }
  50% { box-shadow: 0 0 0 3px var(--gold-line), var(--card-shadow); }
}
.track-card.highlight { animation: card-highlight 1.4s ease-in-out 1; }
.empty { text-align: center; color: var(--text-muted); padding: 40px 0; }
.outro {
  text-align: center;
  color: var(--gold);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  font-style: italic;
  font-size: 0.95rem;
  max-width: 420px;
  margin: 44px auto 0;
  padding-top: 28px;
  position: relative;
}
.outro::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}

.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 22px;
}
.track-card.has-video {
  border-color: var(--gold-line);
  box-shadow: 0 0 0 1px var(--gold-line), 0 0 20px color-mix(in srgb, var(--gold) 20%, transparent), var(--card-shadow);
}
.track-head { display: flex; gap: 16px; }
.track-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.video-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold);
  color: var(--surface);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.video-badge svg { width: 10px; height: 10px; }
.cover {
  width: 88px; height: 88px;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-clickable { cursor: pointer; transition: opacity 0.15s ease; }
.cover-clickable:hover { opacity: 0.85; }
.cover-clickable:focus-visible { outline: 2px solid var(--gold-line); outline-offset: 2px; }
.cover-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.new-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--surface);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--gold) 40%, transparent);
}
.track-meta { flex: 1; min-width: 0; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox-close svg { width: 18px; height: 18px; }
.track-title { font-size: 1.25rem; }
.track-artist { color: var(--gold); font-size: 0.85rem; letter-spacing: 0.03em; margin-top: 2px; }
.track-intro { color: var(--text-muted); font-size: 0.9rem; margin: 10px 0 0; }
.track-date { text-align: right; font-size: 0.72rem; color: var(--text-muted); margin-top: 14px; }

.player { margin-top: 14px; display: flex; align-items: center; gap: 12px; }
.video-player { margin-top: 14px; }
.video-player video { width: 100%; max-height: 360px; border-radius: 10px; background: #000; display: block; }
.play-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: transparent;
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.play-btn:hover { background: var(--gold); color: var(--surface); }
.play-btn svg { width: 14px; height: 14px; }
.scrub { flex: 1; display: flex; align-items: center; gap: 10px; }
.scrub input[type="range"] {
  flex: 1; appearance: none; height: 3px; border-radius: 3px;
  background: var(--border);
  outline: none;
}
.scrub input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); cursor: pointer; border: none;
}
.time {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem; color: var(--text-muted); width: 90px; text-align: right;
}

.actions { display: flex; align-items: center; gap: 18px; margin-top: 14px; flex-wrap: wrap; }
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  cursor: pointer;
}
.like-btn svg { width: 14px; height: 14px; }
.download-btn { text-decoration: none; border-color: var(--gold-line); color: var(--gold); }
.download-btn:hover { background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.like-btn.liked { border-color: var(--gold-line); color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.text-toggle, .comment-toggle {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.82rem; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; padding: 0;
}
.lyrics {
  display: none;
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-left: 2px solid var(--gold-line);
  border-radius: 0 8px 8px 0;
  font-family: Georgia, serif;
  font-style: italic;
  white-space: pre-line;
  color: var(--text);
  font-size: 0.95rem;
}
.lyrics.open { display: block; }

.comments { display: none; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.comments.open { display: block; }
.comment-item { padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 0.88rem; }
.comment-item:last-of-type { border-bottom: none; }
.comment-item .who { color: var(--gold); font-weight: 600; margin-right: 6px; }
.comment-item .when { color: var(--text-muted); font-size: 0.75rem; }

.reply-preview {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-left: 2px solid var(--gold-line);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
}
.reply-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: flex-start; }
.reply-form textarea {
  flex: 1 1 200px;
  min-height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  resize: vertical;
}
.reply-form .btn-primary { padding: 8px 16px; font-size: 0.85rem; flex-shrink: 0; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.comment-form input[type="text"], .comment-form textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font: inherit; font-size: 0.85rem;
}
.comment-form input[type="text"] { flex: 1 1 140px; }
.comment-form textarea { flex: 2 1 220px; resize: vertical; min-height: 38px; }
.comment-form button {
  background: var(--gold); color: #fff; border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.admin-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 720px) { .admin-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--card-shadow); padding: 22px;
}
.panel h2 { font-size: 1.15rem; margin-bottom: 4px; }
.panel .sub { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 18px; }

.dropzone {
  border: 1.5px dashed var(--gold-line);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--surface-2);
  transition: background 0.15s ease;
}
.dropzone.dragover { background: color-mix(in srgb, var(--gold) 14%, var(--surface-2)); }
.dropzone strong { color: var(--gold); display: block; margin-bottom: 4px; font-size: 0.95rem; }

.field { margin-top: 16px; }
.field label { display: block; margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; color: var(--text); font: inherit; font-size: 0.9rem;
}
.field textarea { min-height: 90px; resize: vertical; font-family: Georgia, serif; font-style: italic; }

.cover-edit-row { display: flex; gap: 14px; align-items: center; margin-top: 16px; }

.toggles { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-row .t-label { font-size: 0.88rem; }
.toggle-row .t-desc { font-size: 0.75rem; color: var(--text-muted); }
.tswitch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.tswitch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.tswitch .track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background 0.15s ease; }
.tswitch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: transform 0.15s ease; }
.tswitch input:checked ~ .track { background: var(--gold); }
.tswitch input:checked ~ .knob { transform: translateX(18px); }

.save-row { display: flex; gap: 10px; margin-top: 20px; align-items: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--gold); color: #fff; border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.btn-ghost {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 18px; font-size: 0.88rem; cursor: pointer;
}

.track-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.track-row:last-child { border-bottom: none; }
.track-row .cover { width: 44px; height: 44px; }
.track-row .info { flex: 1; min-width: 0; }
.track-row .info .t { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-row .info .a { font-size: 0.75rem; color: var(--text-muted); }
.badges { display: flex; gap: 5px; flex-shrink: 0; }
.badge {
  font: inherit;
  font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 5px; color: var(--text-muted);
  background: none; cursor: pointer; line-height: 1.4;
}
.badge:hover:not(:disabled) { border-color: var(--gold-line); color: var(--gold); }
.badge:disabled { opacity: 0.5; cursor: default; }
.badge.on { color: var(--gold); border-color: var(--gold-line); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.reorder-form { display: flex; gap: 2px; flex-shrink: 0; }
.row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 6px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold-line); }
.icon-btn svg { width: 13px; height: 13px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--gold-line); color: var(--text);
  padding: 10px 20px; border-radius: 999px; font-size: 0.85rem; box-shadow: var(--card-shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer { text-align: center; color: var(--text-muted); font-size: 0.75rem; margin-top: 50px; }
footer a { color: var(--text-muted); }

.stats-table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.stats-table th, .stats-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table thead th { color: var(--gold); font-weight: 600; font-size: 0.78rem; }
.stats-song-title { font-weight: 600; }
.stats-song-artist { color: var(--text-muted); font-size: 0.78rem; }
