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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #1A1A2D;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameContainer {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  display: block;
}

/* UI Overlay */
#gameUI {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

#gameUI > * {
  pointer-events: auto;
}

canvas {
  pointer-events: auto;
}

/* Score Display */
#scoreDisplay {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 15px 25px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.score-label {
  color: #aaa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.score-value {
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

/* Level Display */
#levelDisplay {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 15px 25px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.level-label {
  color: #aaa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.level-value {
  color: #4ade80;
  font-size: 32px;
  font-weight: bold;
  text-shadow: 0 2px 10px rgba(74, 222, 128, 0.5);
}

/* Shots Display */
#shotsDisplay {
  position: absolute;
  top: 120px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 15px 25px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.shots-label {
  color: #aaa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.shots-value {
  color: #fbbf24;
  font-size: 32px;
  font-weight: bold;
  text-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

.shots-value.warning {
  color: #ff6b6b;
  animation: pulse 0.5s infinite;
  text-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Bubble Queue */
#bubbleQueue {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.queue-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.queue-label {
  color: #aaa;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#currentBubble,
#nextBubble {
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-swap {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  margin-top: 5px;
}

.btn-swap:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

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

/* Controls Hint */
.controls-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 15px 30px;
  border-radius: 15px;
  color: white;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: fadeOut 5s forwards;
}

@keyframes fadeOut {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

.key {
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hint-mobile {
  display: none;
}

/* Game Over Screen */
.game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.game-over.hidden {
  display: none;
}

.game-over-content {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  padding: 40px 60px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.3);
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.game-over-title {
  font-size: 48px;
  color: white;
  margin-bottom: 30px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-over-title.win {
  color: #4ade80;
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
}

.final-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.stat-value {
  color: white;
  font-size: 36px;
  font-weight: bold;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.btn-restart {
  background: white;
  color: #667eea;
  border: none;
  padding: 15px 40px;
  border-radius: 15px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  margin-top: 10px;
}

.btn-restart:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

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

.leaderboard-msg {
  color: rgba(255, 255, 255, 0.8);
  margin-top: 20px;
  font-size: 14px;
}

/* Start Screen */
.start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.start-content {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  padding: 50px 70px;
  border-radius: 25px;
  text-align: center;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
  border: 3px solid rgba(255, 255, 255, 0.3);
  max-width: 600px;
  animation: slideIn 0.6s ease-out;
}

.game-title {
  font-size: 56px;
  color: white;
  margin-bottom: 20px;
  text-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

.game-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.game-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 30px;
}

.feature {
  background: rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-start {
  background: white;
  color: #667eea;
  border: none;
  padding: 18px 50px;
  border-radius: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 30px;
}

.btn-start:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

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

.controls-info h3 {
  color: white;
  font-size: 20px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.controls-desktop {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  line-height: 1.8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hint-desktop {
    display: none;
  }

  .hint-mobile {
    display: block;
  }

  #scoreDisplay,
  #timerDisplay {
    padding: 10px 15px;
  }

  .score-value {
    font-size: 24px;
  }

  .timer-value {
    font-size: 20px;
  }

  #bubbleQueue {
    bottom: 10px;
    right: 10px;
    padding: 10px;
  }

  .game-over-content,
  .start-content {
    padding: 30px 40px;
    margin: 20px;
  }

  .game-title {
    font-size: 40px;
  }

  .game-features {
    grid-template-columns: 1fr;
  }

  .final-stats {
    flex-direction: column;
    gap: 20px;
  }
}

/* Loading/Transition Effects */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}
