.tic-tac-toe-game {
  text-align: center;
  padding: 2rem;
}

.tic-tac-toe-game h1 {
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 400px;
  margin: 0 auto 2rem;
}

.status {
  font-size: 1.5rem;
  font-weight: 600;
}

.reset-button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--link-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.reset-button:hover {
  opacity: 0.8;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  grid-gap: 10px;
  max-width: 380px;
  margin: 0 auto;
}

.cell {
  width: 120px;
  height: 120px;
  background: var(--card-bg);
  border: 2px solid var(--card-border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.cell:hover:not(.x):not(.o) {
  background: var(--card-header-bg);
}

.cell.x::after {
  content: '✕';
  color: #e74c3c;
}

.cell.o::after {
  content: '○';
  color: #3498db;
  font-size: 4rem;
}

.cell.winner {
  background: rgba(46, 204, 113, 0.2);
}

/* Mode Selection */
.mode-selection {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mode-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--card-bg);
  color: var(--text-color);
  border: 2px solid var(--card-border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn.active {
  background: var(--link-color);
  color: white;
  border-color: var(--link-color);
}

.mode-btn:hover:not(.active) {
  background: var(--card-header-bg);
}

/* Online Lobby */
.online-lobby {
  max-width: 400px;
  margin: 0 auto 1rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border: 2px solid var(--card-border-color);
  border-radius: 10px;
}

.lobby-info {
  margin-bottom: 1rem;
}

.online-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  background: #2ecc71;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.online-count {
  font-size: 0.9rem;
  color: var(--text-muted-color);
}

.player-info {
  margin-bottom: 1rem;
}

.player-name-input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  background: var(--card-header-bg);
  color: var(--text-color);
  border: 2px solid var(--card-border-color);
  border-radius: 6px;
}

.find-match-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: #2ecc71;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.find-match-btn:hover {
  opacity: 0.9;
}

.matchmaking-status {
  text-align: center;
  padding: 2rem 0;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 4px solid var(--card-border-color);
  border-top-color: var(--link-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.cancel-match-btn {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.cancel-match-btn:hover {
  opacity: 0.9;
}

/* Players Display */
.players-display {
  display: flex;
  justify-content: space-around;
  max-width: 400px;
  margin: 0 auto 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 2px solid var(--card-border-color);
  border-radius: 10px;
}

.player-x, .player-o {
  text-align: center;
}

.player-symbol {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.player-x .player-symbol {
  color: #e74c3c;
}

.player-o .player-symbol {
  color: #3498db;
}

.player-name {
  font-size: 0.9rem;
  color: var(--text-muted-color);
}

/* Game Result Modal */
.game-result-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.result-content {
  background: var(--card-bg);
  border: 2px solid var(--card-border-color);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  max-width: 400px;
}

.result-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.result-message {
  font-size: 1.2rem;
  color: var(--text-muted-color);
  margin-bottom: 2rem;
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-buttons button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.rematch-btn {
  background: #2ecc71;
  color: white;
}

.new-match-btn {
  background: #3498db;
  color: white;
}

.back-to-lobby-btn {
  background: var(--card-header-bg);
  color: var(--text-color);
}

.result-buttons button:hover {
  opacity: 0.9;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .board {
    grid-template-columns: repeat(3, 90px);
    max-width: 290px;
  }

  .cell {
    width: 90px;
    height: 90px;
    font-size: 2.5rem;
  }

  .result-content {
    margin: 1rem;
    padding: 2rem 1rem;
  }
}
