/* ==========================================================================
   TIỆM BÁNH BÍ MẬT CỦA CHI • 26/11/2002
   MINT & WHITE LUXURY PATISSERIE DESIGN SYSTEM
   ========================================================================== */

:root {
  --m-bg-light: #0b2922;
  --m-bg-mid: #154539;
  --m-bg-deep: #04120e;
  --m-primary: #43c8a4;
  --m-primary-dark: #7de0c5;
  --m-primary-light: #a8f5dd;
  --m-ink: #f0fbf7;
  --m-ink-soft: rgba(240, 251, 247, 0.82);
  --m-ink-muted: rgba(186, 232, 217, 0.62);
  --m-white: #ffffff;
  --m-gold: #e5ca92;
  --m-gold-light: #ffeaa7;

  --f-display: 'Playfair Display', Georgia, serif;
  --f-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
}

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

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background-color: var(--m-bg-light);
  color: var(--m-ink);
  font-family: var(--f-body);
  font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(52, 181, 147, 0.35); border-radius: 99px; }

/* ==========================================================================
   DEEP EMERALD-MINT NIGHT BACKDROP + STARLIGHT (USER PREFERRED)
   ========================================================================== */
.mint-backdrop {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
  background: radial-gradient(110% 90% at 50% 30%, #16473b 0%, #0b2922 55%, #04120e 100%);
  transition: filter 900ms var(--ease-expo);
}

body.night-mode .mint-backdrop {
  filter: brightness(0.75) saturate(1.1);
}

.mint-orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.24;
  animation: orbFloat 14s ease-in-out infinite alternate;
}
.orb-1 { width: 540px; height: 540px; top: -140px; left: -100px; background: radial-gradient(circle, #34b593 0%, transparent 70%); }
.orb-2 { width: 600px; height: 600px; bottom: -180px; right: -120px; background: radial-gradient(circle, #1f8a6e 0%, transparent 70%); animation-delay: -5s; }
.orb-3 { width: 420px; height: 420px; top: 32%; left: 52%; background: radial-gradient(circle, rgba(168, 245, 221, 0.35) 0%, transparent 70%); animation-delay: -9s; }

body.night-mode .mint-orb { opacity: 0.18; }

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(32px, -24px) scale(1.08); }
}

.mint-silk-sheen {
  display: none;
}

#ambient-particles-canvas, #burst-particles-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2;
}
#burst-particles-canvas { z-index: 70; }

/* Cinematic Iris-Silk Transition Curtain */
#scene-transition-veil {
  position: fixed; inset: 0; z-index: 65; pointer-events: none; opacity: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, #1b5748 0%, #0d3027 55%, #051611 100%);
  clip-path: circle(0% at 50% 50%);
}

.veil-emblem {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 140px; height: 140px;
  font-family: var(--f-display); font-size: 18px; font-weight: 700; letter-spacing: 0.12em;
  color: #f0fbf7; text-shadow: 0 0 18px rgba(168, 245, 221, 0.55);
}
.veil-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px dashed rgba(229, 202, 146, 0.7);
  box-shadow: 0 0 36px rgba(125, 224, 197, 0.28);
  animation: spinVinyl 8s linear infinite;
}

/* Botanical Corner Filigree Ornaments */
.corner-ornament {
  position: absolute; width: 48px; height: 48px; color: rgba(200, 164, 100, 0.65);
  pointer-events: none;
}
.corner-ornament.tl { top: 14px; left: 14px; }
.corner-ornament.tr { top: 14px; right: 14px; transform: rotate(90deg); }
.corner-ornament.bl { bottom: 14px; left: 14px; transform: rotate(-90deg); }
.corner-ornament.br { bottom: 14px; right: 14px; transform: rotate(180deg); }

.inv-crest-mini { margin-bottom: 2px; }

.letter-postage-stamp {
  position: absolute; top: 0; right: 8px; width: 46px; height: 54px;
  border: 1.5px dashed var(--m-gold); border-radius: 6px;
  background: rgba(200, 164, 100, 0.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--f-display); font-weight: 700; font-size: 11px; color: #9c7a38;
}
.letter-postage-stamp small { font-size: 9px; opacity: 0.85; }
.letter-header { position: relative; text-align: center; }

/* ==========================================================================
   FLOATING TOP HUD
   ========================================================================== */
.mint-hud {
  position: fixed; top: 0; left: 0; right: 0; height: 58px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  pointer-events: none;
}
.mint-hud > * { pointer-events: auto; }

.hud-brand { display: flex; align-items: center; gap: 10px; }
.hud-badge {
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: rgba(14, 42, 35, 0.85); border: 1px solid rgba(125, 224, 197, 0.35);
  font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  color: var(--m-primary-light); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.hud-date { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: var(--m-ink-muted); }

.hud-stepper {
  display: flex; align-items: center; gap: 4px; padding: 4px 6px;
  border-radius: var(--radius-pill);
  background: rgba(11, 36, 29, 0.78); backdrop-filter: blur(18px);
  border: 1px solid rgba(125, 224, 197, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.step-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px;
  border-radius: var(--radius-pill); border: none; background: transparent;
  color: var(--m-ink-muted); font-family: var(--f-body); font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: all 260ms var(--ease-expo);
}
.step-pill:hover { color: var(--m-ink); }
.step-pill.active {
  background: linear-gradient(135deg, #3ec4a0 0%, #1f8a6e 100%);
  color: var(--m-white); box-shadow: 0 4px 14px rgba(67, 200, 164, 0.35);
}
.step-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.hud-controls { display: flex; align-items: center; gap: 8px; }
.hud-icon-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-radius: var(--radius-pill); border: 1px solid rgba(125, 224, 197, 0.28);
  background: rgba(11, 36, 29, 0.78); backdrop-filter: blur(16px);
  color: var(--m-ink); font-family: var(--f-body); font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: all 220ms ease; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.hud-icon-btn:hover { background: rgba(22, 66, 54, 0.92); border-color: var(--m-primary-light); transform: translateY(-1px); }

/* ==========================================================================
   GLASS SURFACES & BUTTONS (DARK EMERALD FROSTED GLASS)
   ========================================================================== */
.glass-mint-card {
  background: rgba(11, 36, 29, 0.72);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(125, 224, 197, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-pill {
  background: rgba(11, 36, 29, 0.78);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(125, 224, 197, 0.28);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.mint-cta-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 34px; border-radius: var(--radius-pill);
  font-family: var(--f-body); font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--m-white);
  background: linear-gradient(135deg, #43c8a4 0%, #1f9273 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 12px 28px rgba(31, 146, 115, 0.32);
  cursor: pointer; transition: all 320ms var(--ease-expo);
}
.mint-cta-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(31, 146, 115, 0.44);
  background: linear-gradient(135deg, #4dd4af 0%, #24a180 100%);
}
.mint-cta-btn:active:not(:disabled) { transform: scale(0.97); }
.mint-cta-btn.full-width { width: 100%; }
.mint-cta-btn.locked, .mint-cta-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cta-star { color: #fff6d1; }

.btn-shimmer {
  position: absolute; top: 0; left: -120%; width: 55%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg); animation: shimmerSweep 4s infinite; pointer-events: none;
}
@keyframes shimmerSweep { 0%, 55% { left: -120%; } 100% { left: 160%; } }

/* ==========================================================================
   CHAPTERS & CHƯƠNG 1
   ========================================================================== */
.screen-chapter { position: fixed; inset: 0; display: none; opacity: 0; z-index: 10; overflow: hidden; }
.screen-chapter.active { display: flex; }

#chapter-1 { align-items: center; justify-content: center; padding: 32px 24px; }

.inv-card {
  position: relative; z-index: 5; max-width: 680px; width: 100%; padding: 44px 48px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
  transform-style: preserve-3d;
}

.inv-halo {
  position: absolute; inset: -30px; border-radius: 36px; z-index: -1;
  background: radial-gradient(circle, rgba(125, 224, 197, 0.25) 0%, transparent 70%);
  filter: blur(28px); pointer-events: none;
}

.inv-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--m-primary-dark);
}

.inv-title {
  font-family: var(--f-display); font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  font-weight: 700; line-height: 1.2; color: var(--m-ink);
}
.inv-word { display: inline-block; white-space: nowrap; }
.inv-letter { display: inline-block; will-change: transform, opacity; }

.inv-subtitle {
  font-family: var(--f-display); font-style: italic; font-weight: 500;
  font-size: 1.35rem; color: var(--m-primary-dark);
}

.inv-rule {
  width: 64px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--m-primary), transparent);
  margin: 2px 0;
}

.inv-quote {
  max-width: 48ch; font-size: 15px; line-height: 1.75; color: var(--m-ink-soft); margin-bottom: 8px;
}

.inv-hint { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--m-ink-muted); }

/* ==========================================================================
   CHƯƠNG 2: FULL-BLEED MORPHING ATELIER
   ========================================================================== */
.atelier-stage { position: absolute; inset: 0; width: 100%; height: 100%; transition: background 600ms ease; }
.stage-viewport.bg-mint { background: radial-gradient(circle at 50% 42%, #17493c 0%, #0b2922 58%, #04120e 100%); }
.stage-viewport.bg-wood { background: radial-gradient(circle at 50% 42%, #332219 0%, #1c120d 58%, #0e0806 100%); }
.stage-viewport.bg-night { background: radial-gradient(circle at 50% 42%, #11352b 0%, #081c17 60%, #030c09 100%); }

.stage-spotlight {
  position: absolute; top: 43%; left: 50%; transform: translate(-50%, -50%);
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 224, 197, 0.18) 0%, rgba(52, 181, 147, 0.08) 50%, transparent 72%);
  filter: blur(42px); pointer-events: none;
}

#konva-container, #piping-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#piping-canvas { z-index: 5; pointer-events: none; }
#piping-canvas.drawing-active { pointer-events: auto; cursor: crosshair; }

.stage-grid-overlay { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 250ms ease; z-index: 4; }
.stage-grid-overlay.visible { opacity: 1; }
.crosshair-h { position: absolute; top: 43%; left: 0; right: 0; border-top: 1px dashed rgba(31, 138, 110, 0.35); }
.crosshair-v { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px dashed rgba(31, 138, 110, 0.35); }
.crosshair-circle {
  position: absolute; top: 43%; left: 50%; transform: translate(-50%, -50%);
  width: 350px; height: 175px; border-radius: 50%; border: 1px dashed rgba(31, 138, 110, 0.3);
}

/* Floating Top Pills */
.atelier-float-tl {
  position: fixed; top: 68px; left: 24px; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 6px 16px;
}
.cake-summary-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--m-ink); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--m-primary); box-shadow: 0 0 8px var(--m-primary); }
.pill-sep { width: 1px; height: 16px; background: rgba(52, 181, 147, 0.25); }
.bg-presets { display: flex; gap: 4px; }

.table-pill {
  padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: transparent; color: var(--m-ink-muted); font-size: 11px; font-weight: 600; cursor: pointer; transition: all 200ms ease;
}
.table-pill:hover { color: var(--m-ink); }
.table-pill.active { background: rgba(52, 181, 147, 0.16); border-color: rgba(52, 181, 147, 0.45); color: var(--m-primary-dark); }

.lux-switch-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--m-ink-muted); cursor: pointer; }
.lux-switch-mini input { display: none; }
.switch-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--m-primary); transition: background 200ms ease; }
.lux-switch-mini input:checked + .switch-dot { background: var(--m-primary); }
.lux-switch-mini input:checked ~ span { color: var(--m-ink); }

.atelier-float-tr { position: fixed; top: 66px; right: 24px; z-index: 30; display: flex; align-items: center; gap: 10px; }
.mini-actions-pill { display: flex; align-items: center; gap: 4px; padding: 4px 8px; }
.pill-icon-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent;
  color: var(--m-ink-soft); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 180ms ease;
}
.pill-icon-btn:hover { background: rgba(52, 181, 147, 0.18); color: var(--m-primary-dark); }
.pill-icon-btn.danger:hover { background: rgba(230, 57, 70, 0.14); color: #d62839; }
.primary-finish { min-height: 40px; padding: 0 22px; font-size: 12px; }

/* Contextual Selection Pill */
.selection-float-pill {
  position: fixed; bottom: 266px; left: 50%; transform: translateX(-50%);
  z-index: 35; display: none; align-items: center; gap: 8px; padding: 6px 14px;
}
.selection-float-pill.active { display: flex; }
.selection-tag { font-size: 11.5px; color: var(--m-primary-dark); font-weight: 700; }
.sel-btn {
  padding: 4px 9px; border-radius: var(--radius-pill); border: 1px solid rgba(125, 224, 197, 0.25);
  background: rgba(6, 22, 18, 0.65); color: var(--m-ink); font-size: 11px; font-weight: 600; cursor: pointer; transition: all 160ms ease;
}
.sel-btn:hover { background: var(--m-primary); color: var(--m-white); border-color: var(--m-primary); }
.sel-btn.danger { color: #ff8fa3; border-color: rgba(255, 117, 143, 0.35); }
.sel-btn.danger:hover { background: #d62839; color: #fff; }

/* Flower -> Concentric Starlight Rings (VELVET Finale) */
.flower-wish-stage {
  position: relative; width: 100%; min-height: 460px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center;
}
.finale-halo {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(86vw, 660px); height: min(86vw, 660px); border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 245, 221, 0.22) 0%, rgba(67, 200, 164, 0.08) 42%, transparent 72%);
  pointer-events: none;
}
.finale-ring {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) scale(0.45);
  width: min(76vw, 560px); height: min(76vw, 560px); border-radius: 50%;
  border: 1px solid rgba(229, 202, 146, 0.38);
  box-shadow: 0 0 60px -15px rgba(229, 202, 146, 0.45), inset 0 0 60px -25px rgba(125, 224, 197, 0.3);
  opacity: 0; pointer-events: none;
}
.finale-ring--inner {
  width: min(52vw, 380px); height: min(52vw, 380px);
  border-color: rgba(125, 224, 197, 0.3);
}
.finale-flower-btn {
  position: relative; z-index: 4; width: 220px; height: 220px; border: none; background: transparent;
  cursor: pointer; filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.55));
  transition: transform 400ms var(--ease-expo);
}
.finale-flower-btn:hover { transform: scale(1.06); }
.finale-flower-btn svg { width: 100%; height: 100%; overflow: visible; }
.flower-wish-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.28em; color: var(--m-gold); text-transform: uppercase; }
.flower-wish-title { font-family: var(--f-display); font-size: clamp(1.7rem, 3.2vw, 2.4rem); color: var(--m-ink); }
.flower-wish-hint { font-size: 13px; color: var(--m-ink-muted); font-style: italic; }

/* Morphing Bottom Dock */
.morph-dock-wrap {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 30; width: min(960px, calc(100vw - 48px));
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.morph-dock-wrap > * { pointer-events: auto; }
.morph-tray { width: 100%; padding: 16px 22px; overflow: hidden; transform-origin: bottom center; }
.morph-tray.collapsed { display: none; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.tray-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.tray-cols.toppings-layout { grid-template-columns: 2fr 1fr; }
.tray-col { display: flex; flex-direction: column; gap: 8px; }
.tray-col.wide { grid-column: span 2; }

.panel-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--m-primary-dark); }
.panel-note { font-size: 11.5px; color: var(--m-ink-muted); }

.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-card {
  padding: 6px 12px; border-radius: var(--radius-pill);
  border: 1px solid rgba(125, 224, 197, 0.22); background: rgba(6, 22, 18, 0.55);
  color: var(--m-ink-soft); font-size: 11.5px; font-weight: 500; cursor: pointer; transition: all 200ms ease;
}
.picker-card:hover { border-color: var(--m-primary); color: var(--m-white); }
.picker-card.active {
  border-color: var(--m-primary); color: var(--m-white);
  background: var(--m-primary); box-shadow: 0 4px 12px rgba(67, 200, 164, 0.35);
}

.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flavor-circle, .piping-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer; transition: transform 180ms ease, border-color 180ms ease;
}
.flavor-circle.active, .flavor-circle:hover,
.piping-dot.active, .piping-dot:hover {
  transform: scale(1.16); border-color: var(--m-primary-light); box-shadow: 0 0 12px rgba(125, 224, 197, 0.45);
}

.color-picker-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--radius-pill); border: 1px solid rgba(125, 224, 197, 0.3);
  background: rgba(6, 22, 18, 0.55); font-size: 11px; color: var(--m-ink-soft); cursor: pointer;
}
.color-picker-chip input[type="color"] { width: 16px; height: 16px; border: none; background: transparent; cursor: pointer; }

.drip-pills, .photo-frames-row, .toppings-sub-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.drip-pill, .cat-pill, .frame-choice {
  padding: 5px 11px; border-radius: var(--radius-pill);
  border: 1px solid rgba(125, 224, 197, 0.22); background: rgba(6, 22, 18, 0.55);
  color: var(--m-ink-soft); font-size: 11px; font-weight: 500; cursor: pointer; transition: all 180ms ease;
}
.drip-pill.active, .drip-pill:hover,
.cat-pill.active, .cat-pill:hover,
.frame-choice.active, .frame-choice:hover {
  border-color: var(--m-primary); color: var(--m-white); background: var(--m-primary);
}

.slider-header { display: flex; justify-content: space-between; align-items: center; }
.slider-val { font-size: 11.5px; color: var(--m-primary-light); font-weight: 700; }
.lux-slider { width: 100%; accent-color: var(--m-primary); cursor: pointer; }

.piping-tips-grid { display: flex; gap: 6px; }
.tip-luxury-card {
  flex: 1; padding: 7px 8px; border-radius: var(--radius-sm);
  border: 1px solid rgba(125, 224, 197, 0.22); background: rgba(6, 22, 18, 0.55);
  color: var(--m-ink-soft); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all 180ms ease;
}
.tip-luxury-card.active, .tip-luxury-card:hover { border-color: var(--m-primary); color: var(--m-white); background: var(--m-primary); }

.action-stack { display: flex; flex-direction: column; gap: 6px; }
.mt-xs { margin-top: 4px; }

.lux-btn-secondary {
  padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--m-primary); background: rgba(67, 200, 164, 0.16);
  color: var(--m-primary-light); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all 200ms ease;
}
.lux-btn-secondary:hover { background: var(--m-primary); color: var(--m-white); }

.lux-btn-ghost {
  padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1px solid rgba(125, 224, 197, 0.28); background: rgba(6, 22, 18, 0.55);
  color: var(--m-ink-soft); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all 200ms ease;
}
.lux-btn-ghost:hover { border-color: var(--m-primary); color: var(--m-white); background: rgba(20, 62, 50, 0.85); }
.lux-btn-ghost.danger { color: #ff8fa3; border-color: rgba(255, 117, 143, 0.35); }
.lux-btn-ghost.danger:hover { background: #d62839; color: #fff; }

.toppings-header-row { display: flex; justify-content: space-between; align-items: center; }
.toppings-horiz-grid, .candles-horiz-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }

.topping-item-btn, .candle-item-btn {
  flex: 0 0 74px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border-radius: var(--radius-md);
  border: 1px solid rgba(125, 224, 197, 0.22); background: rgba(6, 22, 18, 0.55);
  color: var(--m-ink-soft); font-size: 10.5px; font-weight: 600; cursor: pointer; transition: all 180ms ease;
}
.topping-item-btn:hover, .candle-item-btn:hover {
  border-color: var(--m-primary-light); color: var(--m-white); background: rgba(22, 66, 54, 0.85); transform: translateY(-2px);
}
.topping-item-btn svg, .candle-item-btn svg { width: 34px; height: 34px; display: block; }

.morph-dock-bar { display: flex; align-items: center; gap: 6px; padding: 5px 10px; }
.nav-tab-item {
  padding: 7px 16px; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: transparent; color: var(--m-ink-muted); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 240ms var(--ease-expo);
}
.nav-tab-item:hover { color: var(--m-ink); background: rgba(52, 181, 147, 0.12); }
.nav-tab-item.active {
  color: var(--m-white); background: linear-gradient(135deg, #3ec4a0 0%, #269c7d 100%);
  box-shadow: 0 4px 14px rgba(52, 181, 147, 0.35);
}
.tray-toggle-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent;
  color: var(--m-primary-dark); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 280ms var(--ease-expo);
}
.tray-toggle-btn.collapsed { transform: rotate(180deg); }

/* ==========================================================================
   CHƯƠNG 3: CANDLE CEREMONY (EMERALD-MINT NIGHT)
   ========================================================================== */
#chapter-3 { align-items: center; justify-content: center; padding: 72px 24px 24px; overflow-y: auto; }
.ceremony-container { display: flex; align-items: center; justify-content: center; gap: 32px; max-width: 1040px; width: 100%; margin: auto; }
.ceremony-cake-box {
  flex-shrink: 0; width: 100%; max-width: 520px; aspect-ratio: 520 / 460;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#night-cake-canvas { width: 100%; height: 100%; object-fit: contain; display: block; }

.ceremony-control-card { flex: 1; max-width: 460px; padding: 30px 32px; display: flex; flex-direction: column; gap: 18px; }
.ceremony-header { text-align: center; }
.ceremony-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.25em; color: var(--m-primary-light); margin-bottom: 6px; }
.ceremony-heading { font-family: var(--f-display); font-size: 28px; font-weight: 600; color: #ffffff; }

.vinyl-music-box {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  border-radius: var(--radius-md); background: rgba(8, 24, 20, 0.65); border: 1px solid rgba(125, 224, 197, 0.24);
}
.vinyl-disc-wrap { width: 48px; height: 48px; flex-shrink: 0; }
#vinyl-disc { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle, #2a2a2a 0%, #111 65%, #000 100%); border: 2px solid #444; position: relative; }
#vinyl-disc.spinning { animation: spinVinyl 3.5s linear infinite; }
@keyframes spinVinyl { 100% { transform: rotate(360deg); } }
.vinyl-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 16px; height: 16px; border-radius: 50%; background: var(--m-primary-light); }
.vinyl-meta { flex: 1; }
.track-row { display: flex; justify-content: space-between; font-size: 11.5px; color: #e1f5ed; }
.song-progress-bar { width: 100%; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); margin-top: 8px; overflow: hidden; }
#song-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--m-primary), var(--m-primary-light)); transition: width 200ms linear; }

.ceremony-blow-phase { display: flex; flex-direction: column; gap: 12px; transition: opacity 300ms ease; }
.ceremony-blow-phase.locked { opacity: 0.65; }
.ceremony-quote { font-size: 14.5px; line-height: 1.65; color: rgba(240, 251, 247, 0.86); text-align: center; font-style: italic; }
.blow-wind-gauge { display: flex; align-items: center; gap: 10px; font-size: 11px; color: rgba(225, 245, 237, 0.72); }
.gauge-track { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.gauge-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #43c8a4, #a8f5dd); transition: width 80ms ease; }
.gauge-percent { width: 34px; text-align: right; color: var(--m-primary-light); font-weight: 700; }
.mic-status { font-size: 11.5px; color: rgba(225, 245, 237, 0.72); text-align: center; }

/* ==========================================================================
   CHƯƠNG 4: MINT & PEARL ENVELOPE -> FULL LETTER -> KEEPSAKE VOUCHER
   ========================================================================== */
#chapter-4 { align-items: center; justify-content: center; padding: 72px 24px 24px; overflow-y: auto; }
.ch4-stage { display: none; flex-direction: column; align-items: center; justify-content: center; width: 100%; max-width: 960px; margin: auto; }
.ch4-stage.active { display: flex; }

.envelope-wrapper {
  position: relative; width: min(440px, 88vw); height: 290px; perspective: 1000px;
  margin-bottom: 24px; filter: drop-shadow(0 28px 48px rgba(28, 102, 82, 0.22));
}
.envelope-back {
  position: absolute; inset: 0; border-radius: 16px;
  background: linear-gradient(145deg, #63cfb0 0%, #309b7e 100%);
  border: 1px solid rgba(255, 255, 255, 0.65);
}
.envelope-letter-peek {
  position: absolute; left: 26px; right: 26px; bottom: 18px; top: auto; height: 155px; border-radius: 10px;
  background: #ffffff; display: flex; align-items: flex-start; justify-content: center; padding-top: 24px;
  font-family: var(--f-display); font-style: italic; font-size: 20px; color: #1f8a6e;
  box-shadow: 0 6px 20px rgba(21, 56, 46, 0.14); z-index: 2; opacity: 0;
}
.envelope-front {
  position: absolute; inset: 0; border-radius: 16px; z-index: 3; pointer-events: none;
  background: linear-gradient(160deg, #7be0c3 0%, #37a889 100%);
  clip-path: polygon(0 14%, 50% 58%, 100% 14%, 100% 100%, 0 100%);
}
.envelope-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 60%; z-index: 4; transform-origin: top center;
  background: linear-gradient(180deg, #8be8cd 0%, #44b999 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%); pointer-events: none;
}

.wax-seal-btn {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%);
  z-index: 6; width: 86px; height: 86px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7db 0%, #e4c173 55%, #b58d3d 100%);
  border: 2.5px solid #ffffff;
  box-shadow: 0 10px 26px rgba(21, 56, 46, 0.28), 0 0 28px rgba(228, 193, 115, 0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #3a2b0d; cursor: pointer; transition: transform 300ms var(--ease-expo);
}
.wax-seal-btn:hover { transform: translate(-50%, -50%) scale(1.08); }
.wax-ring { position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed rgba(58, 43, 13, 0.4); pointer-events: none; }
.wax-monogram { font-family: var(--f-display); font-size: 20px; font-weight: 700; line-height: 1; }
.wax-seal-btn small { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; margin-top: 2px; }
.envelope-prompt { font-size: 14px; font-weight: 500; color: var(--m-primary-dark); }

/* Continuous Full Letter */
.luxury-letter-card { width: 100%; max-width: 660px; padding: 36px 44px; display: flex; flex-direction: column; gap: 20px; }
.letter-header { text-align: center; }
.letter-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.24em; color: var(--m-primary-dark); margin-bottom: 6px; }
.letter-title { font-family: var(--f-display); font-size: 28px; font-weight: 700; color: var(--m-ink); }
.letter-body-continuous { display: flex; flex-direction: column; gap: 12px; }
.letter-salutation { font-family: var(--f-display); font-size: 20px; font-style: italic; font-weight: 600; color: var(--m-primary-dark); }
.letter-text { font-size: 15px; line-height: 1.8; color: var(--m-ink-soft); }
.letter-signature { text-align: right; margin-top: 8px; }
.sig-closing { font-style: italic; font-size: 14.5px; color: var(--m-ink-muted); }
.sig-name { font-family: var(--f-display); font-size: 24px; font-weight: 700; color: var(--m-primary-dark); }
.letter-nav-footer.single-cta { display: flex; justify-content: center; padding-top: 14px; border-top: 1px solid rgba(52, 181, 147, 0.2); }

/* Keepsake Showcase & Golden Voucher */
.keepsake-showcase { width: 100%; max-width: 920px; padding: 30px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 28px; align-items: center; }
.keepsake-frame { border-radius: var(--radius-md); overflow: hidden; border: 1px solid rgba(52, 181, 147, 0.35); background: #ffffff; box-shadow: 0 14px 36px rgba(21, 56, 46, 0.14); }
.keepsake-frame img { width: 100%; height: auto; display: block; }
.keepsake-caption { padding: 10px 12px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--m-primary-dark); background: #f2fbf7; }
.keepsake-right { display: flex; flex-direction: column; gap: 16px; }
.keepsake-heading { font-family: var(--f-display); font-size: 26px; font-weight: 700; color: var(--m-ink); }

.golden-voucher {
  position: relative; overflow: hidden; padding: 18px 22px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(229, 202, 146, 0.16) 0%, rgba(16, 54, 44, 0.82) 100%);
  border: 1.5px solid var(--m-gold); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.voucher-shimmer {
  position: absolute; top: 0; left: -120%; width: 50%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg); animation: shimmerSweep 4.2s infinite; pointer-events: none;
}
.voucher-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--m-gold-light); margin-bottom: 4px; }
.voucher-heading { font-family: var(--f-display); font-size: 17px; font-weight: 700; color: var(--m-white); margin-bottom: 4px; }
.voucher-desc { font-size: 12.5px; color: var(--m-ink-soft); line-height: 1.55; }
.keepsake-frame { border-radius: var(--radius-md); overflow: hidden; border: 1px solid rgba(125, 224, 197, 0.35); background: #0b2922; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45); }
.keepsake-caption { padding: 10px 12px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--m-primary-light); background: rgba(8, 28, 22, 0.92); }
.letter-actions { display: flex; flex-direction: column; gap: 10px; }
.secondary-actions-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.btn-secret-spark {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--m-gold);
  background: linear-gradient(135deg, rgba(229, 202, 146, 0.22) 0%, rgba(67, 200, 164, 0.22) 100%);
  color: var(--m-gold-light); font-family: var(--f-body); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.04em; cursor: pointer; transition: all 280ms var(--ease-expo);
  box-shadow: 0 0 22px rgba(229, 202, 146, 0.25);
}
.btn-secret-spark:hover {
  transform: translateY(-2px); background: linear-gradient(135deg, rgba(229, 202, 146, 0.36) 0%, rgba(67, 200, 164, 0.34) 100%);
  box-shadow: 0 0 32px rgba(229, 202, 146, 0.45); color: #fff;
}

.secret-showcase {
  width: 100%; max-width: 740px; padding: 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.secret-header { display: flex; flex-direction: column; gap: 6px; }
.secret-sub { font-size: 13.5px; color: var(--m-ink-soft); max-width: 52ch; margin: 0 auto; }
.secret-frame {
  position: relative; width: 100%; max-width: 600px; border-radius: var(--radius-md); overflow: hidden;
  border: 1.5px solid rgba(229, 202, 146, 0.55); background: #071b16;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.65), 0 0 0 6px rgba(229, 202, 146, 0.08);
}
.secret-frame img { width: 100%; height: auto; display: block; }
.secret-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.luxury-toast {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%) translateY(-16px);
  opacity: 0; pointer-events: none; z-index: 100;
  display: flex; align-items: center; gap: 8px; padding: 9px 22px;
  border-radius: var(--radius-pill); background: rgba(11, 36, 29, 0.94);
  backdrop-filter: blur(18px); border: 1px solid var(--m-primary);
  color: var(--m-white); font-size: 12.5px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); transition: all 340ms var(--ease-expo);
}
.luxury-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-icon { color: var(--m-primary); }

/* ==========================================================================
   RESPONSIVE MOBILE OPTIMIZATION (<= 820px)
   ========================================================================== */
@media (max-width: 820px) {
  .mint-hud { padding: 0 12px; height: 52px; }
  .hud-date, .hud-btn-label { display: none; }
  .hud-badge { padding: 3px 9px; font-size: 11px; }
  .hud-stepper { gap: 2px; padding: 3px 4px; }
  .step-pill { padding: 4px 8px; font-size: 10px; gap: 4px; }
  .step-dot { width: 4px; height: 4px; }
  .hud-icon-btn { padding: 6px 10px; }

  #chapter-1 { padding: 64px 14px 20px; overflow-y: auto; }
  .inv-card { padding: 28px 20px; gap: 10px; }
  .corner-ornament { width: 32px; height: 32px; }
  .inv-crest-mini svg { width: 50px; height: 50px; }
  .inv-title { font-size: clamp(1.6rem, 6.5vw, 2.2rem); }
  .inv-subtitle { font-size: 1.05rem; }
  .inv-quote { font-size: 13.5px; line-height: 1.65; }

  /* Chapter 2 Mobile */
  .atelier-float-tl {
    top: 58px; left: 10px; right: 10px; padding: 5px 10px; gap: 8px;
    justify-content: space-between; overflow-x: auto;
  }
  .cake-summary-chip { font-size: 11px; white-space: nowrap; }
  .table-pill { padding: 3px 8px; font-size: 10px; white-space: nowrap; }

  .atelier-float-tr { top: 102px; right: 10px; left: 10px; justify-content: space-between; }
  .primary-finish { min-height: 36px; padding: 0 16px; font-size: 11px; }

  .morph-dock-wrap { width: calc(100vw - 16px); bottom: 10px; gap: 8px; }
  .morph-tray { padding: 12px 14px; max-height: 34vh; overflow-y: auto; }
  .tray-cols, .tray-cols.toppings-layout { grid-template-columns: 1fr; gap: 14px; }
  .tray-col.wide { grid-column: span 1; }
  .morph-dock-bar { width: 100%; justify-content: space-between; padding: 4px 6px; gap: 2px; overflow-x: auto; }
  .nav-tab-item { padding: 6px 10px; font-size: 11px; white-space: nowrap; }

  .selection-float-pill {
    bottom: 64px; max-width: calc(100vw - 20px); flex-wrap: wrap;
    justify-content: center; border-radius: var(--radius-md); padding: 6px 10px; gap: 5px;
  }

  /* Chapter 3 Mobile */
  #chapter-3 { padding: 64px 14px 20px; align-items: flex-start; }
  .ceremony-container { flex-direction: column; gap: 16px; }
  .ceremony-cake-box { width: 100%; max-width: 380px; height: auto; aspect-ratio: 520 / 460; }
  .ceremony-control-card { width: 100%; max-width: 100%; padding: 20px; gap: 14px; }
  .ceremony-heading { font-size: 22px; }

  /* Chapter 4 Mobile */
  #chapter-4 { padding: 64px 14px 24px; align-items: flex-start; }
  .envelope-wrapper { height: 230px; }
  .luxury-letter-card { padding: 26px 20px; gap: 14px; }
  .letter-postage-stamp { display: none; }
  .letter-title { font-size: 22px; }
  .letter-text { font-size: 14px; line-height: 1.7; }
  .keepsake-showcase { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
  .keepsake-heading { font-size: 22px; }
  .secondary-actions-3 { grid-template-columns: 1fr; }
}
