/* Tic-Tac-Toe Game Styles */
:root {
  --primary-blue: #2563eb;
  --secondary-teal: #0891b2;
  --accent-orange: #ea580c;
  --success-green: #059669;
  --error-red: #dc2626;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --cell-size: 100px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f59e0b 0%, #1e40af 100%);
  min-height: 100vh;
  color: var(--neutral-700);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.game-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 16px 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

.game-header h1 {
  color: var(--neutral-800);
  font-size: 1.5rem;
}

.game-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.lang-btn, #newGameBtn {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

/* Game Main */
.game-main {
  padding: 20px 0;
}

.game-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

.game-info {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.game-info > div {
  font-weight: 500;
}

.game-info span:last-child {
  font-weight: 700;
  color: var(--primary-blue);
}

/* Tic-Tac-Toe Container */
.tic-tac-toe-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.tic-tac-toe-board {
  display: grid;
  grid-template-columns: repeat(3, var(--cell-size));
  grid-template-rows: repeat(3, var(--cell-size));
  gap: 4px;
  background: var(--neutral-800);
  padding: 4px;
  border-radius: 8px;
}

.tic-tac-toe-cell {
  background: white;
  border: none;
  border-radius: 4px;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
}

.tic-tac-toe-cell:hover:not(.filled) {
  background: var(--neutral-100);
  transform: scale(1.05);
}

.tic-tac-toe-cell.filled {
  cursor: not-allowed;
}

.tic-tac-toe-cell.x {
  color: var(--primary-blue);
}

.tic-tac-toe-cell.o {
  color: var(--error-red);
}

.tic-tac-toe-cell.winning {
  background: var(--success-green);
  color: white;
  animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Touch-specific styles */
@media (pointer: coarse) {
  .tic-tac-toe-cell {
    min-width: 60px;
    min-height: 60px;
  }
  
  .tic-tac-toe-cell:active:not(.filled) {
    transform: scale(1.1);
    background: var(--neutral-200);
  }
}

/* Game Actions */
.game-actions {
  text-align: center;
  margin-bottom: 20px;
}

.game-actions button {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.game-actions button:hover {
  background: white;
  transform: translateY(-2px);
}

/* Game Instructions */
.game-instructions {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 24px;
}

.game-instructions h3 {
  color: var(--neutral-800);
  margin-bottom: 16px;
  text-align: center;
}

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.instruction-item {
  background: var(--neutral-50);
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

.instruction-item h4 {
  color: var(--primary-blue);
  margin-bottom: 8px;
  font-size: 1rem;
}

.instruction-item p {
  color: var(--neutral-900);
  font-size: 0.875rem;
}

.game-rules {
  background: var(--neutral-50);
  padding: 16px;
  border-radius: 8px;
}

.game-rules h4 {
  color: var(--neutral-800);
  margin-bottom: 12px;
}

.game-rules ul {
  list-style-type: disc;
  padding-left: 20px;
}

.game-rules li {
  color: var(--neutral-900);
  margin-bottom: 8px;
  font-size: 0.875rem;
}

/* Fixed Privacy Controls */
.fixed-privacy-controls {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.privacy-choices-btn {
  background: var(--neutral-800);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-info {
    flex-direction: column;
    gap: 8px;
  }
  
  :root {
    --cell-size: 80px;
  }
  
  .tic-tac-toe-cell {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --cell-size: 70px;
  }
  
  .tic-tac-toe-cell {
    font-size: 1.25rem;
  }
  
  .tic-tac-toe-container {
    padding: 16px;
  }
}

/* Accessibility */
.tic-tac-toe-cell:focus {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .tic-tac-toe-cell,
  .game-actions button {
    transition: none;
  }
  
  .tic-tac-toe-cell.winning {
    animation: none;
  }
}