/* ==========================================================================
   BIRTHDAY SITE . 18TH MOGGER EDITION (BDAY.EXE · LEVEL 18)
   Refined Spacings, Mobile-First Touch UI & Artboard System
   ========================================================================== */

@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/caveat-latin.woff2') format('woff2'),
       url('https://fonts.gstatic.com/s/caveat/v23/WnznHAc5bAfYB2QRah7pcpNvOx-pjRV6eIipYSxP.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/space-grotesk-latin.woff2') format('woff2'),
       url('https://fonts.gstatic.com/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb54C-s0.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/space-grotesk-latin.woff2') format('woff2'),
       url('https://fonts.gstatic.com/s/spacegrotesk/v22/V8mDoQDjQSkFtoMM3T6r8E7mPb54C-s0.woff2') format('woff2');
}

:root {
  --bg-obsidian: #0E1116;
  --bg-olive-glow: #2a3d10;
  --lime: #C6FF3D;
  --lime-ring-1: #C6FF3D33;
  --lime-ring-2: #C6FF3D14;
  --lime-stroke: #C6FF3D26;
  --text-main: #F2F4F0;
  --text-sub: #C9D0CC;
  --text-muted: #9AA3A0;
  --card-bg: #161C22;
  --card-border: #2F3A35;
  --card-shadow: #0a0d10;
  --bub-bg: #1D242B;
  --del-bg: #2a1620;
  --del-pink: #FF3D6E;
  --del-cyan: #3DD5FF;
  --warm-amber: #FFB547;
  --warm-glow: #FFB54755;
  --cake-base: #F2D4B0;
  --cake-top: #FF9EB5;
  --candle-blue: #2B7BFF;
  --paper-cream: #F4EBD9;
  --paper-line: #E6DAC0;
  --paper-ink: #1C1A16;
  --wax-red: #B8352B;
  --wax-border: #D9695C;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior-y: contain;
}

/* ==========================================================================
   MAIN STAGE CONTAINER (.r)
   ========================================================================== */
.r {
  background:
    radial-gradient(circle at 50% 0, #2a3d10 0, transparent 58%),
    linear-gradient(#ffffff09 1px, transparent 1px) 0 0 / 100% 32px,
    #0E1116;
  color: #F2F4F0;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 78px 20px 44px;
  text-align: center;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  transition: filter 0.8s ease, background 0.8s ease;
}

.r.dimmed {
  filter: brightness(0.3) contrast(1.1);
}

.r > * {
  position: relative;
  z-index: 1;
}

/* Giant Background Ghost "18" */
.gh {
  position: fixed;
  z-index: 0 !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  font-size: clamp(320px, 72vw, 760px);
  line-height: 1;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 2px #C6FF3D22;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   TOP NAVIGATION HUD & STAGE SWITCHER
   ========================================================================== */
.hud {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(14, 17, 22, 0.94) 0%, rgba(14, 17, 22, 0.65) 65%, rgba(14, 17, 22, 0) 100%);
  pointer-events: none;
}

.hud > * {
  pointer-events: auto;
}

.lb {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #9AA3A0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C6FF3D;
  box-shadow: 0 0 8px #C6FF3D;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(22, 28, 34, 0.9);
  border: 1px solid #2F3A35;
  padding: 4px 6px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.stage-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: #9AA3A0;
  font: 700 11px 'Space Grotesk', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.stage-dot:hover:not(.locked) {
  color: #F2F4F0;
}

.stage-dot.locked {
  opacity: 0.32;
  cursor: not-allowed;
}

.stage-dot.active {
  background: #C6FF3D;
  color: #0E1116;
  box-shadow: 0 0 10px #C6FF3D55;
  opacity: 1;
}

.hud-btn {
  background: rgba(22, 28, 34, 0.9);
  border: 1px solid #2F3A35;
  color: #C9D0CC;
  font: 700 11px 'Space Grotesk', sans-serif;
  letter-spacing: 0.06em;
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.hud-btn.hidden-until-unlocked {
  display: none;
}

.hud-btn:hover, .hud-btn:active {
  border-color: #C6FF3D;
  color: #C6FF3D;
}

.hud-btn.active-poster {
  background: #C6FF3D;
  color: #0E1116;
  border-color: #C6FF3D;
}

/* ==========================================================================
   STAGE SECTIONS & TRANSITIONS
   ========================================================================== */
.stage {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  max-width: 680px;
  margin: auto;
  animation: stageEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.stage.active {
  display: flex;
}

.stage.exiting-trap {
  animation: trapExit 0.48s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes stageEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes trapExit {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
    filter: blur(6px);
  }
}

/* ==========================================================================
   TYPOGRAPHY, TAGS, PILLS, BUTTONS
   ========================================================================== */
.t {
  font-size: clamp(38px, 8.5vw, 70px);
  line-height: 1.08;
  font-weight: 700;
  margin: 4px 0;
  max-width: 760px;
  letter-spacing: -0.025em;
}

.t.t-verify {
  font-size: clamp(26px, 5vw, 34px);
  max-width: 480px;
  margin-bottom: 2px;
}

.pill {
  display: inline-block;
  background: #C6FF3D;
  color: #0E1116;
  padding: 0.02em 0.2em 0.06em;
  border-radius: 0.2em;
  transform: rotate(-3deg);
  box-shadow: 0 8px 28px rgba(198, 255, 61, 0.24);
}

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 1px solid #C6FF3D;
  color: #C6FF3D;
  border-radius: 20px;
  padding: 6px 15px;
  transform: rotate(-3.5deg);
  background: rgba(198, 255, 61, 0.06);
  box-shadow: 0 0 20px rgba(198, 255, 61, 0.1);
}

.p {
  font-size: clamp(16px, 3.8vw, 19px);
  line-height: 1.55;
  color: #C9D0CC;
  margin: 0;
  max-width: 430px;
}

.a {
  color: #C6FF3D;
  font-weight: 500;
}

.sm {
  font-size: 13px;
  color: #9AA3A0;
  line-height: 1.45;
  max-width: 380px;
}

.b {
  min-height: 54px;
  padding: 0 32px;
  border-radius: 27px;
  border: 0;
  background: #C6FF3D;
  color: #0E1116;
  font: 700 16px 'Space Grotesk', sans-serif;
  box-shadow: 0 0 0 7px #C6FF3D33, 0 0 0 15px #C6FF3D14;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.b:hover {
  transform: translateY(-2px);
}

.b:active {
  transform: scale(0.96);
}

.b.btn-locked {
  background: #1C242B;
  color: #9AA3A0;
  border: 1px dashed #3A4440;
  box-shadow: none;
}

.b.g {
  background: rgba(22, 28, 34, 0.6);
  border: 1px solid #3A4440;
  color: #F2F4F0;
  box-shadow: none;
}

.b.g:hover, .b.g:active {
  border-color: #C6FF3D;
  color: #C6FF3D;
  background: rgba(198, 255, 61, 0.08);
}

/* ==========================================================================
   STAGE 02: DELETED MESSAGE CHAT (Choreographed Live Sequence)
   ========================================================================== */
.chat {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  text-align: left;
  background: rgba(22, 28, 34, 0.55);
  border: 1px solid #26302B;
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  min-height: 185px;
}

.chat-step-hidden {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-step-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.who {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: #9AA3A0;
}

.av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #C6FF3D;
  color: #0E1116;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(198, 255, 61, 0.28);
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9AA3A0;
  animation: blinkDot 1.4s infinite both;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blinkDot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.bub {
  background: #1D242B;
  border: 1px solid #2C3640;
  border-radius: 18px 18px 18px 4px;
  padding: 13px 18px;
  font-size: 16px;
  line-height: 1.4;
  transform: rotate(-1.5deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.bub.chat-step-visible {
  transform: rotate(-1.5deg);
}

.del {
  color: #E8ECEA;
  border: 1px dashed #FF3D6E;
  text-shadow: 1.5px 0 #FF3D6E, -1.5px 0 #3DD5FF;
  transform: rotate(1.2deg) translateX(10px) !important;
  background: #2a1620;
  cursor: pointer;
  user-select: none;
}

.del.glitching {
  animation: glitchShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes glitchShake {
  0%, 100% { transform: rotate(1.2deg) translateX(10px); text-shadow: 1.5px 0 #FF3D6E, -1.5px 0 #3DD5FF; }
  20% { transform: rotate(-1deg) translateX(4px) skewX(4deg); text-shadow: -3px 0 #FF3D6E, 3px 0 #3DD5FF; }
  40% { transform: rotate(2.2deg) translateX(16px) skewX(-4deg); text-shadow: 3px 0 #FF3D6E, -3px 0 #C6FF3D; }
  60% { transform: rotate(0deg) translateX(7px); text-shadow: -2px 0 #3DD5FF, 2px 0 #FF3D6E; }
  80% { transform: rotate(1.8deg) translateX(13px); }
}

/* ==========================================================================
   STAGE 03: VERIFICATION CARDS
   ========================================================================== */
.verify-stack {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.c {
  width: 100%;
  background: #161C22;
  border: 1px solid #2F3A35;
  border-radius: 20px;
  padding: 18px 20px;
  text-align: left;
  font-size: 15px;
  box-shadow: 0 6px 0 #0a0d10;
  transition: border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.c.verified-card {
  border-color: rgba(198, 255, 61, 0.42);
}

.c.shake-attention {
  border-color: #C6FF3D;
  box-shadow: 0 0 22px rgba(198, 255, 61, 0.25), 0 6px 0 #0a0d10;
  animation: cardShake 0.4s ease;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

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

.pips {
  display: flex;
  gap: 10px;
  margin: 12px 0 10px;
}

.pip {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #232C33;
  border: 1.5px solid #3A4440;
  color: #9AA3A0;
  font-weight: 700;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pip.active {
  background: #C6FF3D;
  border-color: #C6FF3D;
  color: #0E1116;
  box-shadow: 0 0 14px rgba(198, 255, 61, 0.35);
}

.pip.pump {
  animation: pipPump 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pipPump {
  0% { transform: scale(1); }
  50% { transform: scale(1.26) rotate(-6deg); }
  100% { transform: scale(1); }
}

.trk {
  height: 12px;
  border-radius: 6px;
  background: #27302C;
  margin: 18px 0 14px;
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.trk-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #27302C, #C6FF3D);
}

.th {
  position: absolute;
  right: -4px;
  top: -11px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #F2F4F0;
  border: 4px solid #C6FF3D;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

.sw {
  width: 64px;
  height: 36px;
  border-radius: 18px;
  background: #C6FF3D;
  position: relative;
  flex: none;
  cursor: pointer;
  transition: background 0.25s ease;
}

.sw.off {
  background: #27302C;
}

.sw i {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: #0E1116;
  transition: right 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sw.off i {
  right: 32px;
  background: #9AA3A0;
}

/* ==========================================================================
   STAGE 04: THE 18TH CAKE & DRAGGABLE LIGHTER
   ========================================================================== */
.glow {
  position: absolute;
  z-index: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(#FFB54755, transparent 65%);
  top: 46%;
  left: 50%;
  transform: translate(-50%, -55%) scale(1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.glow.lit {
  opacity: 1;
  animation: glowPulse 3s infinite ease-in-out;
}

@keyframes glowPulse {
  0%, 100% { transform: translate(-50%, -55%) scale(1); }
  50% { transform: translate(-50%, -55%) scale(1.08); }
}

.cake-stage-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: 12px 0 4px;
  touch-action: none;
}

.cake {
  position: relative;
  width: 250px;
  height: 215px;
  margin-top: 38px;
}

.cake > * {
  position: absolute;
}

.cake::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: -18px;
  width: 286px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
}

.l1 {
  bottom: 0;
  left: 0;
  width: 250px;
  height: 96px;
  border-radius: 16px;
  background: #F2D4B0;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.08);
}

.l2 {
  bottom: 96px;
  left: 38px;
  width: 174px;
  height: 72px;
  border-radius: 16px;
  background: #FF9EB5;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.08);
}

.dr {
  bottom: 148px;
  left: 38px;
  width: 174px;
  height: 20px;
  background: radial-gradient(circle at 14px 0, #fff 12px, transparent 13px) 0 0 / 29px 20px repeat-x;
}

.dr2 {
  bottom: 76px;
  left: 0;
  width: 250px;
  height: 20px;
  background: radial-gradient(circle at 16px 0, #fff 13px, transparent 14px) 0 0 / 36px 20px repeat-x;
}

.sp {
  bottom: 40px;
  left: 20px;
  width: 4px;
  height: 10px;
  background: #C6FF3D;
  transform: rotate(30deg);
  box-shadow:
    50px 14px #2B7BFF,
    100px -8px #FFB547,
    150px 12px #C6FF3D,
    200px -4px #FF3D6E,
    35px -65px #C6FF3D,
    85px -55px #2B7BFF,
    130px -62px #FFB547;
}

.cd {
  bottom: 168px;
  left: 109px;
  width: 32px;
  height: 52px;
  border-radius: 6px;
  background: #2B7BFF;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  font-style: normal;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

/* Candle wick */
.cd::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 10px;
  background: #55625C;
  border-radius: 2px;
}

/* Target zone around wick */
.wick-hitbox {
  bottom: 206px;
  left: 85px;
  width: 80px;
  height: 76px;
  border-radius: 50%;
  z-index: 6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wick-hitbox.needs-light::after {
  content: '';
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 181, 71, 0.75);
  animation: targetPulse 1.4s infinite ease-in-out;
}

@keyframes targetPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.4; }
  50% { transform: scale(1.25); opacity: 1; }
}

.fl {
  bottom: 222px;
  left: 117px;
  width: 16px;
  height: 28px;
  border-radius: 50% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 75%, #fff 10%, #FFB547 55%, #FF6B00 95%);
  box-shadow: 0 0 40px 16px #FFB54777;
  transform-origin: 50% 90%;
  opacity: 0;
  transform: scale(0.1);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.fl.lit {
  opacity: 1;
  transform: scale(1);
  animation: flameFlicker 1.1s infinite ease-in-out alternate;
}

.fl.wind-blown {
  opacity: 0;
  transform: translateX(26px) skewX(-38deg) scale(1.3, 0.2);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

@keyframes flameFlicker {
  0% { transform: scale(1) rotate(-2deg); box-shadow: 0 0 36px 14px #FFB54777; }
  35% { transform: scale(1.06, 0.96) rotate(2deg); box-shadow: 0 0 44px 18px #FFB54799; }
  70% { transform: scale(0.96, 1.05) rotate(-1deg); box-shadow: 0 0 38px 15px #FFB54766; }
  100% { transform: scale(1.04, 1.02) rotate(3deg); box-shadow: 0 0 46px 19px #FFB54788; }
}

/* Wind gust lines */
.wind-gust {
  bottom: 215px;
  left: 15px;
  width: 210px;
  height: 50px;
  pointer-events: none;
  opacity: 0;
}

.wind-gust.active {
  opacity: 1;
}

.wind-gust span {
  position: absolute;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(242, 244, 240, 0.75), transparent);
  width: 90px;
  opacity: 0;
}

.wind-gust span:nth-child(1) { top: 8px; }
.wind-gust span:nth-child(2) { top: 22px; width: 120px; }
.wind-gust span:nth-child(3) { top: 36px; width: 75px; }

.wind-gust.active span:nth-child(1) { animation: windSweep 0.65s ease-out forwards; }
.wind-gust.active span:nth-child(2) { animation: windSweep 0.7s 0.08s ease-out forwards; }
.wind-gust.active span:nth-child(3) { animation: windSweep 0.6s 0.15s ease-out forwards; }

@keyframes windSweep {
  0% { transform: translateX(-20px); opacity: 0; }
  40% { opacity: 0.9; }
  100% { transform: translateX(145px); opacity: 0; }
}

/* Smoke wisps */
.smoke-wrap {
  position: absolute;
  bottom: 224px;
  left: 123px;
  width: 6px;
  height: 60px;
  pointer-events: none;
  opacity: 0;
}

.smoke-wrap.active {
  opacity: 1;
}

.smoke-puff {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(201, 208, 204, 0.6);
  filter: blur(3px);
}

.smoke-wrap.active .smoke-puff:nth-child(1) {
  animation: smokeRise 1.7s ease-out forwards;
}
.smoke-wrap.active .smoke-puff:nth-child(2) {
  animation: smokeRise 2.0s 0.18s ease-out forwards;
}
.smoke-wrap.active .smoke-puff:nth-child(3) {
  animation: smokeRise 2.3s 0.35s ease-out forwards;
}

@keyframes smokeRise {
  0% { opacity: 0.8; transform: translate(0, 0) scale(0.8); }
  50% { opacity: 0.45; transform: translate(14px, -34px) scale(2.1); }
  100% { opacity: 0; transform: translate(24px, -74px) scale(3.4); }
}

/* Draggable Lighter & Disappearing Hint */
.lighter-zone {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.lt {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  position: relative;
  z-index: 30;
  padding: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.35s ease;
}

.lt.ready {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0px, 0px);
  animation: lighterBob 2s infinite ease-in-out;
}

.lt.dragging {
  animation: none;
  cursor: grabbing;
}

@keyframes lighterBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.lt i {
  width: 46px;
  height: 62px;
  border-radius: 9px;
  background: #3A4440;
  border-top: 6px solid #FFB547;
  display: block;
  position: relative;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

/* Lighter flame */
.lt i::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 22px;
  border-radius: 50% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 75%, #fff 15%, #FFB547 60%, #FF6B00 100%);
  box-shadow: 0 0 20px 7px #FFB54799;
  animation: lighterFlame 0.8s infinite alternate ease-in-out;
}

.lt.extinguished {
  opacity: 0;
  pointer-events: none;
  animation: none;
}

.lighter-hint {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #FFB547;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.lighter-hint.visible {
  opacity: 0.9;
}

.lighter-hint.hidden-while-holding {
  opacity: 0 !important;
  transform: translateY(4px);
}

@keyframes lighterFlame {
  from { transform: translateX(-50%) scale(0.92) rotate(-4deg); }
  to { transform: translateX(-50%) scale(1.08) rotate(4deg); }
}

/* ==========================================================================
   STAGE 05: THE LETTER (Sleek Sealed Envelope -> Smooth Slide-to-Open)
   ========================================================================== */
.wrap {
  position: relative;
  max-width: 480px;
  width: 100%;
}

/* Sealed Envelope Card */
.envelope-closed {
  background: linear-gradient(165deg, #1E252C 0%, #14191F 100%);
  border: 1px solid #2F3A35;
  border-radius: 22px;
  padding: 36px 24px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 6px 0 #0a0d10;
  transition: transform 0.4s ease, opacity 0.35s ease;
}

.envelope-closed.opening-anim {
  transform: scale(0.95) translateY(-10px);
  opacity: 0;
  pointer-events: none;
}

.envelope-closed.opened {
  display: none;
}

/* Envelope flap geometry */
.env-flap {
  position: absolute;
  top: -115px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 240px;
  height: 240px;
  border-right: 1.5px dashed rgba(198, 255, 61, 0.25);
  border-bottom: 1.5px dashed rgba(198, 255, 61, 0.25);
  background: rgba(255, 255, 255, 0.015);
  pointer-events: none;
}

.env-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.env-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #C6FF3D;
  border: 1px solid rgba(198, 255, 61, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(198, 255, 61, 0.06);
}

.env-seal {
  margin: 8px auto 4px !important;
}

.env-title {
  font: 700 38px 'Caveat', cursive;
  color: #F4EBD9;
  line-height: 1.1;
}

.env-hint {
  font-size: 13px;
  color: #9AA3A0;
  max-width: 290px;
  line-height: 1.45;
  margin-bottom: 4px;
}

/* Improved Slide-Across-to-Open Track */
.slide-open-track {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 54px;
  border-radius: 27px;
  background: #0E1116;
  border: 1.5px solid #2F3A35;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: pointer;
  padding: 4px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.slide-open-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(198, 255, 61, 0.12), rgba(198, 255, 61, 0.32));
  border-radius: 27px;
  pointer-events: none;
}

.slide-open-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #C6FF3D;
  pointer-events: none;
  z-index: 2;
  padding-left: 28px;
  transition: opacity 0.2s ease;
}

.slide-open-thumb {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #C6FF3D;
  color: #0E1116;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 14px rgba(198, 255, 61, 0.45);
  z-index: 3;
  cursor: grab;
}

.slide-open-thumb:active {
  cursor: grabbing;
}

/* Wax Seal "18" */
.seal {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #B8352B;
  color: #F4EBD9;
  font-weight: 700;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed #D9695C;
  margin: 0 auto -29px;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.seal:hover {
  transform: scale(1.08) rotate(6deg);
}

/* Opened Letter Box */
.opened-letter-box {
  width: 100%;
  animation: letterUnfold 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.opened-letter-box.is-sealed {
  display: none;
}

/* Lined Paper Letter (.ltr) */
.ltr {
  background: #F4EBD9 repeating-linear-gradient(#F4EBD9 0 28px, #E6DAC0 28px 29px);
  color: #1C1A16;
  border-radius: 10px;
  padding: 44px 26px 20px;
  text-align: left;
  font-size: 15px;
  line-height: 29px;
  transform: rotate(-0.6deg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

@keyframes letterUnfold {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 768px) {
  .ltr {
    font-size: 16px;
    padding: 46px 36px 22px;
  }
}

.ltr p {
  margin: 0 0 15px;
  line-height: 1.6;
}

.ltr h2 {
  margin: 0 0 14px;
  font: 700 40px 'Caveat', cursive;
  color: #B8352B;
}

.dl {
  border: 0;
  background: none;
  color: #6B6558;
  font: 13px 'Space Grotesk', sans-serif;
  text-decoration: underline;
  min-height: 40px;
  cursor: pointer;
  margin-top: 2px;
}

.dl:hover, .dl:active {
  color: #B8352B;
}

.toast {
  background: #1D242B;
  border: 1px solid #C6FF3D;
  color: #F2F4F0;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.toast.shake {
  animation: toastBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastBounce {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.06) rotate(-1.5deg); box-shadow: 0 0 20px rgba(198, 255, 61, 0.35); }
  100% { transform: scale(1) rotate(0deg); }
}

.letter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

/* ==========================================================================
   STAGE 06: BIRTHDAY POSTER · 4:5 SHOWCASE
   ========================================================================== */
.poster-stage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.poster-viewport {
  position: relative;
  width: calc(1080px * var(--poster-scale, 0.32));
  height: calc(1350px * var(--poster-scale, 0.32));
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(198, 255, 61, 0.25);
  overflow: hidden;
}

.po {
  width: 1080px;
  height: 1350px;
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(var(--poster-scale, 0.32));
  transform-origin: top left;
  overflow: hidden;
  color: #F2F4F0;
  font-family: 'Space Grotesk', sans-serif;
  background:
    radial-gradient(circle at 70% 25%, #33480f 0, transparent 55%),
    linear-gradient(#ffffff09 1px, transparent 1px) 0 0 / 100% 40px,
    #0E1116;
  text-align: left;
}

.po > * {
  position: absolute;
}

.po .po-gh {
  left: -60px;
  top: -120px;
  font-size: 1150px;
  line-height: 1;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 3px #C6FF3D30;
  pointer-events: none;
}

.po .fr {
  left: 90px;
  top: 110px;
  width: 640px;
  background: #F4EBD9;
  padding: 22px 22px 86px;
  transform: rotate(-4deg);
  box-shadow: 0 30px 70px #000b;
  cursor: pointer;
}

.po .fr img {
  display: block;
  width: 596px;
  height: 596px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.15);
  transition: filter 0.4s ease;
}

.po .fr.color-mode img {
  filter: grayscale(0) contrast(1.05);
}

.po .fr span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font: 700 44px 'Caveat', cursive;
  color: #B8352B;
}

.po .tp {
  left: 330px;
  top: 84px;
  width: 170px;
  height: 48px;
  background: #C6FF3Dcc;
  transform: rotate(3deg);
  pointer-events: none;
}

.po .st {
  right: 70px;
  top: 150px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: #C6FF3D;
  color: #0E1116;
  font-weight: 700;
  font-size: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(10deg);
  box-shadow: 0 0 0 14px #C6FF3D33;
}

.po .tg {
  right: 70px;
  top: 470px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.14em;
  border: 2px solid #C6FF3D;
  color: #C6FF3D;
  border-radius: 30px;
  padding: 10px 24px;
  transform: rotate(5deg);
  background: #0E1116;
}

.po .tg2 {
  top: 560px;
  right: 110px;
  transform: rotate(-3deg);
}

.po .h1 {
  left: 80px;
  top: 880px;
  font-size: 118px;
  line-height: 1;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: #F2F4F0;
}

.po .po-pill {
  display: inline-block;
  background: #C6FF3D;
  color: #0E1116;
  padding: 0 0.2em 22px;
  border-radius: 0.16em;
  transform: rotate(-2deg);
  font-size: 190px;
  line-height: 1.05;
}

.po .ft {
  left: 80px;
  right: 80px;
  bottom: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 26px;
  color: #C9D0CC;
}

.po .ft b {
  color: #C6FF3D;
  cursor: pointer;
}

.poster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   MIRROR CHECK MODAL (Front Camera / Mogger Radar Easter Egg)
   ========================================================================== */
.mirror-modal {
  position: fixed !important;
  inset: 0;
  z-index: 150 !important;
  background: rgba(10, 13, 16, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mirror-modal.open {
  display: flex;
  animation: stageEnter 0.35s ease forwards;
}

.mirror-card {
  width: 100%;
  max-width: 380px;
  background: #161C22;
  border: 1px solid #C6FF3D;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8), 0 0 30px rgba(198, 255, 61, 0.15);
}

.mirror-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #0E1116;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #2F3A35;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mirror-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: none;
}

#mirror-video.active {
  display: block;
}

.mirror-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.mirror-reticle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px dashed #C6FF3D;
  margin-bottom: 6px;
  animation: spinReticle 8s linear infinite;
}

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

.mirror-hud-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #C6FF3D;
  background: rgba(14, 17, 22, 0.78);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(198, 255, 61, 0.3);
  pointer-events: none;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99 !important;
}
