/* Breakout Game Styles */
body {
  background: #0a0a0a;
  overflow-x: hidden;
}

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #0b0b12;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 15px rgba(58,199,255,0.3);
  transition: all 0.3s ease;
  z-index: 100;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58,199,255,0.5);
}

.leaderboard-sidebar {
  position: fixed;
  right: 20px;
  top: 100px;
  width: 280px;
  background: linear-gradient(145deg, rgba(20,24,39,0.95), rgba(26,31,53,0.9));
  border: 2px solid rgba(58,199,255,0.4);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  z-index: 50;
}

.leaderboard h3 {
  color: var(--accent1);
  margin: 0 0 15px;
  text-align: center;
  font-size: 1.2rem;
}

.leaderboard-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(58,199,255,0.1);
  border-radius: 8px;
  border: 1px solid rgba(58,199,255,0.2);
}

.leaderboard-entry.first {
  background: rgba(255,215,0,0.2);
  border-color: rgba(255,215,0,0.5);
}

.leaderboard-entry.second {
  background: rgba(192,192,192,0.2);
  border-color: rgba(192,192,192,0.5);
}

.leaderboard-entry.third {
  background: rgba(205,127,50,0.2);
  border-color: rgba(205,127,50,0.5);
}

.leaderboard-rank {
  font-weight: bold;
  font-size: 1.1rem;
}

.leaderboard-name {
  color: var(--fg);
  font-weight: 600;
}

.leaderboard-score {
  color: var(--accent1);
  font-weight: 700;
}

.game-container {
  margin: 80px auto 40px;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: linear-gradient(145deg, rgba(20,24,39,0.95), rgba(26,31,53,0.9));
  border: 2px solid rgba(58,199,255,0.4);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.score-display {
  display: flex;
  gap: 20px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
}

.score-display span span {
  color: var(--accent1);
  font-size: 1.3rem;
}

#game-canvas {
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 3px solid var(--accent1);
  border-radius: 16px;
  background: radial-gradient(ellipse at center, #001122 0%, #000a1a 100%);
  box-shadow: 
    0 0 40px rgba(58,199,255,0.3),
    inset 0 0 30px rgba(58,199,255,0.1);
  cursor: none;
}

.game-controls {
  width: 100%;
  text-align: center;
  padding: 20px;
  background: linear-gradient(145deg, rgba(20,24,39,0.95), rgba(26,31,53,0.9));
  border: 2px solid rgba(58,199,255,0.4);
  border-radius: 16px;
}

.game-controls p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 1.1rem;
}

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

.game-btn {
  padding: 12px 28px;
  background: linear-gradient(145deg, #1a2a3a, #0f1f2f);
  border: 2px solid var(--accent1);
  border-radius: 12px;
  color: var(--accent1);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(58,199,255,0.2);
}

.game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58,199,255,0.4);
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #0b0b12;
}

.game-btn.primary {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #0b0b12;
  border-color: rgba(255,255,255,0.3);
}

.game-btn.primary:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(58,199,255,0.6);
}

/* Mobile responsiveness */
@media (max-width: 1200px) {
  .leaderboard-sidebar {
    position: static;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
  }
  
  .game-container {
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .wrap {
    padding: 10px;
  }
  
  .back-btn {
    position: static;
    display: inline-block;
    margin-bottom: 15px;
  }
  
  .game-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .score-display {
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
    justify-content: center;
  }
  
  .score-display span span {
    font-size: 1.1rem;
  }
  
  #game-canvas {
    cursor: auto;
  }
  
  .control-buttons {
    flex-direction: column;
  }
  
  .game-btn {
    width: 100%;
  }
}

/* Loading spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 20px auto;
  border: 4px solid rgba(58,199,255,0.2);
  border-top: 4px solid var(--accent1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
