/* Game specific styles for Cosmic Runner */

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.back-btn {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease;
}

.back-btn:hover {
  transform: translateX(-5px);
  color: var(--primary);
}

.game-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

.game-board-container {
  position: relative;
  width: 100%;
  background-color: var(--surface);
  border-radius: 15px;
  overflow: hidden;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.game-info {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 15px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.stats {
  display: flex;
  gap: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.stat-item i {
  font-size: 1.2rem;
  color: var(--primary);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.control-section {
  flex: 1;
  min-width: 180px;
}

.controls h3 {
  margin-bottom: 0.5rem;
  text-align: center;
}

.difficulty-buttons,
.speed-buttons {
  display: flex;
  gap: 0.5rem;
}

.difficulty-btn,
.speed-btn {
  flex: 1;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: none;
  padding: 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.difficulty-btn.active,
.speed-btn.active {
  background-color: var(--primary);
}

.controls-info {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 10px;
}

.controls-info ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.controls-info li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.controls-info li i {
  width: 20px;
  text-align: center;
  color: var(--primary);
}

.mobile-controls {
  display: none; /* Hidden on desktop */
}

.control-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.control-buttons button {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-buttons button:active {
  background-color: var(--primary);
  transform: scale(0.95);
}

.action-btn {
  background-color: var(--accent);
  color: var(--text);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 137, 6, 0.4);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .game-info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stats {
    justify-content: center;
  }
  
  .action-btn {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  .control-section {
    width: 100%;
    max-width: 400px;
  }
  
  .mobile-controls {
    display: block;
  }
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(22, 22, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(3px);
}

.overlay-content {
  text-align: center;
  padding: 2rem;
  background-color: var(--surface);
  border-radius: 15px;
  max-width: 90%;
  width: 400px;
}

.overlay-content h2 {
  margin-bottom: 1rem;
  color: var(--primary);
  font-size: 2rem;
}

.overlay-content p {
  margin-bottom: 1rem;
}

#game-over {
  display: none;
}

#new-high-score {
  color: var(--secondary);
  font-weight: bold;
  display: none;
  margin: 1rem 0;
}

/* Power-up indicator styles */
.power-up-indicator {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.power-up {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 0.5rem;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.power-up.active {
  opacity: 1;
}

.power-up-icon {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.power-up-timer {
  height: 3px;
  background-color: var(--primary);
  transition: width 0.1s linear;
}

/* Media Queries */
@media (max-width: 768px) {
  .game-container {
    grid-template-columns: 1fr;
  }
  
  .game-info {
    order: 2;
  }
  
  .game-board-container {
    order: 1;
    padding-bottom: 75%; /* Adjust aspect ratio for mobile */
  }
  
  .mobile-controls {
    display: block;
  }
}

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

.action-btn:hover {
  animation: pulse 1.5s infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes flash {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.damaged {
  animation: flash 0.2s 3;
}

@keyframes powerUpPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(127, 90, 240, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(127, 90, 240, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(127, 90, 240, 0);
  }
}

.power-up.active .power-up-icon {
  animation: powerUpPulse 1.5s infinite;
}