/* ══════════════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════════════ */
:root {
  /* Palette */
  --boy-blue: #4fc3f7;
  --boy-blue-deep: #0288d1;
  --boy-blue-glow: rgba(79, 195, 247, 0.35);
  --girl-pink: #f48fb1;
  --girl-pink-deep: #e91e8a;
  --girl-pink-glow: rgba(244, 143, 177, 0.35);
  --gold: #ffd54f;
  --gold-glow: rgba(255, 213, 79, 0.4);
  --bg-dark: #0d0d1a;
  --bg-dark-alt: #141428;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);

  /* Typography */
  --font-family: 'Outfit', sans-serif;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Spacing */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ══════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════
   SCREEN SYSTEM
   ══════════════════════════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s var(--ease-smooth), visibility 0.8s;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* ══════════════════════════════════════════════════
   LANDING SCREEN
   ══════════════════════════════════════════════════ */
#landing {
  background: linear-gradient(160deg, var(--bg-dark) 0%, var(--bg-dark-alt) 50%, #1a0a2e 100%);
}

.landing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  gap: 1.5rem;
  z-index: 2;
}

/* Floating icon with ripple rings */
.landing-icon-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-icon {
  font-size: 4.5rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--gold-glow));
  position: relative;
  z-index: 2;
}

.landing-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0;
  animation: ripple 3s ease-out infinite;
}

.landing-ring--delay {
  animation-delay: 1.5s;
}

.landing-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Floating background particles */
.landing-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 6s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════
   CTA BUTTON
   ══════════════════════════════════════════════════ */
.cta-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 3rem;
  border: none;
  border-radius: 60px;
  font-family: var(--font-family);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--bg-dark);
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold) 0%, #ffb300 100%);
  box-shadow:
    0 4px 24px rgba(255, 213, 79, 0.4),
    0 0 60px rgba(255, 213, 79, 0.15);
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s var(--ease-smooth);
  -webkit-tap-highlight-color: transparent;
  animation: pulse 2s ease-in-out infinite;
  margin-top: 0.5rem;
}

.cta-btn:active {
  transform: scale(0.95);
}

.cta-btn__text {
  position: relative;
  z-index: 2;
}

.cta-btn__shimmer {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent 100%);
  transform: rotate(25deg);
  animation: shimmer 3s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════
   SUSPENSE SCREEN
   ══════════════════════════════════════════════════ */
#suspense {
  background: var(--bg-dark);
  transition: opacity 0.8s var(--ease-smooth), visibility 0.8s, background 1.2s var(--ease-smooth);
}

.suspense-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  gap: 2rem;
  z-index: 2;
}

/* Gender card */
.suspense-card {
  width: min(320px, 85vw);
  padding: 3rem 2rem;
  border-radius: 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  transition: transform 0.6s var(--ease-bounce), box-shadow 0.6s var(--ease-smooth),
    border-color 0.6s var(--ease-smooth);
}

.suspense-card.pink {
  border-color: var(--girl-pink);
  box-shadow: 0 0 40px var(--girl-pink-glow), 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: rotate(-2deg) scale(1.02);
}

.suspense-card.blue {
  border-color: var(--boy-blue);
  box-shadow: 0 0 40px var(--boy-blue-glow), 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: rotate(2deg) scale(1.02);
}

.suspense-emoji {
  font-size: 5rem;
  transition: transform 0.5s var(--ease-bounce);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.suspense-card.pink .suspense-emoji {
  transform: scale(1.1) rotate(-5deg);
}

.suspense-card.blue .suspense-emoji {
  transform: scale(1.1) rotate(5deg);
}

.suspense-question {
  font-size: 1.5rem;
  font-weight: 600;
  transition: color 0.5s var(--ease-smooth);
}

.suspense-card.pink .suspense-question {
  color: var(--girl-pink);
}

.suspense-card.blue .suspense-question {
  color: var(--boy-blue);
}

/* Progress ring */
.progress-ring-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring__track {
  fill: none;
  stroke: var(--glass-border);
  stroke-width: 4;
}

.progress-ring__fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 0.3s var(--ease-smooth), stroke 0.5s var(--ease-smooth);
  filter: drop-shadow(0 0 6px var(--gold-glow));
}

.progress-ring__icon {
  position: absolute;
  font-size: 2rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.suspense-hint {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-secondary);
  min-height: 1.5em;
  transition: opacity 0.4s var(--ease-smooth);
}

/* ══════════════════════════════════════════════════
   REVEAL SCREEN
   ══════════════════════════════════════════════════ */
#reveal {
  background: linear-gradient(160deg, #01579b 0%, #0288d1 40%, #4fc3f7 100%);
  z-index: 1;
}

#reveal.active {
  z-index: 20;
}

#confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.reveal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  gap: 1.5rem;
  z-index: 3;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s var(--ease-smooth), transform 0.8s var(--ease-bounce);
}

.reveal-content.visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-flash {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}

.reveal-flash.active {
  opacity: 1;
}

.reveal-mega-emoji {
  font-size: 6rem;
  animation: revealBounce 1s var(--ease-bounce) forwards, float 3s ease-in-out 1s infinite;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
}

.reveal-title {
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, var(--gold) 50%, #ffffff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerText 3s ease-in-out infinite;
  text-shadow: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.reveal-subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.03em;
}

/* Emoji rain container */
.reveal-emoji-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.rain-emoji {
  position: absolute;
  top: -60px;
  font-size: 2rem;
  animation: emojiRain linear forwards;
  opacity: 0.8;
}

/* ══════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ══════════════════════════════════════════════════ */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) rotate(25deg);
  }

  100% {
    transform: translateX(100%) rotate(25deg);
  }
}

@keyframes shimmerText {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes revealBounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  60% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes emojiRain {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.9;
  }

  100% {
    transform: translateY(110dvh) rotate(360deg);
    opacity: 0.2;
  }
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh);
    opacity: 0;
  }

  20% {
    opacity: 0.6;
  }

  80% {
    opacity: 0.4;
  }

  100% {
    transform: translateY(-20px);
    opacity: 0;
  }
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.15);
  }

  30% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.1);
  }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE / MOBILE TWEAKS
   ══════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .landing-title {
    font-size: 1.65rem;
  }

  .suspense-card {
    padding: 2rem 1.5rem;
  }

  .suspense-emoji {
    font-size: 4rem;
  }

  .reveal-mega-emoji {
    font-size: 4.5rem;
  }
}

@media (min-width: 768px) {
  .landing-title {
    font-size: 2.8rem;
  }

  .suspense-card {
    width: 380px;
    padding: 3.5rem 2.5rem;
  }

  .cta-btn {
    padding: 1.1rem 3.5rem;
    font-size: 1.25rem;
  }

  .cta-btn:hover {
    transform: scale(1.05);
    box-shadow:
      0 6px 32px rgba(255, 213, 79, 0.5),
      0 0 80px rgba(255, 213, 79, 0.2);
  }
}