/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg1: #1a0b2e;
  --bg2: #2d1b4e;
  --accent: #ff5e9c;
  --accent2: #ffd166;
  --gold: #ffd166;
  --text: #f5f0ff;
  --muted: #b9a9d6;
}
html, body { height: 100%; }
body {
  font-family: 'Fredoka', system-ui, sans-serif;
  background: radial-gradient(120% 120% at 50% 0%, var(--bg2) 0%, var(--bg1) 60%, #0d0519 100%);
  color: var(--text);
  overflow: hidden;
  min-height: 100dvh;
}
#app { position: relative; height: 100dvh; width: 100%; }

/* ===== SCREENS ===== */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 24px;
  gap: 16px;
  opacity: 0;
  transition: opacity .45s ease;
  overflow-y: auto;
}
.screen.active { display: flex; opacity: 1; }

/* ===== LANDING ===== */
.lock-badge {
  font-size: 64px;
  filter: drop-shadow(0 6px 18px rgba(255,94,156,.5));
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.title {
  font-size: clamp(34px, 11vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .5px;
}
.title .locked {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--muted); font-size: 17px; max-width: 320px; }
.difficulty {
  margin-top: 4px;
  background: rgba(255,94,156,.14);
  border: 1px solid rgba(255,94,156,.4);
  padding: 8px 18px; border-radius: 999px; font-size: 15px;
}
.difficulty strong { color: var(--accent); letter-spacing: 1px; }
.warn { color: var(--accent2); font-size: 14px; }
.tiny { color: var(--muted); font-size: 13px; opacity: .8; }

/* ===== BUTTONS ===== */
.btn-primary {
  margin-top: 10px;
  font-family: inherit;
  font-size: 19px; font-weight: 600;
  color: #1a0b2e;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border: none; border-radius: 999px;
  padding: 16px 34px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255,94,156,.45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:active { transform: scale(.95); }
.btn-ghost {
  margin-top: 18px;
  font-family: inherit; font-size: 15px;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(185,169,214,.4);
  border-radius: 999px; padding: 10px 22px; cursor: pointer;
}

/* ===== QUIZ ===== */
.progress-wrap { width: 100%; max-width: 460px; }
.progress-bar {
  width: 100%; height: 10px;
  background: rgba(255,255,255,.12);
  border-radius: 999px; overflow: hidden;
}
.progress-bar.big { height: 16px; max-width: 320px; margin-top: 8px; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 999px; transition: width .5s ease;
}
.progress-label { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.q-card {
  width: 100%; max-width: 460px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  padding: 28px 22px;
  backdrop-filter: blur(8px);
}
.question {
  font-size: clamp(22px, 6.5vw, 28px);
  font-weight: 600; line-height: 1.25;
  margin-bottom: 22px;
}
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  font-family: inherit; font-size: 17px; font-weight: 500;
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.16);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.option:active { transform: scale(.97); }
.option.correct { background: rgba(94,255,158,.18); border-color: #5eff9e; }
.option.runaway { position: relative; }
.reaction {
  min-height: 28px; font-size: 17px; font-weight: 600;
  color: var(--accent2); opacity: 0;
  transition: opacity .3s ease;
}
.reaction.show { opacity: 1; }

/* ===== CALCULATING ===== */
.spinner {
  width: 58px; height: 58px;
  border: 5px solid rgba(255,255,255,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.calc-text { font-size: 20px; font-weight: 500; }

/* ===== SCORE ===== */
.score-num {
  font-size: clamp(80px, 28vw, 140px);
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  animation: pop .6s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { 0%{transform:scale(0)} 100%{transform:scale(1)} }
.score-sub { font-size: 20px; }
.score-line { color: var(--muted); font-size: 15px; }

/* ===== REVEAL ===== */
#reveal { justify-content: flex-start; padding-top: 36px; gap: 14px; }
.reveal-head { margin-bottom: 4px; }
.bday {
  font-size: clamp(26px, 8vw, 38px); font-weight: 600;
  color: var(--text);
}
.bday sup { font-size: .5em; }
.name {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(52px, 16vw, 84px);
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.slideshow {
  position: relative;
  width: 100%; max-width: 420px;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.slideshow img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.slideshow img.show { opacity: 1; }
.slide-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--muted); font-size: 14px; padding: 20px;
}
.slide-empty p:first-child { font-size: 44px; }
.slide-empty code { color: var(--accent2); }
.message {
  max-width: 440px;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 16px; line-height: 1.6; color: var(--text);
  margin-top: 8px;
}
.message p { opacity: .95; }
.signoff {
  font-family: 'Dancing Script', cursive;
  font-size: 24px; color: var(--accent2); margin-top: 6px;
}

/* ===== CONFETTI CANVAS ===== */
#confetti {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 50;
}
