* {
  box-sizing: border-box;
}

body {
  font-family: "Comic Sans MS", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 25%, #7c3aed 50%, #1e3a8a 75%, #1e1b4b 100%);
  background-size: 300% 300%;
  animation: gradientShift 14s ease infinite;
  position: relative;
  overflow-x: hidden;
  color: #2d1b4e;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 24px 20px 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 1;
}

/* ---------- Level buttons ---------- */
.levels {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.levels button {
  flex: 1;
  padding: 12px 8px;
  border-radius: 12px;
  border: 2px solid #ddd6fe;
  background: #f5f3ff;
  color: #5b21b6;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.levels button:hover {
  transform: translateY(-2px);
}

.levels button.active {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  border-color: #4c1d95;
  color: #fff;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.4);
}

/* ---------- Stats ---------- */
.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.stat {
  flex: 1;
  background: linear-gradient(160deg, #ede9fe, #ddd6fe);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.stat .label {
  font-size: 12px;
  font-weight: 700;
  color: #6d28d9;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat .value {
  font-size: 24px;
  font-weight: 800;
  color: #2d1b4e;
  margin-top: 2px;
}

/* ---------- Question box ---------- */
.question-box {
  background: linear-gradient(160deg, #fef3c7, #fde68a);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 28px 16px;
  text-align: center;
  margin-bottom: 20px;
}

#question {
  font-size: 34px;
  font-weight: 800;
  color: #92400e;
  letter-spacing: 0.02em;
}

#feedback {
  min-height: 22px;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
}

#feedback.correct {
  color: #15803d;
}

#feedback.wrong {
  color: #dc2626;
}

/* ---------- Answer options ---------- */
#options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

#options button {
  padding: 16px 10px;
  font-size: 20px;
  font-weight: 800;
  font-family: inherit;
  border-radius: 14px;
  border: 2px solid #c4b5fd;
  background: #fff;
  color: #4c1d95;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  box-shadow: 0 4px 0 #ddd6fe;
}

#options button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #ddd6fe;
}

#options button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #ddd6fe;
}

#options button:disabled {
  cursor: default;
  opacity: 0.85;
}

#options button.correct {
  background: linear-gradient(135deg, #4ade80, #16a34a);
  border-color: #15803d;
  color: #fff;
  box-shadow: 0 4px 0 #15803d;
}

#options button.wrong {
  background: linear-gradient(135deg, #f87171, #dc2626);
  border-color: #b91c1c;
  color: #fff;
  box-shadow: 0 4px 0 #b91c1c;
}

@media (max-width: 420px) {
  #question { font-size: 28px; }
  #options button { font-size: 18px; padding: 14px 8px; }
}