:root {
  --bg: #0c0a14;
  --bg2: #17122a;
  --text: #e8e3f5;
  --dim: #8d84a8;
  --accent: #a78bfa;
  --accent2: #7c3aed;
  --good: #34d399;
  --bad: #f87171;
  --gold: #fbbf24;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  background: radial-gradient(ellipse 120% 60% at 50% -10%, #241a45 0%, var(--bg) 60%);
}

#app { max-width: 480px; margin: 0 auto; }

#confetti {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 50;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 24px);
}
.screen.active { display: flex; }
.screen.center { justify-content: center; align-items: center; text-align: center; gap: 18px; }

.hidden { display: none !important; }

/* ---------- landing ---------- */
.landing-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.badge {
  align-self: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent);
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(124, 58, 237, 0.08);
}
.badge.small { align-self: flex-start; font-size: 10px; padding: 4px 10px; }
.badge.success { color: var(--good); border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.08); }

h1.glitch {
  font-family: var(--mono);
  text-align: center;
  font-size: clamp(38px, 12vw, 56px);
  line-height: 1.05;
  margin: 0;
  letter-spacing: 4px;
  text-shadow: 0 0 30px rgba(167, 139, 250, 0.45);
  animation: flicker 4s infinite;
}
@keyframes flicker {
  0%, 92%, 96%, 100% { opacity: 1; }
  93%, 95% { opacity: 0.6; }
}

.type {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  color: var(--dim);
  text-align: center;
  min-height: 4.5em;
  margin: 0;
  white-space: pre-wrap;
}
.type::after { content: "▌"; color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.scanline {
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.012) 3px 4px);
}

.footer-note {
  font-family: var(--mono);
  font-size: 11px;
  color: #4d4468;
  text-align: center;
  letter-spacing: 1px;
  margin-top: 20px;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  border: none;
  border-radius: 14px;
  padding: 18px 24px;
  width: 100%;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent2), #5b21b6);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
}
.btn.ghost {
  color: var(--dim);
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.3);
}
.btn.party {
  color: #1c1030;
  font-size: 18px;
  background: linear-gradient(135deg, var(--gold), #f97316);
  box-shadow: 0 6px 28px rgba(251, 191, 36, 0.4);
}

/* ---------- captcha ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.progress { font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: 2px; }

.prompt {
  font-size: 21px;
  margin: 4px 0 16px;
  line-height: 1.35;
  text-align: center;
}
.accent { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.selected { border-color: var(--accent); transform: scale(0.94); }
.tile.selected::after {
  content: "✓";
  position: absolute; top: 5px; right: 7px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent2);
  color: white;
  font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.msg {
  font-family: var(--mono);
  text-align: center;
  font-size: 14px;
  min-height: 1.4em;
  margin: 0 0 12px;
  color: var(--bad);
}
.msg.ok { color: var(--good); }

.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ---------- country game ---------- */
#country-photo-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#country-photo { width: 100%; max-height: 58dvh; object-fit: cover; display: block; }

#countdown {
  position: absolute;
  top: 12px; right: 12px;
  width: 60px; height: 60px;
}
#countdown svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: rgba(0,0,0,0.55); stroke: rgba(255,255,255,0.15); stroke-width: 5; }
.ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 163.4;
}
#countdown-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 24px; font-weight: 800;
  color: white;
}

#country-options { display: flex; flex-direction: column; gap: 10px; }
.country-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: var(--bg2);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.country-btn img, .country-btn svg { width: 54px; height: 54px; flex: none; }
.country-btn.wrong { border-color: var(--bad); background: rgba(248, 113, 113, 0.08); opacity: 0.5; pointer-events: none; }
.country-btn.right { border-color: var(--good); background: rgba(52, 211, 153, 0.1); }

/* ---------- reveal ---------- */
.reveal-headline { font-size: 30px; margin: 0; line-height: 1.25; }

.reveal-birthday {
  font-size: clamp(32px, 10vw, 44px);
  margin: 0;
  line-height: 1.15;
  text-align: center;
  background: linear-gradient(135deg, #fbbf24, #f472b6, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 24px rgba(251, 191, 36, 0.35));
}

.reveal-warm {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
  text-align: center;
  max-width: 340px;
}

.reveal-intro {
  font-size: 16px;
  color: var(--gold);
  font-style: italic;
  margin: 0 0 12px;
  line-height: 1.5;
}

.card {
  width: 100%;
  background: linear-gradient(160deg, #221743, var(--bg2));
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.card-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 10px;
}
.card h2 { margin: 0 0 6px; font-size: 24px; }
.card .when {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.card p { margin: 0; color: var(--dim); line-height: 1.5; }
.card.teaser { border-color: rgba(251, 191, 36, 0.4); }
.card.teaser .card-label { color: var(--gold); }
.card.teaser p { color: var(--text); font-size: 17px; line-height: 1.6; }

.badge.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(167, 139, 250, 0); }
}

.video-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 16px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#message-video {
  width: 100%;
  max-height: 62dvh;
  display: block;
  background: #000;
}

.bigtext { font-size: 22px; line-height: 1.5; margin: 0; }

.fade-in { animation: fadein 0.6s both; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
