:root {
  --bg-a: #0c0f2a;
  --bg-b: #141a3a;
  --bg-c: #2a1f4e;
  --ink: #160c26;
  --muted: #9aa0c8;
  --soft: #f8f4ff;
  --card: rgba(18, 20, 48, 0.62);
  --accent: #ff9bd1;
  --accent-2: #b18bff;
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 18px 60px rgba(6, 7, 20, 0.55);
  --radius: 18px;
  --max-width: 1100px;
  --transition: 220ms ease;
  --glow-a: rgba(0, 247, 255, 0.28);
  --glow-b: rgba(255, 120, 0, 0.22);
  --glass: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.04), transparent 30%),
              radial-gradient(circle at 80% 40%, rgba(255,155,209,0.05), transparent 28%),
              linear-gradient(135deg, var(--bg-a), var(--bg-b), var(--bg-c));
  background-size: 200% 200%, 200% 200%, 200% 200%;
  animation: gradientShift 22s ease-in-out infinite;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Playfair Display', 'Manrope', serif;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 120px 24px 80px;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  color: var(--soft);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 155, 209, 0.14), transparent 32%),
    radial-gradient(circle at 84% 14%, rgba(177, 139, 255, 0.16), transparent 34%),
    radial-gradient(circle at 64% 76%, rgba(255, 255, 255, 0.1), transparent 40%),
    radial-gradient(circle at 30% 72%, rgba(0, 247, 255, 0.08), transparent 38%);
  filter: blur(6px);
  opacity: 0.9;
  z-index: 0;
}

.hero-block {
  position: relative;
  z-index: 2;
  width: min(820px, 94vw);
  display: grid;
  gap: 18px;
  justify-items: center;
  padding: 28px 24px 32px;
  backdrop-filter: blur(12px);
  background: radial-gradient(circle at 25% 20%, rgba(255,255,255,0.08), transparent 35%),
              radial-gradient(circle at 80% 30%, rgba(255,155,209,0.08), transparent 36%),
              radial-gradient(circle at 30% 80%, rgba(177,139,255,0.08), transparent 32%),
              linear-gradient(145deg, rgba(18,20,48,0.78), rgba(12,11,30,0.82));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.hero .eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.hero-topline {
  font-size: clamp(22px, 5vw, 30px);
  color: #ffe5ff;
  letter-spacing: 0.02em;
  text-shadow: 0 10px 30px rgba(0,0,0,0.35);
  margin: 0;
}

.hero-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  max-width: 520px;
  background: none;
  border-radius: 30px;
  padding: clamp(6px, 3vw, 14px);
  overflow: visible;
}

.hero-stage::before,
.hero-stage::after {
  content: none;
}

.hero-stage model-viewer {
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  backdrop-filter: none;
  z-index: 1;
  --poster-color: transparent;
}

.hero-bottom {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.hero-name {
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 700;
  color: #ffe5ff;
  text-shadow: 0 14px 30px rgba(0,0,0,0.35);
}

.hero-love {
  font-size: 18px;
  color: #ffd8f1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.hero-block .button {
  margin-top: 4px;
}

.button.solid {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 12px 30px rgba(255, 107, 139, 0.35);
}

.button.solid:hover { transform: translateY(-2px); }

.button.ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  border: 1px solid var(--border);
}

.button.ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(8px);
  animation: float 3.8s ease-in-out infinite;
  z-index: 2;
}

.scroll-hint .arrow {
  width: 10px;
  height: 10px;
  border-left: 2px solid #f7f4ff;
  border-bottom: 2px solid #f7f4ff;
  transform: rotate(-45deg);
  margin-top: -4px;
}

.section-heading {
  text-align: center;
  margin-bottom: 24px;
}

.section-heading .tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.section-heading h2 {
  font-size: clamp(26px, 4vw, 36px);
  margin-top: 14px;
}

.warmth {
  position: relative;
  padding: 90px 18px 120px;
  max-width: var(--max-width);
  margin: 0 auto;
  overflow: hidden;
}

.text-grid {
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.text-grid .line {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
  background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(249,244,255,0.82));
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.text-grid .line.visible {
  opacity: 1;
  transform: translateY(0);
}

.text-grid .accent {
  color: var(--accent);
  font-weight: 700;
  text-align: center;
}

.floating-hearts,
.floating-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-layer::before,
.floating-layer::after {
  content: '';
  position: absolute;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 30%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06), transparent 28%);
  animation: slowSpin 26s linear infinite;
}

.floating-layer::after { animation-direction: reverse; opacity: 0.6; }

.floating-heart {
  position: absolute;
  width: var(--size, 16px);
  height: var(--size, 16px);
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  clip-path: polygon(
    50% 0%,
    64% 8%,
    74% 20%,
    80% 34%,
    80% 48%,
    72% 62%,
    50% 84%,
    28% 62%,
    20% 48%,
    20% 34%,
    26% 20%,
    36% 8%
  );
  opacity: var(--alpha, 0.6);
  animation: floatHeart var(--duration, 12s) ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(196,153,255,0.35));
}

.game {
  position: relative;
  padding: 90px 18px 140px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: var(--card);
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.counter { font-weight: 700; color: var(--ink); }

.hint { color: var(--muted); font-size: 14px; }

.play-area {
  position: relative;
  border-radius: 26px;
  height: min(540px, 68vh);
  min-height: 320px;
  background: linear-gradient(160deg, rgba(255,255,255,0.8), rgba(246,239,255,0.62));
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.game-heart {
  position: absolute;
  width: var(--size, 42px);
  aspect-ratio: 1;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  clip-path: polygon(
    50% 0%,
    64% 8%,
    74% 20%,
    80% 34%,
    80% 48%,
    72% 62%,
    50% 84%,
    28% 62%,
    20% 48%,
    20% 34%,
    26% 20%,
    36% 8%
  );
  animation: drift var(--speed, 10s) ease-in-out infinite alternate;
  cursor: pointer;
  filter: drop-shadow(0 10px 18px rgba(196,153,255,0.32));
  transition: transform 180ms ease, opacity 180ms ease;
}

.game-heart:hover { transform: scale(1.06); }

.game-heart.pop {
  opacity: 0;
  transform: scale(0.3);
}

.particle {
  position: absolute;
  width: 12px;
  height: 12px;
  clip-path: polygon(
    50% 0%,
    64% 8%,
    74% 20%,
    80% 34%,
    80% 48%,
    72% 62%,
    50% 84%,
    28% 62%,
    20% 48%,
    20% 34%,
    26% 20%,
    36% 8%
  );
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  animation: particle 800ms ease-out forwards;
  pointer-events: none;
}

.game-complete {
  margin-top: 20px;
  text-align: center;
  display: grid;
  gap: 12px;
}

.done-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 30;
}

.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,247,244,0.94));
  border-radius: 24px;
  padding: 22px 20px 18px;
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--border);
  box-shadow: 0 18px 60px rgba(0,0,0,0.18);
  max-height: 88vh;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  transition: var(--transition);
}

.icon-button:hover { background: var(--soft); }

.modal-body p {
  margin-bottom: 14px;
  color: var(--muted);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 280ms ease, transform 280ms ease;
}

.modal-body p.visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 6px;
}

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

.confetti-heart {
  position: absolute;
  width: 14px;
  height: 14px;
  clip-path: polygon(
    50% 0%,
    64% 8%,
    74% 20%,
    80% 34%,
    80% 48%,
    72% 62%,
    50% 84%,
    28% 62%,
    20% 48%,
    20% 34%,
    26% 20%,
    36% 8%
  );
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  opacity: 0.9;
  animation: fall var(--fall, 1.8s) ease-out forwards;
}

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(0.94); }
  50% { transform: scale(1.04); }
}

@keyframes float {
  0%, 100% { translate: -50% 0; }
  50% { translate: -50% -10px; }
}

@keyframes floatHeart {
  0% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
  100% { transform: translateY(0); }
}

@keyframes drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(var(--dx, 30px), var(--dy, -30px)); }
}

@keyframes particle {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--px, 20px), var(--py, -30px)) scale(0.2); opacity: 0; }
}

@keyframes fall {
  0% { transform: translateY(-20px); opacity: 1; }
  100% { transform: translateY(120vh); opacity: 0; }
}

@keyframes slowSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .hero { padding-top: 100px; }
  .hero-block { width: min(640px, 96vw); }
}

@media (max-width: 720px) {
  .hero-block { padding: 22px 18px 26px; }
  .hero-stage { max-width: 420px; }
  .play-area { height: 64vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
