/* Race Track Styles */

/* Track wrapper — contains start/finish lines and lanes */
.track-wrapper {
  position: relative;
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem 1rem;
  overflow: hidden;
  border-top: 6px solid transparent;
  border-image: repeating-conic-gradient(#fff 0% 25%, #1a1a2e 0% 50%) 6 / 6px / 0 stretch;
}

/* Start line — left edge marker */
.track-start-line {
  position: absolute;
  top: 0;
  left: 60px;
  width: 3px;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    var(--text-primary) 0px,
    var(--text-primary) 6px,
    transparent 6px,
    transparent 12px
  );
  opacity: 0.5;
}

/* Finish line — right edge marker (checkered pattern) */
.track-finish-line {
  position: absolute;
  top: 0;
  right: 10px;
  width: 8px;
  height: 100%;
  background: repeating-conic-gradient(
    var(--text-primary) 0% 25%,
    var(--bg-dark) 0% 50%
  ) 0 0 / 8px 8px;
  opacity: 0.7;
}

/* Lanes container */
.track-lanes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Individual lane */
.track-lane {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Competitor name label */
.track-lane-name {
  flex-shrink: 0;
  width: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lane road — the track surface */
.track-lane-road {
  flex: 1;
  position: relative;
  height: 36px;
  background: linear-gradient(
    180deg,
    #2a2a3a 0%,
    #1e1e2e 40%,
    #252535 60%,
    #1a1a2a 100%
  );
  border-radius: 4px;
  border: 1px solid var(--bg-input);
  overflow: hidden;
}

/* Lane markings — dashed center line */
.track-lane-road::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--text-secondary) 0px,
    var(--text-secondary) 8px,
    transparent 8px,
    transparent 16px
  );
  opacity: 0.3;
  transform: translateY(-50%);
}

/* Car icon on the track */
.track-car {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scaleX(-1);
  font-size: 1.5rem;
  transition: left 1s ease-in-out;
  z-index: 1;
}

/* Answer Feedback Screen Styles */
.feedback-indicator {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.feedback-indicator.correct {
  color: var(--success);
  animation: correctFlash 0.6s ease-out;
}

.feedback-indicator.incorrect {
  color: var(--error);
  animation: incorrectFlash 0.6s ease-out;
}

@keyframes correctFlash {
  0% { transform: scale(0.5); opacity: 0; text-shadow: 0 0 30px var(--success); }
  50% { transform: scale(1.2); text-shadow: 0 0 40px var(--success); }
  100% { transform: scale(1); opacity: 1; text-shadow: none; }
}

@keyframes incorrectFlash {
  0% { transform: scale(0.5); opacity: 0; text-shadow: 0 0 30px var(--error); }
  50% { transform: scale(1.2); text-shadow: 0 0 40px var(--error); }
  100% { transform: scale(1); opacity: 1; text-shadow: none; }
}

.feedback-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.feedback-correct-answer {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Results Summary Screen Styles */
.results-content {
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.results-total-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--racing-red);
  margin-bottom: 0.5rem;
}

.results-correct-count {
  font-size: 1.3rem;
  color: var(--text-secondary);
}


/* Leaderboard List Styles */
.leaderboard-list {
  margin-top: 1.5rem;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  border-left: 4px solid transparent;
}

.leaderboard-entry.leaderboard-gold {
  border-left-color: #FFD700;
  background-color: rgba(255, 215, 0, 0.08);
}

.leaderboard-entry.leaderboard-silver {
  border-left-color: #C0C0C0;
  background-color: rgba(192, 192, 192, 0.06);
}

.leaderboard-entry.leaderboard-bronze {
  border-left-color: #CD7F32;
  background-color: rgba(205, 127, 50, 0.06);
}

.leaderboard-position {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 2rem;
  text-align: center;
}

.leaderboard-gold .leaderboard-position {
  color: #FFD700;
}

.leaderboard-silver .leaderboard-position {
  color: #C0C0C0;
}

.leaderboard-bronze .leaderboard-position {
  color: #CD7F32;
}

.leaderboard-car {
  font-size: 1.5rem;
  display: inline-block;
  transform: scaleX(-1);
}

.leaderboard-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.leaderboard-score {
  font-size: 1rem;
  font-weight: 700;
  color: var(--racing-red, #E10600);
}


/* Track screen countdown */
.track-countdown {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--text-secondary);
}

.track-countdown span {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
