:root {
  --pink-50: #fff5fa;
  --pink-100: #ffe3f1;
  --pink-200: #ffc9e3;
  --pink-300: #ffaad3;
  --pink-400: #ff7ab8;
  --pink-500: #ff4fa3;
  --plum: #8a3b66;
  --text: #5a2a47;
  --white: #ffffff;
  --radius: 26px;
  --shadow: 0 14px 40px rgba(255, 122, 184, 0.25);
  /* accent palettes for the themed cards */
  --anime-1: #ffe1f0;
  --anime-2: #e7e0ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--pink-200), transparent 60%),
    linear-gradient(180deg, var(--pink-50), var(--pink-100));
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: "Baloo 2", "Quicksand", sans-serif; line-height: 1.1; }

/* Floating background sprites */
.bg-floats {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.float {
  position: absolute;
  bottom: -40px;
  font-size: 1.8rem;
  opacity: 0;
  animation: floatUp linear forwards;
  will-change: transform, opacity;
}

@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.9; }
  100% { transform: translateY(-110vh) rotate(40deg); opacity: 0; }
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 20px 50px;
}

.hero-inner { max-width: 640px; margin: 0 auto; }

.kicker {
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--pink-500);
  font-weight: 700;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(2.4rem, 8vw, 4rem);
  color: var(--plum);
  font-weight: 800;
  margin-bottom: 16px;
}

.wave { display: inline-block; animation: wiggle 2.5s ease-in-out infinite; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

.nickname {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  color: var(--pink-500);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.lead {
  font-size: 1.15rem;
  color: var(--text);
  max-width: 520px;
  margin: 0 auto 30px;
}

/* Buttons */
.btn {
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  background: var(--pink-500);
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 79, 163, 0.35);
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}

.btn:hover { background: var(--pink-400); transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-big {
  font-size: 1.25rem;
  padding: 18px 34px;
  background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
}

/* Affirmation bubble */
.affirmation {
  margin: 26px auto 0;
  max-width: 460px;
  min-height: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--plum);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease, padding 0.35s ease;
}

.affirmation.show {
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
  padding: 22px 24px;
}

/* Sections */
.card-section {
  position: relative;
  z-index: 1;
  padding: 18px 20px;
  display: flex;
  justify-content: center;
}

.soft-card {
  width: 100%;
  max-width: 560px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 30px;
  text-align: center;
}

.soft-card h2 { color: var(--plum); font-size: 1.6rem; margin-bottom: 10px; }
.muted { color: var(--pink-500); font-weight: 600; margin-bottom: 16px; }

/* Pet the hedgehog */
.hedgie {
  font-size: 5rem;
  background: var(--pink-100);
  border: none;
  border-radius: 50%;
  width: 140px;
  height: 140px;
  cursor: pointer;
  margin: 10px auto;
  display: block;
  transition: transform 0.1s;
  user-select: none;
}

.hedgie:hover { transform: scale(1.05); }
.hedgie.pet { animation: pet 0.4s ease; }

@keyframes pet {
  0% { transform: scale(1); }
  40% { transform: scale(1.18) rotate(-6deg); }
  70% { transform: scale(0.95) rotate(6deg); }
  100% { transform: scale(1); }
}

.hedgie-reaction { font-size: 1.2rem; font-weight: 700; color: var(--pink-500); min-height: 1.5em; }
.pet-count { color: var(--text); margin-top: 6px; font-weight: 600; }

/* Facts */
.fact {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--plum);
  background: var(--pink-50);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  min-height: 3.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Things grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.thing {
  background: var(--pink-50);
  border-radius: 18px;
  padding: 18px 10px;
  font-size: 2.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s, background 0.15s;
  cursor: default;
}

.thing span { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.thing:hover { transform: translateY(-4px) scale(1.03); background: var(--pink-100); }

/* Calm corner */
.calm { background: linear-gradient(180deg, var(--white), var(--pink-50)); }

.breath-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 18px auto;
  background: radial-gradient(circle at 35% 30%, var(--pink-200), var(--pink-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-family: "Baloo 2", sans-serif;
  box-shadow: 0 0 0 0 rgba(255, 122, 184, 0.5);
  transition: transform 0.2s;
}

.breath-circle.breathing { animation: breathe 8s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { transform: scale(0.7); box-shadow: 0 0 0 0 rgba(255, 122, 184, 0.4); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 30px rgba(255, 122, 184, 0); }
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 50px 20px 60px;
  color: var(--plum);
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.site-footer .tiny { font-size: 0.95rem; color: var(--pink-500); margin-top: 6px; font-family: "Quicksand", sans-serif; }

/* Burst hearts (cheer button) */
.burst {
  position: fixed;
  z-index: 50;
  font-size: 1.6rem;
  pointer-events: none;
  animation: burst 1.1s ease-out forwards;
}

@keyframes burst {
  0% { transform: translate(0, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.3); opacity: 0; }
}

/* ---- Anime card ---- */
.anime { background: linear-gradient(180deg, var(--white), var(--anime-1)); }
.anime .fact { background: var(--white); font-style: italic; }

/* ---- Text input (8-ball) ---- */
.text-input {
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  background: var(--pink-50);
  border: 2px solid var(--pink-200);
  border-radius: 999px;
  padding: 12px 20px;
  width: 100%;
  max-width: 360px;
  margin: 4px auto 14px;
  display: block;
  outline: none;
  transition: border-color 0.15s;
}
.text-input:focus { border-color: var(--pink-400); }
.eight-answer { margin-top: 16px; }
.eight-answer.thinking { opacity: 0.6; font-style: italic; }

/* ---- Bubble wrap ---- */
.bubble-wrap {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin: 8px auto 16px;
  max-width: 380px;
}
.bubble {
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--white), var(--pink-300));
  box-shadow: inset -2px -3px 6px rgba(0,0,0,0.12), 0 2px 4px rgba(255,122,184,0.25);
  cursor: pointer;
  transition: transform 0.08s;
}
.bubble:hover { transform: scale(1.08); }
.bubble.popped {
  background: var(--pink-100);
  box-shadow: inset 2px 3px 6px rgba(0,0,0,0.18);
  cursor: default;
  transform: scale(0.82);
  animation: pop 0.25s ease;
}
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(0.7); }
  100% { transform: scale(0.82); }
}
@media (max-width: 420px) {
  .bubble-wrap { grid-template-columns: repeat(6, 1fr); }
}

/* ---- Memory match ---- */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 8px auto 14px;
  max-width: 320px;
}
.mem-card {
  aspect-ratio: 3 / 4;
  border: none;
  border-radius: 14px;
  background: var(--pink-400);
  font-size: 1.9rem;
  cursor: pointer;
  color: transparent;
  box-shadow: 0 4px 10px rgba(255,122,184,0.3);
  transition: transform 0.15s, background 0.15s;
}
.mem-card:hover { transform: translateY(-2px); }
.mem-card.flipped, .mem-card.matched {
  background: var(--pink-50);
  color: initial;
}
.mem-card.matched { opacity: 0.55; cursor: default; }
.mem-card.won { animation: pop 0.4s ease; }
.mem-status { color: var(--text); font-weight: 700; margin-bottom: 12px; }

/* ---- Sparkle cursor trail ---- */
.sparkle {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  font-size: 1rem;
  animation: sparkleFade 0.9s ease-out forwards;
}
@keyframes sparkleFade {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.9; }
  100% { transform: translate(-50%, -120%) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wave, .breath-circle.breathing, .float, .sparkle, .bubble.popped { animation: none; }
}
