/**
 * Game-specific CSS styles for ASCII Space Invaders
 */

/* ASCII Game Container */
.ascii-game-container {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  border: 2px solid rgba(0, 212, 255, 0.5);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 0 20px rgba(0, 212, 255, 0.3),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Game Header */
.game-header {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(26, 26, 46, 0.9) 100%);
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.score-display,
.lives-display,
.level-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 1rem;
  color: #00d4ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  padding: 8px 12px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  min-width: 100px;
  justify-content: center;
}

.score-display::before {
  content: '🎯';
  font-size: 1.2rem;
}

.lives-display::before {
  content: '❤️';
  font-size: 1.2rem;
}

.level-display::before {
  content: '🌟';
  font-size: 1.2rem;
}

/* Game Area */
.game-area {
  background: #000000;
  min-height: 500px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

/* Start Screen */
.start-screen {
  text-align: center;
  color: #ffffff;
  padding: 60px 30px;
  max-width: 500px;
}

.start-screen h3 {
  font-size: 2.5rem;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  margin-bottom: 20px;
  color: #00d4ff;
  text-shadow: 
    0 0 20px rgba(0, 212, 255, 0.8),
    0 0 40px rgba(0, 212, 255, 0.4);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 
      0 0 20px rgba(0, 212, 255, 0.8),
      0 0 40px rgba(0, 212, 255, 0.4);
  }
  to {
    text-shadow: 
      0 0 30px rgba(0, 212, 255, 1),
      0 0 60px rgba(0, 212, 255, 0.6);
  }
}

.start-screen p {
  font-size: 1.3rem;
  margin-bottom: 30px;
  color: #cccccc;
  font-family: 'Courier New', monospace;
}

/* Controls Info */
.controls-info {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  padding: 25px;
  margin-top: 30px;
  backdrop-filter: blur(5px);
}

.controls-info p {
  margin-bottom: 8px;
  font-size: 1rem;
  color: #e0e0e0;
  font-family: 'Courier New', monospace;
}

.controls-info p:first-child {
  font-size: 1.1rem;
  color: #00d4ff;
  font-weight: bold;
  margin-bottom: 15px;
}

/* Game Canvas */
#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 800px;
  max-height: 600px;
  background: #000000;
  border: 2px solid rgba(0, 212, 255, 0.3);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Game Over Screen */
.game-over-screen {
  text-align: center;
  color: #ffffff;
  padding: 60px 30px;
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-over-screen h3 {
  font-size: 3rem;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ff6b6b;
  text-shadow: 
    0 0 20px rgba(255, 107, 107, 0.8),
    0 0 40px rgba(255, 107, 107, 0.4);
}

.game-over-screen p {
  font-size: 1.4rem;
  margin-bottom: 30px;
  color: #ffffff;
  font-family: 'Courier New', monospace;
}

/* Game Controls */
.game-controls {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(26, 26, 46, 0.9) 100%);
  padding: 20px;
  text-align: center;
  border-top: 1px solid rgba(0, 212, 255, 0.3);
}

/* Game Buttons */
.game-btn,
.restart-btn {
  background: linear-gradient(45deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0 8px;
  transition: all 0.3s ease;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.game-btn::before,
.restart-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.game-btn:hover,
.restart-btn:hover {
  background: linear-gradient(45deg, #34ce57, #2dd4aa);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.game-btn:hover::before,
.restart-btn:hover::before {
  left: 100%;
}

.game-btn:active,
.restart-btn:active {
  transform: translateY(-1px);
}

/* Pause/Resume specific styling */
#pause-game-btn {
  background: linear-gradient(45deg, #ffc107, #e0a800);
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

#pause-game-btn:hover {
  background: linear-gradient(45deg, #ffcd39, #f0b90b);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

#resume-game-btn {
  background: linear-gradient(45deg, #17a2b8, #138496);
  box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

#resume-game-btn:hover {
  background: linear-gradient(45deg, #1fb6cc, #157a8a);
  box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

/* Responsive Game Styles */

/* Mobile (320px+) */
@media (max-width: 767px) {
  .game-header {
    padding: 12px 15px;
    flex-direction: column;
    gap: 10px;
  }
  
  .score-display,
  .lives-display,
  .level-display {
    font-size: 0.9rem;
    padding: 6px 10px;
    min-width: 80px;
  }
  
  .start-screen {
    padding: 40px 20px;
  }
  
  .start-screen h3 {
    font-size: 2rem;
  }
  
  .start-screen p {
    font-size: 1.1rem;
  }
  
  .controls-info {
    padding: 20px;
    margin-top: 25px;
  }
  
  .controls-info p {
    font-size: 0.9rem;
  }
  
  .game-controls {
    padding: 15px;
  }
  
  .game-btn,
  .restart-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    margin: 5px 4px;
  }
  
  .game-area {
    min-height: 400px;
  }
  
  #game-canvas {
    max-height: 400px;
  }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
  .game-header {
    padding: 18px 25px;
  }
  
  .game-area {
    min-height: 550px;
  }
  
  .start-screen h3 {
    font-size: 2.8rem;
  }
  
  .game-over-screen h3 {
    font-size: 3.2rem;
  }
  
  .game-controls {
    padding: 25px;
  }
  
  .game-btn,
  .restart-btn {
    padding: 14px 28px;
    font-size: 1.1rem;
    margin: 0 10px;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .ascii-game-container {
    max-width: 900px;
    margin: 0 auto;
  }
  
  .game-header {
    padding: 20px 30px;
  }
  
  .score-display,
  .lives-display,
  .level-display {
    font-size: 1.1rem;
    padding: 10px 15px;
    min-width: 120px;
  }
  
  .game-area {
    min-height: 600px;
  }
  
  .start-screen {
    padding: 80px 40px;
  }
  
  .start-screen h3 {
    font-size: 3rem;
  }
  
  .controls-info {
    padding: 30px;
  }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .ascii-game-container {
    max-width: 1000px;
  }
  
  .game-area {
    min-height: 650px;
  }
  
  #game-canvas {
    max-height: 650px;
  }
}

/* Game Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
  .start-screen h3 {
    animation: none;
  }
  
  .game-over-screen {
    animation: none;
  }
  
  .game-btn::before,
  .restart-btn::before {
    transition: none;
  }
}

/* Touch-specific styles for mobile gaming */
@media (hover: none) and (pointer: coarse) {
  .game-btn,
  .restart-btn {
    padding: 15px 25px;
    font-size: 1.1rem;
    min-height: 48px; /* Minimum touch target size */
  }
  
  .controls-info {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.4);
  }
  
  #game-canvas {
    cursor: crosshair;
  }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
  .ascii-game-container {
    border: 3px solid #ffffff;
    background: #000000;
  }
  
  .game-header {
    background: #000000;
    border-bottom: 2px solid #ffffff;
  }
  
  .score-display,
  .lives-display,
  .level-display {
    background: #000000;
    border: 2px solid #ffffff;
    color: #ffffff;
  }
  
  .start-screen h3,
  .game-over-screen h3 {
    text-shadow: none;
    color: #ffffff;
  }
  
  .controls-info {
    background: #000000;
    border: 2px solid #ffffff;
  }
}