/* Game specific styles for Tic-Tac-Toe */

.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 2fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.game-info {
  background-color: var(--surface);
  padding: 2rem;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

.player {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 10px;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.player.active {
  background-color: rgba(127, 90, 240, 0.2);
  opacity: 1;
  transform: scale(1.05);
}

.player-symbol {
  font-size: 1.5rem;
  font-weight: bold;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.player-x .player-symbol {
  color: var(--primary);
  background-color: rgba(127, 90, 240, 0.2);
}

.player-o .player-symbol {
  color: var(--secondary);
  background-color: rgba(44, 182, 125, 0.2);
}

.game-status {
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  min-height: 2rem;
}

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

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

.mode-toggle {
  display: flex;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  overflow: hidden;
}

.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.8rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn.active {
  background-color: var(--primary);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  aspect-ratio: 1/1;
  max-width: 500px;
  margin: 0 auto;
}

.cell {
  background-color: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cell:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.cell.x::before, .cell.x::after {
  content: '';
  position: absolute;
  width: 80%;
  height: 15%;
  background-color: var(--primary);
  border-radius: 10px;
}

.cell.x::before {
  transform: rotate(45deg);
}

.cell.x::after {
  transform: rotate(-45deg);
}

.cell.o::before {
  content: '';
  position: absolute;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  border: 15px solid var(--secondary);
}

.cell.winning {
  animation: pulse 1s infinite;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--surface);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  max-width: 90%;
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#win-message {
  font-size: 1.8rem;
}

/* Media Queries */
@media (max-width: 768px) {
  .game-container {
      grid-template-columns: 1fr;
  }
  
  .game-board {
      max-width: 100%;
  }
}

/* Animations */
@keyframes draw-x-first {
  from { width: 0; }
  to { width: 80%; }
}

@keyframes draw-x-second {
  from { width: 0; }
  to { width: 80%; }
}

@keyframes draw-o {
  from { 
      width: 0;
      height: 0;
      border-width: 0;
  }
  to { 
      width: 60%;
      height: 60%;
      border-width: 15px;
  }
}

.cell.x::before {
  animation: draw-x-first 0.2s ease forwards;
}

.cell.x::after {
  animation: draw-x-second 0.2s 0.1s ease forwards;
}

.cell.o::before {
  animation: draw-o 0.3s ease forwards;
}