* {
  box-sizing: border-box;
}

body {
  font-family: "Comic Sans MS", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #d9f2ff 0%, #e8d9ff 25%, #ffd9ec 50%, #d9ffe6 75%, #d9f2ff 100%);
  background-size: 300% 300%;
  animation: gradientShift 12s ease infinite;
  position: relative;
  overflow-x: hidden;
}

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

#fireworks-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.card {
  width: 100%;
  max-width: 540px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  padding: 24px 20px 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 20px;
  background: linear-gradient(90deg, #7b61ff, #ff6ec4, #4ecdc4, #6a89ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.levels {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.lvl-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

.lvl-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

#lvl-easy { background: #4ecdc4; }
#lvl-medium { background: #f7b733; }
#lvl-hard { background: #ff6b6b; }

.lvl-btn.active {
  outline: 4px solid #fff;
  outline-offset: -4px;
  transform: scale(1.05);
}

.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  flex: 1;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  color: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-score { background: linear-gradient(135deg, #ff9a9e, #fecfef); }
.stat-streak { background: linear-gradient(135deg, #a1c4fd, #c2e9fb); }
.stat-word { background: linear-gradient(135deg, #d9b8ff, #b8e0ff); }

.stat .label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
}

.stat .value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.question-box {
  background: #fbfaff;
  border: 3px dashed #c7b6ff;
  border-radius: 20px;
  padding: 26px 18px;
  text-align: center;
  margin-bottom: 20px;
}

#qtype {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #7b61ff;
  background: #ece5ff;
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#prompt {
  font-size: 19px;
  font-weight: 700;
  color: #4a3f5c;
  margin-bottom: 22px;
  line-height: 1.5;
}

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

.opt-btn {
  padding: 16px 10px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.opt-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
}

.opt-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}

.opt-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.opt-btn.opt-0 { background: #ff6b6b; }
.opt-btn.opt-1 { background: #f7b733; }
.opt-btn.opt-2 { background: #4ecdc4; }
.opt-btn.opt-3 { background: #6a89ff; }

.opt-btn.correct {
  background: #2ecc71 !important;
  opacity: 1;
}

.opt-btn.wrong {
  background: #d3d3d3 !important;
  color: #999;
}

#feedback {
  min-height: 26px;
  font-size: 16px;
  font-weight: 800;
  margin-top: 18px;
}

.feedback-correct { color: #2ecc71; }
.feedback-wrong { color: #ff6b6b; }
.feedback-info { color: #6a89cc; }

.actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  flex: 1;
  padding: 14px 6px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

.skip-btn { background: #ffa94d; }

@media (max-width: 420px) {
  #prompt { font-size: 17px; }
  .opt-btn { font-size: 14px; padding: 14px 8px; }
}
