/* Game specific styles for Snake */

.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: 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;
}

.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;
  color: var(--primary);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

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

.speed-btn,
.theme-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;
}

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

.mobile-controls {
  display: none;
}

.d-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.d-pad button {
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.d-pad-middle {
  display: flex;
  gap: 0.5rem;
}

.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;
  margin-top: auto;
}

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

.game-board-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 80%;
  background-color: var(--surface);
  border-radius: 15px;
  overflow: hidden;
}

#game-board {
  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(22, 22, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

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

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

#game-over {
  display: none;
}

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

/* Themes */
.game-board-container.classic #game-board {
  background-color: #2c3e50;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.game-board-container.neon #game-board {
  background-color: #000;
  box-shadow: inset 0 0 30px rgba(127, 90, 240, 0.5);
  border: 2px solid var(--primary);
}

.game-board-container.retro #game-board {
  background-color: #8bc34a;
  background-image: linear-gradient(45deg, #8bc34a 25%, #9ccc65 25%, #9ccc65 50%, #8bc34a 50%, #8bc34a 75%, #9ccc65 75%, #9ccc65 100%);
  background-size: 20px 20px;
}

/* 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;
  }
}

/* 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;
  }
}

#game-over.active {
  display: flex;
  animation: fadeIn 0.5s ease;
}