/* Bubble Pop game specific styles */

/* Layout */
.bubble_pop-section {
  padding: 2rem 0 1rem;
}

.bubble_pop-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 1rem;
}

/* Bubble tank */
.bubble_pop-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.bubble-tank {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 420px;
  background: linear-gradient(180deg, #cffafe 0%, #a5f3fc 50%, #67e8f9 100%);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 3px solid #0ea5e9;
  box-shadow: var(--shadow-lg), inset 0 0 40px rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .bubble-tank {
  background: linear-gradient(180deg, #164e63 0%, #155e75 50%, #0e7490 100%);
  border-color: #22d3ee;
  box-shadow: var(--shadow-lg), inset 0 0 40px rgba(0, 0, 0, 0.3);
}

.bubble-tank-water {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.5), transparent 60%);
  pointer-events: none;
}

.bubble-tank-glass {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 30%, transparent 70%, rgba(255, 255, 255, 0.2) 100%);
  border-radius: calc(var(--radius-xl) - 3px);
  pointer-events: none;
  z-index: 3;
}

.bubble-tank-floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  z-index: 2;
}

[data-theme="dark"] .bubble-tank-floor {
  background: linear-gradient(180deg, #78350f, #451a03);
}

/* Bubbles */
.bubble {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #0c4a6e;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0.15) 70%, transparent 100%);
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset -4px -6px 12px rgba(255, 255, 255, 0.5), inset 4px 6px 12px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  z-index: 4;
  padding: 0 4px;
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
  animation: bubbleFloat 4s ease-in-out infinite;
  will-change: transform;
}

[data-theme="dark"] .bubble {
  color: #e0f2fe;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2) 45%, rgba(255, 255, 255, 0.05) 70%, transparent 100%);
  border-color: rgba(255, 255, 255, 0.4);
}

.bubble:hover {
  transform: scale(1.08);
  box-shadow: inset -4px -6px 12px rgba(255, 255, 255, 0.6), inset 4px 6px 12px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.15);
}

.bubble:active {
  transform: scale(0.95);
}

.bubble.correct-pop {
  animation: correctPop 0.4s ease forwards;
  pointer-events: none;
}

.bubble.wrong-pop {
  animation: wrongPop 0.4s ease forwards;
  pointer-events: none;
}

.bubble.escaped {
  animation: bubbleEscape 0.6s ease forwards;
  pointer-events: none;
}

@keyframes bubbleFloat {

  0%,
  100% {
    transform: translateY(0) translateX(0);
  }

  33% {
    transform: translateY(-8px) translateX(3px);
  }

  66% {
    transform: translateY(4px) translateX(-3px);
  }
}

@keyframes correctPop {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.8;
  }

  100% {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes wrongPop {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  30% {
    transform: scale(1.15) rotate(5deg);
    opacity: 1;
  }

  60% {
    transform: scale(1.15) rotate(-5deg);
    opacity: 1;
  }

  100% {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes bubbleEscape {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-420px) scale(0.6);
    opacity: 0;
  }
}

/* Floating score popups */
.bubble-popup {
  position: absolute;
  font-weight: 800;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 10;
  animation: popupFloat 0.8s ease forwards;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bubble-popup.plus {
  color: var(--success-color);
}

.bubble-popup.minus {
  color: var(--error-color);
}

@keyframes popupFloat {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }

  20% {
    transform: translateY(-10px) scale(1.1);
    opacity: 1;
  }

  100% {
    transform: translateY(-50px) scale(1);
    opacity: 0;
  }
}

/* Life hearts */
.bubble_pop-life {
  display: flex;
  gap: 0.4rem;
  font-size: 1.4rem;
}

.life-heart {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.life-heart.lost {
  opacity: 0.2;
  transform: scale(0.8);
  filter: grayscale(1);
}

/* Stats */
.bubble_pop-stats {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.bubble_pop-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  min-width: 80px;
}

.bubble_pop-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bubble_pop-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
}

.bubble_pop-stat-value.warning {
  color: var(--warning-color);
  animation: timerPulse 1s ease-in-out infinite;
}

.bubble_pop-stat-value.danger {
  color: var(--error-color);
  animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }
}

/* Category */
.bubble_pop-category {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-secondary);
}

.category-value {
  font-weight: 600;
  color: var(--primary-color);
}

/* Task */
.bubble_pop-task {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  min-height: 2rem;
}

/* Feedback */
.bubble_pop-feedback {
  text-align: center;
  min-height: 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.bubble_pop-feedback.success {
  color: var(--success-color);
}

.bubble_pop-feedback.error {
  color: var(--error-color);
}

.bubble_pop-feedback.info {
  color: var(--primary-color);
}

/* Actions */
.bubble_pop-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.bubble_pop-actions .btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

/* Progress */
.bubble_pop-progress {
  margin-top: 0.5rem;
}

.bubble_pop-progress .progress-bar {
  width: 100%;
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: 5px;
  overflow: hidden;
}

.bubble_pop-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 5px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Info section */
.bubble_pop-info {
  padding: 3rem 0;
}

/* Responsive */
@media (max-width: 900px) {
  .bubble_pop-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bubble_pop-visual {
    order: -1;
  }

  .bubble-tank {
    max-width: 280px;
    height: 380px;
  }

  .bubble {
    font-size: 0.65rem;
  }
}

@media (max-width: 600px) {
  .bubble-tank {
    max-width: 240px;
    height: 340px;
  }

  .bubble {
    font-size: 0.6rem;
  }

  .bubble_pop-actions {
    flex-direction: column;
  }

  .bubble_pop-actions .btn {
    width: 100%;
  }

  .bubble_pop-stat {
    min-width: 65px;
    padding: 0.5rem 0.8rem;
  }

  .bubble_pop-stat-value {
    font-size: 1.15rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .bubble,
  .life-heart,
  .bubble_pop-stat-value {
    animation: none !important;
    transition: none !important;
  }
}