:root {
  --bg-1: #ff5a93;
  --bg-2: #ff2f7a;
  --bg-3: #ff7ac7;
  --text-main: #3b0e1b;
  --text-soft: #5b1b2d;
  --accent: #ff2d75;
  --accent-dark: #d31258;
  --accent-bright: #ff8fc7;
  --accent-yellow: #ffd46a;
  --shadow-strong: 0 24px 40px rgba(145, 17, 70, 0.35);
  --shadow-soft: 0 12px 20px rgba(60, 10, 30, 0.2);
  --radius-xl: 30px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Baloo 2", "Trebuchet MS", "Verdana", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.6) 0 120px, transparent 230px),
    radial-gradient(circle at 85% 10%, rgba(255, 188, 220, 0.7) 0 200px, transparent 320px),
    radial-gradient(circle at 20% 75%, rgba(255, 152, 200, 0.6) 0 160px, transparent 280px),
    linear-gradient(160deg, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-3) 100%);
  min-height: 100svh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 1.6px, transparent 3px),
    radial-gradient(circle, rgba(255, 200, 230, 0.55) 0 1.2px, transparent 2.6px);
  background-size: 140px 140px, 200px 200px;
  background-position: 0 0, 60px 90px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.25) 0 12px, transparent 16px),
    radial-gradient(circle, rgba(255, 180, 220, 0.2) 0 10px, transparent 14px);
  background-size: 260px 260px, 320px 320px;
  background-position: 20px 40px, 140px 160px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

h1,
h2,
h3 {
  font-family: "Pacifico", "Comic Sans MS", cursive;
  margin: 0 0 0.6rem;
  color: var(--text-main);
  letter-spacing: 0.01em;
  text-shadow: 0 6px 12px rgba(118, 0, 52, 0.25);
}

p {
  margin: 0 0 1rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.page {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vh, 2rem);
  --zone-top-height: 20vh;
}

.question {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(520px, 90vw);
  z-index: 6;
  padding: 1vh 2vw;
}

.question h1 {
  font-size: clamp(2.6rem, 10vw, 4rem);
  margin-bottom: 0.2rem;
  color: #fff;
  text-shadow: 0 6px 0 rgba(139, 12, 59, 0.8), 0 14px 24px rgba(70, 6, 26, 0.3);
}

.button-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.9rem;
  align-items: center;
  width: min(420px, 100%);
  justify-content: center;
}

.zone {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.zone-top {
  flex: 0 0 var(--zone-top-height);
  overflow: visible;
}

.zone-center {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-bottom {
  flex: 1 1 auto;
  overflow: visible;
  padding-bottom: 5vh;
}

.zone-bottom .wheel-area {
  margin-top: 5vh;
}

.countdown {
  margin-top: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 0 rgba(153, 14, 63, 0.6), var(--shadow-soft);
  font-weight: 800;
  color: #ff2f7a;
}

.btn {
  appearance: none;
  border: 4px solid #fff;
  border-radius: var(--radius-pill);
  padding: 1rem 1.6rem;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #ff7db5 0%, #ff3f86 100%);
  box-shadow: 0 8px 0 rgba(139, 12, 59, 0.8), 0 18px 25px rgba(152, 16, 67, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  position: relative;
  overflow: hidden;
}

.question .btn {
  flex: 1 1 0;
  min-width: 0;
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 0 rgba(139, 12, 59, 0.8), 0 20px 30px rgba(152, 16, 67, 0.35);
}

.btn:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 4px 0 rgba(139, 12, 59, 0.8), 0 8px 16px rgba(152, 16, 67, 0.2);
}

.btn:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

.btn::after {
  content: "";
  position: absolute;
  left: 12%;
  top: 10%;
  width: 76%;
  height: 40%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent);
  opacity: 0.8;
  pointer-events: none;
}

.btn-yes {
  background: linear-gradient(180deg, #ff9bd1 0%, #ff4b89 100%);
}

.btn-no {
  background: linear-gradient(180deg, #ffb3c9 0%, #ff6aa0 100%);
  position: relative;
  transition: transform 0.2s ease;
}

.btn-no:hover {
  animation: jiggle 0.35s ease;
}

.btn-no.jiggle {
  animation: jiggle 0.35s ease;
}

.btn-no:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.btn-spin {
  width: min(260px, 80vw);
  margin-top: 0.8rem;
  background: linear-gradient(180deg, #ff90c9 0%, #ff357b 100%);
}

.btn-cat {
  width: min(320px, 90vw);
  background: linear-gradient(180deg, #ff8fb8 0%, #ff2f7a 100%);
}

.status {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.4rem;
  min-height: 1.2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 4px 10px rgba(90, 6, 36, 0.45);
}

.wheel-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  transform: rotate(-1.2deg);
  z-index: 5;
  margin: 2vh auto 0;
}

.wheel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0 0.2rem;
}

.wheel-wrap::after {
  content: "";
  position: absolute;
  top: -38px;
  left: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7a8 0%, #ffd46a 45%, rgba(255, 125, 180, 0.2) 60%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.wheel-wrap.sparkle::after {
  animation: sparkleBurst 0.9s ease;
}

.wheel {
  width: min(clamp(200px, 60vw, 320px), 28vh);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 10px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 0 rgba(153, 14, 63, 0.8), 0 20px 30px rgba(101, 10, 43, 0.35);
  background: conic-gradient(
    #ff8fb8 0deg 45deg,
    #ff6fa0 45deg 90deg,
    #ff90c6 90deg 135deg,
    #ff5d8b 135deg 180deg,
    #ffa3c7 180deg 225deg,
    #ff7aa8 225deg 270deg,
    #ff9cc0 270deg 315deg,
    #ff5c8c 315deg 360deg
  );
  position: relative;
  --spin: 0deg;
  transform: rotate(var(--spin));
  transition: transform 4s cubic-bezier(0.2, 0.7, 0.1, 1);
}

.wheel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.wheel.spinning {
  filter: saturate(1.1);
}

.wheel-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  color: #5a1b2f;
  text-shadow: 0 2px 6px rgba(255, 255, 255, 0.7);
  text-align: center;
  max-width: 70px;
  transition: transform 0s;
  transform-origin: center;
  line-height: 1;
  filter: drop-shadow(0 6px 10px rgba(90, 8, 36, 0.25));
}

.wheel-result {
  position: absolute;
  top: -42px;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 0 rgba(153, 14, 63, 0.65), var(--shadow-soft);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
  min-height: 1.4rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  z-index: 3;
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffd6e4 60%, #ff4b89 100%);
  box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.8), 0 6px 0 rgba(153, 14, 63, 0.6);
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 26px solid #ff216c;
  filter: drop-shadow(0 6px 8px rgba(160, 12, 61, 0.45));
  z-index: 2;
}

.cat-float {
  position: absolute;
  transform: rotate(1.2deg);
  z-index: 5;
  left: 6%;
  top: 22%;
}

.sticker {
  position: absolute;
  z-index: 4;
  width: clamp(90px, 22vw, 160px);
  filter: drop-shadow(0 14px 18px rgba(70, 7, 29, 0.35));
  animation: floaty 5s ease-in-out infinite;
  pointer-events: none;
}

.sticker svg {
  width: 100%;
  height: auto;
  display: block;
}

.sticker-cupcake {
  --rot: -8deg;
  right: 6%;
  bottom: 14%;
}

.sticker-unicorn {
  --rot: 6deg;
  right: 6%;
  bottom: 14%;
  animation-delay: -2s;
}

.cat-box {
  margin: 0;
  width: min(105px, 27vw);
  cursor: pointer;
  transition: transform 0.3s ease;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 0.2rem;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 0 rgba(153, 14, 63, 0.7), var(--shadow-soft);
}

.zone-bottom .wheel-area {
  margin-left: 0;
}

.cat-box:hover {
  transform: scale(1.02);
}

.cat-box svg {
  width: 100%;
  height: auto;
}

.box-base {
  fill: #ff3f86;
}

.box-front {
  fill: #ff2f7a;
}

.box-lid rect {
  fill: #ff7eb6;
}

.lid-highlight {
  fill: rgba(255, 255, 255, 0.7);
}

.box-lid {
  transform-origin: 40px 90px;
  transition: transform 0.6s ease;
}

.cat {
  transform: translateY(35px);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.4s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.cat-head {
  fill: #fff0f7;
}

.cat-ear {
  fill: #ffb6d8;
}

.cat-eye {
  fill: #4a1b2a;
  animation: blink 4s infinite;
  transform-origin: center;
  transform-box: fill-box;
}

.cat-blush {
  fill: #ff6aa0;
  opacity: 0.7;
}

.cat-mouth {
  stroke: #4a1b2a;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
}

.sparkles circle {
  fill: #fff3f8;
  opacity: 0.7;
  animation: sparkle 2.8s ease-in-out infinite;
}

.sparkles circle:nth-child(2) {
  animation-delay: 0.6s;
}

.sparkles circle:nth-child(3) {
  animation-delay: 1.2s;
}

.cat-box.open .box-lid {
  transform: rotate(-25deg);
}

.cat-box.open .cat {
  transform: translateY(-10px);
  opacity: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(38, 10, 20, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: linear-gradient(160deg, #fff5fb 0%, #ffd1ea 100%);
  border-radius: 26px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  padding: 1.8rem 1.6rem;
  width: min(92vw, 420px);
  box-shadow: 0 10px 0 rgba(153, 14, 63, 0.6), 0 20px 40px rgba(30, 8, 16, 0.2);
  position: relative;
}

.modal h3 {
  margin-bottom: 0.8rem;
}

.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #ff8fb8;
  color: #3b0e1b;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(153, 14, 63, 0.6);
}

.modal-body {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.typewriter {
  min-height: 4.4rem;
  font-size: 1rem;
}

.pulse-heart {
  font-size: 1.6rem;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
  animation: heartPulse 1.2s ease-in-out infinite;
}

.pulse-heart.is-on {
  opacity: 1;
  transform: scale(1);
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.bg-heart {
  position: absolute;
  width: calc(34px * var(--s));
  height: calc(32px * var(--s));
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  animation: float var(--t) ease-in-out infinite;
  animation-delay: var(--d);
  transform-origin: center;
  opacity: 0.85;
  mix-blend-mode: screen;
}

.bg-heart-svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: pulse 3s ease-in-out infinite;
  animation-delay: var(--d);
  filter: drop-shadow(0 8px 14px rgba(255, 52, 120, 0.35));
}

.bg-heart-svg path {
  fill: var(--c, rgba(255, 60, 130, 0.6));
}

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

body.modal-open {
  overflow: hidden;
}

@media (min-width: 760px) {
  .page {
    --zone-top-height: 22vh;
  }

  .sticker {
    width: clamp(120px, 20vw, 190px);
  }

  .cat-box {
    width: min(120px, 24vw);
  }

  .sticker-cupcake {
    right: 8%;
    bottom: 16%;
  }

  .cat-float {
    left: 8%;
    top: 20%;
  }

  .sticker-unicorn {
    right: 8%;
    bottom: 16%;
  }
}

@media (max-width: 700px) {
  .question {
    width: min(480px, 88vw);
  }

  .wheel {
    width: min(clamp(180px, 56vw, 240px), 26vh);
  }

  .sticker-cupcake {
    right: 4%;
    bottom: 12%;
  }

  .cat-float {
    left: 4%;
    top: 18%;
  }

  .sticker-unicorn {
    right: 4%;
    bottom: 12%;
  }
}

@media (max-width: 520px) {
  .secret-egg {
    top: 1rem;
    right: 0.8rem;
    width: 56px;
    height: 56px;
  }

  .sticker {
    width: clamp(80px, 24vw, 120px);
  }

  .cat-box {
    width: min(90px, 27vw);
  }

  .sticker-cupcake {
    right: 4%;
    bottom: 10%;
  }

  .cat-float {
    left: 4%;
    top: 16%;
  }

  .sticker-unicorn {
    right: 4%;
    bottom: 10%;
  }
}

@media (min-width: 980px) {
  .page {
    --zone-top-height: 24vh;
  }

  .question {
    width: min(580px, 70vw);
  }

  .sticker-cupcake {
    right: 10%;
    bottom: 18%;
  }

  .cat-float {
    left: 10%;
    top: 18%;
  }

  .sticker-unicorn {
    right: 10%;
    bottom: 18%;
  }
}

@keyframes jiggle {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  30% {
    transform: translate(-2px, -1px) rotate(-2deg);
  }
  60% {
    transform: translate(2px, 1px) rotate(2deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1) rotate(45deg);
  }
  50% {
    transform: scale(1.08) rotate(45deg);
  }
}

@keyframes heartPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes blink {
  0%, 90%, 100% {
    transform: scaleY(1);
  }
  94% {
    transform: scaleY(0.1);
  }
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.2);
  }
}

@keyframes floaty {
  0%, 100% {
    transform: translateY(0) rotate(var(--rot, 0deg));
  }
  50% {
    transform: translateY(-10px) rotate(var(--rot, 0deg));
  }
}

@keyframes popFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -120px))) scale(1.4);
  }
}

@keyframes sparkleBurst {
  0% {
    opacity: 0;
    transform: scale(0.4) rotate(0deg);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.6) rotate(25deg);
  }
}

@keyframes wiggle {
  0%, 100% {
    transform: rotate(-14deg);
  }
  50% {
    transform: rotate(-6deg);
  }
}


.secret-egg {
  position: fixed;
  right: 1.4rem;
  top: 1.4rem;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, #fff4fb, #ffd1ea);
  box-shadow: 0 8px 0 rgba(153, 14, 63, 0.6), var(--shadow-strong);
  cursor: pointer;
  transform: rotate(-14deg);
  display: grid;
  place-items: center;
  z-index: 7;
  animation: wiggle 3.6s ease-in-out infinite;
}

.secret-egg:hover {
  transform: rotate(-8deg) scale(1.05);
  animation-play-state: paused;
}

.envelope {
  position: relative;
  width: 38px;
  height: 26px;
  background: #ff6aa0;
  border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(140, 18, 60, 0.25);
}

.envelope::before,
.envelope::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

.envelope::before {
  left: 0;
  top: 0;
  border-width: 13px 19px 0 19px;
  border-color: #ffc0d9 transparent transparent transparent;
}

.envelope::after {
  left: 0;
  bottom: 0;
  border-width: 0 19px 13px 19px;
  border-color: transparent transparent #ff6f9e transparent;
}

.envelope-heart {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7b2e41;
  font-size: 1rem;
}

.pop-heart {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-size: var(--size, 24px);
  filter: drop-shadow(0 6px 10px rgba(255, 60, 130, 0.4));
  pointer-events: none;
  z-index: 15;
  animation: popFloat 1.6s ease-out forwards;
}
