:root {
  --lemon: #ffe84a;
  --cream: #fffbe8;
  --blue: #1557ff;
  --deep-blue: #0937ac;
  --pink: #ff4fa3;
  --coral: #ff6b4a;
  --mint: #9cf2d0;
  --ink: #152448;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--lemon);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--lemon);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

.quiz-card {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
  padding: clamp(30px, 6vw, 62px);
  border: 6px solid var(--ink);
  border-radius: 42px;
  background: var(--cream);
  box-shadow: 16px 18px 0 var(--deep-blue);
  text-align: center;
}

.level-badge {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 auto 28px;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 5px 5px 0 var(--blue);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.level-badge span {
  color: var(--pink);
}

h1,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: clamp(48px, 8vw, 82px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.06em;
  color: var(--pink);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 7px 8px 0 var(--blue);
}

.question {
  max-width: 560px;
  margin: 0 auto 26px;
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 800;
  line-height: 1.5;
}

.attempts {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-bottom: 30px;
}

.attempt {
  width: 17px;
  height: 17px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--mint);
  transition: transform 160ms ease, background 160ms ease;
}

.attempt.used {
  background: var(--coral);
  transform: rotate(45deg) scale(0.85);
  border-radius: 4px;
}

form {
  text-align: left;
}

label {
  display: block;
  margin: 0 0 9px 4px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 13px;
}

input {
  min-width: 0;
  height: 64px;
  padding: 0 20px;
  border: 3px solid var(--ink);
  border-radius: 17px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  box-shadow: inset 0 -4px 0 #e8e4d0;
}

input::placeholder {
  color: #7a8295;
}

input:focus,
button:focus-visible {
  outline: 4px solid var(--pink);
  outline-offset: 3px;
}

button {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 3px solid var(--ink);
  border-radius: 17px;
  background: var(--pink);
  box-shadow: 5px 6px 0 var(--ink);
  color: var(--ink);
  cursor: pointer;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: 17px;
  font-weight: 900;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

button:not(:disabled):hover {
  transform: translate(-1px, -2px);
  box-shadow: 7px 8px 0 var(--ink);
}

button:not(:disabled):active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

button:disabled {
  background: #d8d7cf;
  box-shadow: 3px 4px 0 #7c8191;
  color: #656b79;
  cursor: not-allowed;
}

.feedback {
  min-height: 26px;
  margin-top: 22px;
  font-size: 16px;
  font-weight: 900;
}

.feedback p {
  margin-bottom: 0;
}

.feedback.wrong {
  color: #c23f28;
}

.feedback.patient {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  margin-top: 28px;
  padding: 20px 22px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: var(--mint);
  box-shadow: 6px 6px 0 var(--ink);
  text-align: left;
  animation: reward-pop 480ms cubic-bezier(0.18, 0.89, 0.32, 1.35);
}

.reward-star {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--lemon);
  font-size: 28px;
}

.feedback strong {
  display: block;
  margin-bottom: 5px;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: 24px;
}

.feedback.patient p {
  font-size: 16px;
  line-height: 1.4;
}

.floating-ring {
  position: absolute;
  top: 8%;
  right: 7%;
  width: 104px;
  height: 104px;
  border: 18px solid var(--pink);
  border-radius: 50%;
  box-shadow: 7px 7px 0 var(--ink);
}

.confetti {
  position: absolute;
  width: 22px;
  height: 68px;
  border: 4px solid var(--ink);
  border-radius: 9px;
}

.confetti-one {
  left: 8%;
  top: 15%;
  background: var(--mint);
  transform: rotate(26deg);
}

.confetti-two {
  right: 9%;
  bottom: 10%;
  background: var(--coral);
  transform: rotate(54deg);
}

.confetti-three {
  left: 10%;
  bottom: 9%;
  background: var(--blue);
  transform: rotate(-44deg);
}

@keyframes reward-pop {
  0% {
    opacity: 0;
    transform: scale(0.82) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 620px) {
  .page-shell {
    padding: 28px 16px 48px;
  }

  .quiz-card {
    padding: 30px 19px 32px;
    border-width: 4px;
    border-radius: 28px;
    box-shadow: 9px 10px 0 var(--deep-blue);
  }

  h1 {
    font-size: clamp(44px, 14vw, 66px);
    -webkit-text-stroke-width: 2px;
    text-shadow: 5px 6px 0 var(--blue);
  }

  .answer-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .attempts {
    gap: 6px;
  }

  .attempt {
    width: 14px;
    height: 14px;
    border-width: 2px;
  }

  .floating-ring,
  .confetti-three {
    display: none;
  }
}

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