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

body {
  font-family: 'Arial', sans-serif;
  background: #1a1a1a;
  color: #ffffff;
  overflow: hidden;
}

.screen {
  display: none;
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: block;
}

/* Join Screen */
.join-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 20px;
  padding: 20px;
}

.join-container h1 {
  font-size: 3em;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.2em;
  color: #aaa;
  margin-bottom: 30px;
}

.join-container input,
.join-container select {
  width: 100%;
  max-width: 400px;
  padding: 15px;
  font-size: 1.1em;
  border: 2px solid #444;
  border-radius: 8px;
  background: #2a2a2a;
  color: #fff;
}

.join-container button {
  width: 100%;
  max-width: 400px;
  padding: 15px;
  font-size: 1.2em;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.join-container button:hover {
  background: #2980b9;
}

/* Display Screen */
.display-container {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.scoreboard-display {
  width: 100%;
  max-width: 1200px;
  text-align: center;
}

.game-title {
  font-size: 2.5em;
  margin-bottom: 30px;
  color: #3498db;
}

/* Basic Scoreboard Display */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.team-card {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s, box-shadow 0.3s;
}

.team-card.leader {
  border: 3px solid #f39c12;
  box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
  transform: scale(1.05);
}

.team-name {
  font-size: 1.8em;
  font-weight: bold;
  margin-bottom: 15px;
  color: #ecf0f1;
}

.team-score {
  font-size: 4em;
  font-weight: bold;
  color: #3498db;
  margin: 20px 0;
}

.team-color-indicator {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  margin-top: 10px;
}

/* Baseball Display */
.baseball-board {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.team-section {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.team-name {
  font-size: 2em;
  margin-bottom: 15px;
}

.stats-row {
  display: flex;
  justify-content: space-around;
  font-size: 1.5em;
  margin-top: 15px;
}

.inning-display {
  background: #34495e;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
}

#inning-info {
  font-size: 2em;
  margin-bottom: 20px;
  color: #3498db;
}

.count-display {
  display: flex;
  justify-content: space-around;
  font-size: 1.5em;
  margin: 20px 0;
}

.bases-display {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  position: relative;
  height: 200px;
}

.base {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #555;
  border: 3px solid #777;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  font-weight: bold;
  transition: all 0.3s;
}

.base.occupied {
  background: #f39c12;
  border-color: #e67e22;
  box-shadow: 0 0 20px rgba(243, 156, 18, 0.8);
}

/* Football Display */
.football-board {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 15px;
  padding: 30px 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.score-large {
  font-size: 5em;
  font-weight: bold;
  color: #3498db;
}

.game-info {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #34495e;
  border-radius: 15px;
  padding: 25px;
  font-size: 1.5em;
}

.clock {
  font-size: 3em;
  font-weight: bold;
  color: #e74c3c;
  font-family: 'Courier New', monospace;
}

/* Timer Display */
.timer-display {
  margin-top: 30px;
  font-size: 3em;
  font-weight: bold;
  color: #3498db;
  font-family: 'Courier New', monospace;
}

/* Control Screen */
.control-container {
  width: 100%;
  height: 100%;
  padding: 20px;
  overflow-y: auto;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #444;
}

.control-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.control-actions button {
  padding: 10px 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.3s;
}

.control-actions button:hover {
  background: #2980b9;
}

.scoreboard-controls {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.control-section {
  background: #2a2a2a;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #444;
}

.control-section h3 {
  margin-bottom: 15px;
  color: #3498db;
  font-size: 1.5em;
}

.control-section button {
  padding: 12px 24px;
  margin: 5px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.3s;
}

.control-section button:hover {
  background: #229954;
}

.teams-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.team-control-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #333;
  border-radius: 8px;
}

.team-control-item input {
  flex: 1;
  padding: 8px;
  background: #444;
  border: 1px solid #555;
  border-radius: 5px;
  color: white;
  font-size: 1em;
}

.team-control-item input[type="color"] {
  width: 50px;
  height: 40px;
  border: none;
  cursor: pointer;
}

.team-control-item .score-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-control-item button {
  padding: 8px 15px;
  background: #e74c3c;
  margin: 0;
}

.count-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 15px 0;
  font-size: 1.2em;
}

.count-controls button {
  padding: 10px 20px;
  background: #e74c3c;
}

.bases-controls {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  justify-content: center;
}

.bases-controls button {
  padding: 10px 20px;
  background: #9b59b6;
}

.clock-controls {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  justify-content: center;
}

.down-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0;
}

.down-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.down-controls input {
  padding: 8px;
  background: #444;
  border: 1px solid #555;
  border-radius: 5px;
  color: white;
  font-size: 1em;
  width: 80px;
}

.settings {
  margin-top: 20px;
}

.settings label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings input {
  padding: 8px;
  background: #444;
  border: 1px solid #555;
  border-radius: 5px;
  color: white;
  font-size: 1em;
  width: 100px;
}

/* Alert Container */
#alert-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert {
  padding: 15px 20px;
  background: #e74c3c;
  color: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
}

.alert.success {
  background: #27ae60;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Light Theme */
body.light-theme {
  background: #f5f5f5;
  color: #333;
}

body.light-theme .team-card,
body.light-theme .team-section,
body.light-theme .team-row {
  background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
  color: #333;
}

body.light-theme .control-section {
  background: #ffffff;
  border: 1px solid #ddd;
}

body.light-theme .team-control-item {
  background: #f8f8f8;
}

body.light-theme input,
body.light-theme select {
  background: #ffffff;
  color: #333;
  border-color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-title {
    font-size: 1.8em;
  }
  
  .team-score,
  .score-large {
    font-size: 3em;
  }
  
  .teams-grid {
    grid-template-columns: 1fr;
  }
  
  .control-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .control-actions {
    width: 100%;
  }
  
  .control-actions button {
    flex: 1;
    min-width: 100px;
  }
}

