:root {
  --ink: #263238;
  --muted: #65727c;
  --paper: #fffaf0;
  --panel: #ffffff;
  --line: #d7e1df;
  --green: #2f9d73;
  --red: #d45757;
  --yellow: #f6c85f;
  --blue: #4d89dc;
  --coral: #f07f66;
  --shadow: 0 18px 45px rgba(38, 50, 56, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(246, 200, 95, 0.28), transparent 34rem),
    linear-gradient(135deg, #ecf7f4 0%, #fff6df 52%, #f7e3df 100%);
}

button,
input {
  font: inherit;
}

.app {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.label {
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.4rem);
  line-height: 0.96;
}

h2 {
  font-size: clamp(1.35rem, 3.8vw, 2.3rem);
  line-height: 1.08;
}

.scoreboard {
  min-width: 142px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px solid #f1d083;
  border-radius: 8px;
  background: #fff8df;
  box-shadow: var(--shadow);
  font-size: 1.05rem;
}

.score-icon {
  color: #d69612;
  font-size: 1.5rem;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.tab,
.small-button,
.answer,
.check-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.tab {
  min-height: 52px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #34444c;
  font-weight: 800;
  border: 2px solid rgba(77, 137, 220, 0.18);
}

.tab.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 12px 24px rgba(77, 137, 220, 0.24);
}

.panel {
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(236, 247, 244, 0.88));
  border-bottom: 1px solid var(--line);
}

.small-button,
.check-button {
  min-height: 46px;
  padding: 10px 16px;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.small-button:hover,
.check-button:hover,
.answer:hover {
  transform: translateY(-1px);
}

.question-card {
  min-height: 420px;
  padding: 22px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.prompt {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.25;
  font-weight: 850;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.answer {
  min-height: 210px;
  padding: 16px;
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 25px rgba(38, 50, 56, 0.08);
  display: grid;
  place-items: center;
  gap: 10px;
}

.answer.correct {
  border-color: var(--green);
  background: #edf9f3;
}

.answer.wrong {
  border-color: var(--red);
  background: #fff0f0;
}

.choice-label {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #3d2b05;
  font-size: 1.35rem;
  font-weight: 900;
}

.objects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 8px;
  min-height: 116px;
}

.object {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.count-tag {
  color: var(--muted);
  font-weight: 800;
}

.number-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.big-number {
  min-height: 150px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 3px solid var(--line);
  background: #f8fbff;
  color: #203846;
  font-size: clamp(3.8rem, 11vw, 7rem);
  font-weight: 950;
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.number-input {
  width: 150px;
  min-height: 58px;
  border: 3px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  background: white;
}

.place-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.place-box {
  min-height: 190px;
  border: 3px dashed #aabbb8;
  border-radius: 8px;
  padding: 14px;
  background: #fbfffd;
}

.place-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
}

.tens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ten-stick {
  width: 22px;
  height: 112px;
  border-radius: 7px;
  background: repeating-linear-gradient(to bottom, #4d89dc 0 9px, #ffffff 9px 11px);
  border: 2px solid #2e66ae;
}

.ones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.one-cube {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--coral);
  border: 2px solid #be553f;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.word-choice {
  min-height: 72px;
  padding: 12px;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
}

.equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: clamp(2.2rem, 8vw, 4.4rem);
  font-weight: 950;
}

.feedback {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 14px 22px;
  background: #203846;
  color: white;
  font-size: 1.05rem;
  font-weight: 750;
}

.feedback.good {
  background: var(--green);
}

.feedback.try {
  background: var(--red);
}

.progress-strip {
  margin-top: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-weight: 800;
}

.dot {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 50%;
  border: 2px solid #b7c8c5;
  background: white;
}

.dot.done {
  background: var(--green);
  border-color: var(--green);
}

@media (max-width: 760px) {
  .topbar,
  .panel-head,
  .progress-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .choices,
  .number-pair,
  .place-board,
  .word-grid {
    grid-template-columns: 1fr;
  }

  .question-card {
    min-height: 380px;
    padding: 16px;
  }

  .answer {
    min-height: 170px;
  }

  .object {
    width: 36px;
    height: 36px;
    font-size: 1.7rem;
  }
}
