/* Game specific styles for Neon Runner */

:root {
  --neon-blue: #00c2ff;
  --neon-purple: #7f5af0;
  --neon-pink: #ff2a6d;
  --neon-green: #05ffa1;
  --neon-yellow: #fffc00;
  --dark-bg: #0d0221;
  --dark-surface: #1a1a2e;
}

.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(--neon-blue);
}

.game-container {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.game-info {
  background-color: var(--surface);
  padding: 2rem;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  box-shadow: 0 0 20px rgba(0, 194, 255, 0.1);
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.stat-item i {
  font-size: 1.2rem;
}

.stat-item:nth-child(1) i {
  color: var(--neon-blue);
}

.stat-item:nth-child(2) i {
  color: var(--neon-pink);
}

.stat-item:nth-child(3) i {
  color: var(--neon-yellow);
}

.stat-item:nth-child(4) i {
  color: var(--neon-green);
}

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

.controls-info h3 {
  margin-bottom: 0.8rem;
  color: var(--neon-purple);
}

.control-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-item:last-child {
  border-bottom: none;
}

.control-item span:first-child {
  padding: 0.2rem 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  font-family: monospace;
}

.difficulty {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.difficulty h3 {
  color: var(--neon-purple);
}

.difficulty-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.difficulty-btn {
  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;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.difficulty-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 5px;
  background-color: var(--neon-green);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.difficulty-btn.active::before {
  transform: scaleY(1);
}

.difficulty-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.mobile-controls {
  display: none;
}

.mobile-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.direction-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.direction-buttons button {
  flex: 1;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-buttons {
  display: flex;
  gap: 1rem;
}

.action-buttons button {
  flex: 1;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-buttons button:first-child {
  background-color: rgba(5, 255, 161, 0.3);
}

.action-buttons button:last-child {
  background-color: rgba(255, 42, 109, 0.3);
}

.action-btn {
  background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
  color: var(--text);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--neon-pink), var(--neon-purple));
  z-index: -1;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.action-btn:hover::before {
  opacity: 1;
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 194, 255, 0.4);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  margin-top: 0;
}

.game-board-container {
  position: relative;
  width: 100%;
  background-color: var(--dark-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 194, 255, 0.2);
  aspect-ratio: 16 / 9;
}

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

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

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

.overlay-content {
  text-align: center;
  padding: 2rem;
  background-color: var(--dark-surface);
  border-radius: 15px;
  max-width: 90%;
  width: 500px;
  border: 1px solid rgba(0, 194, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 194, 255, 0.2);
}

.overlay-content h2 {
  margin-bottom: 1rem;
  color: var(--neon-blue);
  font-size: 2rem;
  text-shadow: 0 0 10px rgba(0, 194, 255, 0.5);
}

.game-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.feature i {
  font-size: 1.5rem;
}

.feature:nth-child(1) i {
  color: var(--neon-green);
}

.feature:nth-child(2) i {
  color: var(--neon-blue);
}

.feature:nth-child(3) i {
  color: var(--neon-yellow);
}

.feature:nth-child(4) i {
  color: var(--neon-pink);
}

.level-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

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

.stat i {
  font-size: 1.2rem;
}

.stat:nth-child(1) i {
  color: var(--neon-blue);
}

.stat:nth-child(2) i {
  color: var(--neon-yellow);
}

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

/* Media Queries */
@media (max-width: 768px) {
  .game-container {
    grid-template-columns: 1fr;
  }
  
  .game-info {
    order: 2;
  }
  
  .game-board-container {
    order: 1;
  }
  
  .mobile-controls {
    display: block;
  }
  
  .controls-info {
    display: none;
  }
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 194, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 194, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 194, 255, 0);
  }
}

.difficulty-btn.active {
  animation: pulse 2s infinite;
}

@keyframes neon-glow {
  0% {
    text-shadow: 0 0 5px rgba(0, 194, 255, 0.5);
  }
  50% {
    text-shadow: 0 0 20px rgba(0, 194, 255, 0.8), 0 0 30px rgba(0, 194, 255, 0.6);
  }
  100% {
    text-shadow: 0 0 5px rgba(0, 194, 255, 0.5);
  }
}

h1 {
  animation: neon-glow 2s infinite;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.overlay.active {
  animation: fade-in 0.5s ease forwards;
}