/* ============================================
   TIC TAC TOE STYLES
   ============================================ */

.turn-indicator {
  text-align: center;
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-base);
}

.board-area {
  position: relative;
  width: min(320px, 85vw);
  aspect-ratio: 1;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
}

.ttt-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-base);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.ttt-cell:hover:not(.taken) {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.03);
}

.ttt-cell:active:not(.taken) {
  transform: scale(0.97);
}

.ttt-cell.taken {
  cursor: default;
}

/* X marker */
.ttt-cell.x {
  color: #ef4444;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* O marker */
.ttt-cell.o {
  color: #3b82f6;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Winning cells */
.ttt-cell.winner {
  animation: winPulse 0.6s ease infinite alternate;
}

.ttt-cell.winner.x {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.ttt-cell.winner.o {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}

@keyframes winPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

/* Win line SVG */
.win-line-svg {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  pointer-events: none;
  z-index: 5;
}

.win-line-svg line {
  stroke: rgba(245, 158, 11, 0.7);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.win-line-svg line.animate {
  animation: drawLine 0.5s ease forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* Player score badges */
.player-x {
  border-color: rgba(239, 68, 68, 0.2) !important;
}

.player-x .value {
  color: #ef4444;
}

.player-o {
  border-color: rgba(59, 130, 246, 0.2) !important;
}

.player-o .value {
  color: #3b82f6;
}

.draws .value {
  color: var(--text-muted);
}

/* Result overlay */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: var(--transition-base);
}

.result-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.result-content {
  text-align: center;
  transform: scale(0.9);
  transition: var(--transition-bounce);
}

.result-overlay:not(.hidden) .result-content {
  transform: scale(1);
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 0.75rem;
}

.result-content h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.result-content h2.x-wins {
  color: #ef4444;
}

.result-content h2.o-wins {
  color: #3b82f6;
}

/* Responsive */
@media (max-width: 480px) {
  .ttt-cell {
    font-size: 2.2rem;
    border-radius: var(--radius-sm);
  }
  
  .ttt-board {
    gap: 8px;
    padding: 8px;
  }
}
