:root {
  --accent: #cc624f;
  --accent-dark: #7a3b30;
  --wash: #f3b4a8;
  --wrong: #a84238;
}

.number-addition-stage {
  width: min(100%, 650px);
}

.equation-card {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: min(34vh, 290px);
  min-height: min(34dvh, 290px);
  padding: 26px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.32)),
    var(--wash);
  box-shadow: var(--shadow);
  place-items: center;
}

.equation-card::before,
.equation-card::after {
  position: absolute;
  border: 2px solid color-mix(in srgb, var(--accent) 17%, transparent);
  border-radius: 50%;
  content: "";
}

.equation-card::before {
  top: -54px;
  right: -32px;
  width: 132px;
  height: 132px;
}

.equation-card::after {
  bottom: -44px;
  left: -34px;
  width: 104px;
  height: 104px;
}

.equation {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 3vw, 18px);
  font-family: "Nunito", sans-serif;
  font-size: clamp(2.7rem, 12vw, 5.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.equation-card.is-changing .equation {
  animation: equation-pop 300ms cubic-bezier(0.2, 0.85, 0.35, 1.15);
}

.equation-number {
  color: var(--ink);
}

.equation-sign {
  color: var(--accent-dark);
  font-size: 0.7em;
}

.equation-answer {
  display: grid;
  width: 1.02em;
  height: 1.02em;
  place-items: center;
  border-radius: 0.3em;
  background: rgba(255, 255, 255, 0.68);
  color: var(--accent-dark);
}

.feedback {
  min-height: 25px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.feedback.is-correct { color: var(--accent-dark); }
.feedback.is-wrong { color: var(--wrong); }

.answer-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.answer-button {
  min-height: 68px;
  border: 2px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(32, 48, 41, 0.07);
  color: var(--ink);
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  font-size: clamp(1.8rem, 8vw, 2.45rem);
  font-weight: 900;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.answer-button:hover { transform: translateY(-2px); border-color: var(--accent); }
.answer-button:active { transform: scale(0.97); }
.answer-button:disabled { cursor: default; }

.answer-button.is-correct {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--wash) 54%, white);
  color: var(--accent-dark);
}

.answer-button.is-wrong {
  border-color: var(--wrong);
  animation: gentle-shake 280ms ease;
}

@keyframes equation-pop {
  0% { opacity: 0; transform: scale(0.72) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

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

@media (min-width: 700px) {
  .equation-card {
    min-height: min(39vh, 350px);
    min-height: min(39dvh, 350px);
    border-radius: 42px;
  }

  .answer-options { gap: 14px; }
  .answer-button { min-height: 80px; border-radius: 25px; }
}

@media (max-height: 650px) {
  .equation-card { min-height: 210px; }
  .feedback { margin-block: 8px 6px; }
  .answer-button { min-height: 58px; }
}
