* {
  box-sizing: border-box;
}

body {
  font-family: "Comic Sans MS", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 25%, #fbc2eb 50%, #a6c1ee 75%, #fbc2eb 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: 520px;
  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, #770707, #63460c, #0c6862, #02186e);
  -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, #fbc2eb, #a6c1ee); }

.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: #fffaf0;
  border: 3px dashed #ffb6c1;
  border-radius: 20px;
  padding: 26px 16px;
  text-align: center;
  margin-bottom: 20px;
}

#clue {
  font-size: 17px;
  font-weight: 600;
  color: #5a4a6a;
  margin-bottom: 20px;
}

#answer-slots {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 48px;
  margin-bottom: 20px;
}

.slot {
  width: 38px;
  height: 44px;
  border: 2px solid #d9b8ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  background: #fff;
  color: #6a4c93;
}

.slot.filled {
  background: linear-gradient(135deg, #d9b8ff, #b8e0ff);
  border-color: #9a7fd9;
}

#letter-tiles {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tile-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: none;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
}

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

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

.tile-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

#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);
}

.clear-btn { background: #a29bfe; }
.check-btn { background: #2ecc71; }
.skip-btn { background: #ffa94d; }

@media (max-width: 400px) {
  .slot { width: 30px; height: 38px; font-size: 16px; }
  .tile-btn { width: 38px; height: 38px; font-size: 15px; }
}
