/* ============================================================
   Prairie Home Companion Archive — Shared Styles
   Design System: "Earthy Professional" (Stitch)
   Tokens: Material Design 3, 8px grid, warm parchment palette
   ============================================================ */

/* --- Design Tokens (Light mode fallback) --- */
:root {
  /* Light palette — Earthy Professional */
  --bg: #fef9f1;
  --bg-elevated: #f8f3e9;
  --bg-subtle: #f3ede2;
  --bg-hover: #ede8dc;
  --text: #353229;
  --text-secondary: #625f54;
  --text-tertiary: #7e7b6f;
  --border: #b6b2a5;
  --border-light: #e8e2d5;

  --accent: #8f4e0e;
  --accent-hover: #814301;
  --accent-bright: #b86a1e;
  --accent-light: #ffddb6;
  --accent-glow: rgba(143, 78, 14, 0.12);

  --green: #3b693d;
  --green-light: #c6fcc2;
  --red: #a73b21;

  /* Roundness (ROUND_EIGHT from Stitch) */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows (Level 1 and Level 2 from design system) */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);

  /* Typography (from design system) */
  --font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-label: 'Public Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --player-height: 72px;
  --transition: 0.2s ease;
}

/* Dark mode (default / Spotify-inspired) */
body {
  --bg: #1a1a1a;
  --bg-elevated: #2d2d2d;
  --bg-subtle: #2a2a2a;
  --bg-hover: #333333;
  --text: #e8e0d8;
  --text-secondary: #a09890;
  --text-tertiary: #706860;
  --border: #444444;
  --border-light: #3a3a3a;

  --accent: #faa560;
  --accent-hover: #ea9854;
  --accent-bright: #ffcc80;
  --accent-light: #3a2a1a;
  --accent-glow: rgba(250, 165, 96, 0.15);

  --green: #b8edb5;
  --green-light: #225026;
  --red: #fd795a;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.2);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--player-height) + 28px);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; font-size: inherit; }

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* --- Top Nav --- */
.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0;
}
.topnav-logo {
  font-family: var(--font-display);
  font-size: 1.25em;
  font-weight: 700;
  color: var(--accent);
  margin-right: 24px;
  white-space: nowrap;
}
.topnav-links {
  display: flex;
  gap: 4px;
}
.topnav-links a, .topnav-links button {
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font-label);
  font-size: 0.82em;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.topnav-links a:hover, .topnav-links button:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.topnav-links a.active {
  color: var(--text);
  background: var(--bg-elevated);
}
.topnav-spacer { flex: 1; }
.topnav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- View Toggle --- */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 3px;
}
.view-toggle button {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-tertiary);
  transition: all var(--transition);
  display: flex;
  align-items: center;
}
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* --- Theme Toggle --- */
.theme-toggle {
  padding: 6px 12px;
  border-radius: 20px;
  font-family: var(--font-label);
  font-size: 0.78em;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
}

/* --- Hero / Search --- */
.hero {
  text-align: center;
  padding: 32px 0 24px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: 2.6em;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
  margin-bottom: 6px;
}
.hero .subtitle {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 6px 6px 6px 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.92em;
  min-width: 0;
}
.search-bar input::placeholder { color: var(--text-tertiary); }
.search-bar .search-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.search-bar select {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  color: var(--text-secondary);
  font-size: 0.8em;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  max-width: 120px;
}
.search-bar .clear-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
  flex-shrink: 0;
}
.search-bar .clear-btn:hover { color: var(--text); }

/* --- Filters row --- */
.filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.result-count {
  font-family: var(--font-label);
  font-size: 0.78em;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Episode Grid (Spotify-style cards) --- */
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.ep-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
  position: relative;
}
.ep-card:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}
.ep-card .cover {
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ep-card .cover .cover-bg {
  position: absolute;
  inset: 0;
}
.ep-card .cover .cover-text {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.3em;
  font-weight: 700;
  text-align: center;
  padding: 12px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ep-card .play-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-bright);
  color: #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 2;
}
.ep-card:hover .play-overlay {
  opacity: 1;
  transform: translateY(0);
}
.ep-card .play-overlay:hover {
  transform: scale(1.06);
  background: var(--accent-hover);
}
.ep-card .play-overlay.playing {
  opacity: 1;
  transform: translateY(0);
  background: var(--green);
}
.ep-card .card-info {
  padding: 12px 14px 14px;
}
.ep-card .card-title {
  font-weight: 600;
  font-size: 0.9em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.ep-card .card-meta {
  font-size: 0.75em;
  color: var(--text-tertiary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ep-card .card-meta .tag-pill {
  background: var(--accent-light);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
}

/* --- Episode List (compact rows) --- */
.ep-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}
.ep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer;
}
.ep-row:hover { background: var(--bg-hover); }
.ep-row .row-num {
  width: 28px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.78em;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.ep-row .row-cover {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.ep-row .row-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
}
.ep-row:hover .row-play { opacity: 1; }
.ep-row .row-play:hover { color: var(--accent); }
.ep-row .row-play.playing { opacity: 1; color: var(--green); }
.ep-row .row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ep-row .row-title {
  font-weight: 600;
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-row .row-venue {
  font-size: 0.78em;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  flex-shrink: 1;
}
.ep-row .row-date {
  font-size: 0.78em;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  width: 90px;
  text-align: right;
}
.ep-row .row-dur {
  font-family: var(--font-mono);
  font-size: 0.72em;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  width: 48px;
  text-align: right;
}
.ep-row .row-link {
  flex-shrink: 0;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}
.ep-row .row-link:hover {
  color: var(--accent);
  background: var(--bg-subtle);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 20px 0 32px;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: var(--font-label);
  font-size: 0.82em;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.pagination button:hover { background: var(--bg-hover); color: var(--text); }
.pagination button.current {
  background: var(--accent-bright);
  color: #121212;
}

/* --- Player Bar (fixed bottom, floating) --- */
.player-bar {
  position: fixed;
  bottom: 6px;
  left: 8px;
  right: 8px;
  z-index: 100;
  height: var(--player-height);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03);
}
.player-now {
  flex: 0 0 220px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.player-now-cover {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.player-now-info {
  min-width: 0;
  overflow: hidden;
}
.player-now-title {
  font-size: 0.82em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-now-sub {
  font-size: 0.72em;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-now-link {
  font-size: 0.7em;
  color: var(--text-tertiary);
  transition: color var(--transition);
}
.player-now-link:hover { color: var(--accent); }

.player-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 600px;
  margin: 0 auto;
}
.player-controls-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.player-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.player-btn:hover { color: var(--text); background: var(--bg-hover); }
.player-btn-play {
  width: 44px;
  height: 44px;
  background: var(--accent-bright);
  color: #121212;
}
.player-btn-play:hover {
  background: var(--accent-hover);
  transform: scale(1.06);
}
.player-time {
  font-family: var(--font-mono);
  font-size: 0.7em;
  color: var(--text-tertiary);
  width: 38px;
  text-align: center;
  flex-shrink: 0;
}
.player-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.player-progress input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.player-progress input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity var(--transition);
}
.player-progress:hover input[type="range"]::-webkit-slider-thumb { opacity: 1; }
.player-progress input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-elevated);
}

.player-right {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.player-right input[type="range"] {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.player-right input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}
.player-speed-btn {
  font-family: var(--font-label);
  font-size: 0.7em;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.player-speed-btn:hover { border-color: var(--text-tertiary); color: var(--text); }

/* --- Episode Detail Page --- */
.detail-header {
  margin-bottom: 28px;
  border-left: 4px solid var(--accent);
  padding-left: 20px;
}
.detail-info { min-width: 0; }
.detail-info h1 {
  font-family: var(--font-display);
  font-size: 2em;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}
.detail-info .page-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1em;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 0.85em;
  margin-bottom: 16px;
}
.detail-meta .meta-label {
  color: var(--text-tertiary);
  font-family: var(--font-label);
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-meta a { color: var(--accent); }
.detail-meta a:hover { text-decoration: underline; }
.detail-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: var(--accent-bright);
  color: #121212;
  border-radius: 28px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.9em;
  transition: all var(--transition);
  margin-top: 8px;
}
.detail-play-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.04);
}
.detail-play-btn .btn-icon {
  width: 20px;
  height: 20px;
}

.detail-section {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.detail-section h2 {
  font-family: var(--font-display);
  font-size: 1.15em;
  font-weight: 600;
  margin-bottom: 12px;
}
.detail-section p {
  font-size: 0.9em;
  line-height: 1.7;
  color: var(--text-secondary);
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.detail-tags span {
  padding: 4px 14px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.78em;
  font-family: var(--font-label);
  font-weight: 500;
}
.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.detail-nav a {
  color: var(--accent);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.9em;
  padding: 8px 0;
  transition: color var(--transition);
}
.detail-nav a:hover { color: var(--accent-hover); text-decoration: underline; }
.detail-nav .disabled { color: var(--text-tertiary); pointer-events: none; }

/* Rundown */
.rundown-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 0.88em;
  line-height: 1.6;
  color: var(--text-secondary);
  max-height: 500px;
  overflow-y: auto;
}
.rundown-box p { margin: 4px 0; }
.seek-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-light);
  padding: 1px 6px;
  border-radius: 3px;
  transition: all var(--transition);
  white-space: nowrap;
}
.seek-link:hover {
  background: var(--accent);
  color: #fff;
}

/* --- Stats Page --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
}
.stat-card .stat-num {
  font-family: var(--font-display);
  font-size: 2.2em;
  font-weight: 700;
  color: var(--accent);
}
.stat-card .stat-label {
  font-size: 0.8em;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-family: var(--font-label);
  font-weight: 500;
}
.year-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}
.year-table th {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
  color: var(--text-tertiary);
  font-family: var(--font-label);
  font-size: 0.78em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.year-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-light);
}
.year-table tr:hover td { background: var(--bg-hover); }
.year-bar {
  display: inline-block;
  height: 10px;
  background: var(--accent);
  border-radius: 5px;
  opacity: 0.5;
  vertical-align: middle;
  margin-right: 8px;
}

/* --- Recently Played Section --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.4em;
  font-weight: 600;
}
.recent-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.recent-scroll::-webkit-scrollbar { height: 0; }
.recent-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition);
}
.recent-card:hover { background: var(--bg-hover); }
.recent-card .recent-cover {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  font-size: 0.85em;
  text-align: center;
  padding: 8px;
}
.recent-card .recent-info {
  padding: 10px 12px 12px;
}
.recent-card .recent-title {
  font-weight: 600;
  font-size: 0.82em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-card .recent-date {
  font-size: 0.72em;
  color: var(--text-tertiary);
  margin-top: 3px;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: var(--bg-hover);
  border-radius: var(--radius);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 32px 0 24px;
  color: var(--text-tertiary);
  font-size: 0.78em;
  border-top: 1px solid var(--border-light);
  margin-top: 40px;
}
.footer a { color: var(--accent); }
.footer a:hover { text-decoration: underline; }

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-family: var(--font-label);
  font-size: 0.85em;
  font-weight: 600;
  padding: 6px 0;
  margin-bottom: 12px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--text); }

/* --- Utility --- */
.hidden { display: none !important; }
.no-audio { opacity: 0.4; pointer-events: none; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .container { padding: 12px 16px; }
  .topnav { padding: 10px 14px; }
  .topnav-logo { font-size: 1.1em; margin-right: 12px; }
  .topnav-links a, .topnav-links button { padding: 6px 10px; font-size: 0.75em; }

  .hero h1 { font-size: 1.8em; }
  .search-bar { flex-wrap: wrap; padding: 8px 12px; border-radius: 16px; }
  .search-bar input { order: 1; flex-basis: 100%; }
  .search-bar select { order: 2; }
  .search-bar .clear-btn { order: 3; }

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

  .detail-header { padding-left: 12px; }

  .player-bar { padding: 0 10px; gap: 8px; }
  .player-now { flex: 0 0 140px; }
  .player-right { flex: 0 0 auto; }
  .player-right input[type="range"] { display: none; }
  .player-speed-btn { display: none; }
}

@media (max-width: 480px) {
  .ep-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ep-card .card-title { font-size: 0.78em; }
  .ep-card .card-meta { font-size: 0.68em; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
