:root {
  --bg: #fdf6f0;
  --ink: #3a2a2a;
  --accent: #d98a8a;
  --accent-2: #e8b4a0;
  --muted: #a08a8a;
  --card: rgba(255, 255, 255, 0.55);
  --card-border: rgba(58, 42, 42, 0.1);
  --shadow: 0 10px 40px rgba(58, 42, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ---- Stage (fullscreen container for the current slide) ---- */
.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
  padding-top: max(2rem, env(safe-area-inset-top));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

/* ---- Slide ---- */
.slide {
  width: 100%;
  max-width: 36rem;
  text-align: center;
  animation: slideIn .7s cubic-bezier(.2,.7,.2,1);
}
.slide.out { animation: slideOut .35s ease-in forwards; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideOut {
  to { opacity: 0; transform: translateY(-8px); }
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

h1.title {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
h1.title em {
  font-style: italic;
  color: var(--accent);
}

h2.subtitle {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.4rem, 4.5vw, 2.2rem);
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

.body-text {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(1.1rem, 3.4vw, 1.35rem);
  line-height: 1.7;
  color: var(--ink);
  opacity: 0.9;
  margin-bottom: 2rem;
}
.body-text + .body-text { margin-top: -0.5rem; }

/* ---- Countdown ---- */
.countdown {
  display: inline-flex;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.unit { text-align: center; min-width: 2.6rem; }
.unit .num {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  line-height: 1;
  display: block;
}
.unit .label {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.4rem;
  display: block;
}

/* ---- Tap to continue hint ---- */
.tap-hint {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: hintFade 2.5s ease-in-out 1.2s infinite;
}
@keyframes hintFade {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.7; }
}

/* ---- Progress dots ---- */
.progress {
  position: fixed;
  left: 0; right: 0;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  pointer-events: none;
}
.progress .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.3;
  transition: opacity .3s, transform .3s;
}
.progress .dot.active { opacity: 0.9; transform: scale(1.3); }
.progress .dot.done { opacity: 0.55; }

/* ---- Button ---- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background .25s, color .25s, transform .15s;
  margin: 0.4rem;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover, .btn:focus-visible { background: var(--accent); color: #fff; outline: none; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #c97474; border-color: #c97474; }
.btn.ghost { border-color: var(--card-border); color: var(--ink); }
.btn.ghost:hover { background: rgba(58,42,42,0.06); color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }

/* ---- Gift list ---- */
.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 1.5rem 0 1rem;
  max-height: 55vh;
  overflow-y: auto;
  padding: 0.25rem;
  scrollbar-width: thin;
}
.gift {
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card);
  padding: 1rem 0.75rem;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-align: center;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gift:active { transform: scale(0.97); }
.gift.selected {
  border-color: var(--accent);
  background: rgba(217, 138, 138, 0.12);
  color: var(--accent);
}
.gift.selected::after {
  content: '✓';
  position: absolute;
  top: 6px; right: 8px;
  font-size: 0.8rem;
  color: var(--accent);
}

.selection-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* ---- Raffle ---- */
.raffle-stage {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-style: italic;
  color: var(--accent);
  min-height: 4rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Reveal ---- */
.reveal-card {
  display: inline-block;
  padding: 2rem 2.5rem;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
  animation: pop .6s cubic-bezier(.2,1.5,.4,1);
}
@keyframes pop {
  0%   { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
.reveal-card .label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.6rem;
}
.reveal-card .gift-name {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-style: italic;
}

/* ---- Hamburger menu (free phase) ---- */
.menu-btn {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: 1rem;
  width: 42px; height: 42px;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 20;
  -webkit-tap-highlight-color: transparent;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform .3s, opacity .3s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 15;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  animation: slideIn .35s ease-out;
}
.menu[hidden], .menu-btn[hidden] { display: none !important; }
.menu button {
  background: none;
  border: none;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: var(--ink);
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: color .2s;
}
.menu button:hover { color: var(--accent); }

/* ---- Petals (decorative) ---- */
#petals { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.petal {
  position: absolute;
  top: -20px;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50% 0;
  opacity: 0.5;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(540deg); }
}

/* ---- Misc ---- */
.center { text-align: center; }
.hidden { display: none !important; }
.dim { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }
