/* Act 2 — The 100-Gram Temporal Scale Duel */

.scale-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 22px;
}

.scale-header-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 660px;
  min-width: 0;
}

.scale-header h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.scale-header .lead {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.scale-header h1 em {
  font-style: italic;
  color: var(--past);
}

.scale-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mode-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ---------- Kinetic Brass Scale Stage ---------- */
.scale-stage-card {
  padding: 20px 22px 22px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 155, 59, 0.11), transparent 62%),
    var(--surface);
}

.scale-stage-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.scale-stage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.total-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
}

.lean-readout {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.scale-svg-wrap {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.scale-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  user-select: none;
}

/* ---------- Linked Zero-Sum 100g Controller ---------- */
.scale-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.pan-control {
  background: var(--surface-tint);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pan-control[data-tense="past"] { border-top: 3px solid var(--past); }
.pan-control[data-tense="present"] { border-top: 3px solid var(--present); }
.pan-control[data-tense="future"] { border-top: 3px solid var(--future); }

.pan-control:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(24, 24, 27, 0.06);
}

.pan-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pan-song-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  padding: 6px 9px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pan-song-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pan-song-artist {
  font-size: 12.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pan-grams {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pan-control[data-tense="past"] .pan-grams { color: var(--past); }
.pan-control[data-tense="present"] .pan-grams { color: var(--present); }
.pan-control[data-tense="future"] .pan-grams { color: var(--future); }

/* Custom Tactile Range Sliders */
.gram-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
  margin: 4px 0;
}

.gram-slider:focus-visible {
  outline: 3px solid #18181B;
  outline-offset: 6px;
  border-radius: 999px;
}

.gram-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FEF3C7 0%, #D97706 45%, #78350F 100%);
  border: 2px solid #FFFDF8;
  box-shadow: 0 2px 8px rgba(24, 24, 27, 0.28);
  cursor: grab;
  transition: transform 0.12s ease;
}

.gram-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.gram-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FEF3C7 0%, #D97706 45%, #78350F 100%);
  border: 2px solid #FFFDF8;
  box-shadow: 0 2px 8px rgba(24, 24, 27, 0.28);
  cursor: grab;
}

.pan-control[data-tense="present"] .gram-slider::-webkit-slider-thumb {
  background: radial-gradient(circle at 35% 30%, #DCFCE7 0%, #15803D 52%, #14532D 100%);
}
.pan-control[data-tense="present"] .gram-slider::-moz-range-thumb {
  background: radial-gradient(circle at 35% 30%, #DCFCE7 0%, #15803D 52%, #14532D 100%);
}

.pan-control[data-tense="future"] .gram-slider::-webkit-slider-thumb {
  background: radial-gradient(circle at 35% 30%, #DBEAFE 0%, #1D4ED8 52%, #1E3A8A 100%);
}
.pan-control[data-tense="future"] .gram-slider::-moz-range-thumb {
  background: radial-gradient(circle at 35% 30%, #DBEAFE 0%, #1D4ED8 52%, #1E3A8A 100%);
}

.stepper-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stepper-btn {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.stepper-btn:hover:not(:disabled) {
  background: var(--bg-deep);
  border-color: var(--border-strong);
}

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

.stepper-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.controller-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ---------- Mode Panels ---------- */
.mode-section {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hidden {
  display: none !important;
}

/* Author bar */
.author-bar {
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.author-field {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-soft);
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.char-counter.near { color: var(--past); }
.char-counter.full { color: var(--wax); }

/* 3 Song Cards Grid */
.songs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.song-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  min-width: 0;
}

.song-card[data-tense="past"] { border-top: 4px solid var(--past); }
.song-card[data-tense="present"] { border-top: 4px solid var(--present); }
.song-card[data-tense="future"] { border-top: 4px solid var(--future); }

.song-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.song-card-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: -4px 0 2px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.song-card textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.4;
}

.field-error {
  border-color: var(--wax) !important;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.14) !important;
}

/* Seal CTA Bar */
.seal-cta-bar {
  padding: 20px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, var(--surface) 0%, #FBF3E4 100%);
}

.seal-cta-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.seal-cta-copy h2 {
  font-size: 22px;
}

.seal-cta-copy p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Sealed Output Packet */
.sealed-packet {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 2px solid var(--past);
  background: linear-gradient(180deg, #FFFDF8 0%, #FAF4E6 100%);
}

.sealed-packet.is-stale {
  border-style: dashed;
  border-color: var(--wax);
}

.sealed-packet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sealed-packet-head h2 {
  font-size: 24px;
}

.stale-banner {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--wax-soft);
  border: 1px solid rgba(185, 28, 28, 0.25);
  color: var(--wax);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.teaser-box {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 0;
}

.packet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.packet-actions .btn {
  flex: 1 1 180px;
}

/* ---------- Mode B · Friend Guess Mode ---------- */
.guess-intro-banner {
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, #FFFDF8 0%, #F7EFE0 100%);
}

.guess-song-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.guess-song-artist {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.listen-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.listen-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-tint);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.listen-chip:hover {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

/* Frosted Wax/Brass Sealed Envelope */
.sealed-envelope {
  position: relative;
  margin-top: auto;
  border-radius: 14px;
  padding: 18px 16px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(180, 83, 9, 0.04),
      rgba(180, 83, 9, 0.04) 8px,
      rgba(255, 253, 248, 0.6) 8px,
      rgba(255, 253, 248, 0.6) 16px
    ),
    linear-gradient(160deg, #F4EBDC 0%, #E9DCC5 100%);
  border: 1.5px dashed rgba(120, 53, 15, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  min-height: 112px;
  overflow: hidden;
}

.sealed-envelope::before,
.sealed-envelope::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FDE68A, #92400E);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6);
}
.sealed-envelope::before { top: 8px; left: 8px; }
.sealed-envelope::after { top: 8px; right: 8px; }

.wax-medallion {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #EF4444 0%, #B91C1C 58%, #7F1D1D 100%);
  border: 2px solid rgba(254, 202, 202, 0.55);
  box-shadow: 0 4px 12px rgba(127, 29, 29, 0.28), inset 0 1px 2px rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFDF8;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sealed-envelope-caption {
  font-size: 12.5px;
  font-weight: 600;
  color: #78350F;
  max-width: 24ch;
}

.guess-secondary-exit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: rgba(255, 253, 248, 0.6);
  font-size: 13px;
  color: var(--muted);
}

/* Sticky Bottom Action Bar in Friend Guess Mode */
.guess-sticky-bar {
  position: sticky;
  bottom: 12px;
  z-index: 30;
  margin-top: 18px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(180, 83, 9, 0.42);
  box-shadow: 0 12px 32px rgba(24, 24, 27, 0.16), 0 2px 8px rgba(24, 24, 27, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.guess-sticky-bar.is-ready {
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98) 0%, rgba(254, 243, 199, 0.96) 100%);
  border-color: var(--past);
}

.guess-sticky-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 220px;
}

.guess-sticky-balance {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.guess-sticky-hint {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--past);
}

.guess-sticky-bar.is-ready .guess-sticky-hint {
  color: var(--present);
}

.guess-sticky-cta {
  flex-shrink: 0;
}

/* ---------- Mode C · Spring-Physics Snap Reveal ---------- */
.reveal-hero-card {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  background: linear-gradient(135deg, #FFFDF8 0%, #FBF4E4 100%);
}

.reveal-reply-row {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reveal-reply-note {
  font-size: 13.5px;
  color: var(--muted);
  flex: 1 1 240px;
}

.resonance-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.resonance-dial {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--past) calc(var(--pct, 0) * 1%), var(--bg-deep) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 1px 4px rgba(24, 24, 27, 0.12);
}

.resonance-dial-inner {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.resonance-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 850;
  color: var(--ink);
  line-height: 1;
}

.resonance-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.resonance-copy {
  min-width: 0;
}

.resonance-copy h2 {
  font-size: 26px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.resonance-copy p {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.delta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.delta-cell {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.delta-cell-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.delta-cell-nums {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.delta-badge {
  display: inline-block;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
}

.delta-pos { color: var(--present); background: var(--present-soft); }
.delta-neg { color: var(--wax); background: var(--wax-soft); }
.delta-zero { color: var(--past); background: var(--past-soft); }

/* Unsealed Reveal Quote Card with Smooth Flip */
.reveal-quote-wrap {
  perspective: 900px;
  margin-top: auto;
}

.reveal-quote-card {
  border-radius: 14px;
  padding: 16px;
  background: var(--surface-tint);
  border: 1.5px solid var(--border);
  transform-origin: top center;
  transform: rotateX(-72deg);
  opacity: 0;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

.reveal-quote-card.unsealed {
  transform: rotateX(0deg);
  opacity: 1;
}

.reveal-quote-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reveal-quote-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reveal-quote-masked {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-deep);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  margin: 0;
}

.gram-compare-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.compare-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-deep);
  overflow: hidden;
}

.compare-fill-truth {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.compare-marker-guess {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%);
}

/* Poster Export & Privacy Toggle Panel */
.export-panel {
  padding: 22px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.poster-preview-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  background: var(--bg);
  aspect-ratio: 9 / 16;
  width: 100%;
}

.poster-preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.export-panel-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.export-panel-body h2 {
  font-size: 24px;
}

/* Tactile Privacy Toggle Switch */
.privacy-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-tint);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  user-select: none;
}

.privacy-toggle-copy strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
}

.privacy-toggle-copy span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.switch-input {
  position: relative;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-deep);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(24, 24, 27, 0.22);
  transition: transform 0.18s ease;
}

.switch-input:checked {
  background: var(--ink);
  border-color: var(--ink);
}

.switch-input:checked::after {
  transform: translateX(22px);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.export-actions .btn {
  flex: 1 1 200px;
}

/* Error Notice for corrupted hash */
.error-card {
  padding: 24px;
  border: 1.5px solid var(--wax);
  background: #FFFDF8;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

/* Footer Note */
.scale-footer {
  margin-top: 32px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.72);
  border: 1px dashed var(--border-strong);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scale-footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.scale-footer a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

.scale-footer a:hover {
  color: var(--terracotta);
}

/* ---------- Mobile-First Responsive (390×844 tuned) ---------- */
@media (max-width: 900px) {
  .songs-grid {
    grid-template-columns: 1fr;
  }
  .reveal-hero-card {
    grid-template-columns: 1fr;
  }
  .export-panel {
    grid-template-columns: 1fr;
  }
  .poster-preview-frame {
    max-width: 240px;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .scale-stage-card {
    padding: 14px 14px 16px;
  }
  .scale-controls {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
  }
  .pan-control {
    padding: 11px 12px;
    gap: 8px;
  }
  .pan-grams {
    font-size: 20px;
  }
  .scale-header {
    padding: 2px 0 16px;
  }
  .scale-header-actions {
    width: 100%;
  }
  .scale-header-actions .btn {
    flex: 1;
  }
  .seal-cta-bar,
  .guess-intro-banner,
  .author-bar,
  .sealed-packet,
  .reveal-hero-card,
  .export-panel {
    padding: 16px;
  }
  .guess-sticky-bar {
    padding: 12px 14px;
    gap: 8px;
    border-radius: 18px;
  }
  .guess-sticky-copy {
    flex: 1 1 100%;
  }
  .guess-sticky-balance {
    font-size: 12px;
  }
  .guess-sticky-cta {
    width: 100%;
  }
  .reveal-reply-row .btn {
    width: 100%;
  }
  .pan-song-meta {
    padding: 5px 8px;
  }
  .pan-song-title {
    font-size: 13.5px;
  }
  .resonance-block {
    gap: 14px;
  }
  .resonance-dial {
    width: 82px;
    height: 82px;
  }
  .resonance-dial-inner {
    width: 62px;
    height: 62px;
  }
  .resonance-num {
    font-size: 19px;
  }
}
