:root {
  --bg: #fff7c8;
  --ink: #3d315b;
  --pink: #ff75a0;
  --green: #38c172;
  --red: #ff5252;
  --blue: #7bc7ff;
  --orange: #ffb84d;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--ink);
  font-family: "Comic Sans MS", "Marker Felt", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, #ffb7d1 0 46px, transparent 48px),
    radial-gradient(circle at 88% 18%, #8ee5ff 0 42px, transparent 44px),
    radial-gradient(circle at 78% 84%, #b8f58d 0 56px, transparent 58px),
    linear-gradient(135deg, #fff7c8, #dff8ff);
}

.app {
  width: min(94vw, 720px);
}

.panel {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: 34px;
  border: 5px solid #3d315b;
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 14px 0 #3d315b22, 0 24px 38px #3d315b26;
  text-align: center;
}

.hidden {
  display: none;
}

h1,
h2 {
  margin: 14px 0 8px;
  font-size: clamp(2.2rem, 8vw, 4.4rem);
  line-height: 1;
}

h2 {
  font-size: clamp(2rem, 7vw, 4rem);
}

.subtitle,
.celebration p {
  margin: 0 0 26px;
  font-size: 1.2rem;
}

.mascot {
  position: relative;
  width: 118px;
  height: 96px;
  margin: 0 auto;
  border: 5px solid var(--ink);
  border-radius: 45% 45% 50% 50%;
  background: #ffe7ef;
}

.ear {
  position: absolute;
  top: -28px;
  width: 36px;
  height: 50px;
  border: 5px solid var(--ink);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: #ffe7ef;
}

.ear.left {
  left: 18px;
  transform: rotate(-16deg);
}

.ear.right {
  right: 18px;
  transform: rotate(16deg);
}

.face {
  display: grid;
  height: 100%;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
}

.category-list {
  display: grid;
  gap: 14px;
  margin: 28px auto;
  max-width: 480px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding: 14px 18px;
  border: 4px solid var(--ink);
  border-radius: 20px;
  background: #fff9e8;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, background 0.15s ease;
}

.category-card:hover,
.category-card:has(input:checked) {
  transform: translateY(-3px);
  background: #e8fbff;
}

.category-card input {
  width: 20px;
  height: 20px;
  accent-color: var(--pink);
}

.icon {
  display: grid;
  flex: 0 0 46px;
  height: 46px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
  font-size: 2rem;
  font-weight: 900;
}

.category-card strong,
.category-card small {
  display: block;
}

.category-card strong {
  font-size: 1.18rem;
}

.category-card small {
  margin-top: 4px;
  color: #6e6388;
}

button,
input {
  font: inherit;
}

.primary-button,
.ghost-button {
  border: 4px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  padding: 14px 30px;
  color: var(--ink);
  background: var(--pink);
  box-shadow: 0 7px 0 var(--ink);
}

.primary-button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 var(--ink);
}

.ghost-button {
  padding: 8px 15px;
  background: #e8fbff;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-text {
  font-size: 1.1rem;
  font-weight: 900;
}

.progress-bar {
  height: 20px;
  margin: 20px 0 34px;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: #f2edf7;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 0.25s ease;
}

.question-card {
  position: relative;
  margin: 0 auto 26px;
  padding: 36px 20px;
  max-width: 460px;
  border: 5px solid var(--ink);
  border-radius: 26px;
  background: #fff0a6;
}

.question-label {
  margin: 0 0 8px;
  color: #6e6388;
  font-weight: 900;
}

.question {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 900;
  line-height: 1;
}

.star {
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--pink);
  clip-path: polygon(50% 0, 62% 36%, 100% 36%, 70% 58%, 82% 96%, 50% 72%, 18% 96%, 30% 58%, 0 36%, 38% 36%);
}

.star-one {
  top: 18px;
  left: 22px;
}

.star-two {
  right: 28px;
  bottom: 20px;
  background: var(--blue);
}

.answer-area {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  max-width: 430px;
}

.answer-area input {
  min-width: 0;
  width: 170px;
  padding: 12px 16px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 900;
}

.feedback {
  min-height: 58px;
  margin-top: 22px;
  font-size: 1.4rem;
  font-weight: 900;
}

.feedback.correct {
  color: var(--green);
}

.feedback.wrong {
  color: var(--red);
  animation: shake 0.28s ease;
}

.trophy {
  margin: 68px auto 18px;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border: 6px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
  color: #fff7c8;
  font-size: 6rem;
  animation: pop 0.8s ease infinite alternate;
}

.confetti span {
  position: absolute;
  top: -24px;
  width: 14px;
  height: 24px;
  border-radius: 6px;
  background: var(--pink);
  animation: fall 2.4s linear infinite;
}

.confetti span:nth-child(2n) {
  background: var(--green);
}

.confetti span:nth-child(3n) {
  background: var(--blue);
}

.confetti span:nth-child(4n) {
  background: var(--orange);
}

.confetti span:nth-child(1) { left: 8%; animation-delay: 0s; }
.confetti span:nth-child(2) { left: 18%; animation-delay: 0.3s; }
.confetti span:nth-child(3) { left: 28%; animation-delay: 0.6s; }
.confetti span:nth-child(4) { left: 38%; animation-delay: 0.1s; }
.confetti span:nth-child(5) { left: 48%; animation-delay: 0.9s; }
.confetti span:nth-child(6) { left: 58%; animation-delay: 0.4s; }
.confetti span:nth-child(7) { left: 68%; animation-delay: 0.7s; }
.confetti span:nth-child(8) { left: 78%; animation-delay: 0.2s; }
.confetti span:nth-child(9) { left: 88%; animation-delay: 1s; }
.confetti span:nth-child(10) { left: 94%; animation-delay: 0.5s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-10px); }
  70% { transform: translateX(10px); }
}

@keyframes pop {
  from { transform: scale(0.96) rotate(-3deg); }
  to { transform: scale(1.05) rotate(3deg); }
}

@keyframes fall {
  from {
    transform: translateY(-30px) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translateY(650px) rotate(360deg);
    opacity: 0;
  }
}

@media (max-width: 560px) {
  body {
    padding: 12px;
  }

  .panel {
    min-height: 620px;
    padding: 24px 16px;
    border-radius: 22px;
  }

  .answer-area {
    display: grid;
  }

  .answer-area input {
    width: 100%;
  }
}
