/* ==========================================================================
   TypeApex Pro — Nitro Ghost Race Stylesheet
   ========================================================================== */

.racing-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.racetrack-arena {
  background: radial-gradient(circle at 50% 50%, #0f172a 0%, #090d16 100%);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(99, 102, 241, 0.05);
  position: relative;
  overflow: hidden;
}

.finish-line {
  position: absolute;
  top: 0;
  right: 60px;
  bottom: 0;
  width: 24px;
  background-image: 
    linear-gradient(45deg, #ffffff 25%, transparent 25%), 
    linear-gradient(-45deg, #ffffff 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #ffffff 75%), 
    linear-gradient(-45deg, transparent 75%, #ffffff 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  opacity: 0.7;
  border-left: 2px solid #ef4444;
  z-index: 2;
}

.finish-line::after {
  content: 'FINISH';
  position: absolute;
  bottom: 6px;
  right: -8px;
  font-size: 0.6rem;
  font-weight: 900;
  color: #ef4444;
  letter-spacing: 0.1em;
  transform: rotate(-90deg);
}

.race-lanes-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 3;
}

.race-lane {
  position: relative;
  height: 52px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
}

.race-lane.player-lane {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: inset 0 0 15px rgba(99, 102, 241, 0.1);
}

.lane-tag {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  z-index: 1;
  pointer-events: none;
}

.race-lane.player-lane .lane-tag {
  color: var(--accent-cyan);
}

.lane-guide-line {
  position: absolute;
  left: 120px;
  right: 80px;
  height: 1px;
  border-top: 2px dashed rgba(255, 255, 255, 0.1);
}

.racer-object {
  position: absolute;
  left: 110px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: left 0.15s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 5;
}

.racer-avatar {
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  position: relative;
}

.racer-label-floating {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.nitro-flame {
  display: none;
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 14px;
  background: radial-gradient(ellipse at center, #38bdf8 0%, #3b82f6 50%, transparent 80%);
  border-radius: 50%;
  filter: blur(1px);
  animation: flameFlicker 0.1s infinite alternate;
}

.racer-object.nitro-active .nitro-flame {
  display: block;
}

.racer-object.nitro-active .racer-avatar {
  filter: drop-shadow(0 0 12px #38bdf8);
}

@keyframes flameFlicker {
  0% { transform: translateY(-50%) scale(0.9); opacity: 0.8; }
  100% { transform: translateY(-50%) scale(1.25); opacity: 1; }
}

.race-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
}

.nitro-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nitro-gauge-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #38bdf8;
}

.nitro-meter {
  width: 140px;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.nitro-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #38bdf8, #ec4899);
  transition: width 0.1s ease;
}

.race-podium-card {
  text-align: center;
}

.podium-headline {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.podium-places {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.podium-stand {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 110px;
}

.podium-driver {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.podium-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.podium-block {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
}

.podium-stand.first .podium-block {
  height: 110px;
  background: linear-gradient(180deg, #f59e0b, #b45309);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.podium-stand.second .podium-block {
  height: 80px;
  background: linear-gradient(180deg, #94a3b8, #475569);
}

.podium-stand.third .podium-block {
  height: 60px;
  background: linear-gradient(180deg, #b45309, #78350f);
}
