*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', 'Arial Rounded MT Bold', 'Nunito', sans-serif;
  background: #e8f4fd;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(173, 216, 230, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 153, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 90% 70%, rgba(186, 225, 255, 0.3) 0%, transparent 40%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  overflow-x: hidden;
}

/* floating background bubbles */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
}

body::before {
  width: 200px;
  height: 200px;
  background: #ff9ff3;
  top: -40px;
  left: -60px;
  animation: bgFloat 8s ease-in-out infinite;
}

body::after {
  width: 150px;
  height: 150px;
  background: #48dbfb;
  bottom: 20px;
  right: -30px;
  animation: bgFloat 10s ease-in-out infinite reverse;
}

@keyframes bgFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.08); }
}

.container {
  max-width: 600px;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.title {
  font-size: 32px;
  color: #5b5ea6;
  text-shadow: 2px 2px 0 rgba(91, 94, 166, 0.15);
}

.scores {
  display: flex;
  gap: 12px;
}

.score-box {
  background: #fff;
  border-radius: 16px;
  padding: 6px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.score-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: #999;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.score-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #5b5ea6;
}

/* Question */
.question {
  background: #fff;
  border-radius: 24px;
  padding: 28px 20px;
  text-align: center;
  font-size: 52px;
  font-weight: 800;
  color: #333;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 28px;
  letter-spacing: 4px;
}

/* Bubbles grid */
.bubbles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  justify-items: center;
  margin-bottom: 24px;
}

/* Individual bubble */
.bubble {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  border: none;
  outline: none;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 -3px 6px rgba(0, 0, 0, 0.1),
    inset 0 3px 6px rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: bobble 3s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  user-select: none;
}

.bubble:nth-child(1) { background: #ff6b6b; animation-delay: 0s; }
.bubble:nth-child(2) { background: #48dbfb; animation-delay: 0.4s; }
.bubble:nth-child(3) { background: #ff9ff3; animation-delay: 0.8s; }
.bubble:nth-child(4) { background: #feca57; animation-delay: 1.2s; }

.bubble:active {
  transform: scale(0.92);
}

.bubble.disabled {
  pointer-events: none;
}

/* Bobbing animation */
@keyframes bobble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Correct answer pop */
.bubble.correct {
  animation: popCorrect 0.6s ease forwards;
  box-shadow: 0 0 24px 8px rgba(46, 213, 115, 0.5);
}

@keyframes popCorrect {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1.1); opacity: 0.85; }
}

/* Wrong answer shake */
.bubble.wrong {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
}

/* Feedback text */
.feedback {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  min-height: 40px;
  transition: opacity 0.3s;
}

.feedback.correct-msg {
  color: #2ed573;
}

.feedback.wrong-msg {
  color: #ff6348;
}

/* Overlay for game over */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(232, 244, 253, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.overlay-text {
  font-size: 28px;
  font-weight: 800;
  color: #5b5ea6;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

.overlay-btn {
  background: #5b5ea6;
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 16px 48px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(91, 94, 166, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.overlay-btn:active {
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 420px) {
  .title { font-size: 24px; }
  .question { font-size: 40px; padding: 20px 14px; }
  .bubble { width: 80px; height: 80px; font-size: 30px; }
  .bubbles { gap: 14px; }
  .feedback { font-size: 22px; }
  .overlay-text { font-size: 24px; }
}
