* {
  box-sizing: border-box;
}

body {
  font-family: "Comic Sans MS", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #581c87 0%, #be185d 25%, #7c3aed 50%, #1e1b4b 75%, #581c87 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%; }
}

.card {
  width: 100%;
  max-width: 480px;
  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;
  border-radius: 10px;
  border: 2px solid #e9d5ff;
  background: #faf5ff;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}

.lvl-btn.active {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  border-color: #6d28d9;
  color: #fff;
  font-weight: 700;
}

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

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

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

.question-box {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
}

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

#play-area {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pad-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.pad {
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.1s ease, transform 0.1s ease;
}

.pad:not(:disabled):hover {
  transform: scale(1.04);
}

.pad.active {
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6), 0 0 24px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

.overlay-screen {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  text-align: center;
}

.overlay-screen.hidden { display: none; }

.overlay-screen h2 {
  margin: 0;
  color: #4c1d95;
}

.overlay-screen p { margin: 0 0 8px; color: #6b21a8; }

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

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

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

.check-btn { background: #7c3aed; color: #fff; }
.check-btn:hover { background: #6d28d9; }