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

body {
  background: transparent;
  font-family: 'Arial', sans-serif;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.scoreboard {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.75);
  padding: 15px 24px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  max-width: 550px;
}

.scoreboard-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.score-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  display: none;
}

.score-label.visible {
  display: block;
}

.player-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.player-name {
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.player-score {
  color: #4CAF50;
  font-size: 38px;
  font-weight: bold;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
  transition: all 0.3s ease;
}

.player-score.updated {
  transform: scale(1.1);
  color: #66BB6A;
}

.race-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 90px;
  padding: 0 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.race-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.race-number {
  color: #ffffff;
  font-size: 26px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.connection-status {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 152, 0, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.connection-status.hidden {
  display: none;
}

/* Animation for score updates */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.player-score.pulse {
  animation: pulse 0.3s ease;
}

/* ===== STYLE THEMES ===== */

/* Blue/Ice Theme */
body.style-blue .scoreboard {
  background: rgba(13, 71, 161, 0.75);
  border: 1px solid rgba(100, 181, 246, 0.3);
}

body.style-blue .player-score {
  color: #42A5F5;
}

body.style-blue .player-score.updated {
  color: #64B5F6;
}

body.style-blue .race-info {
  border-left: 1px solid rgba(100, 181, 246, 0.3);
  border-right: 1px solid rgba(100, 181, 246, 0.3);
}

/* Purple/Neon Theme */
body.style-purple .scoreboard {
  background: rgba(74, 20, 140, 0.75);
  border: 1px solid rgba(186, 104, 200, 0.3);
}

body.style-purple .player-score {
  color: #AB47BC;
}

body.style-purple .player-score.updated {
  color: #CE93D8;
}

body.style-purple .race-info {
  border-left: 1px solid rgba(186, 104, 200, 0.3);
  border-right: 1px solid rgba(186, 104, 200, 0.3);
}

/* ===== POSITION VARIANTS ===== */

/* Top-left position */
.scoreboard.position-top-left {
  top: 25px;
  bottom: auto;
  left: 25px;
  transform: none;
}

/* Top-center position */
.scoreboard.position-top-center {
  top: 25px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
}

/* Top-right position */
.scoreboard.position-top-right {
  top: 25px;
  bottom: auto;
  right: 25px;
  left: auto;
  transform: none;
}

/* Bottom-left position */
.scoreboard.position-bottom-left {
  bottom: 25px;
  left: 25px;
  transform: none;
}

/* Bottom-center position (default) */
.scoreboard.position-bottom-center {
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
}

/* Bottom-right position */
.scoreboard.position-bottom-right {
  bottom: 25px;
  right: 25px;
  left: auto;
  transform: none;
}
