* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f5f5f5;
  padding: 20px;
}

.form-container {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 100%;
  transition: all 0.8s ease;
}

.form-container.expanding {
  opacity: 0;
  pointer-events: none;
}

.form-container h1 {
  margin: 0 0 30px 0;
  font-size: 24px;
  color: #333;
  font-weight: normal;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #666;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.form-group select:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

#birthDateInput {
  cursor: pointer;
}

#birthDateInput:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.submit-btn:hover:not(:disabled) {
  background: #5568d3;
}

.submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.game-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
}

.game-container.hidden {
  display: none;
}

.game-container.appearing {
  animation: expandFromInput 0.8s ease forwards;
}

@keyframes expandFromInput {
  from {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.game-on-title {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 120px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.6),
    0 0 60px rgba(255, 215, 0, 0.4), 4px 4px 0 #ff6b00, 8px 8px 0 #ff0000;
  z-index: 2000;
  letter-spacing: 10px;
  pointer-events: none;
}

.game-on-title.showing {
  animation: gameOnAnimation 2s ease-out forwards;
}

@keyframes gameOnAnimation {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3) rotate(10deg);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) scale(0.9) rotate(-5deg);
  }
  85% {
    transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(5) rotate(0deg);
    opacity: 0;
  }
}

.scoreboards {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: -4px;
  width: 800px;
}

.scoreboard {
  background: white;
  padding: 10px 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  font-size: 16px;
  color: #333;
  border: 4px solid white;
  border-bottom: none;
  position: relative;
  z-index: 1;
}

.player-score {
  text-align: left;
  border-radius: 8px 8px 0 0;
}

.ai-score {
  text-align: right;
  border-radius: 8px 8px 0 0;
  margin-left: auto;
}

.score-name {
  font-weight: bold;
}

.player-score .score-name {
  color: #60a5fa;
}

.ai-score .score-name {
  color: #f42c04;
}

.score-value {
  white-space: pre;
  font-family: monospace;
  letter-spacing: 1px;
}

.pitch {
  width: 800px;
  height: 500px;
  background: #98ce00;
  border: 4px solid white;
  border-radius: 0 0 8px 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  touch-action: none;
}

.pitch::before {
  content: "";
  position: absolute;
  left: 400px;
  top: 0;
  width: 2px;
  height: 100%;
  background: white;
  transform: translateX(-1px);
  z-index: 0;
}

.pitch::after {
  content: "";
  position: absolute;
  left: 400px;
  top: 250px;
  width: 120px;
  height: 120px;
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-60px, -60px);
  z-index: 0;
}

.player {
  position: absolute;
  width: 50px;
  height: 24px;
  z-index: 10;
  transition: transform 0.1s;
  transform-origin: center center;
}

.player::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 20px;
  background: #60a5fa;
  border-radius: 10px;
  border: 2px solid #2563eb;
}

.ai-player::before {
  background: #f42c04;
  border-color: #dc2626;
}

.ai-player::after {
  background: #f5deb3;
}

.teammate-player::before {
  background: #60a5fa;
  border-color: #2563eb;
}

.teammate-player::after {
  background: #f5deb3;
}

.player::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  background: #f5deb3;
  border-radius: 50%;
  border: 1px solid #d4a574;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ball {
  position: absolute;
  width: 30px;
  height: 30px;
  background: white;
  border-radius: 50%;
  border: 1px solid #333;
  z-index: 5;
  background-image: url("assets/ball.jpg");
  background-size: 60px 60px;
  background-color: white;
  overflow: hidden;
}

.ball-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 40%,
    rgba(255, 255, 255, 0.4) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
}

.number {
  position: absolute;
  width: 50px;
  height: 50px;
  background: #fbbf24;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  color: #1f2937;
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.number.player-only {
  background: #60a5fa;
  color: white;
}

.number.ai-only {
  background: #f42c04;
  color: white;
}

.number.both-valid {
  background: linear-gradient(90deg, #60a5fa 50%, #f42c04 50%);
  color: white;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  background: white;
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
}

#overlayTitle {
  font-size: 48px;
  font-weight: bold;
  margin: 0 0 15px 0;
  color: #1f2937;
}

#overlayMessage {
  font-size: 20px;
  margin-bottom: 20px;
  color: #666;
}

#overlayButtons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.overlay-btn {
  padding: 12px 30px;
  font-size: 18px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.overlay-btn:hover {
  background: #5568d3;
}

#selectDateButton {
  background: #10b981;
}

#selectDateButton.hidden {
  display: none;
}

#selectDateButton:hover {
  background: #059669;
}

.difficulty-btn {
  display: block;
  width: 100%;
  padding: 15px 30px;
  font-size: 18px;
  margin-bottom: 10px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
}

.difficulty-btn:hover {
  background: #5568d3;
  transform: scale(1.05);
}

.difficulty-btn:last-child {
  margin-bottom: 0;
}
