/* F1 Quiz Race - Shared Styles (F1 Theme) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --racing-red: #E10600;
  --racing-red-dark: #b30500;
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-input: #0f3460;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --success: #00c853;
  --error: #ff5252;
  --warning: #ffab00;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 600px;
  padding: 2rem;
  text-align: center;
}

/* Screen visibility */
.screen {
  display: block;
}

.screen.hidden {
  display: none;
}

/* Typography */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--racing-red);
  text-transform: uppercase;
  letter-spacing: 2px;
}

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Buttons */
.btn {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--racing-red);
  color: var(--text-primary);
}

.btn-primary:hover {
  background-color: var(--racing-red-dark);
}

/* Registration Form */
.registration-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.registration-form input[type="text"] {
  width: 100%;
  max-width: 320px;
  padding: 0.8rem 1.2rem;
  border: 2px solid var(--bg-input);
  border-radius: 4px;
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}

.registration-form input[type="text"]:focus {
  border-color: var(--racing-red);
}

.registration-form input[type="text"]::placeholder {
  color: var(--text-secondary);
}

/* Error Message */
.error-message {
  color: var(--error);
  font-size: 0.9rem;
  min-height: 1.2rem;
}

/* Waiting Screen */
.waiting-content {
  margin-top: 1.5rem;
}

.car-assignment {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.car-assignment span {
  font-size: 2rem;
}

.waiting-message {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.competitors-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.competitor-badge {
  background-color: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  border: 1px solid var(--bg-input);
}

/* Race In Progress (Blocked) Screen */
.blocked-content {
  margin-top: 2rem;
}

.blocked-message {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 0.75rem;
}

.blocked-sub {
  font-size: 1rem;
  color: var(--text-secondary);
}


/* Checkered flag header accent */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-conic-gradient(#fff 0% 25%, #1a1a2e 0% 50%) 0 0 / 12px 6px;
  z-index: 1000;
}

/* Responsive Design — Tablet */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
    max-width: 100%;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .question-text {
    font-size: 1.2rem;
    padding: 0.75rem;
  }
}

/* Responsive Design — Mobile */
@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding-top: 1rem;
  }

  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.6rem;
    letter-spacing: 1px;
  }

  h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .btn {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    min-height: 48px;
  }

  .registration-form input[type="text"] {
    max-width: 100%;
    font-size: 1rem;
    padding: 0.9rem 1rem;
    min-height: 48px;
  }

  .btn-answer {
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    min-height: 48px;
  }

  .question-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }

  .timer-text {
    font-size: 1.2rem;
  }

  .track-lane-name {
    width: 40px;
    font-size: 0.7rem;
  }

  .track-lane-road {
    height: 30px;
  }

  .track-car {
    font-size: 1.2rem;
  }

  .leaderboard-entry {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
  }

  .leaderboard-name {
    font-size: 0.9rem;
  }

  .feedback-indicator {
    font-size: 3rem;
  }

  .feedback-score {
    font-size: 1.2rem;
  }
}


/* Waiting for others message on feedback screen */
.waiting-for-others {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.waiting-for-others.hidden {
  display: none;
}


/* Lights Out Splash Screen */
.lights-out-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.lights-out-text {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: lightsOutZoom 0.6s ease-out;
}

@keyframes lightsOutZoom {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
