/* ==========================================================================
   FOR CEMILE | OCTOBER 15 - LUXURY DESIGN SYSTEM & STYLES
   ========================================================================== */

:root {
  --bg-primary: #090a13;
  --bg-secondary: #121424;
  --bg-card: rgba(22, 25, 44, 0.65);
  --bg-card-hover: rgba(30, 34, 60, 0.8);
  --border-gold: rgba(230, 201, 156, 0.25);
  --border-gold-glow: rgba(230, 201, 156, 0.5);
  --gold-primary: #e6c99c;
  --gold-bright: #fff0d4;
  --rose-primary: #f28b9a;
  --rose-glow: rgba(242, 139, 154, 0.35);
  --barca-garnet: #8a1538;
  --barca-blue: #004d98;
  --text-primary: #f5f6fa;
  --text-secondary: #b0b4cf;
  --text-muted: #797d9e;
  
  --font-display: 'Cinzel', serif;
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-script: 'Alex Brush', cursive;

  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bottom: env(safe-area-inset-bottom, 20px);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(45, 30, 75, 0.45) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(20, 30, 60, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 90% 70%, rgba(60, 20, 40, 0.35) 0%, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Canvas Layers */
#ambient-canvas,
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

#confetti-canvas {
  z-index: 99;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 580px;
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ================= STAGE TRANSITIONS ================= */
.stage-view {
  display: none;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.7s var(--ease-cinematic), transform 0.7s var(--ease-cinematic);
  width: 100%;
}

.stage-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.stage-view.fade-out {
  opacity: 0;
  transform: translateY(-20px) scale(0.97);
}

.stage-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  gap: 22px;
}

/* ================= TYPOGRAPHY & BADGES ================= */
.stage-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-primary);
  background: rgba(230, 201, 156, 0.1);
  border: 1px solid rgba(230, 201, 156, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.eyebrow {
  font-size: 0.9rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-primary);
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #ffffff 20%, var(--gold-bright) 60%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
  text-shadow: 0 4px 30px rgba(230, 201, 156, 0.2);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.3rem);
  color: var(--text-primary);
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 380px;
}

.section-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.5;
}

/* ================= BUTTONS ================= */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  padding: 16px 28px;
  background: linear-gradient(135deg, rgba(230, 201, 156, 0.92) 0%, rgba(210, 165, 110, 0.92) 100%);
  color: #121422;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(210, 165, 110, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: all 0.3s var(--ease-spring);
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.75s ease;
}

.btn-primary:hover::after,
.btn-primary:active::after {
  transform: translateX(100%);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(210, 165, 110, 0.45);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
}

.btn-arrow {
  width: 18px;
  height: 18px;
  stroke: #121422;
  stroke-width: 2.2;
  fill: none;
  transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-text-subtle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-text-subtle:hover {
  color: var(--gold-primary);
}

/* ================= STAGE 1: GATEWAY ================= */
.seal-emblem {
  margin-bottom: 5px;
}

.wax-seal {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b32d3e 0%, #681520 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(230, 201, 156, 0.6);
  box-shadow: 0 8px 24px rgba(179, 45, 62, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  animation: pulse-glow 3s infinite alternate;
}

.seal-letter {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold-bright);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.gate-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 28px 22px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.question-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(230, 201, 156, 0.12);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-icon svg {
  width: 24px;
  height: 24px;
}

.card-question {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-hint-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -6px;
}

.date-selector-group {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.1fr;
  gap: 10px;
  width: 100%;
  margin: 6px 0;
}

.custom-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.custom-select-wrapper label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-primary);
}

.gate-select {
  width: 100%;
  padding: 12px 10px;
  background: rgba(10, 12, 22, 0.75);
  border: 1px solid rgba(230, 201, 156, 0.3);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  text-align-last: center;
}

.gate-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px rgba(230, 201, 156, 0.25);
}

.gate-error-message {
  font-size: 0.85rem;
  color: #ff8595;
  background: rgba(255, 133, 149, 0.1);
  border: 1px solid rgba(255, 133, 149, 0.3);
  padding: 8px 14px;
  border-radius: 8px;
  animation: shake 0.4s ease;
}

/* ================= STAGE 2: PROLOGUE ================= */
.story-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 22px;
  backdrop-filter: blur(16px);
  text-align: left;
  line-height: 1.7;
}

.story-lead {
  font-size: 0.98rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.story-lead:last-child {
  margin-bottom: 0;
}

.story-lead strong {
  color: var(--gold-bright);
}

/* Counter Card */
.counter-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(30, 25, 48, 0.6) 0%, rgba(18, 20, 36, 0.6) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 20px 16px;
  backdrop-filter: blur(16px);
}

.counter-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
}

.counter-label {
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-primary);
  font-weight: 600;
}

.counter-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.counter-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(10, 12, 22, 0.6);
  border: 1px solid rgba(230, 201, 156, 0.15);
  border-radius: 12px;
  padding: 12px 6px;
}

.counter-number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1.2;
}

.counter-unit {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Photo Cards */
.photo-frame-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 18px;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s var(--ease-cinematic);
}

.photo-wrapper {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #0f111e;
}

.photo-wrapper.portrait {
  aspect-ratio: 3 / 4;
}

.photo-wrapper.landscape {
  aspect-ratio: 4 / 3;
}

.photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-cinematic);
}

.photo-frame-card:hover .photo-wrapper img {
  transform: scale(1.025);
}

.photo-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 65%, rgba(10, 12, 22, 0.45) 100%);
  pointer-events: none;
}

.photo-caption {
  margin-top: 16px;
  text-align: left;
}

.photo-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rose-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.photo-caption p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ================= STAGE 3: CHESS & BARÇA ================= */
.passion-card {
  position: relative;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 24px 20px;
  backdrop-filter: blur(18px);
  text-align: left;
  overflow: hidden;
}

.card-icon-tag {
  margin-bottom: 10px;
}

.tag-chess {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-primary);
  background: rgba(230, 201, 156, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.tag-barca {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ff758c;
  background: rgba(138, 21, 56, 0.25);
  border: 1px solid rgba(138, 21, 56, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.card-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-subtext {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.card-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 14px;
}

/* Mini Chessboard */
.mini-board-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  gap: 12px;
}

.board-header {
  font-size: 0.85rem;
  color: var(--gold-primary);
  font-weight: 500;
}

.mini-chessboard {
  display: grid;
  grid-template-columns: repeat(4, 48px);
  grid-template-rows: repeat(2, 48px);
  border: 3px solid #4a3424;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.square {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.3s ease;
}

.square.light {
  background-color: #eed6b2;
}

.square.dark {
  background-color: #9c6c44;
}

.piece {
  font-size: 1.9rem;
  user-select: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring);
}

.piece.white-king {
  color: #fff9e6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.piece.white-queen {
  color: #fff9e6;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  animation: gentle-bob 2s infinite ease-in-out;
}

.piece.movable:hover,
.piece.movable:active {
  transform: scale(1.2);
}

.target-square.highlight {
  background-color: rgba(230, 201, 156, 0.85) !important;
  cursor: pointer;
}

.move-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  animation: pulse-dot 1.5s infinite;
}

.chess-reveal {
  margin-top: 10px;
  text-align: center;
  background: rgba(230, 201, 156, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 14px;
  animation: pop-in 0.5s var(--ease-spring);
}

.heart-pulse {
  font-size: 1.6rem;
  animation: heartbeat 1.2s infinite;
  margin-bottom: 4px;
}

.chess-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold-bright);
  line-height: 1.5;
}

/* Barça Card Glow */
.barca-card {
  border-color: rgba(138, 21, 56, 0.35);
}

.barca-glow-accent {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 21, 56, 0.45) 0%, rgba(0, 77, 152, 0.4) 60%, transparent 100%);
  filter: blur(30px);
  pointer-events: none;
}

.barca-quote-box {
  background: rgba(0, 77, 152, 0.12);
  border-left: 3px solid #ff4d6d;
  padding: 12px 14px;
  border-radius: 0 10px 10px 0;
}

.barca-quote-box p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ================= STAGE 4: CAROUSEL GALLERY ================= */
.carousel-container {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 0;
}

.carousel-track {
  display: flex;
  width: 300%;
  transition: transform 0.5s var(--ease-cinematic);
}

.carousel-slide {
  width: calc(100% / 3);
  flex-shrink: 0;
  padding: 0 2px;
  box-sizing: border-box;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 22px;
  padding: 16px;
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.slide-caption {
  margin-top: 14px;
  text-align: left;
}

.slide-counter {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-primary);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.slide-caption p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  width: 100%;
  padding: 0 8px;
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(22, 25, 44, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav-btn:hover {
  background: var(--gold-primary);
  color: #121422;
  transform: scale(1.08);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  width: 24px;
  border-radius: 8px;
  background: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-primary);
}

/* ================= STAGE 5: CAKE RITUAL ================= */
.cake-display-area {
  position: relative;
  width: 100%;
  height: 310px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 30px;
}

.cake-glow-ambience {
  position: absolute;
  top: 30px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 180, 70, 0.3) 0%, rgba(240, 120, 60, 0.15) 50%, transparent 70%);
  filter: blur(25px);
  transition: opacity 1.2s ease, filter 1.2s ease;
  pointer-events: none;
}

.cake-glow-ambience.dimmed {
  opacity: 0.1;
  filter: blur(40px);
}

/* 3D Layered Cake */
.cake-3d {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: perspective(600px) rotateX(8deg);
  transition: transform 0.6s var(--ease-spring);
}

/* Candles */
.candle {
  position: absolute;
  bottom: 122px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.candle-1 { left: 45px; }
.candle-2 { left: 95px; bottom: 128px; }
.candle-3 { left: 145px; }

.wick {
  width: 2px;
  height: 8px;
  background: #444;
}

.candle-body {
  width: 10px;
  height: 36px;
  border-radius: 4px 4px 1px 1px;
  background: repeating-linear-gradient(
    45deg,
    #fff,
    #fff 4px,
    #f28b9a 4px,
    #f28b9a 8px
  );
  box-shadow: inset -2px 0 3px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Candle Flames */
.flame {
  position: absolute;
  top: -24px;
  width: 14px;
  height: 24px;
  border-radius: 50% 50% 20% 20% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at bottom, #fff 15%, #ffd452 45%, #ff5c1c 85%, transparent 100%);
  box-shadow: 0 0 15px #ffb326, 0 0 35px #ff5c1c;
  animation: flicker 0.15s infinite alternate ease-in-out;
  transform-origin: bottom center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.flame.extinguished {
  opacity: 0;
  transform: scale(0.2) translateY(-10px);
  pointer-events: none;
}

/* Smoke Whisp */
.smoke {
  position: absolute;
  top: -20px;
  width: 6px;
  height: 6px;
  background: rgba(220, 220, 220, 0.6);
  border-radius: 50%;
  filter: blur(2px);
  animation: smoke-rise 1.5s ease-out forwards;
}

/* Cake Tiers */
.cake-tier {
  position: relative;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

.tier-top {
  width: 150px;
  height: 52px;
  background: linear-gradient(180deg, #f7d9ba 0%, #e2ab80 70%, #ca8856 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 5;
  border-radius: 12px;
  margin-bottom: -4px;
}

.frosting-drops {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
}

.frosting-drops span {
  width: 18px;
  height: 14px;
  background: #fffdf5;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tier-bottom {
  width: 200px;
  height: 70px;
  background: linear-gradient(180deg, #ca8856 0%, #aa6435 60%, #874921 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  z-index: 4;
}

.tier-creams {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
}

.tier-creams span {
  width: 22px;
  height: 12px;
  background: #fff8eb;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.12);
}

.cake-plate {
  width: 250px;
  height: 14px;
  background: linear-gradient(90deg, #8c909e 0%, #f0f2f5 50%, #8c909e 100%);
  border-radius: 50%;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6);
  margin-top: -6px;
  z-index: 2;
}

/* Blow Controls */
.cake-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.btn-blow {
  background: linear-gradient(135deg, #ffb570 0%, #ff8364 100%);
  box-shadow: 0 10px 25px rgba(255, 131, 100, 0.35);
}

.blow-icon {
  font-size: 1.2rem;
}

.mic-toggle-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mic-meter {
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.meter-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.meter-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--mic-vol, 0%);
  background: linear-gradient(90deg, #4ade80, #facc15, #f87171);
  transition: width 0.08s ease;
}

.meter-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Post-blow Reveal */
.wish-reveal {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 24px 20px;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: pop-in 0.6s var(--ease-spring);
}

.celebration-badge {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold-bright);
}

.celebration-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ================= STAGE 6: LETTER & FINALE ================= */
.finale-photo-wrapper {
  width: 100%;
  max-width: 320px;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.finale-date-tag {
  position: absolute;
  bottom: 22px;
  right: 22px;
  background: rgba(10, 12, 22, 0.85);
  border: 1px solid var(--border-gold);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-primary);
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
}

.letter-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(26, 29, 48, 0.75) 0%, rgba(18, 20, 36, 0.85) 100%);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 32px 24px;
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: left;
}

.letter-header {
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(230, 201, 156, 0.2);
  padding-bottom: 12px;
}

.letter-salutation {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-bright);
}

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

.letter-body p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: #e4e7f5;
  letter-spacing: 0.01em;
}

.letter-closing {
  margin-top: 10px;
  font-weight: 600;
  color: var(--gold-bright) !important;
}

.letter-signature {
  margin-top: 24px;
  text-align: right;
}

.script-sig {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--rose-primary);
  text-shadow: 0 2px 10px rgba(242, 139, 154, 0.4);
}

.finale-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 10px;
}

.btn-save-app {
  background: linear-gradient(135deg, rgba(230, 201, 156, 0.95) 0%, rgba(242, 139, 154, 0.95) 100%);
  color: #121422;
}

.btn-icon-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.app-footer {
  margin-top: 30px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ================= FLOATING MUSIC PLAYER ================= */
.music-player {
  position: fixed;
  top: max(var(--safe-top), 16px);
  right: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 20, 36, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), border-color 0.3s ease;
}

.music-player:hover {
  transform: scale(1.04);
  border-color: var(--gold-primary);
}

.disc-wrap {
  position: relative;
  width: 32px;
  height: 32px;
}

.disc {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #333 30%, #111 70%);
  border: 2px solid rgba(230, 201, 156, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 3s linear infinite;
  animation-play-state: paused;
}

.music-player.playing .disc {
  animation-play-state: running;
}

.disc-center {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-primary);
}

.equalizer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
}

.equalizer .bar {
  width: 2px;
  height: 4px;
  background: var(--gold-bright);
  border-radius: 1px;
}

.music-player.playing .equalizer .bar-1 { animation: eq-bounce 0.8s infinite 0.1s; }
.music-player.playing .equalizer .bar-2 { animation: eq-bounce 0.8s infinite 0.3s; }
.music-player.playing .equalizer .bar-3 { animation: eq-bounce 0.8s infinite 0.2s; }
.music-player.playing .equalizer .bar-4 { animation: eq-bounce 0.8s infinite 0.4s; }

.player-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.player-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.player-status {
  font-size: 0.65rem;
  color: var(--gold-primary);
}

.player-toggle-btn {
  background: transparent;
  border: none;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
}

.player-toggle-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ================= PWA BANNER ================= */
.pwa-banner {
  position: fixed;
  bottom: max(var(--safe-bottom), 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 480px;
  background: rgba(18, 20, 36, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  animation: slide-up 0.5s var(--ease-spring);
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(230, 201, 156, 0.4);
}

.pwa-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.pwa-text strong {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.pwa-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pwa-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pwa {
  padding: 8px 16px;
  background: var(--gold-primary);
  color: #121422;
  font-weight: 600;
  font-size: 0.82rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn-pwa-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
}

/* ================= UTILITY & KEYFRAMES ================= */
.hidden {
  display: none !important;
}

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

@keyframes flicker {
  0% { transform: scale(1) rotate(-1deg); }
  50% { transform: scale(1.08) rotate(1deg); }
  100% { transform: scale(0.96) rotate(-2deg); }
}

@keyframes smoke-rise {
  0% { transform: scale(0.6) translateY(0); opacity: 0.8; }
  100% { transform: scale(2.5) translateY(-35px); opacity: 0; }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 15px rgba(179, 45, 62, 0.3); }
  100% { box-shadow: 0 0 30px rgba(179, 45, 62, 0.7); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.18); }
  50% { transform: scale(1.05); }
  75% { transform: scale(1.15); }
}

@keyframes gentle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

@keyframes eq-bounce {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

@keyframes slide-up {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 400px) {
  .date-selector-group {
    grid-template-columns: 1fr;
  }
  .counter-grid {
    gap: 6px;
  }
  .counter-number {
    font-size: 1.25rem;
  }
}
