/* ═══════════════════════════════════════════════════════════════════════════
   Bilingual Soul Food - SPA Stylesheet
   PWA-ready, safe-area aware, 44px minimum touch targets
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  /* Background */
  --bg-primary: #0a1628;
  --bg-secondary: #1a2332;
  --bg-card: #282a36;

  /* Brassy / gold */
  --gold: #d4a76a;
  --gold-light: #e8c878;
  --gold-dark: #8b6f47;
  --gold-mid: #b8925a;
  --brass-gradient: linear-gradient(145deg, #d4a76a 0%, #b8925a 20%, #8b6f47 50%, #b8925a 80%, #d4a76a 100%);
  --brass-btn: linear-gradient(145deg, #e8c878 0%, #d4a76a 30%, #b8925a 70%, #d4a76a 100%);
  --brass-text: #1a1208;

  /* Dracula */
  --dracula-bg: #282a36;
  --dracula-current: #44475a;
  --dracula-fg: #f8f8f2;
  --dracula-comment: #6272a4;
  --dracula-cyan: #8be9fd;
  --dracula-green: #50fa7b;
  --dracula-orange: #ffb86c;
  --dracula-pink: #ff79c6;
  --dracula-purple: #bd93f9;
  --dracula-red: #ff5555;
  --dracula-yellow: #f1fa8c;

  /* Semantic */
  --text-primary: #f8f8f2;
  --text-gold: #d4a76a;
  --text-muted: #6272a4;
  --accent-green: #50fa7b;
  --accent-red: #ff5555;

  /* Layout */
  --header-height: 56px;
  --player-bar-height: 136px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);

  /* Font sizes */
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 2rem;

  /* Quiz-specific */
  --font-question: 1.5rem;
  --font-question-secondary: 1.5rem;
  --font-answer: 1.5rem;
  --font-answer-secondary: 1.5rem;
  --font-explanation: 1.5rem;
  --font-verse: 1.5rem;
  --font-verse-secondary: 1.5rem;
}

@media (min-width: 768px) {
  :root {
    --player-bar-height: 144px;
  }
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  /* PWA: account for safe areas */
  padding-top: var(--safe-area-top);
  padding-left: var(--safe-area-left);
  padding-right: var(--safe-area-right);
}

/* PWA standalone mode adjustments */
@media (display-mode: standalone) {
  body {
    /* Extra top padding for status bar in standalone mode */
    padding-top: max(var(--safe-area-top), 20px);
  }
}

button, a {
  font-family: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

a { text-decoration: none; color: inherit; }

img { display: block; }

/* ─── App Shell Layout ───────────────────────────────────────────────────── */
#app-header {
  flex-shrink: 0;
  z-index: 600;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

#app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Leave room for player bar */
  padding-bottom: calc(var(--player-bar-height) + var(--safe-area-bottom));
}

#player-bar {
  flex-shrink: 0;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 640px;
  z-index: 900;
  padding-bottom: var(--safe-area-bottom);
  background: #111;
  transition: transform 0.3s ease;
}

#player-bar.player-hidden {
  transform: translateX(-50%) translateY(100%);
}

/* Drag handle */
.player-drag-handle {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  cursor: grab;
  touch-action: none;
}

.player-drag-handle:active {
  cursor: grabbing;
}

.player-drag-pill {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
}

/* Collapsed state: hide everything except handle + progress bar */
#player-bar.player-collapsed .player-bar-content,
#player-bar.player-collapsed .player-controls-row {
  display: none;
}

#player-bar.player-collapsed .player-progress-bar {
  margin-bottom: 8px;
}

#player-bar.player-collapsed .player-drag-handle {
  padding: 6px 0 2px;
}

/* When player is hidden, content doesn't need extra padding */
#player-bar.player-hidden ~ #app-content,
body:has(#player-bar.player-hidden) #app-content {
  padding-bottom: var(--safe-area-bottom);
}

#modal-container {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  z-index: 500;
  pointer-events: none;
}

#modal-container > * {
  pointer-events: auto;
}

/* ─── Header Bar ─────────────────────────────────────────────────────────── */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 12px;
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.95) 0%, rgba(10, 22, 40, 0.85) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 167, 106, 0.15);
}

.header-title {
  font-size: var(--font-lg);
  font-weight: bold;
  color: var(--gold);
  letter-spacing: 1px;
  text-align: center;
  flex: 1;
}

.header-back-btn,
.header-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--gold);
  border-radius: 12px;
  transition: background 0.2s;
}

.header-back-btn:active,
.header-menu-btn:active {
  background: rgba(212, 167, 106, 0.15);
}

.header-spacer {
  width: 44px;
}

/* Header dropdown menu */
.header-menu-dropdown {
  position: absolute;
  top: var(--header-height);
  right: 12px;
  background: linear-gradient(145deg, #1a3a5c 0%, #0d2840 100%);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 180px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  z-index: 700;
}

.header-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 20px;
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--gold);
  background: transparent;
  border: none;
  text-align: left;
  transition: background 0.2s;
}

.header-menu-dropdown button:active {
  background: rgba(212, 167, 106, 0.15);
}

.header-menu-dropdown .menu-separator {
  border: none;
  border-top: 1px solid rgba(212, 167, 106, 0.2);
  margin: 4px 0;
}

.header-menu-dropdown .menu-icon {
  width: 20px;
  text-align: center;
  font-size: var(--font-lg);
}

/* ─── Player Bar ─────────────────────────────────────────────────────────── */
.player-bar-content {
  display: flex;
  align-items: center;
  padding: 20px 12px 8px;
  gap: 12px;
  cursor: pointer;
}

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 2px 0 6px;
}

.player-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  transition: color 0.2s;
}

.player-ctrl-btn svg {
  width: 22px;
  height: 22px;
}

#player-prev-btn,
#player-next-btn,
#player-replay10-btn {
  color: var(--dracula-fg);
}

@media (max-width: 500px) {
  #player-repeat-btn { display: none; }
}

.player-ctrl-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

.player-ctrl-btn.active {
  color: var(--accent-green);
}

.player-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gold-dark);
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-title {
  font-size: var(--font-sm);
  font-weight: bold;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-subtitle {
  font-size: calc(var(--font-xs) + 2px);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-play-btn,
.player-like-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--font-xl);
  flex-shrink: 0;
}

.player-ctrl-btn.player-like-btn {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.player-ctrl-btn.player-like-btn.liked {
  color: #e74c3c;
  font-size: 1.4rem;
}

.player-play-btn svg {
  width: 22px;
  height: 22px;
}

.player-play-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

.player-progress-bar {
  display: none;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  margin-bottom: 20px;
}

.player-progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.3s linear;
}

@media (min-width: 768px) {
  .player-thumb {
    width: 48px;
    height: 48px;
  }

  .player-progress-bar {
    height: 4px;
  }
}

/* ─── View Container ─────────────────────────────────────────────────────── */
.view-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 10px 100px;
  width: 100%;
}

@media (min-width: 768px) {
  .view-container {
    padding: 20px 20px 100px;
  }
}

.view-loading,
.view-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-gold);
  font-size: var(--font-lg);
  text-align: center;
  padding: 40px;
}

.view-error {
  color: var(--accent-red);
  cursor: pointer;
}

/* ─── Hidden / No Display Utility ────────────────────────────────────────── */
.no-display { display: none !important; }
.hidden { display: none !important; }

/* ─── Brass Card (shared) ────────────────────────────────────────────────── */
.brass-card {
  background: var(--brass-gradient);
  border-radius: 20px;
  padding: 25px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
              inset 0 -1px 0 rgba(0, 0, 0, 0.4),
              0 10px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  color: var(--brass-text);
}

.brass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(90deg,
    transparent, transparent 2px,
    rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
  pointer-events: none;
}

/* ─── Brass Button ───────────────────────────────────────────────────────── */
.brass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  min-height: 48px;
  font-size: var(--font-base);
  font-weight: bold;
  background: var(--brass-btn);
  border: 2px solid #5a4428;
  border-radius: 12px;
  color: var(--brass-text);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.brass-btn:active {
  transform: scale(0.97);
}

/* ─── Green CTA Button ───────────────────────────────────────────────────── */
.green-btn {
  display: block;
  width: 100%;
  padding: 18px;
  min-height: 56px;
  font-size: 1.3rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #1a3a2a 0%, #0d261a 100%);
  color: var(--accent-green);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

.green-btn:active {
  transform: scale(0.97);
}

/* ─── Home View ──────────────────────────────────────────────────────────── */
.home-view-container {
  display: flex;
  align-items: flex-start;
}

.home-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.home-title {
  font-size: var(--font-2xl);
  font-weight: bold;
  color: var(--brass-text);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-bottom: 15px;
  display: none;
}

@media (min-width: 768px) {
  .home-title {
    display: block;
  }
}

/* Thumbnail nav */
.thumb-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.thumb-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: none;
  border-radius: 50%;
  background: var(--brass-btn);
  color: var(--brass-text);
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3),
              inset 0 1px 3px rgba(255, 255, 255, 0.4);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.thumb-nav-arrow:active { transform: scale(0.9); }
.thumb-nav-arrow.invisible { visibility: hidden; }

.thumb-nav-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thumb-wrapper {
  position: relative;
  width: 280px;
  max-width: 60vw;
  flex-shrink: 0;
}

.thumb-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 15px;
  background-size: cover;
  background-position: center;
  background-color: var(--gold-dark);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.2s;
}

.thumb-img:active { transform: scale(0.97); }

/* Badges on thumbnail */
.music-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  background: var(--brass-gradient);
  border: 2px solid var(--dracula-purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(189, 147, 249, 0.6);
  z-index: 10;
  overflow: hidden;
}

.music-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(189, 147, 249, 0.6) 0%, rgba(139, 100, 200, 0.7) 100%);
  mix-blend-mode: color;
  border-radius: 50%;
  pointer-events: none;
}

.music-badge svg {
  width: 18px; height: 18px;
  fill: var(--brass-text);
  position: relative;
  z-index: 1;
}

.like-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  z-index: 10;
  font-size: 18px;
  color: #666;
}

.like-badge.liked {
  background: linear-gradient(145deg, #50fa7b 0%, #3ad864 100%);
  border-color: #3ad864;
  box-shadow: 0 3px 10px rgba(80, 250, 123, 0.4);
  color: #1a1a2e;
}

/* Theme reference card (pillow / raised style) */
.theme-ref-card {
  background: var(--brass-btn);
  border-radius: 25px;
  padding: 18px 24px;
  margin-bottom: 20px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
              inset 0 2px 4px rgba(255, 255, 255, 0.4),
              inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  border: none;
}

.theme-ref-card:active { transform: scale(0.97); }

.theme-ref-primary {
  font-size: var(--font-lg);
  font-weight: bold;
  color: var(--brass-text);
  margin-bottom: 4px;
}

.theme-ref-secondary {
  font-size: var(--font-base);
  color: var(--brass-text);
  /* opacity: 0.85; */
}

/* Welcome section */
.welcome-text {
  font-size: var(--font-2xl);
  color: var(--brass-text);
  margin-bottom: 15px;
}

.welcome-name {
  font-weight: bold;
}

/* Language globe button */
.lang-globe-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  min-height: 48px;
  font-size: var(--font-base);
  font-weight: bold;
  background: var(--brass-btn);
  border: none;
  border-radius: 25px;
  color: var(--brass-text);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
              inset 0 2px 4px rgba(255, 255, 255, 0.4),
              inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.lang-globe-btn:active { transform: scale(0.97); }

/* ─── Song View ──────────────────────────────────────────────────────────── */
.song-header {
  text-align: center;
  padding: 20px 0;
}

.song-thumb-large {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  background-color: var(--gold-dark);
  margin: 0 auto 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* Card flip thumbnail */
.song-thumb-flip {
  width: 200px;
  height: 200px;
  perspective: 800px;
  margin: 0 auto 20px;
  cursor: pointer;
}

.song-thumb-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s ease;
  transform-style: preserve-3d;
}

.song-thumb-flip.flipped .song-thumb-inner {
  transform: rotateY(180deg);
}

.song-thumb-front,
.song-thumb-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.song-thumb-front {
  background-size: cover;
  background-position: center;
  background-color: var(--gold-dark);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.song-thumb-back {
  transform: rotateY(180deg);
  background: var(--bg-secondary);
  border: 1px solid rgba(212, 167, 106, 0.3);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.song-flip-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.5rem;
  background: var(--accent-green);
  border: none;
  box-shadow: 0 4px 15px rgba(80, 250, 123, 0.4);
  text-shadow: 2px 2px 2px black;
}

.song-flip-label {
  color: var(--text-muted);
  font-size: var(--font-xs);
  margin-bottom: 8px;
}

.song-flip-credit {
  color: var(--dracula-fg);
  font-size: calc(var(--font-sm) + 2px);
  text-align: center;
  padding: 0 12px;
  line-height: 1.5;
}

.song-flip-inspire {
  color: var(--gold);
  font-size: calc(var(--font-sm) + 2px);
  text-align: center;
  margin-top: 8px;
  text-shadow: 0 0 8px rgba(212, 167, 106, 0.6);
}

.lang-zht .song-flip-credit,
.lang-zht .song-flip-inspire {
  font-size: 20px;
}

.song-title-text {
  font-size: var(--font-2xl);
  color: var(--dracula-pink);
  font-weight: bold;
  margin-bottom: 5px;
}

/* Song header row: heart + jukebox below thumb */
.song-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 15px auto;
}

.song-jukebox-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.2rem;
}

.song-lang-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1208;
}

.song-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.song-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-green);
  border: none;
  color: #000;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(80, 250, 123, 0.4);
  transition: transform 0.2s;
}

.song-play-btn svg {
  width: 32px;
  height: 32px;
}

.song-play-btn:active { transform: scale(0.9); }

.song-like-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.2rem;
}

.song-like-btn.liked {
  color: #1a1208;
  font-size: 1.4rem;
}

/* Variant tabs */
.variant-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 15px 0;
  flex-wrap: wrap;
}

.variant-tab {
  padding: 8px 16px;
  min-height: 36px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 20px;
  font-size: var(--font-sm);
  transition: all 0.2s;
}

.variant-tab.active {
  background: var(--gold);
  color: var(--bg-primary);
}

/* Song variant cards */
.song-variants-list {
  padding: 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.song-variant-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(212, 167, 106, 0.15);
  transition: border-color 0.2s;
}

.song-variant-card.active {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(80, 250, 123, 0.1);
}

.song-variant-header {
  margin-bottom: 12px;
}

.song-variant-lang {
  font-size: var(--font-2xl);
  color: var(--dracula-purple);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-align: center;
}

.song-variant-title {
  font-size: var(--font-2xl);
  color: var(--dracula-pink);
  font-weight: bold;
  line-height: 1.5;
  text-align: center;
}

.song-variant-title.has-scrubber {
  margin-bottom: 0;
}

.song-variant-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px 0;
}

.song-variant-card .song-scrubber-wrap {
  padding: 0 0 18px;
}

.song-variant-card .lyrics-section {
  padding: 0 20px 12px;
}

.song-variant-card .story-section {
  padding: 0 20px 25px;
}

@media (max-width: 600px) {
  .song-variant-card .lyrics-section,
  .song-variant-card .story-section {
    padding-left: 0;
    padding-right: 0;
  }

  #app-content[data-view="play"] {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* SC player embed */
.song-player-embed {
  padding: 0 20px 20px;
}

.song-player-embed iframe {
  border-radius: 12px;
}

/* Custom scrubber */
.song-scrubber-wrap {
  padding: 0 24px 25px;
}

.song-scrubber-times {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.song-scrubber-time {
  font-size: var(--font-sm);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.song-scrubber {
  position: relative;
  padding: 10px 0;
  cursor: pointer;
  touch-action: none;
}

.song-scrubber-track {
  position: relative;
  height: 6px;
  background: #1a1208;
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.song-scrubber-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--brass-gradient);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.song-scrubber-dot {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 22px;
  height: 22px;
  background: var(--brass-btn);
  border: 3px solid #1a1208;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5),
              inset 0 1px 2px rgba(255, 255, 255, 0.4),
              inset 0 -1px 2px rgba(0, 0, 0, 0.2);
  transition: left 0.1s linear;
}

.song-scrubber:active .song-scrubber-dot {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6),
              inset 0 1px 2px rgba(255, 255, 255, 0.4),
              inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

/* Lyrics */
.lyrics-section {
  padding: 0 20px 25px;
}

.lyrics-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  min-height: 48px;
  background: var(--brass-btn);
  border: none;
  border-radius: 10px;
  color: var(--brass-text);
  font-weight: bold;
  font-size: calc(var(--font-sm) + 4px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
              inset 0 2px 4px rgba(255, 255, 255, 0.4);
  text-shadow: 0.5px 0.5px 0.5px rgba(128, 128, 128, 0.8);
}

.lyrics-toggle.lang-zht {
  font-size: calc(var(--font-sm) + 8px);
}

.lyrics-toggle svg {
  width: 16px; height: 16px;
  fill: currentColor;
  transition: transform 0.3s;
}

.lyrics-toggle.expanded svg { transform: rotate(180deg); }

.lyrics-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.lyrics-content.expanded {
  max-height: 99999px;
}

.lyrics-text {
  padding: 20px 0;
  margin-top: 20px;
  color: var(--dracula-fg);
  font-size: calc(var(--font-lg) + 4px);
  line-height: 1.8;
  white-space: pre-wrap;
}

.lyrics-zht {
  font-size: calc(var(--font-lg) + 8px);
}

/* ─── Jukebox View ───────────────────────────────────────────────────────── */
.jukebox-sort-arrows {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 15px;
}

.jukebox-sort-arrow-btn {
  width: 40px;
  height: 40px;
  background: var(--dracula-purple);
  border: 2px solid #5a4428;
  border-radius: 50%;
  color: #1a1208;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3),
              inset 0 1px 3px rgba(255, 255, 255, 0.4),
              inset 0 -1px 3px rgba(0, 0, 0, 0.2);
}

.jukebox-sort-arrow-btn:active {
  transform: scale(0.92);
}

.jukebox-sort-label {
  font-size: 1.3rem;
  color: var(--dracula-purple);
}

.jukebox-search {
  margin-bottom: 15px;
}

.jukebox-search-input {
  width: 100%;
  padding: 12px 16px;
  min-height: 44px;
  border: 1px solid var(--gold);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-radius: 25px;
  font-size: var(--font-base);
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.jukebox-search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(212, 167, 106, 0.2);
}

.jukebox-search-input::placeholder {
  color: #808080;
}

.jukebox-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.jukebox-filter-btn {
  padding: 8px 16px;
  min-height: 36px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 20px;
  font-size: var(--font-sm);
  font-family: inherit;
  transition: all 0.2s;
}

.jukebox-filter-btn.active {
  background: var(--dracula-fg);
  color: var(--bg-primary);
}

.jukebox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jukebox-card {
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 2px solid goldenrod;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 80px;
}

.jukebox-card.current {
  border-color: var(--accent-green);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(80, 250, 123, 0.3);
}

.jukebox-user-heart {
  color: #e74c3c;
  font-size: 1.1em;
}

@keyframes gold-glow {
  0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 167, 106, 0.6); }
  100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
}

.jukebox-card.highlight-glow {
  animation: gold-glow 1.5s ease-out forwards;
}

.jukebox-card-thumb {
  width: 80px;
  min-width: 80px;
  background-size: cover;
  background-position: center;
  background-color: var(--gold-mid);
  flex-shrink: 0;
}

.jukebox-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 15px;
  gap: 4px;
  background: var(--dracula-bg);
}

.jukebox-card-title {
  font-size: var(--font-base);
  color: var(--dracula-fg);
  font-weight: bold;
  line-height: 1.3;
}

.jukebox-card-ref {
  font-size: var(--font-base);
  color: var(--gold);
}

.jukebox-card-stats {
  font-size: var(--font-base);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.jukebox-card-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.jukebox-card-stats span:nth-child(3) {
  display: none;
}

.stat-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Now playing indicator */
.now-playing-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin-right: 6px;
}

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

.now-playing-bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.now-playing-bars span:nth-child(2) { height: 70%; animation-delay: 0.15s; }
.now-playing-bars span:nth-child(3) { height: 50%; animation-delay: 0.3s; }

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

/* ─── Read View ──────────────────────────────────────────────────────────── */
.read-header {
  background: var(--brass-gradient);
  border-radius: 16px;
  padding: 25px;
  text-align: center;
  margin-bottom: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.read-header-thumb {
  width: 100px;
  height: 100px;
  margin: 0 auto 15px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.read-header-title {
  font-size: var(--font-2xl);
  color: var(--brass-text);
  font-weight: 600;
  margin-bottom: 10px;
}

.read-header-ref {
  font-size: var(--font-2xl);
  color: var(--brass-text);
  font-weight: bold;
}

.read-header-ref .ref-secondary {
  display: block;
  font-size: var(--font-xl);
  opacity: 1;
  margin-top: 4px;
  font-weight: 600;
}

/* Passage card */
.passage-card {
  background: var(--dracula-fg);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 20px;
  line-height: 1.8;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  color: #1a1310;
}

.section-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--gold);
}

.section-reference {
  font-size: 1.2rem;
  color: var(--gold-dark);
  font-weight: bold;
}

.section-reference.secondary {
  /* color: #5a4a3a; */
  font-style: italic;
  margin-top: 5px;
}

.verse-couplet {
  margin-bottom: 25px;
}

.verse-couplet:last-child { margin-bottom: 0; }

.verse {
  margin-bottom: 8px;
  font-size: var(--font-verse);
  color: #1a1310;
  line-height: 1.8;
}

.verse-num {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--gold-dark);
  font-weight: bold;
  margin-right: 6px;
  vertical-align: super;
}

.verse.secondary {
  font-size: var(--font-verse-secondary);
  /* color: #5a4a3a; */
  font-style: italic;
  padding-left: 15px;
  border-left: 3px solid var(--gold);
  margin-bottom: 0;
}

/* ─── Play (Quiz) View ───────────────────────────────────────────────────── */
.quiz-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px 0;
}

.quiz-progress {
  font-size: var(--font-sm);
  color: var(--gold);
  font-weight: bold;
  letter-spacing: 1px;
}

.quiz-score {
  font-size: var(--font-sm);
  color: var(--accent-green);
  font-weight: bold;
}

/* Timer */
.timer-container {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

.timer-circle {
  position: relative;
  width: 90px;
  height: 90px;
}

.timer-svg {
  transform: rotate(-90deg);
  width: 90px;
  height: 90px;
}

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}

.timer-progress {
  fill: none;
  stroke: var(--gold-mid);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

.timer-progress.warning { stroke: var(--gold); }
.timer-progress.danger { stroke: var(--accent-red); }

.timer-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--gold-mid);
  transition: color 0.3s ease;
}

.timer-number.warning { color: var(--gold); }
.timer-number.danger { color: var(--accent-red); }

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.9; }
}

.timer-circle.active { animation: breathe 2s ease-in-out infinite; }

/* Question card */
.question-card {
  background: var(--dracula-fg);
  border: 1px solid rgba(90, 68, 40, 0.3);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  color: #1a1310;
}

.question-text {
  font-size: var(--font-question);
  line-height: 1.6;
  /* text-align: center; */
  margin-bottom: 15px;
}

.question-text-secondary {
  font-size: var(--font-question-secondary);
  /* color: rgba(26, 19, 16, 0.75); */
  line-height: 1.5;
  /* text-align: center; */
  margin-top: 10px;
  font-style: italic;
}

/* Hint button */
.hint-btn {
  display: inline-block;
  padding: 10px 20px;
  min-height: 44px;
  font-size: 0.85rem;
  background: var(--brass-btn);
  border: 2px solid #5a4428;
  border-radius: 20px;
  color: var(--brass-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  margin-top: 10px;
}

.hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Answer buttons */
.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-btn {
  width: 100%;
  padding: 18px 22px;
  min-height: 56px;
  font-size: var(--font-answer);
  text-align: left;
  background: var(--dracula-fg);
  border: 2px solid rgba(90, 68, 40, 0.3);
  border-radius: 12px;
  color: #1a1310;
  line-height: 1.6;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, border-color 0.2s;
}

.answer-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.answer-btn:disabled { cursor: not-allowed; }

.answer-btn.correct {
  background: linear-gradient(145deg, var(--accent-green) 0%, #3ad864 100%);
  border-color: var(--accent-green);
  color: #0f172a;
}

.answer-btn.wrong {
  background: linear-gradient(145deg, var(--accent-red) 0%, #cc3333 100%);
  border-color: var(--accent-red);
  color: white;
}

.answer-label {
  font-weight: bold;
  margin-right: 10px;
}

.answer-text-secondary {
  display: block;
  font-size: var(--font-answer-secondary);
  /* color: rgba(26, 19, 16, 0.75); */
  margin-top: 6px;
  font-style: italic;
}

/* Result after answer */
.result-section {
  margin-top: 20px;
  padding: 20px;
  background: var(--dracula-fg);
  border: 1px solid rgba(90, 68, 40, 0.3);
  border-radius: 12px;
  /* text-align: center; */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  color: #1a1310;
}

.result-text {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.result-text.correct { color: #1a8a3a; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.result-text.wrong { color: #c02020; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

.result-points {
  font-size: var(--font-lg);
  color: var(--gold);
  margin-bottom: 15px;
}

.explanation {
  font-size: var(--font-explanation);
  line-height: 1.6;
  text-align: left;
  margin-bottom: 20px;
}

.explanation-secondary {
  font-size: var(--font-answer-secondary);
  /* color: #6b5c4a; */
  margin-top: 10px;
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.5;
}

.next-btn {
  width: 100%;
  padding: 16px;
  min-height: 52px;
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 2px solid #5a4428;
  border-radius: 10px;
  background: var(--brass-btn);
  color: var(--brass-text);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Quit button */
.quit-container {
  text-align: center;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid rgba(90, 68, 40, 0.3);
}

.quit-btn {
  position: relative;
  overflow: hidden;
  padding: 20px 50px;
  min-height: 56px;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 1px;
  background: var(--brass-btn);
  border: 2px solid #5a4428;
  border-radius: 10px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.quit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(200, 30, 30, 0.8);
  mix-blend-mode: color-burn;
  pointer-events: none;
  border-radius: 8px;
}

/* Hint modal */
.hint-modal-content {
  max-width: 400px;
  overflow-y: auto;
  text-align: left;
  position: relative;
  margin-bottom: calc(var(--player-bar-height) + 100px);
}

.hint-reference {
  text-align: center;
  font-size: var(--font-2xl);
  color: #1a1310;
  font-weight: bold;
  margin-bottom: 10px;
}

.hint-verse {
  font-size: var(--font-2xl);
  color: #1a1310;
  line-height: 1.6;
  margin-bottom: 15px;
  padding: 15px;
  background: var(--dracula-fg);
  border-radius: 8px;
  border-left: 3px solid var(--gold-dark);
}

.hint-verse-secondary {
  font-size: var(--font-2xl);
  color: #1a1310;
  line-height: 1.6;
  margin-bottom: 15px;
  padding: 15px;
  background: var(--dracula-fg);
  border-radius: 8px;
  border-left: 3px solid var(--gold-dark);
  font-style: italic;
}

/* Chinese quiz text: thicker strokes */
.lang-zht .question-text,
.lang-zht .answer-btn,
.lang-zht .explanation {
  font-weight: 500;
}

@media (max-width: 600px) {
  .lang-zht .question-text { font-size: calc(var(--font-question) + 2px); }
  .lang-zht .answer-btn { font-size: calc(var(--font-answer) + 2px); }
  .lang-zht .explanation { font-size: calc(var(--font-explanation) + 2px); }
  .lang-zht .review-question { font-size: calc(var(--font-question) + 2px); }
  .lang-zht .review-correct,
  .lang-zht .review-answer.wrong { font-size: calc(var(--font-answer) + 2px); }
  .lang-zht .review-explanation { font-size: calc(var(--font-explanation) + 2px); }
  .review-lang-block.lang-zht .review-question { font-size: calc(var(--font-question) + 2px); }
  .review-lang-block.lang-zht .review-correct,
  .review-lang-block.lang-zht .review-answer.wrong { font-size: calc(var(--font-answer) + 2px); }
  .review-lang-block.lang-zht .review-explanation { font-size: calc(var(--font-explanation) + 2px); }
}

/* ─── Results View ───────────────────────────────────────────────────────── */
.results-header {
  background: var(--brass-gradient);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  color: var(--brass-text);
}

.result-icon { font-size: 4rem; margin-bottom: 15px; }

.result-title-text {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.score-display {
  font-size: 3.2rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.score-max {
  font-size: 1.05rem;
  opacity: 0.75;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.results-actions .brass-btn {
  width: 100%;
  text-align: center;
}

/* Review section */
.review-title {
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(212, 167, 106, 0.3);
}

.question-review {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  border-left: 4px solid var(--accent-green);
}

.question-review.wrong {
  border-left-color: var(--accent-red);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.review-qnum {
  font-weight: bold;
  color: var(--gold);
  font-size: 1.2rem;
}

.review-points {
  font-size: 1.2rem;
  padding: 5px 12px;
  border-radius: 12px;
  font-weight: bold;
}

.review-points.correct {
  background: rgba(80, 250, 123, 0.2);
  color: var(--accent-green);
}

.review-points.wrong {
  background: rgba(255, 85, 85, 0.2);
  color: var(--accent-red);
}

.review-question {
  font-size: var(--font-question);
  color: #e8e8e8;
  margin-bottom: 12px;
  line-height: 1.6;
}

.review-answer {
  font-size: var(--font-answer);
  color: var(--accent-green);
  margin-bottom: 10px;
}

.review-answer.wrong {
  color: var(--accent-red);
  text-decoration: line-through;
}

.review-correct {
  font-size: var(--font-answer);
  color: var(--accent-green);
  margin-bottom: 10px;
}

.review-correct,
.review-answer.wrong {
  line-height: 1.6;
}

/* Non-bilingual zht: lang-zht on view-container cascades to all review elements */
.lang-zht .review-question,
.lang-zht .review-correct,
.lang-zht .review-answer.wrong,
.lang-zht .review-explanation {
  line-height: 1.8;
  font-weight: 500;
}

/* Bilingual: reset all to 1.6, then re-apply 1.8 only on the zht block */
.review-bilingual .review-question,
.review-bilingual .review-correct,
.review-bilingual .review-answer.wrong,
.review-bilingual .review-explanation {
  line-height: 1.6;
}

.review-lang-block.lang-zht .review-question,
.review-lang-block.lang-zht .review-correct,
.review-lang-block.lang-zht .review-answer.wrong,
.review-lang-block.lang-zht .review-explanation {
  line-height: 1.8;
  font-weight: 500;
}

.review-explanation {
  font-size: var(--font-explanation);
  color: var(--dracula-fg);
  line-height: 1.6;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Bilingual review */
.review-bilingual {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.review-lang-block {
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.review-lang-label {
  font-size: 1.2rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 600;
}

/* ─── Results View – light background overrides ─────────────────────────── */
.results-view {
  background: #f8f8f2;
  border-radius: 16px;
}

.results-view .review-title {
  color: #1a1310;
  border-bottom-color: rgba(26, 18, 8, 0.2);
}

.results-view .question-review {
  background: rgba(26, 18, 8, 0.035);
  border-left-color: #1a7a3a;
}

.results-view .question-review.wrong {
  border-left-color: #c0392b;
}

.results-view .review-qnum {
  color: #6b5320;
}

.results-view .review-points.correct {
  background: rgba(26, 122, 58, 0.12);
  color: #1a7a3a;
}

.results-view .review-points.wrong {
  background: rgba(192, 57, 43, 0.12);
  color: #c0392b;
}

.results-view .review-question {
  color: #1a1310;
}

.results-view .review-correct {
  color: #1a7a3a;
}

.results-view .review-answer {
  color: #1a7a3a;
}

.results-view .review-answer.wrong {
  color: #c0392b;
}

.results-view .review-explanation {
  color: #3a3028;
  border-top-color: rgba(26, 18, 8, 0.12);
}

.results-view .review-lang-block {
  background: rgba(26, 18, 8, 0.04);
}

.results-view .review-lang-label {
  color: #6b5320;
}

/* ─── Leaderboard View ───────────────────────────────────────────────────── */
.leaderboard-header {
  background: var(--brass-gradient);
  border-radius: 16px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  color: var(--brass-text);
}

.leaderboard-header-title {
  font-size: var(--font-2xl);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.date-select {
  padding: 8px 12px;
  font-size: var(--font-2xl);
  font-family: inherit;
  border: 2px solid rgba(26, 19, 16, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1310;
  cursor: pointer;
  margin-top: 10px;
}

.leaderboard-table {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
}

.leaderboard-table-header {
  display: grid;
  grid-template-columns: 50px 1fr 80px;
  padding: 12px 15px;
  background: rgba(212, 167, 106, 0.2);
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: 50px 1fr 80px;
  padding: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: center;
}

.leaderboard-entry:last-child { border-bottom: none; }
.leaderboard-entry.top-3 { background: rgba(212, 167, 106, 0.1); }

.rank { font-weight: bold; font-size: var(--font-2xl); }
.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

.entry-name {
  font-size: var(--font-lg);
  color: var(--text-primary);
  font-weight: bold;
}

.entry-details {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-top: 4px;
}

.entry-score {
  font-size: var(--font-xl);
  font-weight: bold;
  color: var(--accent-green);
  text-align: right;
}

/* ─── Themes Modal ───────────────────────────────────────────────────────── */
.themes-modal-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  z-index: 600;
  padding: 20px;
  overflow-y: auto;
}

.themes-modal {
  background: var(--dracula-bg);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  margin: auto;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--dracula-current);
}

.themes-header {
  padding: 25px 25px 20px;
  text-align: center;
  position: relative;
}

.themes-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--dracula-comment);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.themes-title {
  font-size: var(--font-2xl);
  color: var(--dracula-yellow);
  font-weight: bold;
  margin-bottom: 5px;
}

.themes-reference {
  font-size: var(--font-2xl);
  color: var(--dracula-fg);
}

.themes-list { padding: 0 20px 20px; }

.themes-preface {
  color: var(--dracula-fg);
  font-size: calc(var(--font-lg) + 4px);
  line-height: 1.8;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--dracula-current);
}
.themes-preface p { margin: 35px 0 35px; }
.lang-zht .themes-preface { font-size: calc(var(--font-lg) + 8px); }
.themes-preface p:last-child { margin-bottom: 0; }
.preface-h1 {
  font-size: 1.8rem;
  color: var(--dracula-yellow);
  font-weight: bold;
  margin: 0 0 6px;
  line-height: 1.3;
}
.preface-h2 {
  font-size: 1.5rem;
  color: var(--dracula-pink);
  font-weight: bold;
  margin: 20px 0 8px;
  line-height: 1.3;
}
.preface-hr {
  border: none;
  border-top: 1px solid var(--dracula-comment);
  margin: 20px 0;
}
.preface-matrix {
  display: grid;
  gap: 2px;
  margin: 1.2rem 0;
  font-size: 0.82rem;
  border-radius: 6px;
  overflow: hidden;
}
.pm-hdr {
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: var(--dracula-fg);
}
.pm-good {
  padding: 8px 10px;
  text-align: center;
  background: rgba(80, 250, 123, 0.12);
  color: #50fa7b;
  font-weight: 500;
}
.pm-bad {
  padding: 8px 10px;
  text-align: center;
  background: rgba(255, 85, 85, 0.12);
  color: #ff5555;
  font-weight: 500;
}
.pm-cell {
  padding: 8px 10px;
  text-align: center;
  background: rgba(255,255,255,0.04);
}
.preface-secondary p:last-child { margin-bottom: 0; }
.themes-preface strong { color: var(--dracula-yellow); }
.themes-preface em {
  font-style: italic;
  color: var(--dracula-green);
}

.theme-card {
  background: var(--dracula-fg);
  color: var(--dracula-bg);
  border: none;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
}

.theme-card:last-child { margin-bottom: 0; }

.theme-verse {
  display: inline-block;
  background: var(--dracula-current);
  color: var(--dracula-fg);
  font-size: var(--font-xs);
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.theme-title {
  font-size: var(--font-2xl);
  font-weight: bold;
  margin-bottom: 8px;
  line-height: 1.3;
}

.theme-title-secondary {
  margin-top: 4px;
  font-size: 1.3rem;
  /* opacity: 0.85; */
}

.theme-desc {
  font-size: 1.4rem;
  color: var(--dracula-current);
  line-height: 1.5;
}

.theme-desc-secondary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--dracula-current);
  /* opacity: 0.85; */
}

.themes-takeaway {
  background: var(--dracula-purple);
  margin: 20px;
  padding: 20px;
  border-radius: 12px;
}

.takeaway-label {
  font-size: var(--font-2xl);
  color: var(--dracula-fg);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.takeaway-text {
  font-size: var(--font-2xl);
  color: var(--dracula-bg);
  line-height: 1.5;
  font-weight: 500;
}

.takeaway-text-secondary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(26, 19, 16, 0.2);
}

.themes-footer {
  padding: 16px 20px calc(var(--player-bar-height) + 70px);
  text-align: center;
}

.themes-ok-btn {
  background: var(--accent-green);
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 12px 48px;
  font-size: var(--font-md, 1rem);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(80, 250, 123, 0.3);
  cursor: pointer;
}

.section-divider {
  text-align: center;
  padding: 15px 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(212, 167, 106, 0.2);
}

.section-divider-ref {
  display: block;
  font-size: var(--font-2xl);
  color: var(--gold);
  font-weight: bold;
}

.section-divider-ref.secondary {
  color: var(--gold);
  font-style: italic;
  margin-top: 4px;
}

/* ─── Modal Shared ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  z-index: 600;
  padding: 20px;
  overflow-y: auto;
}

.modal-box {
  background: linear-gradient(145deg, #1a3a5c 0%, #0d2840 100%);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  margin: auto;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
}

.modal-box-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 25px;
}

.modal-box-title {
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: bold;
}

/* Mode toggle (Mono/Bilingual) */
.mode-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.mode-btn {
  flex: 1;
  padding: 14px;
  min-height: 48px;
  font-size: var(--font-base);
  font-weight: bold;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(212, 167, 106, 0.3);
  border-radius: 10px;
  color: rgba(212, 167, 106, 0.6);
  transition: all 0.2s;
}

.mode-btn.active {
  background: rgba(212, 167, 106, 0.2);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 15px rgba(212, 167, 106, 0.2);
}

.mode-btn-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
}

.mode-btn-sub {
  font-size: 0.8rem;
  opacity: 0.7;
}

.lang-subtitle {
  font-size: var(--font-sm);
  color: rgba(212, 167, 106, 0.7);
  text-align: center;
  margin-bottom: 15px;
  font-style: italic;
}

.modal-lang-options {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-lang-btn {
  flex: 1;
  padding: 12px 8px;
  min-height: 48px;
  font-size: var(--font-base);
  font-weight: bold;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(212, 167, 106, 0.25);
  border-radius: 12px;
  color: rgba(212, 167, 106, 0.8);
  text-align: center;
  transition: all 0.2s;
}

.modal-lang-btn.selected {
  background: rgba(212, 167, 106, 0.25);
  border-color: var(--gold);
  color: var(--gold);
}

.modal-error {
  color: #ff6b6b;
  font-size: var(--font-sm);
  text-align: center;
  margin-bottom: 15px;
  min-height: 20px;
}

.modal-ok-btn {
  width: 100%;
  padding: 14px;
  min-height: 48px;
  font-size: 1.1rem;
  font-weight: bold;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-mid) 100%);
  border: none;
  border-radius: 12px;
  color: var(--brass-text);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-ok-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Profile modal - brass style */
.profile-modal-box {
  background: var(--brass-gradient);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
              inset 0 -1px 0 rgba(0, 0, 0, 0.4),
              0 15px 50px rgba(0, 0, 0, 0.6);
  color: var(--brass-text);
  position: relative;
  overflow: hidden;
}

.profile-modal-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    transparent, transparent 2px,
    rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
  pointer-events: none;
  border-radius: 20px;
}

.form-group { margin-bottom: 18px; position: relative; }

.form-label {
  display: block;
  font-size: 0.8rem;
  color: #1a1310;
  font-weight: bold;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  min-height: 48px;
  font-size: 16px; /* prevents iOS zoom */
  font-family: inherit;
  border: 3px solid rgba(26, 19, 16, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #1a1310;
}

.form-input:focus {
  outline: none;
  border-color: #1a1310;
}

.form-input::placeholder { color: rgba(26, 19, 16, 0.4); }

/* Location display */
.location-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.9);
  border: 3px solid rgba(26, 19, 16, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 48px;
}

.location-text { font-size: 16px; color: #1a1310; }

.location-change {
  font-size: 13px;
  color: #1a1310;
  text-decoration: underline;
  cursor: pointer;
  opacity: 0.7;
}

.profile-modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}

.profile-btn {
  flex: 1;
  padding: 14px 16px;
  min-height: 48px;
  font-size: var(--font-base);
  font-weight: bold;
  border-radius: 10px;
}

.profile-btn-cancel {
  background: rgba(255, 255, 255, 0.3);
  border: 2px solid rgba(26, 19, 16, 0.4);
  color: #1a1310;
}

.profile-btn-ok {
  background: linear-gradient(180deg, #1a3a2a 0%, #0d261a 100%);
  border: none;
  color: var(--accent-green);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--player-bar-height) + var(--safe-area-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a3a5c;
  color: var(--gold);
  padding: 12px 24px;
  border-radius: 25px;
  font-size: var(--font-base);
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 3000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Quit Modal ─────────────────────────────────────────────────────────── */
.quit-modal-btns {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.quit-cancel-btn {
  flex: 1;
  padding: 14px 16px;
  min-height: 50px;
  font-size: 0.95rem;
  font-weight: bold;
  background: var(--accent-green);
  border: 2px solid #1a5c2e;
  border-radius: 10px;
  color: var(--brass-text);
}

.quit-confirm-btn {
  flex: 1;
  padding: 14px 16px;
  min-height: 50px;
  font-size: 0.95rem;
  font-weight: bold;
  background: var(--accent-red);
  border: 2px solid #a82222;
  border-radius: 10px;
  color: var(--brass-text);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .passage-card { padding: 20px; }
  .read-header-ref { font-size: 1.2rem; }
}

@media (max-width: 400px) {
  .question-text { font-size: var(--font-answer); }
  .answer-btn { padding: 14px 16px; font-size: var(--font-answer); }
  .timer-circle, .timer-svg { width: 80px; height: 80px; }
  .timer-number { font-size: 1.5rem; }
  .thumb-nav { gap: 8px; }
}

/* ─── Mobile: flat song variants (no cards) ──────────────────────────────── */
@media (max-width: 500px) {
  .song-variants-list {
    padding: 0 20px 20px;
    gap: 0;
  }
  .song-variant-card {
    background: none;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0;
    padding: 24px 0 0;
    margin-top: 24px;
    margin-bottom: 20px;
  }
  .song-variant-card.active {
    border-top-color: rgba(255, 255, 255, 0.25);
    box-shadow: none;
  }
  .song-variant-card.active .lyrics-toggle {
    border: 2px solid var(--accent-green);
    box-shadow: 0 0 20px rgba(80, 250, 123, 0.1),
                inset 0 2px 4px rgba(255, 255, 255, 0.4);
  }
}

/* ─── Now Playing View ────────────────────────────────────────────────────── */
.now-playing-container {
  padding-top: 10px;
}

.now-playing-thumb {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  background-color: var(--gold-dark);
  margin: 0 auto 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.now-playing-title {
  font-size: var(--font-2xl);
  color: var(--dracula-pink);
  font-weight: bold;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 6px;
}

.now-playing-lang {
  font-size: var(--font-lg);
  color: var(--dracula-purple);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.now-playing-ref {
  color: var(--dracula-fg);
  font-size: calc(var(--font-lg) + 2px);
  text-align: center;
  margin-bottom: 10px;
}

.now-playing-player-section {
  padding: 0 16px 10px;
}

.now-playing-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 15px auto 24px;
}

.np-action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.2rem;
}

/* ─── Short Story (Now Playing) ──────────────────────────────────────────── */
.np-story {
  padding: 0 0 10px;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
  margin-top: 10px;
}

@media (max-width: 600px) {
  .np-story {
    padding-left: 0;
    padding-right: 0;
  }
  .np-story:not(.lang-zht) .np-story-text p {
    font-size: calc(var(--font-lg) + 4px);
  }
}

.np-story-title {
  font-size: calc(var(--font-2xl) + 4px);
  font-weight: bold;
  color: var(--dracula-green);
  text-align: center;
  padding: 24px 0 8px;
}

.np-story-author {
  text-align: center;
  color: var(--dracula-yellow);
  font-size: var(--font-2xl);
  font-style: italic;
  margin-top: 25px;
  margin-bottom: 16px;
}

.np-story-text p {
  color: var(--dracula-fg);
  font-size: calc(var(--font-lg) + 2px);
  line-height: 2;
  margin-bottom: 40px;
}

.np-story.lang-zht .np-story-text p {
  font-size: calc(var(--font-lg) + 8px);
}

.np-story-text-secondary {
  color: var(--dracula-comment);
  /* font-style: italic; */
}

.np-story.lang-zht .np-story-text p.np-story-text-secondary {
  font-size: calc(var(--font-lg) + 4px);
}

.now-playing-lyrics-title {
  font-size: calc(var(--font-2xl) + 4px);
  font-weight: bold;
  color: var(--dracula-green);
  text-align: center;
  padding: 24px 0 0;
  margin-top: 10px;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
}

#np-story-content {
  padding: 0 20px 25px;
}

.now-playing-lyrics {
  padding: 0 20px 25px;
}

.now-playing-lyrics .lyrics-text {
  padding: 20px 0;
  color: var(--dracula-fg);
  font-size: calc(var(--font-lg) + 4px);
  line-height: 1.8;
  white-space: pre-wrap;
}

/* ─── Share View ──────────────────────────────────────────────────────────── */
.share-container {
  padding-top: 10px;
}

.share-note {
  background: linear-gradient(145deg, #1a3a5c 0%, #0d2840 100%);
  border: 1px solid rgba(212, 167, 106, 0.3);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 20px;
}

.share-note-text {
  font-size: calc(var(--font-lg) + 2px);
  color: var(--dracula-fg);
  line-height: 1.6;
  font-style: italic;
}

.share-player-section {
  padding: 0 16px 10px;
}

.share-lyrics {
  padding: 0 20px 25px;
}

.share-lyrics .lyrics-text {
  padding: 20px 0;
  color: var(--dracula-fg);
  font-size: calc(var(--font-lg) + 2px);
  line-height: 1.8;
  white-space: pre-wrap;
}

.share-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px;
  margin-bottom: 20px;
}

.share-action-btn {
  flex: 1;
  padding: 12px 8px;
  font-size: var(--font-sm);
  text-align: center;
  min-height: 48px;
}

.share-send-btn {
  margin: 40px 20px 30px;
  width: calc(100% - 40px);
}

/* ─── Inline Content (Now Playing + Song page) ──────────────────────────── */

/* Section container */
.np-section {
  padding: 0 20px 30px;
}

/* CJK font bump — match .lyrics-zht size */
.np-section.lang-zht .np-theme-title,
.np-section.lang-zht .np-theme-desc,
.np-section.lang-zht .np-takeaway-text,
.np-section.lang-zht .np-verse {
  font-size: calc(var(--font-lg) + 8px);
}

/* Section titles — yellow, centered, single separator above only */
.np-section-title {
  font-size: calc(var(--font-2xl) + 4px);
  font-weight: bold;
  color: var(--dracula-green);
  text-align: center;
  padding: 24px 0 16px;
  margin-top: 10px;
  margin-bottom: 16px;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
}

/* Section reference (multi-passage divider) */
.np-section-ref {
  text-align: center;
  font-size: calc(var(--font-lg) + 6px);
  font-weight: bold;
  color: var(--dracula-fg);
  padding: 12px 0;
  margin-bottom: 16px;
}

.np-section-ref-secondary {
  display: block;
  color: var(--dracula-fg);
  font-style: italic;
  margin-top: 2px;
}

/* Theme items — no cards, flat on dark bg, separated by thin borders */
.np-theme-item {
  background: none;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.np-theme-item:last-child {
  border-bottom: none;
}

/* Verse badge — subtle translucent pill */
.np-theme-verse {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: var(--dracula-fg);
  font-size: calc(var(--font-xs) + 4px);
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}

/* Theme titles — pink for accent, high contrast */
.np-theme-title {
  font-size: calc(var(--font-lg) + 4px);
  font-weight: bold;
  color: var(--dracula-pink);
  margin-bottom: 8px;
  line-height: 1.4;
}

.np-theme-title-secondary {
  margin-top: 4px;
  font-size: var(--font-lg);
  color: var(--dracula-fg);
  font-style: italic;
}

/* Theme descriptions — full white, zero friction reading */
.np-theme-desc {
  font-size: calc(var(--font-lg) + 4px);
  color: var(--dracula-fg);
  line-height: 1.7;
}

.np-theme-desc-secondary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--dracula-fg);
  font-style: italic;
}

/* Takeaway — purple left-border accent, translucent purple bg */
.np-takeaway {
  background: rgba(189, 147, 249, 0.12);
  border-left: 4px solid var(--dracula-purple);
  border-radius: 0 8px 8px 0;
  padding: 16px 18px;
  margin: 16px 0;
}

.np-takeaway-label {
  font-size: var(--font-sm);
  color: var(--dracula-purple);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  margin-bottom: 6px;
}

.np-takeaway-text {
  font-size: calc(var(--font-lg) + 4px);
  color: var(--dracula-fg);
  line-height: 1.6;
  font-weight: 500;
}

.np-takeaway-text-secondary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(189, 147, 249, 0.2);
  color: var(--dracula-fg);
  font-style: italic;
}

/* Passage verses — white text, gold verse numbers, dark bg */
.np-verse {
  padding: 12px 0;
  font-size: calc(var(--font-lg) + 4px);
  color: var(--dracula-fg);
  line-height: 1.8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.np-verse:last-of-type {
  border-bottom: none;
}

.np-verse-num {
  display: inline-block;
  font-size: var(--font-sm);
  color: var(--gold);
  font-weight: bold;
  margin-right: 6px;
  vertical-align: super;
}

/* Bilingual secondary verse — full white, italic, gold left-border */
.np-verse-secondary {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  color: var(--dracula-fg);
  font-style: italic;
  line-height: 1.7;
}

/* Start Quiz button — shiny emerald gradient, beveled edges */
.np-start-quiz-btn {
  display: block;
  width: 100%;
  padding: 20px;
  margin-top: 24px;
  font-size: 1.4rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(145deg, #2ecc71 0%, #27ae60 50%, #1e8449 100%);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.3),
              inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.np-start-quiz-btn:active {
  transform: scale(0.97);
}

/* ─── Song Page: Behind the Song Toggle ─────────────────────────────────── */

.song-behind-wrap {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.song-behind-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  margin: 0 auto;
  padding: 14px;
  min-height: 48px;
  background: linear-gradient(145deg, #5dfc8d 0%, #50fa7b 30%, #3ad864 70%, #2ebd55 100%);
  border: none;
  border-radius: 10px;
  color: #0f172a;
  font-weight: bold;
  font-size: calc(var(--font-sm) + 4px);
  font-family: inherit;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(80, 250, 123, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.4),
              inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s;
}

.song-behind-toggle.lang-zht {
  font-size: calc(var(--font-sm) + 8px);
}

.song-behind-toggle:active {
  transform: scale(0.97);
}

.song-behind-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.3s;
}

.song-behind-toggle.expanded svg {
  transform: rotate(180deg);
}

.song-behind-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  margin-top: 0;
}

.song-behind-content.expanded {
  max-height: 50000px;
  margin-top: 20px;
  padding-bottom: 40px;
}

/* ─── Passage Toggle (long passages) ───────────────────────────────────── */
/* Hide Full Explanation toggle for now — content stays in JSON, just not shown */
#np-full-toggle, #np-full-content,
#song-full-toggle, #song-full-content { display: none; }

.np-passage-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  min-height: 48px;
  background: var(--brass-gradient);
  border: none;
  border-radius: 10px;
  color: #1a0e00;
  font-weight: bold;
  font-size: calc(var(--font-sm) + 4px);
  font-family: inherit;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  margin: 12px 0;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4),
              inset 0 -2px 4px rgba(0, 0, 0, 0.15),
              0 2px 6px rgba(0, 0, 0, 0.3);
}
.np-passage-toggle.lang-zht { font-size: calc(var(--font-sm) + 8px); }
.np-passage-toggle svg {
  width: 20px; height: 20px;
  fill: #1a0e00;
  transition: transform 0.3s;
}
.np-passage-toggle.expanded svg { transform: rotate(180deg); }
.np-passage-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.np-passage-content.expanded {
  max-height: 50000px;
}

/* ─── Back to Top Button ────────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: calc(var(--player-bar-height) + var(--safe-area-bottom) + 16px);
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(13, 40, 64, 0.9);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.2s;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:active {
  transform: scale(0.9);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}
