:root {
  --pink: #ff5c8a;
  --pink-soft: #ffd6e4;
  --pink-deep: #d63b6b;
  --cream: #fff6f9;
  --ink: #3a2a33;
  --shadow: 0 12px 40px rgba(214, 59, 107, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Fredoka", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #fff0f5 0%, #ffe6f0 40%, #ffeef6 100%);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2 { font-family: "Baloo 2", "Fredoka", sans-serif; }

/* ---------- floating hearts bg ---------- */
#hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.float-heart {
  position: absolute;
  bottom: -40px;
  font-size: 22px;
  opacity: 0;
  animation: floatUp linear forwards;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.7) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.9; }
  100% { transform: translateY(-110vh) scale(1.1) rotate(40deg); opacity: 0; }
}

/* ---------- faint background love-line ---------- */
#bgline {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  overflow: hidden;
}
#bgline span {
  white-space: nowrap;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 3.4rem);
  color: rgba(214, 59, 107, 0.09);
  transform: rotate(-4deg);
  letter-spacing: 1px;
}

/* ---------- her photo ---------- */
.photo-frame {
  position: relative;
  margin-bottom: 26px;
}
.her-photo {
  width: clamp(130px, 34vw, 190px);
  height: clamp(130px, 34vw, 190px);
  object-fit: cover;
  object-position: center 30%;
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: 0 14px 40px rgba(214, 59, 107, 0.35);
  animation: photoPop 0.9s cubic-bezier(.22,1.4,.36,1) both, sway 5s ease-in-out infinite 1s;
}
.photo-heart {
  position: absolute;
  bottom: -6px;
  right: -6px;
  font-size: 2rem;
  animation: beat 1.4s ease-in-out infinite;
}
@keyframes photoPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes sway { 0%,100% { rotate: -2deg; } 50% { rotate: 2deg; } }
@keyframes beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }

/* ---------- layout ---------- */
.hero, .section { position: relative; z-index: 1; }

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.badge {
  background: #fff;
  color: var(--pink-deep);
  border: 2px dashed var(--pink);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.title {
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  line-height: 1.05;
  color: var(--pink-deep);
  text-shadow: 0 4px 0 #fff, 0 6px 14px rgba(214,59,107,0.25);
}
.wobble { display: inline-block; animation: wobble 3s ease-in-out infinite; }
@keyframes wobble {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
.subtitle {
  max-width: 620px;
  margin: 22px auto 0;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: #6b4a58;
  line-height: 1.6;
}
.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 34px;
}
.scroll-hint {
  margin-top: 42px;
  color: var(--pink-deep);
  font-weight: 600;
  animation: bounce 1.6s infinite;
}
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--pink);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(214,59,107,0.32); }
.btn-ghost {
  background: #fff;
  color: var(--pink-deep);
  border: 2px solid var(--pink-soft);
}
.btn-ghost:hover { transform: translateY(-3px); }
.btn-small { padding: 8px 18px; font-size: 0.9rem; }
.btn.big { font-size: 1.2rem; padding: 18px 36px; margin-top: 10px; }

/* ---------- sections / cards ---------- */
.section { padding: 70px 22px; }
.card {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  border-radius: 28px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.card h2 { color: var(--pink-deep); font-size: clamp(1.6rem, 5vw, 2.2rem); margin-bottom: 16px; }
.card p { line-height: 1.7; margin-bottom: 14px; color: #5a3f4b; }
.counter-line strong { color: var(--pink-deep); font-size: 1.2rem; }
.reasons { list-style: none; margin: 20px 0; }
.reasons li {
  background: var(--cream);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 10px;
  font-weight: 500;
}
.tiny { font-size: 0.85rem; color: #9a7b87; margin-top: 8px; }

/* ---------- arcade ---------- */
.arcade-title { text-align: center; color: var(--pink-deep); font-size: clamp(2rem, 6vw, 3rem); }
.arcade-sub { text-align: center; max-width: 560px; margin: 12px auto 30px; color: #6b4a58; line-height: 1.6; }
.tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.tab {
  border: 2px solid var(--pink-soft);
  background: #fff;
  color: var(--pink-deep);
  font-family: inherit;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab.active { background: var(--pink); color: #fff; border-color: var(--pink); }

.game-panel { display: none; max-width: 740px; margin: 0 auto; }
.game-panel.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:none} }

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  font-weight: 500;
}
#catchCanvas {
  width: 100%;
  background: linear-gradient(180deg, #fff8fb 0%, #ffe9f2 100%);
  border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow);
  touch-action: none;
  display: block;
}
.win-msg {
  text-align: center;
  margin-top: 18px;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--pink-deep);
  min-height: 1.5em;
}

/* forgive game */
.forgive-box {
  background: #fff;
  border-radius: 24px;
  padding: 50px 30px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  min-height: 320px;
}
.forgive-q { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 600; color: var(--pink-deep); margin-bottom: 30px; font-family: "Baloo 2"; }
.forgive-btns { display: flex; gap: 18px; justify-content: center; position: relative; }
#noBtn { position: relative; transition: none; }
.forgive-note { margin-top: 24px; color: #9a7b87; font-size: 0.9rem; }

/* memory game */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: #fff;
  padding: 20px;
  border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow);
}
.mem-card {
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s ease, background 0.25s ease;
  transform-style: preserve-3d;
}
.mem-card .face { opacity: 0; transition: opacity 0.15s; }
.mem-card.flipped, .mem-card.matched {
  background: var(--pink-soft);
  transform: rotateY(180deg);
}
.mem-card.flipped .face, .mem-card.matched .face { opacity: 1; transform: rotateY(180deg); }
.mem-card.matched { background: #ffe08a; cursor: default; }

/* finale */
.finale-card { text-align: center; }
.finale-text { font-size: 1.1rem; }
.finale-sign { margin: 24px 0; font-style: italic; color: var(--pink-deep); }
.sign-name { font-size: 1.3rem; font-weight: 700; }

.footer {
  text-align: center;
  padding: 30px 20px 40px;
  color: #a98795;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

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

@media (max-width: 520px) {
  .card { padding: 26px; }
  .game-head { flex-direction: column; align-items: flex-start; }

  /* background love-line: fit + stay readable on phones */
  #bgline { justify-content: space-between; padding: 40px 0; }
  #bgline span {
    font-size: 1.15rem;
    color: rgba(214, 59, 107, 0.16);
    transform: rotate(-3deg);
    letter-spacing: 0;
    text-align: center;
    width: 100%;
    white-space: normal;   /* allow wrap so nothing runs off-screen */
    line-height: 1.35;
    padding: 0 12px;
  }
}
