/* Square Invaders Game Styles */
:root {
  --primary: #bb86fc;
  --secondary: #4286f5;
  --accent: #9c42f5;
  --dark: #121212;
  --bg-secondary: #1e1e1e;
  --bg-card: #2a2a2a;
  --text-color: #e0e0e0;
  --text-light: #a0a0a0;
  --text-white: #ffffff;
  --space-color: #0c0c2a;
  --star-color: rgba(255, 255, 255, 0.8);
  --player-blue: #4286f5;
  --enemy-red: #e64a4a;
  --laser-green: #42f5ad;
  --explosion-orange: #ff9d00;
  --text-glow: 0 0 10px rgba(187, 134, 252, 0.7);
  --border-radius: 12px;
  --shadow-light: 0 3px 10px rgba(0, 0, 0, 0.2);
  --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

body.dark-theme {
  font-family: 'Poppins', sans-serif;
  background-color: var(--dark);
  color: var(--text-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--dark);
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Game Page Header */
.game-page-header {
  background-color: #1f1f1f;
  padding: 0.8rem 0;
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-color);
}

/* Main Game Content Area */
.game-content {
  padding: 2rem 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-title {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(187, 134, 252, 0.3);
  background: linear-gradient(to right, var(--primary), #9d70d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The Game Container */
#game-container {
  width: 100%;
  max-width: 800px;
  min-height: 500px;
  background-color: var(--bg-card);
  border: 2px solid #444;
  border-radius: 8px;
  margin: 0 auto 2rem auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

/* Game Instructions Area */
.game-instructions {
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1rem 1.5rem;
  max-width: 700px;
  width: 90%;
  margin: 0 auto;
  text-align: center;
}

.game-instructions h2 {
  font-size: 1.3rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.game-instructions p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* Footer Styles */
.site-footer {
  background-color: #1f1f1f;
  color: var(--text-light);
  text-align: center;
  padding: 1.5rem 0;
  margin-top: auto;
  font-size: 0.9rem;
  border-top: 1px solid #333;
  flex-shrink: 0;
}

.site-footer p {
  margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .game-title {
    font-size: 1.8rem;
  }
  #game-container {
    min-height: 400px;
  }
  .game-instructions {
    width: 95%;
    padding: 0.8rem 1rem;
  }
  .game-instructions h2 {
    font-size: 1.2rem;
  }
  .game-instructions p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .game-title {
    font-size: 1.6rem;
  }
  #game-container {
    min-height: 300px;
    border-width: 1px;
  }
  .back-link {
    font-size: 0.9rem;
  }
}

/* ================= Game-specific styles below ================= */

.game-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.canvas-container {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: 480px;
  border-radius: 10px;
  background: #000000;
  overflow: hidden;
  box-shadow: 
    0 0 0 2px rgba(187, 134, 252, 0.3),
    0 0 30px rgba(66, 134, 245, 0.4);
  margin: 0 auto;
}

#gameCanvas {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
}

.controls-info {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 600px;
  background: rgba(12, 12, 42, 0.7);
  padding: 12px 20px;
  border-radius: 30px;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  color: white;
  margin-bottom: 10px;
}

.controls-info p {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.controls-info i {
  color: var(--primary);
}

.level-lives {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 640px;
  padding: 15px 20px;
  background: #1a1a1a;
  border-radius: 8px;
  backdrop-filter: blur(5px);
  color: white;
  font-weight: 500;
}

.lives {
  display: flex;
  align-items: center;
  gap: 10px;
}

#lives-display {
  display: flex;
  gap: 5px;
}

.ship-life {
  width: 20px;
  height: 20px;
  background-color: var(--player-blue);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  transform: rotate(180deg);
}

.score-display {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 0 auto 15px;
  width: 100%;
}

.score-box {
  background: #1a1a1a;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 500;
  backdrop-filter: blur(5px);
  color: white;
  min-width: 120px;
  text-align: center;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(5px);
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  display: none !important;
  opacity: 0;
}

.overlay-content {
  text-align: center;
  color: white;
  padding: 30px;
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.8);
  max-width: 80%;
  box-shadow: 0 0 30px rgba(187, 134, 252, 0.4);
  transform: scale(1);
  transition: transform 0.3s ease;
}

.overlay-content h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(to right, #4286f5, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: var(--text-glow);
}

.overlay-content p {
  margin-bottom: 25px;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* Add animation for countdown */
@keyframes countdownPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.countdown {
  animation: countdownPulse 1s ease-in-out;
}

/* Ensure restart button is not hidden */
#restartButton {
  display: inline-block;
}

#restartButton.hidden {
  display: none !important;
}

.primary-btn {
  background: linear-gradient(90deg, var(--primary), #9d70d8);
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(187, 134, 252, 0.3);
  font-family: 'Poppins', sans-serif;
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(187, 134, 252, 0.4);
}

.primary-btn:active {
  transform: translateY(1px);
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .canvas-container {
    height: 400px;
  }
  
  .controls-info {
    flex-direction: column;
    gap: 10px;
  }
  
  .overlay-content h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .canvas-container {
    height: 300px;
  }
  
  .level-lives {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  .score-display {
    flex-direction: column;
    gap: 10px;
  }
  
  .overlay-content h2 {
    font-size: 1.5rem;
  }
} 