* {
  box-sizing: border-box;
}

body {
  font-family: "Comic Sans MS", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #7c2d12 0%, #c2410c 25%, #db2777 50%, #6b21a8 75%, #7c2d12 100%);
  background-size: 300% 300%;
  animation: gradientShift 14s 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: 440px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 24px 20px 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

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

.lvl-btn {
  flex: 1;
  padding: 10px 6px;
  border-radius: 10px;
  border: 2px solid #fed7aa;
  background: #fff7ed;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.lvl-btn.active {
  background: linear-gradient(135deg, #f97316, #c2410c);
  border-color: #9a3412;
  color: #fff;
  font-weight: 700;
}

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

.stat {
  flex: 1;
  background: #ffedd5;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.stat .label { font-size: 12px; color: #c2410c; font-weight: 700; }
.stat .value { font-size: 22px; font-weight: 800; color: #7c2d12; margin-top: 2px; }

.question-box {
  background: #fffaf5;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
}

#prompt {
  font-size: 16px;
  font-weight: 700;
  color: #7c2d12;
  margin-bottom: 16px;
}

.slide-board {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 16px;
  padding: 8px;
  background: #7c2d12;
  border-radius: 14px;
}

.slide-tile {
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 28px;
  font-weight: 800;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

.slide-tile:hover:not(:disabled) { transform: scale(1.05); }
.slide-tile:active:not(:disabled) { transform: scale(0.96); }
.slide-tile:disabled { cursor: default; }

.slide-tile.empty-tile {
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.slide-board.size-4 .slide-tile { font-size: 22px; }
.slide-board.size-5 .slide-tile { font-size: 17px; border-radius: 8px; }

#feedback {
  min-height: 20px;
  font-weight: 700;
  font-size: 14px;
}

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

.actions { display: flex; margin-top: 16px; }

.action-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.check-btn { background: #ea580c; color: #fff; }
.check-btn:hover { background: #c2410c; }