/* ==========================================================================
   今天是太阳雨 · 指尖晴雨 (SunrainTap)
   Cinema-grade atmospheric glassmorphism & mobile 60fps safe styling
   ========================================================================== */

:root {
  --bg-top: #091824;
  --bg-mid: #153345;
  --bg-bot: #3c3121;
  --accent: #ffd166;
  --accent-2: #7ce0f9;
  --accent-rgb: 255, 209, 102;
  --accent-2-rgb: 124, 224, 249;
  --ink: #fffaf0;
  --ink-soft: rgba(255, 250, 240, 0.8);
  --ink-muted: rgba(255, 250, 240, 0.56);
  --glass-bg: rgba(10, 22, 33, 0.56);
  --glass-bg-strong: rgba(11, 24, 37, 0.84);
  --glass-border: rgba(255, 245, 220, 0.18);
  --glass-active: rgba(255, 209, 102, 0.24);
  --shadow-soft: 0 12px 36px rgba(4, 10, 18, 0.44);
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "PingFang SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --safe-top: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
  --safe-right: 0px;
}

@supports (top: env(safe-area-inset-top)) {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
  }
}

/* Theme 1: 晴雨午后 · 日光穿雨 */
body[data-theme="sunshower"] {
  --bg-top: #091824;
  --bg-mid: #163547;
  --bg-bot: #3e3222;
  --accent: #ffd166;
  --accent-2: #7ce0f9;
  --accent-rgb: 255, 209, 102;
  --accent-2-rgb: 124, 224, 249;
  --glass-bg: rgba(10, 23, 34, 0.56);
  --glass-bg-strong: rgba(12, 26, 39, 0.88);
}

/* Theme 2: 深夜便利店 · 雨夜暖窗 */
body[data-theme="convenience"] {
  --bg-top: #060b18;
  --bg-mid: #121d38;
  --bg-bot: #2f1d28;
  --accent: #ffb76b;
  --accent-2: #ff8fab;
  --accent-rgb: 255, 183, 107;
  --accent-2-rgb: 255, 143, 171;
  --glass-bg: rgba(10, 14, 29, 0.58);
  --glass-bg-strong: rgba(13, 19, 38, 0.9);
}

/* Theme 3: 破云彩虹 · 微光初晴 */
body[data-theme="rainbow"] {
  --bg-top: #112142;
  --bg-mid: #214e73;
  --bg-bot: #5c3d62;
  --accent: #ffe066;
  --accent-2: #5eead4;
  --accent-rgb: 255, 224, 102;
  --accent-2-rgb: 94, 234, 212;
  --glass-bg: rgba(17, 33, 60, 0.54);
  --glass-bg-strong: rgba(20, 38, 68, 0.88);
}

/* Theme 4: 35mm 胶片 · 定格瞬间 */
body[data-theme="film"] {
  --bg-top: #100d0b;
  --bg-mid: #1e1813;
  --bg-bot: #362619;
  --accent: #f4a261;
  --accent-2: #e9c46a;
  --accent-rgb: 244, 162, 97;
  --accent-2-rgb: 233, 196, 106;
  --glass-bg: rgba(20, 17, 14, 0.6);
  --glass-bg-strong: rgba(22, 18, 15, 0.92);
}

/* Theme 5 (越声集): 烟火本色 · 暮风暖街 */
body[data-theme="yanhuo"] {
  --bg-top: #1a110c;
  --bg-mid: #352017;
  --bg-bot: #5c3621;
  --accent: #ffb85c;
  --accent-2: #ffe2b8;
  --accent-rgb: 255, 184, 92;
  --accent-2-rgb: 255, 226, 184;
  --glass-bg: rgba(28, 17, 12, 0.58);
  --glass-bg-strong: rgba(31, 19, 14, 0.9);
}

/* Theme 6 (越声集): 逆风星光 · 破夜微芒 */
body[data-theme="xingguang"] {
  --bg-top: #070d1e;
  --bg-mid: #132346;
  --bg-bot: #27315e;
  --accent: #ffd56b;
  --accent-2: #9ad8ff;
  --accent-rgb: 255, 213, 107;
  --accent-2-rgb: 154, 216, 255;
  --glass-bg: rgba(9, 16, 36, 0.58);
  --glass-bg-strong: rgba(11, 20, 44, 0.9);
}

/* Theme 7 (越声集): 拾趣灵光 · 晴午桃光 */
body[data-theme="lingguang"] {
  --bg-top: #1a1331;
  --bg-mid: #332250;
  --bg-bot: #623654;
  --accent: #ffe169;
  --accent-2: #ff9ebb;
  --accent-rgb: 255, 225, 105;
  --accent-2-rgb: 255, 158, 187;
  --glass-bg: rgba(26, 18, 46, 0.56);
  --glass-bg-strong: rgba(30, 21, 52, 0.9);
}

/* Theme 8 (越声集): 幕落回响 · 剧场余光 */
body[data-theme="huixiang"] {
  --bg-top: #14090c;
  --bg-mid: #2a1118;
  --bg-bot: #4b1f25;
  --accent: #f6c478;
  --accent-2: #f4978e;
  --accent-rgb: 246, 196, 120;
  --accent-2-rgb: 244, 151, 142;
  --glass-bg: rgba(24, 11, 15, 0.6);
  --glass-bg-strong: rgba(28, 12, 17, 0.92);
}

/* Base reset & mobile gesture lock */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #070d14;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button,
input,
a {
  font-family: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Viewport & Stage Shell (Full-screen on mobile, phone bezel in desktop sim)
   ========================================================================== */

@supports (height: 100dvh) {
  :root { --app-vh: 100dvh; }
}

.tap-viewport {
  position: relative;
  width: 100%;
  height: 100vh;
  height: var(--app-vh, 100vh);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 24%, #152534 0%, #070c13 78%);
}

.tap-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 72% 54% at 75% 16%, rgba(var(--accent-rgb), 0.26) 0%, transparent 68%),
    radial-gradient(ellipse 66% 50% at 22% 72%, rgba(var(--accent-2-rgb), 0.16) 0%, transparent 72%),
    linear-gradient(175deg, var(--bg-top) 0%, var(--bg-mid) 56%, var(--bg-bot) 100%);
  transition: background 0.72s ease;
  isolation: isolate;
}

/* Desktop phone preview mode (#btn-mobile-sim) */
body.is-mobile-sim .tap-viewport {
  padding: 16px;
}

body.is-mobile-sim .tap-stage {
  width: min(390px, 100%);
  height: min(844px, calc(var(--app-vh, 100vh) - 32px));
  border-radius: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.65),
    0 0 0 8px rgba(10, 14, 22, 0.82),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Interactive Canvas */
.tap-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: crosshair;
  z-index: 1;
}

/* Whisper cinema vignette for poster depth (zero per-frame canvas cost) */
.cinema-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse 88% 82% at 50% 48%, transparent 56%, rgba(4, 9, 15, 0.42) 100%);
}

/* Subtle 35mm film vignette & frame markers */
.film-frame-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.55s ease;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(8, 6, 4, 0.58) 100%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 238, 210, 0.02) 0px,
      rgba(255, 238, 210, 0.02) 1px,
      transparent 1px,
      transparent 3px
    );
}

body[data-theme="film"] .film-frame-overlay {
  opacity: 1;
}

/* Subtle warm theater spotlight & velvet side vignette for 幕落回响 (zero per-frame cost) */
.theater-curtain-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s ease;
  background:
    radial-gradient(ellipse 64% 48% at 50% 8%, rgba(246, 196, 120, 0.2), transparent 72%),
    linear-gradient(90deg, rgba(16, 4, 8, 0.44) 0%, transparent 18%, transparent 82%, rgba(16, 4, 8, 0.44) 100%);
}

body[data-theme="huixiang"] .theater-curtain-overlay {
  opacity: 1;
}

/* Subtle optional touch-pad grid hints */
.tap-grid-hints {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tap-grid-hints.is-visible {
  opacity: 1;
}

.tap-grid-cell {
  border: 1px solid rgba(255, 250, 240, 0.06);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(255, 250, 240, 0.22);
  transition: background-color 0.22s ease, border-color 0.22s ease;
}

.tap-grid-cell.is-flash {
  background-color: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.34);
}

@media (max-width: 720px) {
  .tap-grid-hints {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
  }
}

body.is-mobile-sim .tap-grid-hints {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(6, 1fr);
}

/* ==========================================================================
   Top & Bottom Glass HUD (Lightweight GPU compositing, zero full-screen blur)
   ========================================================================== */

.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(12px + var(--safe-top)) calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
  min-width: 0;
}

.hud-pill,
.hud-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 250, 240, 0.14);
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hud-pill {
  padding: 0 12px;
}

.hud-icon-btn {
  width: 38px;
  font-size: 15px;
  flex-shrink: 0;
}

.hud-pill:active,
.hud-icon-btn:active {
  transform: scale(0.94);
}

.hud-pill.is-active,
.hud-icon-btn.is-active {
  background: rgba(var(--accent-rgb), 0.24);
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.26);
}

.hud-pill.is-companion {
  background: rgba(var(--accent-2-rgb), 0.2);
  border-color: rgba(var(--accent-2-rgb), 0.56);
  box-shadow: 0 0 16px rgba(var(--accent-2-rgb), 0.22);
}

.hud-pill-ledger {
  font-variant-numeric: tabular-nums;
}

.pill-ico {
  font-size: 14px;
  line-height: 1;
}

.pill-txt {
  line-height: 1;
}

.pill-txt-sub {
  line-height: 1;
  opacity: 0.78;
}

@media (max-width: 520px) {
  .pill-txt-sub {
    display: none;
  }
}

body.is-mobile-sim .pill-txt-sub {
  display: none;
}

.desktop-only {
  display: inline-flex;
}

@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}

/* First-time gentle gesture hint on stage (GPU-composited only, zero reflow) */
.stage-first-hint {
  position: absolute;
  left: 50%;
  bottom: calc(92px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  text-align: center;
  width: max-content;
  max-width: calc(100% - 24px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.stage-first-hint.is-fading {
  opacity: 0;
  transform: translateX(-50%) scale(0.95);
}

.first-hint-rings {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.first-hint-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--accent-rgb), 0.62);
  will-change: transform, opacity;
  animation: tapHintPulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.first-hint-ring.is-inner {
  inset: 10px;
  border-color: rgba(var(--accent-2-rgb), 0.56);
  animation-delay: 0.75s;
}

.first-hint-core {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(11, 24, 37, 0.76);
  border: 1px solid rgba(var(--accent-rgb), 0.52);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.34);
}

.first-hint-text {
  margin: 0;
  padding: 6px 15px;
  border-radius: 999px;
  background: rgba(10, 22, 34, 0.76);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  color: #fff6df;
  font-size: 12.5px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}

/* Lightweight in-stage dual-mode switch (sits under top-left HUD, zero mobile crowding) */
.stage-pack-switch {
  position: absolute;
  top: calc(56px + var(--safe-top));
  left: calc(14px + var(--safe-left));
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 250, 240, 0.12);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.stage-pack-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.stage-pack-btn:active {
  transform: scale(0.95);
}

.stage-pack-btn.is-active {
  background: rgba(var(--accent-rgb), 0.26);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.56);
}

/* Hide stage HUD controls while start veil is visible (zero ghost overlap behind back-home pill) */
body.is-start-screen .hud-top,
body.is-start-screen .stage-pack-switch,
body.is-start-screen .hud-bottom,
body.is-start-screen .local-track-bar {
  opacity: 0;
  pointer-events: none;
}

/* Lift first-time gesture hint above local mini-player bar when entering via local audio */
body.has-local-track .stage-first-hint {
  bottom: calc(152px + var(--safe-bottom));
}

@keyframes tapHintPulse {
  0% {
    transform: scale(0.68);
    opacity: 0;
  }
  24% {
    opacity: 0.78;
  }
  100% {
    transform: scale(1.26);
    opacity: 0;
  }
}

/* First-time Companion OST 2-step gentle card */
.companion-intro-hint {
  position: absolute;
  top: calc(96px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  width: min(400px, calc(100% - 28px));
  padding: 14px 16px 12px;
  border-radius: 20px;
  background: rgba(10, 24, 37, 0.94);
  border: 1px solid rgba(var(--accent-2-rgb), 0.45);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 250, 240, 0.14);
  color: var(--ink);
}

.companion-intro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.companion-intro-badge {
  font-size: 13px;
  font-weight: 600;
  color: #d6f7ff;
}

.companion-intro-close {
  flex-shrink: 0;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(var(--accent-2-rgb), 0.2);
  border: 1px solid rgba(var(--accent-2-rgb), 0.5);
  color: #ebfcff;
  font-size: 12px;
  font-weight: 600;
}

.companion-intro-steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.58;
  color: var(--ink-soft);
}

.companion-intro-steps strong {
  color: var(--ink);
  font-weight: 600;
}

.companion-intro-foot {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 250, 240, 0.1);
  font-size: 11.5px;
  color: var(--ink-muted);
  text-align: center;
}

/* Clean screen-record mode */
body.is-clean-mode .hud-top,
body.is-clean-mode .stage-pack-switch,
body.is-clean-mode .hud-bottom,
body.is-clean-mode .local-track-bar,
body.is-clean-mode .data-fallback-bar,
body.is-clean-mode .stage-first-hint,
body.is-clean-mode .companion-intro-hint {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

body.is-clean-mode .hud-bottom,
body.is-clean-mode .local-track-bar {
  transform: translateY(12px);
}

.exit-clean-btn {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: calc(14px + var(--safe-right));
  z-index: 15;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(10, 18, 28, 0.68);
  border: 1px solid rgba(255, 250, 240, 0.22);
  color: rgba(255, 250, 240, 0.8);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.is-clean-mode .exit-clean-btn {
  opacity: 0.78;
  pointer-events: auto;
}

/* Toast notification */
.tap-toast {
  position: absolute;
  top: calc(96px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;
  max-width: calc(100% - 32px);
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 250, 240, 0.12);
  pointer-events: none;
}

/* Weak network data fallback notice */
.data-fallback-bar {
  position: absolute;
  top: calc(96px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 28px);
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(25, 20, 12, 0.88);
  border: 1px solid rgba(255, 209, 102, 0.4);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.fallback-retry-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.22);
  border: 1px solid rgba(255, 209, 102, 0.55);
  color: #ffe8a3;
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   Local Music Mini Player Bar (above bottom theme dock)
   ========================================================================== */

.local-track-bar {
  position: absolute;
  left: 50%;
  bottom: calc(68px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 12;
  width: min(460px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 18px;
  background: var(--glass-bg-strong);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 250, 240, 0.12);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mini-icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.22);
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.track-meta {
  flex: 1 1 120px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.track-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex-shrink: 0;
}

.track-eq i {
  display: block;
  width: 2.5px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: bottom;
  transform: scaleY(0.32);
  will-change: transform;
}

.track-eq.is-playing i:nth-child(1) { animation: eqPulse 0.62s ease-in-out infinite alternate; }
.track-eq.is-playing i:nth-child(2) { animation: eqPulse 0.48s ease-in-out 0.12s infinite alternate; }
.track-eq.is-playing i:nth-child(3) { animation: eqPulse 0.56s ease-in-out 0.24s infinite alternate; }
.track-eq.is-playing i:nth-child(4) { animation: eqPulse 0.44s ease-in-out 0.08s infinite alternate; }

@keyframes eqPulse {
  from { transform: scaleY(0.24); }
  to { transform: scaleY(1); }
}

.track-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.track-time {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.track-seek {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.22);
  accent-color: var(--accent);
  cursor: pointer;
}

.track-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.7);
}

.mini-text-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.1);
  border: 1px solid rgba(255, 250, 240, 0.18);
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ==========================================================================
   Bottom Theme Dock
   ========================================================================== */

.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px calc(12px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(12px + var(--safe-left));
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-dock {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 250, 240, 0.14);
  max-width: calc(100% - 50px);
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.theme-pill:active {
  transform: scale(0.95);
}

.theme-pill.is-active {
  background: rgba(var(--accent-rgb), 0.26);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.55);
}

.tp-ico {
  font-size: 14px;
  line-height: 1;
}

.hud-mute-btn {
  pointer-events: auto;
  height: 44px;
  width: 44px;
}

/* ==========================================================================
   Start Veil Overlay — Editorial Cinema Poster Card
   ========================================================================== */

.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(58px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 209, 102, 0.16), rgba(7, 15, 24, 0.88) 72%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.start-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-back-home {
  position: absolute;
  top: calc(14px + var(--safe-top));
  left: calc(14px + var(--safe-left));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(11, 24, 37, 0.82);
  border: 1px solid rgba(255, 245, 220, 0.2);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, border-color 0.2s ease, color 0.2s ease;
}

.start-back-home:hover {
  color: var(--ink);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.start-back-home:active {
  transform: scale(0.95);
}

.start-card {
  width: min(444px, 100%);
  margin: auto 0;
  padding: 24px 22px 20px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse 90% 45% at 50% 0%, rgba(var(--accent-rgb), 0.14), transparent 70%),
    linear-gradient(165deg, rgba(16, 36, 52, 0.93), rgba(9, 19, 31, 0.96));
  border: 1px solid rgba(255, 244, 214, 0.22);
  box-shadow:
    0 26px 68px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 250, 240, 0.16);
  text-align: center;
  transition: background 0.55s ease, border-color 0.45s ease;
}

body[data-pack="yuesheng"] .start-card {
  background:
    radial-gradient(ellipse 92% 48% at 50% 0%, rgba(var(--accent-rgb), 0.18), transparent 72%),
    linear-gradient(165deg, rgba(42, 24, 18, 0.94), rgba(18, 11, 14, 0.97));
  border-color: rgba(255, 214, 150, 0.28);
}

/* A/B Album Capsule Switcher (太阳雨 | 越声集) */
.start-pack-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 245, 220, 0.16);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
}

.pack-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 102px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.15s ease;
}

.pack-pill:active {
  transform: scale(0.96);
}

.pack-pill.is-active {
  background: rgba(var(--accent-rgb), 0.26);
  color: var(--ink);
  font-weight: 600;
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.62),
    0 4px 14px rgba(var(--accent-rgb), 0.18);
}

.pack-ico {
  font-size: 14px;
  line-height: 1;
}

.start-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.13);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  color: #ffe7ad;
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.badge-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.start-title {
  margin: 0 0 9px;
  font-family: var(--font-serif);
  font-size: clamp(29px, 7.6vw, 37px);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.24;
  color: #fffaf0;
  text-shadow: 0 6px 26px rgba(255, 209, 102, 0.28);
}

.start-subtitle {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.start-sub-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.start-cta-resume,
.start-cta-primary,
.start-cta-secondary {
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.start-cta-resume {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  font-size: 14px;
  background: rgba(var(--accent-2-rgb), 0.18);
  border: 1px solid rgba(var(--accent-2-rgb), 0.56);
  color: #e8fcff;
  box-shadow: 0 8px 22px rgba(4, 14, 24, 0.28);
}

.start-cta-resume:active {
  transform: scale(0.97);
}

.start-cta-resume span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-cta-primary {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  font-size: 15.5px;
  background: linear-gradient(135deg, #ffe08a 0%, #ffb752 100%);
  color: #1f1608;
  box-shadow: 0 10px 28px rgba(255, 195, 86, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.start-cta-primary:active {
  transform: scale(0.97);
}

.start-cta-secondary {
  min-height: 56px;
  padding: 9px 10px;
  flex-direction: column;
  gap: 3px;
  background: rgba(255, 250, 240, 0.08);
  border: 1px solid rgba(255, 250, 240, 0.2);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
}

.start-cta-secondary:active {
  transform: scale(0.97);
}

.cta-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1.25;
  white-space: nowrap;
}

.cta-sub {
  font-size: 10.5px;
  line-height: 1.3;
  font-weight: 400;
  color: var(--ink-muted);
}

.start-steps {
  list-style: none;
  margin: 15px 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.start-steps li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.06);
  border: 1px solid rgba(255, 250, 240, 0.1);
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink-soft);
}

.start-legal {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 250, 240, 0.1);
  font-size: 11px;
  line-height: 1.65;
  color: rgba(255, 250, 240, 0.48);
}

.start-legal a {
  color: rgba(255, 224, 150, 0.84);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   Bottom Sheets & Quote Ledger Drawer
   ========================================================================== */

.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 24;
  background: rgba(4, 10, 18, 0.68);
}

.sheet-modal,
.ledger-drawer {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 28;
  width: min(500px, 100%);
  max-height: 84%;
  display: flex;
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: rgba(11, 22, 34, 0.97);
  border: 1px solid rgba(255, 244, 214, 0.2);
  border-bottom: 0;
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.54), inset 0 1px 0 rgba(255, 250, 240, 0.14);
  padding-bottom: calc(16px + var(--safe-bottom));
  overflow: hidden;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.24);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px 12px;
  border-bottom: 1px solid rgba(255, 250, 240, 0.1);
  flex-shrink: 0;
}

.sheet-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
}

.sheet-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.sheet-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.1);
  color: var(--ink-soft);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 3-Track Audio Mode Switcher */
.mode-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 250, 240, 0.12);
}

.mode-tab {
  min-height: 40px;
  padding: 6px 6px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mode-tab.is-active {
  background: rgba(var(--accent-rgb), 0.24);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.56);
}

.mode-tab-ico {
  font-size: 14px;
  line-height: 1;
}

.sheet-block {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.045);
  border: 1px solid rgba(255, 250, 240, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-block-companion {
  border-color: rgba(var(--accent-2-rgb), 0.26);
  background: rgba(var(--accent-2-rgb), 0.055);
}

.sheet-block-ost {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.06);
}

.sheet-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sheet-block-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.sheet-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.1);
  color: var(--ink-soft);
}

.sheet-tag-gold {
  background: rgba(var(--accent-rgb), 0.2);
  color: #ffe6a8;
}

.sheet-tag-cyan {
  background: rgba(var(--accent-2-rgb), 0.2);
  color: #d6f7ff;
}

.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sheet-row-compact {
  padding-top: 2px;
}

.sheet-row-info {
  flex: 1 1 160px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-row-info strong {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}

.sheet-row-info span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.toggle-chip {
  flex-shrink: 0;
  min-width: 68px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.1);
  border: 1px solid rgba(255, 250, 240, 0.2);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}

.toggle-chip.is-on {
  background: rgba(var(--accent-rgb), 0.24);
  border-color: rgba(var(--accent-rgb), 0.65);
  color: #fff8e6;
}

.sheet-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}

.sheet-primary-btn,
.sheet-secondary-btn {
  width: 100%;
  min-height: 45px;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, opacity 0.18s ease;
}

.sheet-primary-btn {
  background: linear-gradient(135deg, #ffe08a 0%, #ffb752 100%);
  color: #1f1608;
  box-shadow: 0 8px 22px rgba(255, 195, 86, 0.26);
}

.sheet-secondary-btn {
  background: rgba(var(--accent-2-rgb), 0.16);
  border: 1px solid rgba(var(--accent-2-rgb), 0.45);
  color: #e6fbff;
}

.sheet-secondary-btn.is-active {
  background: rgba(var(--accent-2-rgb), 0.28);
  border-color: rgba(var(--accent-2-rgb), 0.72);
  color: #ffffff;
}

.sheet-primary-btn:active,
.sheet-secondary-btn:active {
  transform: scale(0.98);
}

.seg-control {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 250, 240, 0.14);
}

.seg-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.seg-btn.is-active {
  background: rgba(var(--accent-rgb), 0.28);
  color: var(--ink);
  font-weight: 600;
}

.sheet-tip-ios {
  margin: 2px 0 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(var(--accent-2-rgb), 0.08);
  border: 1px solid rgba(var(--accent-2-rgb), 0.22);
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(230, 249, 255, 0.86);
}

.sheet-status {
  font-size: 12px;
  color: #ffe6a8;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 250, 240, 0.08);
  line-height: 1.45;
}

/* Patient Help Sheet */
.help-body {
  gap: 10px;
  padding-bottom: 14px;
}

.help-card {
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.05);
  border: 1px solid rgba(255, 250, 240, 0.11);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-card-soft {
  background: rgba(var(--accent-2-rgb), 0.06);
  border-color: rgba(var(--accent-2-rgb), 0.22);
}

.help-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff6df;
}

.help-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}

.help-list strong,
.help-paragraph strong {
  color: var(--ink);
  font-weight: 600;
}

.help-list code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 250, 240, 0.12);
  color: #ffe8a8;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.help-paragraph {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.68;
  color: var(--ink-soft);
}

.help-legal-note {
  margin: 2px 0 0;
  padding: 0 4px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-muted);
  text-align: center;
}

/* Quote Ledger Drawer specifics */
.ledger-progress {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.ledger-pack-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 16px 0;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 250, 240, 0.12);
  flex-shrink: 0;
}

.ledger-pack-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ledger-pack-btn.is-active {
  background: rgba(var(--accent-rgb), 0.24);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.56);
}

.ledger-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.ledger-filters::-webkit-scrollbar {
  display: none;
}

.ledger-tab {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.08);
  border: 1px solid rgba(255, 250, 240, 0.14);
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.ledger-tab.is-active {
  background: rgba(var(--accent-rgb), 0.24);
  border-color: rgba(var(--accent-rgb), 0.62);
  color: var(--ink);
  font-weight: 600;
}

.ledger-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ledger-empty {
  margin: 0;
  padding: 13px 15px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

.ledger-mystery-note {
  margin: 0;
  padding: 7px 8px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

.ledger-card {
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.055);
  border: 1px solid rgba(255, 250, 240, 0.12);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}

.ledger-card.is-unlocked:active {
  transform: scale(0.985);
}

.ledger-card.is-unlocked:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.42);
}

.ledger-card.is-locked {
  opacity: 0.62;
  cursor: default;
}

.ledger-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ledger-tag {
  font-size: 11.5px;
  color: #ffe5a6;
  letter-spacing: 0.03em;
}

.ledger-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  color: #ffe8b3;
  white-space: nowrap;
}

.ledger-badge.is-ssr {
  background: linear-gradient(135deg, rgba(255, 214, 102, 0.34), rgba(255, 143, 171, 0.26));
  border: 1px solid rgba(255, 214, 102, 0.5);
  color: #fff6db;
  font-weight: 600;
}

.ledger-quote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}

.ledger-locked-hint {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.ledger-replay-hint {
  font-size: 11px;
  color: var(--ink-muted);
}

.ledger-footer {
  padding: 10px 16px 2px;
  border-top: 1px solid rgba(255, 250, 240, 0.08);
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  flex-shrink: 0;
}

/* ==========================================================================
   Small Phone Refinements (<= 410px & Desktop Phone Simulator)
   ========================================================================== */

@media (max-width: 410px) {
  .hud-top {
    padding-left: calc(10px + var(--safe-left));
    padding-right: calc(10px + var(--safe-right));
  }
  .stage-pack-switch {
    top: calc(52px + var(--safe-top));
    left: calc(10px + var(--safe-left));
  }
  .stage-pack-btn {
    height: 24px;
    padding: 0 8.5px;
    font-size: 11px;
  }
  .hud-group {
    gap: 5px;
  }
  .hud-pill {
    height: 34px;
    padding: 0 8.5px;
    font-size: 11.5px;
    gap: 4px;
  }
  .hud-icon-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
  .theme-pill {
    height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }
  .hud-mute-btn {
    width: 40px;
    height: 40px;
  }
  .start-card {
    padding: 20px 16px 16px;
    border-radius: 24px;
  }
  .pack-pill {
    min-width: 92px;
    height: 32px;
    padding: 0 11px;
    font-size: 12.5px;
  }
  .start-cta-secondary {
    font-size: 12.5px;
    padding: 8px 6px;
  }
  .cta-sub {
    font-size: 10px;
  }
  .start-steps li {
    font-size: 11px;
    padding: 3.5px 8px;
  }
  .mode-tab {
    font-size: 11.5px;
    padding: 6px 4px;
    gap: 3px;
  }
  .ledger-pack-bar {
    margin: 8px 12px 0;
  }
  .ledger-pack-btn {
    height: 32px;
    font-size: 12px;
  }
  .ledger-filters {
    gap: 5px;
    padding: 10px 12px;
  }
  .ledger-tab {
    padding: 0 8.5px;
    font-size: 11.5px;
  }
}

body.is-mobile-sim .stage-pack-switch {
  top: calc(52px + var(--safe-top));
  left: 10px;
}

body.is-mobile-sim .stage-pack-btn {
  height: 24px;
  padding: 0 8.5px;
  font-size: 11px;
}

body.is-mobile-sim .pack-pill {
  min-width: 92px;
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}

body.is-mobile-sim .ledger-pack-bar {
  margin: 8px 12px 0;
}

body.is-mobile-sim .ledger-pack-btn {
  height: 32px;
  font-size: 12px;
}

body.is-mobile-sim .ledger-filters {
  gap: 5px;
  padding: 10px 12px;
}

body.is-mobile-sim .ledger-tab {
  padding: 0 8.5px;
  font-size: 11.5px;
}

body.is-mobile-sim .hud-top {
  padding-left: 10px;
  padding-right: 10px;
}

body.is-mobile-sim .hud-group {
  gap: 5px;
}

body.is-mobile-sim .hud-pill {
  height: 34px;
  padding: 0 8.5px;
  font-size: 11.5px;
  gap: 4px;
}

body.is-mobile-sim .hud-icon-btn {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

body.is-mobile-sim .theme-pill {
  height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

body.is-mobile-sim .hud-mute-btn {
  width: 40px;
  height: 40px;
}

body.is-mobile-sim .start-card {
  padding: 20px 16px 16px;
  border-radius: 24px;
}

body.is-mobile-sim .start-cta-secondary {
  font-size: 12.5px;
  padding: 8px 6px;
}

body.is-mobile-sim .cta-sub {
  font-size: 10px;
}

body.is-mobile-sim .start-steps li {
  font-size: 11px;
  padding: 3.5px 8px;
}

body.is-mobile-sim .mode-tab {
  font-size: 11.5px;
  padding: 6px 4px;
  gap: 3px;
}

/* ==========================================================================
   Share Triggers, Cinema Poster Sheet & Clean-Mode Fade (Art-Directed)
   ========================================================================== */

.start-share-btn {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: calc(14px + var(--safe-right));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid rgba(var(--accent-rgb), 0.44);
  color: #fff6df;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 250, 240, 0.14);
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.start-share-btn:hover {
  background: rgba(var(--accent-rgb), 0.26);
  border-color: rgba(var(--accent-rgb), 0.72);
}

.start-share-btn:active {
  transform: scale(0.95);
}

.start-shared-hint {
  margin: -10px 0 16px;
  padding: 8px 13px;
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  color: #ffe8b3;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* Floating stage share pill: mirrors top-left stage-pack-switch on top-right */
.stage-share-btn {
  position: absolute;
  top: calc(56px + var(--safe-top));
  right: calc(14px + var(--safe-right));
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  color: #fff6df;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 250, 240, 0.12);
  transition: opacity 0.3s ease, transform 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.stage-share-btn:hover {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.6);
}

.stage-share-btn:active {
  transform: scale(0.95);
}

body.is-start-screen .stage-share-btn {
  opacity: 0;
  pointer-events: none;
}

body.is-clean-mode .stage-share-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

/* Clean recording exit pill gently fades after 2.2s so screen recordings stay cinema-pure */
body.is-clean-mode .exit-clean-btn.is-faded {
  opacity: 0.16;
  background: rgba(10, 18, 28, 0.28);
  border-color: rgba(255, 250, 240, 0.12);
}

body.is-clean-mode .exit-clean-btn.is-faded:hover,
body.is-clean-mode .exit-clean-btn.is-faded:focus-visible {
  opacity: 0.85;
  background: rgba(10, 18, 28, 0.72);
}

/* Ledger header & per-card share action (non-nested accessible buttons) */
.ledger-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ledger-share-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  color: #fff4d2;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.14s ease, background-color 0.2s ease;
}

.ledger-share-all-btn:active {
  transform: scale(0.96);
}

.ledger-card-main {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: inherit;
}

.ledger-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 250, 240, 0.08);
}

.ledger-card-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.15);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  color: #ffe8b3;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.18s ease, transform 0.14s ease;
}

.ledger-card-share-btn:hover {
  background: rgba(var(--accent-rgb), 0.26);
}

.ledger-card-share-btn:active {
  transform: scale(0.95);
}

/* Share Poster Modal */
.share-sheet {
  max-height: 88%;
}

.share-body {
  gap: 11px;
  padding-bottom: 14px;
}

.share-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 250, 240, 0.12);
}

.share-mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.share-mode-tab.is-active {
  background: rgba(var(--accent-rgb), 0.24);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.56);
}

.share-poster-frame {
  position: relative;
  flex-shrink: 0;
  width: min(252px, 68vw);
  aspect-ratio: 2 / 3;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 45% at 50% 12%, rgba(var(--accent-rgb), 0.18), transparent 70%),
    rgba(6, 13, 21, 0.86);
  border: 1px solid rgba(255, 244, 214, 0.24);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 250, 240, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-poster-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  -webkit-touch-callout: default;
  user-select: auto;
  -webkit-user-select: auto;
}

.share-poster-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
  background: rgba(8, 17, 27, 0.72);
}

.share-poster-tip {
  margin: -2px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

.share-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.share-actions-grid .sheet-primary-btn,
.share-actions-grid .sheet-secondary-btn {
  min-height: 43px;
  padding: 9px 10px;
  font-size: 13px;
  gap: 5px;
}

.share-record-btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 13px;
  background: rgba(255, 250, 240, 0.06);
  border: 1px solid rgba(255, 250, 240, 0.16);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}

.share-record-btn:hover {
  background: rgba(255, 250, 240, 0.11);
  border-color: rgba(var(--accent-rgb), 0.36);
  color: var(--ink);
}

.share-record-btn:active {
  transform: scale(0.98);
}

.share-copy-fallback {
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.share-copy-fallback-label {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #ffe8b3;
}

.share-copy-text {
  width: 100%;
  min-height: 66px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 250, 240, 0.18);
  background: rgba(8, 17, 27, 0.82);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  resize: none;
}

.share-watermark-box {
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.045);
  border: 1px solid rgba(255, 250, 240, 0.1);
}

@media (max-width: 410px) {
  .start-share-btn {
    height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }
  .stage-share-btn {
    top: calc(52px + var(--safe-top));
    right: calc(10px + var(--safe-right));
    height: 30px;
    padding: 0 9.5px;
    font-size: 11px;
  }
  .share-poster-frame {
    width: min(218px, 60vw);
  }
  .share-actions-grid .sheet-primary-btn,
  .share-actions-grid .sheet-secondary-btn {
    font-size: 12.5px;
    padding: 8px 8px;
  }
  .ledger-share-all-btn {
    height: 30px;
    padding: 0 9px;
    font-size: 11.5px;
  }
}

body.is-mobile-sim .start-share-btn {
  height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

body.is-mobile-sim .stage-share-btn {
  top: calc(52px + var(--safe-top));
  right: 10px;
  height: 30px;
  padding: 0 9.5px;
  font-size: 11px;
}

body.is-mobile-sim .share-poster-frame {
  width: 214px;
}

body.is-mobile-sim .share-actions-grid .sheet-primary-btn,
body.is-mobile-sim .share-actions-grid .sheet-secondary-btn {
  font-size: 12.5px;
  padding: 8px 8px;
}

body.is-mobile-sim .ledger-share-all-btn {
  height: 30px;
  padding: 0 9px;
  font-size: 11.5px;
}

@media (prefers-reduced-motion: reduce) {
  .track-eq.is-playing i {
    animation: none;
    transform: scaleY(0.58);
  }
  .first-hint-ring {
    animation: none;
    opacity: 0.45;
  }
}
