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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}

.game-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.5s ease-out;
}

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

.game-header {
  text-align: center;
  margin-bottom: 30px;
}

.game-title {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.title-emoji {
  display: inline-block;
  animation: bounce 2s infinite;
}

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

.game-controls {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.difficulty-selector,
.mode-selector {
  display: flex;
  align-items: center;
  gap: 15px;
}

.difficulty-selector label,
.mode-selector label {
  font-weight: bold;
  color: #333;
}

.difficulty-buttons,
.mode-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.difficulty-btn,
.mode-btn {
  padding: 8px 16px;
  border: 2px solid #667eea;
  background: white;
  color: #667eea;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.difficulty-btn:hover,
.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.difficulty-btn.active,
.mode-btn.active {
  background: #667eea;
  color: white;
}

.stats-bar {
  display: flex;
  justify-content: space-around;
  padding: 15px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 15px;
  margin-bottom: 20px;
  color: white;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-label {
  font-size: 0.9rem;
}

.stat-value {
  font-weight: bold;
  font-size: 1.1rem;
}

.power-ups-bar {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.power-up {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-width: 80px;
}

.power-up:hover:not(.disabled) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 25px rgba(252, 182, 159, 0.4);
}

.power-up.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.power-up.active {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  animation: powerUpActive 1s infinite;
}

@keyframes powerUpActive {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.power-icon {
  font-size: 2rem;
}

.power-name {
  font-size: 0.8rem;
  font-weight: bold;
  color: #333;
}

.power-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6b6b;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}

.game-board {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#game-canvas {
  border: 2px solid #3498db;
  border-radius: 10px;
  background: #000;
  box-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
}

.game-controls-bottom {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.control-btn {
  padding: 12px 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.achievements-bar {
  background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
  padding: 15px;
  border-radius: 15px;
}

.achievements-bar h3 {
  color: #333;
  margin-bottom: 10px;
}

.achievements-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 40px;
}

.achievement-item {
  background: white;
  padding: 8px 15px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: achievementSlide 0.5s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

@keyframes achievementSlide {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.achievement-icon {
  font-size: 1.2rem;
}

.achievement-text {
  font-size: 0.9rem;
  color: #333;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: modalPop 0.3s ease;
  position: relative;
}

@keyframes modalPop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #333;
}

.modal-title {
  color: #667eea;
  margin-bottom: 20px;
  font-size: 2rem;
}

.modal-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.final-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.final-stat-label {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.final-stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #667eea;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-btn {
  padding: 12px 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 16px;
  border: 2px solid #667eea;
  background: white;
  color: #667eea;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background: #667eea;
  color: white;
}

.leaderboard-list {
  text-align: left;
  max-height: 300px;
  overflow-y: auto;
}

.leaderboard-list li {
  padding: 10px;
  margin-bottom: 5px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
}

.leaderboard-list li:nth-child(1) {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.leaderboard-list li:nth-child(2) {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.leaderboard-list li:nth-child(3) {
  background: linear-gradient(135deg, #cd7f32 0%, #e6a468 100%);
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.brick-power-up {
  animation: brickPowerUp 0.5s infinite;
}

@keyframes brickPowerUp {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.5) saturate(1.5);
  }
}

.paddle-expanded {
  animation: paddleGlow 1s infinite;
}

@keyframes paddleGlow {
  0%,
  100% {
    box-shadow: 0 0 10px #3498db;
  }
  50% {
    box-shadow: 0 0 20px #3498db, 0 0 30px #3498db;
  }
}

.laser-mode {
  animation: laserCharge 0.5s infinite;
}

@keyframes laserCharge {
  0%,
  100% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(90deg);
  }
}

@media (max-width: 768px) {
  .game-title {
    font-size: 1.8rem;
  }

  .game-controls {
    flex-direction: column;
  }

  .stats-bar {
    flex-wrap: wrap;
  }

  .power-ups-bar {
    flex-wrap: wrap;
  }

  #game-canvas {
    max-width: 100%;
    height: auto;
  }

  .game-controls-bottom {
    flex-wrap: wrap;
  }

  .modal-stats {
    flex-wrap: wrap;
    gap: 10px;
  }
}
