/* ════════════════════════════════════════════════════════════
   VALENTINE — style.css
   Design tokens, animations, and all component styles.
   ════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --cream:     #FDF6F0;
  --soft-white:#FFFBF7;
  --blush:     #F2C4CE;
  --rose:      #D4677A;
  --deep-rose: #B84B5E;
  --burgundy:  #7A1F35;
  --muted:     #E8A0AD;
  --gold:      #C9A070;
  --text:      #3D2228;
  --mid:       #6B3845;

  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-display:'Playfair Display', serif;
  --font-script: 'Dancing Script', cursive;

  --radius-card: 20px;
  --radius-btn:  999px;
  --shadow-btn:  0 8px 28px rgba(180,75,94,.35);
  --shadow-card: 0 4px 32px rgba(61,34,40,.08);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-serif);
  background: var(--cream);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes float-up {
  0%   { transform: translateY(0) rotate(0deg); opacity: .55; }
  100% { transform: translateY(-110vh) rotate(30deg); opacity: 0; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes stage-enter {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.25); }
}
@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(580deg); opacity: 0; }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(212,103,122,.4); }
  50%       { box-shadow: 0 0 28px rgba(212,103,122,.8); }
}
@keyframes rec-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .2; }
}
@keyframes overlay-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes overlay-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(.96); }
}
@keyframes badge-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes badge-pop-left {
  from { opacity: 0; transform: translateY(14px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dl-slide {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes flip-card {
  from { transform: rotateY(0); }
  to   { transform: rotateY(180deg); }
}

/* ── Stages ──────────────────────────────────────────────── */
.stage {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stage.entering {
  animation: stage-enter .65s cubic-bezier(.22,1,.36,1) both;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: rgba(255,251,247,.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(242,196,206,.45);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #D4677A, #B84B5E);
  color: white;
  border: none;
  border-radius: var(--radius-btn);
  padding: 14px 40px;
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: .06em;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(180,75,94,.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  animation: shimmer 2.5s ease infinite;
}
.btn-primary.btn-sm { padding: 10px 20px; font-size: 14px; flex-shrink: 0; }

.btn-ghost {
  background: rgba(255,251,247,.7);
  border: 1.5px solid rgba(212,103,122,.4);
  color: var(--deep-rose);
  border-radius: var(--radius-btn);
  padding: 11px 30px;
  font-family: var(--font-serif);
  font-size: 16px;
  cursor: pointer;
  transition: all .22s ease;
}
.btn-ghost:hover { background: rgba(242,196,206,.35); border-color: #D4677A; transform: translateY(-1px); }

/* ── Floating Hearts ─────────────────────────────────────── */
#hearts {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.heart-particle {
  position: absolute;
  color: #D4677A;
  pointer-events: none;
  animation: float-up linear infinite;
}

/* ── Confetti ─────────────────────────────────────────────── */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confetti-fall ease-in both;
}

/* ════════════════════════════════════════════════════════════
   RECORDING OVERLAY
   ════════════════════════════════════════════════════════════ */
.rec-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(160deg, #3D1520 0%, #5C2535 45%, #3D1520 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: overlay-in .55s cubic-bezier(.22,1,.36,1) both;
}
.rec-overlay.exiting { animation: overlay-out .42s ease both; }

#overlay-hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.overlay-heart {
  position: absolute;
  color: #F2C4CE;
  pointer-events: none;
  animation: float-up linear infinite;
}

.overlay-content {
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 1;
}
.overlay-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(242,196,206,.12);
  border: 1.5px solid rgba(242,196,206,.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: 0 auto 24px;
  animation: float-up 0s; /* reuse float-gentle via custom anim below */
}
@keyframes icon-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.overlay-icon { animation: icon-float 3.5s ease-in-out infinite; }

.overlay-kicker {
  font-family: var(--font-script);
  font-size: 18px;
  color: #E8A0AD;
  letter-spacing: .1em;
  margin-bottom: 14px;
}
.overlay-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(24px, 5.5vw, 38px);
  color: #FDF6F0;
  line-height: 1.2;
  margin-bottom: 18px;
  animation: fadeInUp .7s ease both;
}
.overlay-body {
  font-size: clamp(14px, 2.2vw, 16px);
  color: rgba(253,246,240,.72);
  line-height: 1.85;
  margin-bottom: 36px;
  font-style: italic;
  animation: fadeInUp .7s .1s ease both;
}
.overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  animation: fadeInUp .7s .2s ease both;
}
.btn-allow {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #D4677A, #B84B5E);
  color: white;
  border: none;
  border-radius: var(--radius-btn);
  padding: 16px 40px;
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: .06em;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(180,75,94,.5);
  transition: transform .2s, box-shadow .2s;
}
.btn-allow:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(180,75,94,.6); }
.btn-allow:disabled { opacity: .65; cursor: default; }
.btn-allow::after {
  content: ''; position: absolute; top:0; left:-100%; width:50%; height:100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  animation: shimmer 2.8s ease infinite;
}
.btn-skip {
  background: none;
  border: 1.5px solid rgba(253,246,240,.22);
  color: rgba(253,246,240,.65);
  border-radius: var(--radius-btn);
  padding: 12px 32px;
  font-family: var(--font-serif);
  font-size: 15px;
  cursor: pointer;
  transition: all .22s ease;
}
.btn-skip:hover { border-color: rgba(253,246,240,.45); color: rgba(253,246,240,.9); background: rgba(253,246,240,.06); }
.overlay-disclaimer {
  margin-top: 28px;
  font-size: 12px;
  color: rgba(253,246,240,.28);
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   PROGRESS BAR
   ════════════════════════════════════════════════════════════ */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(253,246,240,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(242,196,206,.4);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-dots { display: flex; gap: 8px; align-items: center; }
.progress-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  transition: all .4s ease;
}
.progress-dot.done   { background: #D4677A; }
.progress-dot.active { background: #B84B5E; transform: scale(1.5); box-shadow: 0 0 0 3px rgba(212,103,122,.25); }
.progress-dot.locked { background: rgba(212,103,122,.2); border: 1.5px solid rgba(212,103,122,.3); }
.progress-label {
  font-size: 13px;
  color: var(--mid);
  letter-spacing: .06em;
  font-style: italic;
  margin-left: 4px;
  white-space: nowrap;
}
.progress-track {
  flex: 1;
  height: 4px;
  background: rgba(242,196,206,.3);
  border-radius: 999px;
  overflow: hidden;
  margin-left: auto;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #D4677A, #B84B5E);
  border-radius: 999px;
  transition: width .6s ease;
}
.progress-counter { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ════════════════════════════════════════════════════════════
   RECORDING BADGE + TOASTS
   ════════════════════════════════════════════════════════════ */
.rec-badge {
  position: fixed;
  bottom: 22px; left: 22px;
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(253,246,240,.93);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(242,196,206,.5);
  border-radius: 999px;
  padding: 8px 16px 8px 12px;
  box-shadow: 0 4px 22px rgba(61,34,40,.13);
  animation: badge-pop-left .5s .2s ease both;
}
.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #e05252;
  flex-shrink: 0;
  animation: rec-blink 1.4s ease-in-out infinite;
}
.rec-label { font-size: 13px; letter-spacing: .06em; color: var(--mid); }

.saved-toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(253,246,240,.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(212,103,122,.35);
  border-radius: 999px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(61,34,40,.14);
  white-space: nowrap;
  animation: badge-pop .5s ease both;
  font-size: 15px;
  color: var(--burgundy);
  font-style: italic;
}

.dl-banner {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(253,246,240,.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(242,196,206,.5);
  border-radius: 16px;
  padding: 14px 22px;
  box-shadow: 0 8px 32px rgba(61,34,40,.14);
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  animation: dl-slide .5s ease both;
}
.dl-icon { font-size: 24px; }
.dl-title { font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--burgundy); margin-bottom: 2px; }
.dl-sub   { font-size: 13px; color: var(--mid); font-style: italic; }
.btn-dismiss { background: none; border: none; color: var(--mid); cursor: pointer; font-size: 18px; padding: 0 4px; }

/* ════════════════════════════════════════════════════════════
   STAGE 0 — WELCOME
   ════════════════════════════════════════════════════════════ */
.welcome-stage {
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
  background: linear-gradient(160deg, #FDF6F0 0%, #F9E8EE 45%, #F2C4CE 100%);
  position: relative;
}
.welcome-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
}
.welcome-blob-1 { top:-12%; right:-8%; width:380px; height:380px; background: rgba(242,196,206,.3); }
.welcome-blob-2 { bottom:-10%; left:-6%; width:300px; height:300px; background: rgba(212,103,122,.18); filter: blur(60px); }
.welcome-content {
  position: relative;
  z-index: 1;
  max-width: 580px;
  width: 100%;
}
.welcome-heart {
  font-size: 56px;
  animation: pulse-heart 1.6s ease-in-out infinite;
  margin-bottom: 20px;
}
.welcome-date-label {
  font-family: var(--font-script);
  font-size: clamp(15px, 3vw, 18px);
  color: var(--deep-rose);
  letter-spacing: .14em;
  margin-bottom: 14px;
  animation: fadeInUp .8s ease both;
}
.welcome-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--burgundy);
  margin-bottom: 18px;
  animation: fadeInUp .9s .15s ease both;
}
.welcome-subtitle {
  font-size: clamp(17px, 2.8vw, 22px);
  color: var(--mid);
  font-style: italic;
  margin-bottom: 52px;
  animation: fadeInUp .9s .3s ease both;
}
.welcome-cta { animation: fadeInUp .9s .5s ease both; }
.welcome-cta .btn-primary { font-size: 20px; padding: 16px 52px; }

/* ════════════════════════════════════════════════════════════
   STAGE 1 — LETTER
   ════════════════════════════════════════════════════════════ */
.letter-stage {
  min-height: 100vh;
  padding: 80px 20px 40px;
  background: linear-gradient(180deg, #FDF6F0, #F9E8EE 60%, #FDF6F0);
}
.letter-header {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeInUp .7s ease both;
}
.letter-kicker { font-family: var(--font-script); font-size: 18px; color: var(--rose); letter-spacing: .1em; }
.letter-heading {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(28px, 5vw, 42px);
  color: var(--burgundy);
  margin-top: 6px;
}
.letter-card {
  max-width: 620px;
  width: 100%;
  padding: 36px 36px 28px;
  margin-bottom: 28px;
  animation: scaleIn .7s .1s ease both;
}
.letter-seal {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(242,196,206,.4);
  font-size: 40px;
}
.letter-body p {
  font-size: clamp(15px, 2.2vw, 17px);
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.9;
}
.letter-body p:first-child { font-weight: 500; }
.letter-signoff {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(242,196,206,.4);
}
.letter-sign-text { font-size: 16px; color: var(--mid); font-style: italic; margin-bottom: 4px; }
.letter-sign-name { font-family: var(--font-script); font-size: 28px; color: var(--deep-rose); }

.reactions-card {
  max-width: 620px;
  width: 100%;
  padding: 20px 24px;
  margin-bottom: 28px;
  animation: fadeInUp .7s .2s ease both;
}
.reactions-label {
  text-align: center;
  font-size: 14px;
  color: var(--mid);
  letter-spacing: .08em;
  margin-bottom: 14px;
}
.reactions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.emoji-btn {
  background: none;
  border: 2px solid rgba(212,103,122,.2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 20px;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}
.emoji-btn:hover { transform: scale(1.15); border-color: #D4677A; background: rgba(242,196,206,.2); }
.emoji-btn.reacted { border-color: #D4677A; background: rgba(242,196,206,.3); animation: pulse-heart .4s ease; }
.emoji-count { font-size: 11px; vertical-align: top; color: var(--rose); margin-left: 3px; }
.emoji-floater {
  position: fixed;
  pointer-events: none;
  z-index: 500;
  font-size: 30px;
  animation: float-up 2s ease both;
}

.letter-cta { max-width: 620px; width: 100%; text-align: center; animation: fadeInUp .7s .4s ease both; }

/* ════════════════════════════════════════════════════════════
   STAGE 2 — MEMORY MATCH
   ════════════════════════════════════════════════════════════ */
.memory-stage {
  min-height: 100vh;
  padding: 80px 20px 40px;
  background: linear-gradient(180deg, #F9E8EE, #FDF6F0);
}
.game-header { text-align: center; margin-bottom: 24px; animation: fadeInUp .7s ease both; }
.game-kicker  { font-family: var(--font-script); font-size: 17px; color: var(--rose); }
.game-title   { font-family: var(--font-display); font-style: italic; font-size: clamp(24px,5vw,36px); color: var(--burgundy); margin-top: 4px; }
.game-hint    { font-size: 14px; color: var(--mid); font-style: italic; margin-top: 6px; }

.game-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 22px;
}
.stat { text-align: center; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--deep-rose); font-family: var(--font-display); }
.stat-label { font-size: 11px; color: var(--mid); letter-spacing: .1em; }

.game-win-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  padding: 24px;
  margin-bottom: 22px;
  animation: scaleIn .5s ease both;
}
.game-win-icon  { font-size: 44px; }
.game-win-title { font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--burgundy); margin-top: 10px; }
.game-win-sub   { color: var(--mid); margin-top: 6px; font-size: 15px; }
.game-win-card .btn-primary { margin-top: 18px; }

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}
.memory-card {
  perspective: 700px;
  cursor: pointer;
  height: clamp(75px, 20vw, 95px);
}
.memory-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.175,.885,.32,1.275);
  border-radius: 12px;
}
.memory-inner.flipped  { transform: rotateY(180deg); }
.memory-face, .memory-back {
  position: absolute;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.memory-face {
  background: linear-gradient(135deg, #D4677A, #7A1F35);
  font-size: 22px; opacity: .65; color: white;
}
.memory-back {
  transform: rotateY(180deg);
}
.memory-back img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
.memory-card.matched .memory-inner {
  box-shadow: 0 0 0 2.5px #D4677A, 0 0 14px rgba(212,103,122,.4);
}

/* ════════════════════════════════════════════════════════════
   STAGE 3 — WORD HUNT
   ════════════════════════════════════════════════════════════ */
.wordhunt-stage {
  min-height: 100vh;
  padding: 80px 20px 40px;
  background: linear-gradient(180deg, #FDF6F0, #F9E8EE 60%, #FDF6F0);
}
.word-list-card {
  max-width: 480px;
  width: 100%;
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: fadeInUp .6s .1s ease both;
}
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.word-chip {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .08em;
  border: 1px solid rgba(212,103,122,.2);
  color: var(--mid);
  background: rgba(242,196,206,.3);
  transition: all .3s ease;
}
.word-chip.found {
  background: linear-gradient(135deg, #D4677A, #B84B5E);
  color: white;
  font-weight: 700;
  border-color: transparent;
}

.ws-grid-wrap { display: flex; justify-content: center; }
.ws-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 2px;
  user-select: none;
  touch-action: none;
}
.word-cell {
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-serif);
  cursor: default;
  transition: background .08s, transform .08s;
}
.word-cell.selecting { background: rgba(212,103,122,.28) !important; transform: scale(1.08); }
.word-cell.found     { background: linear-gradient(135deg, #D4677A, #B84B5E) !important; color: white !important; font-weight: 700; }

.ws-progress { text-align: center; font-size: 13px; color: var(--mid); margin-top: 12px; font-style: italic; }

/* ════════════════════════════════════════════════════════════
   STAGE 4 — TRIVIA
   ════════════════════════════════════════════════════════════ */
.trivia-stage {
  min-height: 100vh;
  padding: 80px 20px 40px;
  background: linear-gradient(180deg, #FDF6F0, #F9E8EE 60%, #FDF6F0);
}

/* Trivia intro */
.trivia-intro { max-width: 520px; width: 100%; text-align: center; }
.trivia-intro .game-title { margin-bottom: 12px; }
.trivia-intro-sub { color: var(--mid); font-size: 16px; font-style: italic; margin-bottom: 30px; }
.timer-option-card { max-width: 520px; width: 100%; padding: 24px 28px; margin-bottom: 28px; text-align: left; }
.timer-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 16px; color: var(--text); }
.timer-label input { accent-color: #D4677A; width: 18px; height: 18px; }
.trivia-start-btn { font-size: 19px; padding: 15px 48px; }

/* Trivia playing */
.trivia-playing { max-width: 540px; width: 100%; }
.trivia-hud {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}
.trivia-stat { text-align: center; }
.trivia-stat-value { font-size: 18px; font-weight: 700; color: var(--deep-rose); font-family: var(--font-display); }
.trivia-stat-label { font-size: 10px; color: var(--mid); letter-spacing: .08em; }
.trivia-timer-circle {
  margin-left: auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #D4677A;
  background: rgba(242,196,206,.3);
  font-size: 15px; font-weight: 700; color: var(--deep-rose);
  transition: border-color .3s, color .3s, background .3s;
  flex-shrink: 0;
}
.trivia-timer-circle.urgent {
  border-color: #dc7070;
  background: rgba(220,100,100,.12);
  color: #dc7070;
}

.trivia-meta {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--mid);
  margin-bottom: 6px;
}
.trivia-progress-track {
  height: 4px;
  background: rgba(242,196,206,.3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}
.trivia-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #D4677A, #B84B5E);
  border-radius: 999px;
  transition: width .4s ease;
}

.trivia-question-card { padding: 26px 26px 22px; animation: fadeInUp .45s ease both; }
.trivia-q { font-family: var(--font-display); font-style: italic; font-size: 18px; color: var(--burgundy); margin-bottom: 20px; line-height: 1.5; }
.answer-options { display: flex; flex-direction: column; gap: 9px; }
.answer-btn {
  width: 100%;
  background: rgba(253,246,240,.85);
  border: 1.5px solid rgba(212,103,122,.2);
  border-radius: 12px;
  padding: 13px 18px;
  text-align: left;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  transition: all .2s ease;
}
.answer-btn:hover:not([disabled]) { background: rgba(242,196,206,.35); border-color: #D4677A; transform: translateX(6px); }
.answer-btn .opt-letter { color: var(--rose); margin-right: 8px; font-size: 13px; }
.answer-btn .opt-tick   { float: right; color: #6ec87a; }
.answer-btn.correct { background: rgba(130,200,145,.28) !important; border-color: #6ec87a !important; }
.answer-btn.wrong   { background: rgba(220,100,100,.22) !important; border-color: #dc7070 !important; }

.trivia-tip {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: rgba(242,196,206,.22);
  font-size: 14px; color: var(--deep-rose);
  font-style: italic;
  animation: fadeInUp .3s ease both;
}

/* Trivia done */
.trivia-done { max-width: 500px; width: 100%; text-align: center; }
.trivia-done-card { padding: 44px 36px; }
.trivia-done-icon  { font-size: 52px; }
.trivia-done-title { font-family: var(--font-display); font-style: italic; font-size: clamp(22px,4vw,30px); color: var(--burgundy); margin: 16px 0 12px; }
.trivia-done-stats { display: flex; justify-content: center; gap: 28px; margin: 20px 0; }
.trivia-done-stat-v { font-size: 22px; font-weight: 700; color: var(--deep-rose); font-family: var(--font-display); }
.trivia-done-stat-l { font-size: 11px; color: var(--mid); letter-spacing: .08em; margin-top: 3px; }
.trivia-done-btns { display: flex; gap: 14px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* ════════════════════════════════════════════════════════════
   STAGE 5 — FINAL
   ════════════════════════════════════════════════════════════ */
.final-stage {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 80px 24px 40px;
  background: linear-gradient(160deg, #FDF6F0 0%, #F9E8EE 50%, #F2C4CE 100%);
  position: relative;
}
.final-blob { position: absolute; border-radius: 50%; pointer-events: none; }
.final-blob-1 { top:-15%; right:-8%; width:400px; height:400px; background:rgba(242,196,206,.28); filter:blur(80px); }
.final-blob-2 { bottom:-12%; left:-6%; width:350px; height:350px; background:rgba(212,103,122,.16); filter:blur(70px); }
.final-content { max-width: 600px; width: 100%; position: relative; z-index: 1; }
.final-heart { font-size: 60px; animation: pulse-heart 1.8s ease-in-out infinite; margin-bottom: 20px; }
.final-kicker { font-family: var(--font-script); font-size: 18px; color: var(--rose); letter-spacing: .1em; }
.final-title {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(28px,6vw,52px); color: var(--burgundy);
  margin: 10px 0 20px; line-height: 1.15;
  animation: fadeInUp .8s ease both;
}
.final-message {
  font-size: clamp(16px,2.5vw,20px); color: var(--mid);
  font-style: italic; line-height: 1.85; margin-bottom: 42px;
  animation: fadeInUp .8s .15s ease both;
}
.final-open-wrap { animation: fadeInUp .8s .3s ease both; }
.final-open-btn  { font-size: 20px; padding: 18px 56px; animation: glow-pulse 2s ease-in-out infinite; }

.final-reveal-card {
  padding: 40px 36px;
  animation: scaleIn .65s ease both;
  position: relative; overflow: hidden;
  text-align: center;
}
.final-reveal-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(242,196,206,.35), transparent 70%);
  pointer-events: none;
}
.final-reveal-icon    { font-size: 52px; margin-bottom: 16px; }
.final-reveal-quote   {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(22px,4.5vw,36px); color: var(--burgundy);
  line-height: 1.3; margin-bottom: 20px;
}
.final-reveal-divider { height: 1px; background: linear-gradient(90deg,transparent,rgba(212,103,122,.4),transparent); margin: 20px 0; }
.final-reveal-message { font-size: 16px; color: var(--mid); font-style: italic; line-height: 1.8; }
.final-signoff { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(242,196,206,.35); }
.final-signoff-from { font-size: 14px; color: var(--mid); font-style: italic; }
.final-signoff-name  { font-family: var(--font-script); font-size: 30px; color: var(--deep-rose); margin-top: 4px; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .btn-primary { padding: 12px 28px; font-size: 16px; }
  .btn-ghost   { padding: 10px 22px; font-size: 15px; }
  .letter-card { padding: 24px 20px; }
  .memory-grid { gap: 6px; }
  .dl-banner   { flex-wrap: wrap; white-space: normal; }
  .trivia-done-stats { gap: 16px; }
}
@media (max-width: 360px) {
  .welcome-title { font-size: 40px; }
  .progress-label { display: none; }
}
