/* ==========================================================================
   01.12 — GỬI KHÁNH · TRẠM NGHỈ ĐẦU ĐÔNG
   Editorial Tabletop Aesthetic • 3D Cake & 60fps Candlelight
   Desktop + iPhone 14 (390x844) Clean Cascade Architecture
   ========================================================================== */

:root {
  /* Dim Room State (before turning on desk lamp) */
  --bg-room: #14100D;
  --bg-card: #1F1915;
  --bg-surface: #28201B;
  --bg-paper: #2D241E;
  --border-subtle: rgba(216, 154, 82, 0.22);
  --border-strong: rgba(216, 154, 82, 0.42);
  --text-primary: #EFE4D4;
  --text-secondary: #C2B09B;
  --text-muted: #8F7D6A;
  --accent-amber: #D89A52;
  --accent-amber-soft: rgba(216, 154, 82, 0.16);
  --accent-stamp: #B85A3A;
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.65);

  /* Typography */
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Lit Room State (once the table lamp is switched on) */
body[data-lamp="lit"] {
  --bg-room: #1E1713;
  --bg-card: #F6EFE4;
  --bg-surface: #EFE5D6;
  --bg-paper: #FBF7F0;
  --border-subtle: rgba(110, 82, 54, 0.2);
  --border-strong: rgba(110, 82, 54, 0.42);
  --text-primary: #261C15;
  --text-secondary: #5A4738;
  --text-muted: #87705C;
  --accent-amber: #B56E29;
  --accent-amber-soft: rgba(181, 110, 41, 0.12);
  --accent-stamp: #9E3E22;
  --shadow-card: 0 26px 70px rgba(10, 7, 5, 0.52), 0 0 100px rgba(235, 173, 96, 0.16);
}

/* Candlelight Dark Mode when 29 candles are burning */
body[data-lamp="lit"][data-candlelight="dark"] {
  --bg-room: #100C09;
  --bg-card: #1F1813;
  --bg-surface: #2A211B;
  --bg-paper: #2E241D;
  --border-subtle: rgba(232, 168, 90, 0.25);
  --border-strong: rgba(232, 168, 90, 0.48);
  --text-primary: #F7ECDC;
  --text-secondary: #D4C1AA;
  --text-muted: #9E8A74;
  --accent-amber: #E5A253;
  --accent-amber-soft: rgba(229, 162, 83, 0.16);
  --shadow-card: 0 28px 80px rgba(0, 0, 0, 0.8), 0 0 120px rgba(245, 166, 66, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background-color: var(--bg-room);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background-color 0.85s cubic-bezier(0.22, 1, 0.36, 1), color 0.6s ease;
}

/* Ambient dust canvas & warm lamp radial glow */
#ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.room-lighting {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(236, 171, 88, 0.12), transparent 58%),
    radial-gradient(circle at 50% 85%, rgba(164, 102, 43, 0.08), transparent 65%);
  opacity: 0.45;
  transition: opacity 1s ease, background 1s ease;
}

body[data-lamp="lit"] .room-lighting {
  opacity: 1;
  background:
    radial-gradient(circle at 50% 22%, rgba(245, 184, 98, 0.34), transparent 62%),
    radial-gradient(circle at 50% 80%, rgba(216, 146, 68, 0.18), transparent 68%);
}

/* Subtle organic paper grain overlay */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.035;
  background-image: radial-gradient(#000 0.65px, transparent 0.65px);
  background-size: 12px 12px;
}

/* ==========================================================================
   FLOATING MUSIC TOGGLE (CORNER)
   ========================================================================== */

.floating-music-wrap {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 25;
}

.turntable-toggle {
  appearance: none;
  border: 1px solid rgba(216, 154, 82, 0.38);
  background: rgba(24, 19, 15, 0.84);
  backdrop-filter: blur(10px);
  color: #EFE4D4;
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}

.turntable-toggle:hover {
  border-color: rgba(232, 168, 90, 0.75);
  transform: translateY(-1px);
}

.record-platter {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #D89A52 0 24%, #1A1410 26% 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  position: relative;
  display: inline-block;
}

.turntable-toggle.is-playing .record-platter {
  animation: spinRecord 4.5s linear infinite;
}

@keyframes spinRecord {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   MAIN DESK STAGE & CARD FRAME + DIRECTIONAL STATION TRANSITIONS
   ========================================================================== */

.desk-stage {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.desk-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: min(100%, 670px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition:
    background-color 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.8s ease,
    box-shadow 0.8s ease;
}

/* Double inner editorial rule border */
.desk-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 15px;
  pointer-events: none;
  opacity: 0.55;
  z-index: 2;
}

/* Directional Slide + Fade Transitions */
.station {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(18px) scale(0.992);
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.44s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.42s;
}

.station[data-exit="left"] {
  transform: translateX(-18px) scale(0.992);
}

.station[data-exit="right"] {
  transform: translateX(18px) scale(0.992);
}

.station.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  z-index: 3;
}

.station-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 26px 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ==========================================================================
   EDITORIAL HEADERS & TYPOGRAPHY
   ========================================================================== */

.section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-header.section-header-inline {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.station-title {
  font-family: var(--font-serif);
  font-size: clamp(1.52rem, 4.2vw, 2.02rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  outline: none;
}

.station-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent-amber);
}

.station-lead {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.68;
}

.station-sub {
  font-size: 0.91rem;
  color: var(--text-secondary);
  line-height: 1.56;
}

.mono-inline {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   MÀN 1: DESK LAMP ILLUSTRATION & BALANCED WELCOME LAYOUT
   ========================================================================== */

.welcome-scroll {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding-top: 30px;
  padding-bottom: 30px;
}

.welcome-top-stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.stamp-line {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
  opacity: 0.65;
}

.stamp-text {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--accent-amber);
  font-weight: 500;
}

.lamp-illustration-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2px 0;
}

.lamp-scene-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 16px;
  transition: transform 0.25s ease;
}

.lamp-scene-btn:hover {
  transform: translateY(-2px);
}

.lamp-halo {
  position: absolute;
  top: 4%;
  width: 235px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 184, 103, 0.36) 0%, transparent 72%);
  opacity: 0.14;
  pointer-events: none;
  transition: opacity 0.85s ease;
}

body[data-lamp="lit"] .lamp-halo {
  opacity: 1;
}

.desk-lamp-svg {
  width: min(255px, 64vw);
  height: auto;
  overflow: visible;
}

.lamp-light-cone,
.lamp-bulb-glow {
  opacity: 0.08;
  transition: opacity 0.75s ease;
}

body[data-lamp="lit"] .lamp-light-cone {
  opacity: 1;
}

body[data-lamp="lit"] .lamp-bulb-glow {
  opacity: 0.95;
}

body[data-lamp="lit"] .lamp-shade-body {
  fill: #E8B872;
  stroke: #9A6424;
}

.lamp-pull-cord {
  transform-origin: 147px 92px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lamp-scene-btn:active .lamp-pull-cord,
.lamp-pull-cord.is-pulled {
  transform: translateY(7px);
}

.lamp-caption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.editorial-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 450px;
}

.welcome-scroll .station-actions {
  justify-content: center;
  width: 100%;
  padding-top: 6px;
}

/* ==========================================================================
   MÀN 2: 3D CAKE, NUMBER CANDLE SWAP, MATCHSTICK LIGHTING & POLAROID TOPPER
   ========================================================================== */

.cake-station-scroll {
  gap: 12px;
}

.cake-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: auto 0;
}

/* Warm dynamic candlelight glow behind the cake */
.candle-room-glow {
  position: absolute;
  top: -15px;
  width: 330px;
  height: 265px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 178, 66, 0.52) 0%, rgba(235, 138, 38, 0.2) 50%, transparent 74%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.5s ease;
}

.cake-stage[data-state="lit"] .candle-room-glow {
  opacity: 1;
  animation: candleGlowPulse 3.2s ease-in-out infinite;
}

@keyframes candleGlowPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.94;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

.cake-viewport {
  position: relative;
  width: min(430px, 92vw);
  aspect-ratio: 380 / 285;
  user-select: none;
  touch-action: none;
}

.birthday-cake-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.num-candle-right {
  transform-origin: 196px 88px;
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.num-candle-right.is-swapping {
  transform: translateY(-18px) scale(1.14);
}

/* Matchstick appearance when ready to light candles */
.wooden-match-group {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.cake-stage[data-state="match"] .wooden-match-group {
  opacity: 1;
}

.flame-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* Hit targets matching shifted candle centers (154 & 196 in 380 viewBox) */
.candle-hit {
  position: absolute;
  top: 4%;
  width: 11.5%;
  height: 33%;
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 5;
  border-radius: 12px;
}

.candle-hit-left {
  left: 34.5%;
}

.candle-hit-right {
  left: 46%;
}

.candle-hit:focus-visible {
  outline: 1.5px dashed var(--accent-amber);
}

/* SVG-Anchored Polaroid Cake Topper at (256, 99) rotated 14deg */
.cake-photo-hitbox {
  position: absolute;
  top: 3%;
  left: 59%;
  width: 22%;
  height: 33%;
  z-index: 6;
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transform: rotate(14deg);
  border-radius: 8px;
}

.svg-photo-topper {
  transform: translate(256px, 99px) rotate(14deg);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cake-viewport:has(.cake-photo-hitbox:hover) .svg-photo-topper {
  transform: translate(256px, 96px) rotate(10deg) scale(1.06);
}

.cake-stage[data-state="lit"] .svg-polaroid-frame {
  stroke: #F3B35E;
  stroke-width: 1.8px;
}

/* Gentle gleam hint across the Polaroid photo on screen entry */
.station.is-active .topper-photo-sheen {
  animation: topperSheenHint 1.4s ease-in-out 0.6s 1;
}

@keyframes topperSheenHint {
  0%, 100% {
    opacity: 0;
  }
  45% {
    opacity: 0.28;
  }
}

/* Lightbox popup when user taps the cake photo topper */
.topper-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(14, 10, 8, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeSlideUp 0.25s ease forwards;
}

.topper-lightbox[hidden] {
  display: none !important;
}

.topper-lightbox-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: #FFFDF8;
  border: 1px solid #C9AD88;
  border-radius: 14px;
  padding: 12px 12px 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  transform: rotate(1.5deg);
  text-align: center;
}

.topper-lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(216, 154, 82, 0.5);
  background: #231A14;
  color: #F6EAD9;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.topper-lightbox-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 4.3;
  border-radius: 8px;
  overflow: hidden;
  background: #2B211A;
}

.topper-lightbox-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.topper-lightbox-note {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.96rem;
  font-weight: 600;
  color: #3B281B;
}

/* Interactive Breath / Blow Meter Panel */
.blow-panel {
  width: 100%;
  max-width: 360px;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.blow-panel[hidden],
.wish-reveal-box[hidden] {
  display: none !important;
}

.breath-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.breath-percent {
  color: var(--accent-amber);
  font-weight: 500;
}

.breath-meter-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.breath-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #D89A52, #F4BC6A, #FFE2A8);
  transition: width 0.06s linear;
}

.breath-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
}

.wish-reveal-box {
  width: 100%;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 13px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeSlideUp 0.45s ease forwards;
}

.wish-headline {
  font-family: var(--font-serif);
  font-size: 1.14rem;
  font-weight: 600;
  color: var(--accent-amber);
}

.wish-subtext {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.cake-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cake-primary-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-editorial-ghost.is-listening {
  border-color: var(--accent-amber);
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
}

/* ==========================================================================
   MÀN 3: HANDWRITTEN LETTER (DEDICATED SCREEN)
   ========================================================================== */

.paper-letter {
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.paper-letter.paper-letter-full {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.paper-letter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.paper-letter-body {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  font-size: 0.95rem;
  line-height: 1.76;
  color: var(--text-primary);
  padding-right: 4px;
}

.typewriter-output p {
  margin-bottom: 12px;
}

.typewriter-output p:last-child {
  margin-bottom: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--accent-amber);
}

.sig-heart {
  color: var(--accent-stamp);
  display: inline-block;
  margin-left: 2px;
}

.typewriter-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-amber);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: caretBlink 0.9s steps(2, start) infinite;
}

@keyframes caretBlink {
  to {
    visibility: hidden;
  }
}

/* ==========================================================================
   MÀN 4: DEDICATED VOUCHER SCREEN
   ========================================================================== */

.vouchers-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.voucher-stage {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.paper-voucher {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 104px 1fr;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.paper-voucher:hover {
  transform: translateY(-1px);
  border-color: var(--accent-amber);
}

.voucher-stub {
  padding: 20px 12px;
  border-right: 1.5px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  font-family: var(--font-mono);
  text-align: center;
}

.stub-serial {
  font-size: 0.72rem;
  color: var(--accent-amber);
  font-weight: 500;
}

.stub-zone {
  font-size: 0.66rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.voucher-main {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voucher-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voucher-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.voucher-stamp {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent-stamp);
  border: 1.5px solid var(--accent-stamp);
  padding: 1px 6px;
  border-radius: 4px;
  transform: rotate(-6deg) scale(1.1);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.paper-voucher.is-claimed {
  background: var(--accent-amber-soft);
  border-color: var(--accent-amber);
}

.paper-voucher.is-claimed .voucher-stamp {
  opacity: 1;
  transform: rotate(-4deg) scale(1);
}

.voucher-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.voucher-note {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.48;
}

.voucher-feedback {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.25s ease;
}

.voucher-feedback.is-active {
  color: var(--accent-amber);
  font-weight: 500;
}

/* ==========================================================================
   BUTTONS & ACTIONS
   ========================================================================== */

.station-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.station-actions.split-actions {
  justify-content: space-between;
}

.btn-editorial-primary {
  appearance: none;
  border: 1px solid var(--accent-amber);
  background: var(--accent-amber);
  color: #FFFBF4;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease, opacity 0.35s ease;
  box-shadow: 0 6px 18px rgba(181, 110, 41, 0.25);
}

.btn-editorial-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-editorial-primary:active {
  transform: translateY(0);
}

.btn-editorial-primary.is-waiting {
  opacity: 0.45;
  box-shadow: none;
}

.btn-editorial-primary.is-ready-pulse {
  animation: gentleBtnPulse 2s ease-in-out infinite;
}

@keyframes gentleBtnPulse {
  0%, 100% {
    box-shadow: 0 6px 18px rgba(181, 110, 41, 0.26);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(216, 154, 82, 0.22), 0 8px 22px rgba(181, 110, 41, 0.42);
  }
}

.btn-editorial-primary[hidden],
.btn-editorial-ghost[hidden] {
  display: none !important;
}

.btn-editorial-ghost {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.btn-editorial-ghost.btn-icon-only,
.btn-editorial-primary.btn-icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  line-height: 1;
}

.btn-editorial-ghost:hover {
  color: var(--text-primary);
  border-color: var(--accent-amber);
  background: var(--accent-amber-soft);
}

.btn-text-toggle {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent-amber);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 6px;
}

.btn-text-toggle:hover {
  opacity: 0.8;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   RESPONSIVE OVERRIDES (PLACED LAST SO IPHONE 14 390x844 NEVER GETS OVERRIDDEN)
   ========================================================================== */

@media (max-width: 600px) {
  .desk-stage {
    padding: calc(max(12px, env(safe-area-inset-top)) + 42px) 12px max(12px, env(safe-area-inset-bottom));
  }
  .desk-card {
    height: 100%;
    max-height: 740px;
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  .station-scroll {
    padding: 18px 16px 18px;
    gap: 10px;
  }
  .welcome-scroll {
    gap: 16px;
    padding-top: 22px;
    padding-bottom: 22px;
  }
  .station-title {
    font-size: 1.44rem;
  }
  .station-sub,
  .station-lead {
    font-size: 0.87rem;
    line-height: 1.52;
  }
  .desk-lamp-svg {
    width: min(215px, 56vw);
  }
  .cake-viewport {
    width: min(340px, 86vw);
  }
  .blow-panel,
  .wish-reveal-box {
    padding: 9px 12px;
  }
  .wish-headline {
    font-size: 1.04rem;
  }
  .wish-subtext {
    font-size: 0.82rem;
  }
  .paper-letter {
    padding: 15px 16px;
  }
  .paper-letter-body {
    font-size: 0.89rem;
    line-height: 1.66;
  }
  .btn-editorial-primary {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
  .btn-editorial-ghost {
    padding: 9px 12px;
    font-size: 0.82rem;
  }
  .paper-voucher {
    grid-template-columns: 82px 1fr;
  }
  .voucher-stub {
    padding: 14px 8px;
  }
  .voucher-main {
    padding: 14px 14px;
  }
  .voucher-name {
    font-size: 1.04rem;
  }
  .voucher-note {
    font-size: 0.81rem;
  }
}
