:root {
  --primary-color: #2563eb;
  --secondary-color: #dc2626;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

#app {
  width: 100%;
  max-width: 600px;
  padding: 20px;
}

.game-container {
  background: var(--surface);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--background);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.current-player {
  font-size: 1.1rem;
  font-weight: 600;
}

.current-player span {
  color: var(--primary-color);
  font-size: 1.3rem;
}

.score {
  display: flex;
  gap: 20px;
  font-weight: 600;
}

.score span {
  color: var(--text-secondary);
}

#game-canvas {
  border: 3px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  background: var(--surface);
}

#game-canvas:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.game-controls {
  margin-top: 20px;
  display: flex;
  gap: 15px;
  justify-content: center;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

#reset-game {
  background: var(--primary-color);
  color: white;
}

#reset-game:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

#reset-scores {
  background: var(--text-secondary);
  color: white;
}

#reset-scores:hover {
  background: #475569;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.game-status {
  margin-top: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.winner {
  color: var(--primary-color);
  animation: pulse 2s infinite;
}

.draw {
  color: var(--text-secondary);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@media (max-width: 600px) {
  .game-container {
    padding: 20px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .game-info {
    flex-direction: column;
    gap: 10px;
  }
  
  .score {
    gap: 15px;
  }
  
  #game-canvas {
    width: 100%;
    height: auto;
  }
  
  .game-controls {
    flex-direction: column;
    align-items: center;
  }
  
  button {
    width: 200px;
  }
}