:root {
  --bg: #fef9ef;
  --ink: #2b2140;
  --purple: #7c5cff;
  --purple-dark: #5f3fe0;
  --green: #22c55e;
  --green-dark: #16a34a;
  --red: #ef4444;
  --yellow: #fbbf24;
  --card: #ffffff;
  --shadow: 0 6px 0 rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Comic Sans MS", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px 60px;
}

.screen {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hidden { display: none !important; }

.title {
  font-size: clamp(2rem, 8vw, 2.8rem);
  margin: 8px 0 4px;
}

.subtitle {
  font-size: 1.2rem;
  color: #6b6280;
  margin: 0 0 20px;
}

/* ---------- Start screen ---------- */
.choice-group {
  width: 100%;
  margin-bottom: 20px;
}

.choice-label {
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: #4a4460;
}

.choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.choice-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 16px;
  border: 3px solid transparent;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.choice-btn:active { transform: translateY(3px); box-shadow: none; }

.choice-btn.selected {
  background: var(--purple);
  color: white;
  border-color: var(--purple-dark);
}

.big-btn {
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  background: var(--green);
  border: none;
  border-radius: 20px;
  padding: 18px 36px;
  margin-top: 12px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--green-dark);
  transition: transform 0.08s ease;
}

.big-btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--green-dark);
}

/* ---------- Game screen ---------- */
.game-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.progress-wrap {
  flex: 1;
  text-align: left;
}

.progress-track {
  width: 100%;
  height: 14px;
  background: #eee6ff;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--purple);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.95rem;
  color: #6b6280;
}

.score-badge {
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--card);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.question-card {
  width: 100%;
  background: var(--card);
  border-radius: 24px;
  padding: 36px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.question-text {
  font-size: clamp(2.2rem, 10vw, 3rem);
  font-weight: 800;
}

.feedback {
  font-size: 1.3rem;
  font-weight: 700;
  min-height: 1.6rem;
}

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

.answer-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.answer-btn {
  font-family: inherit;
  font-size: 1.8rem;
  font-weight: 800;
  padding: 20px 10px;
  border-radius: 20px;
  border: none;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
}

.answer-btn:active { transform: translateY(3px); box-shadow: none; }

.answer-btn:disabled { cursor: default; }

.answer-btn.correct {
  background: var(--green);
  color: white;
}

.answer-btn.wrong {
  background: var(--red);
  color: white;
}

/* ---------- End screen ---------- */
.end-emoji {
  font-size: 4.5rem;
  margin-top: 12px;
}

.stars {
  font-size: 2.2rem;
  margin: 8px 0 24px;
  letter-spacing: 6px;
}

@media (max-width: 380px) {
  .answer-btn { font-size: 1.5rem; padding: 16px 8px; }
  .choice-btn { font-size: 0.95rem; padding: 12px 14px; }
}
