#bubble-math-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #e0f7ff;
  padding: 20px;
  border-radius: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.bm-body {
  display: flex;
  align-items: stretch; /* Helps columns match height */
  gap: 20px;
}

/* 1. Sidebar (15%) - Larger tabs to cover height */
#bm-sidebar {
  flex: 0 0 15%;
}

.bm-level-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bm-level-list li {
  padding: 12px 5px; /* Increased padding for larger tabs */
  border-radius: 6px;
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 2. Game Area (60%) */
#bm-game-area {
  flex: 0 0 60%;
  position: relative;
  height: 500px; /* Standard game height */
  background-color: #fff;
  background-size: cover;
  background-position: center;
  border: 3px solid #87ceeb;
  border-radius: 10px;
  overflow: hidden;
}

/* 3. Right Panel (25%) */
#bm-right-panel {
  flex: 0 0 25%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#bm-controls button {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background-color: #4caf50;
  color: white;
  box-shadow: 0 4px 0 #388e3c;
}

#bm-controls button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #388e3c;
}

#bm-reset-btn { background-color: #f44336 !important; box-shadow: 0 4px 0 #d32f2f !important; }

#bm-equation-container {
  background: #fff;
  border: 2px solid #2196f3;
  border-radius: 10px;
  overflow: hidden;
}

.bm-stats-row {
  display: flex;
  justify-content: space-between;
  background: #2196f3;
  padding: 10px 15px;
  font-weight: bold;
  font-size: 16px;
  color: #fff;
}

#bm-equation-display {
  font-size: 32px;
  font-weight: bold;
  padding: 25px 10px;
  text-align: center;
  color: #333;
}

/* --- FIXED BALLOON ANIMATION --- */
.bm-balloon-wrapper {
  position: absolute;
  left: 0;
  bottom: -100px; /* Initial position hidden below the area */
  text-align: center;
  cursor: pointer;
  z-index: 10;
  animation-name: float;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.bm-balloon {
  width: 65px;
  height: auto;
}

.bm-label {
  margin-top: -38px;
  font-weight: bold;
  font-size: 18px;
  color: #000;
  text-shadow: 1px 1px 0px #fff;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  100% {
    /* Large enough to travel through 500px height + 100px starting offset */
    transform: translateY(-700px); 
  }
}

.bm-balloon-wrapper.bursting {
  animation: burst 0.3s ease-out forwards;
}

@keyframes burst {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

#bm-message-box {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
  text-align: center;
  z-index: 1000;
}