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

body {
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a2a 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: system-ui, sans-serif;
  overflow: hidden;
  touch-action: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#aiming-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
  pointer-events: none;
}

.score-container,
.high-score-container,
.level-container,
.moves-container {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 10px 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  min-width: 80px;
}

.score-container .label,
.high-score-container .label,
.level-container .label,
.moves-container .label {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.score-container span,
.high-score-container span,
.level-container span,
.moves-container span {
  display: block;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px currentColor;
}

.score-container span {
  color: #ff6b6b;
}

.high-score-container span {
  color: #ffd93d;
}

.level-container span {
  color: #6bcb77;
}

.moves-container span {
  color: #4d96ff;
}

/* Screens */
#start-screen,
#game-over-screen,
#pause-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

#start-screen .hidden,
#game-over-screen .hidden,
#pause-screen .hidden {
  display: none;
}

.game-title {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.title-char {
  font-size: 48px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 20px currentColor;
  animation: bounce 0.6s ease infinite alternate;
}

.subtitle {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-10px);
  }
}

.character-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #ffd93d);
  margin-bottom: 20px;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(255, 107, 107, 0.8);
  }
}

.instructions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
  text-align: center;
}

.instruction-item {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(5px);
}

.start-button,
.menu-button {
  padding: 18px 60px;
  font-size: 20px;
  font-weight: bold;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.start-button {
  background: linear-gradient(135deg, #ff6b6b, #ffd93d);
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
}

.start-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(255, 107, 107, 0.6);
}

.menu-button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  margin: 10px 0;
}

.menu-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Game Over Screen */
.game-over-title {
  font-size: 48px;
  font-weight: bold;
  color: #ff6b6b;
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
  margin-bottom: 20px;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.final-score {
  font-size: 32px;
  color: #fff;
  margin-bottom: 10px;
}

.final-score span {
  color: #ffd93d;
  font-size: 40px;
}

.high-score-display {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 30px;
}

.high-score-display span {
  color: #ffd93d;
  font-size: 28px;
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 16px;
}

.breakdown-label {
  color: rgba(255, 255, 255, 0.6);
}

.breakdown-value {
  color: #fff;
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
  .score-container,
  .high-score-container,
  .level-container,
  .moves-container {
    min-width: 60px;
    padding: 8px 12px;
  }

  .score-container .label,
  .high-score-container .label,
  .level-container .label,
  .moves-container .label {
    font-size: 8px;
    margin-bottom: 3px;
  }

  .score-container span,
  .high-score-container span,
  .level-container span,
  .moves-container span {
    font-size: 18px;
  }

  .title-char {
    font-size: 36px;
    gap: 4px;
  }

  .subtitle {
    font-size: 18px;
  }

  .instructions {
    gap: 8px;
    margin-bottom: 30px;
  }

  .instruction-item {
    font-size: 14px;
    padding: 8px 16px;
  }

  .control-btn {
    width: 60px;
    height: 60px;
    font-size: 12px;
  }

  #btn-rotate {
    font-size: 20px;
  }

  .start-button,
  .menu-button {
    padding: 14px 50px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .score-container,
  .high-score-container,
  .level-container,
  .moves-container {
    min-width: 50px;
    padding: 6px 10px;
  }

  .score-container .label,
  .high-score-container .label,
  .level-container .label,
  .moves-container .label {
    font-size: 7px;
  }

  .score-container span,
  .high-score-container span,
  .level-container span,
  .moves-container span {
    font-size: 16px;
  }
}

/* High Score Animation */
.score-pop {
  animation: scorePop 0.3s ease;
}

@keyframes scorePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: #ffd93d; }
  100% { transform: scale(1); }
}

/* Bubble popping effect */
.bubble-pop {
  position: absolute;
  pointer-events: none;
  animation: bubblePop 0.5s ease forwards;
}

@keyframes bubblePop {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(2);
  }
}
