/**
 * BALAP MOTOR KUIS - Gaya Layar Balapan (Mode Proyektor / TV)
 * Tampilan Horizontal Resolusi Tinggi, Animasi Halus, Kontras Tinggi
 */

.layar-body {
  background: #090c14;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.layar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: rgba(15, 21, 33, 0.95);
  border-bottom: 2px solid rgba(0, 240, 255, 0.2);
  z-index: 10;
}

.layar-title-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.layar-title-box h1 {
  font-family: var(--font-racing);
  font-size: 2rem;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
}

.layar-race-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Lintasan Balap Utama */
.track-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 16px 24px;
  background: radial-gradient(circle at 50% 50%, #171f2e 0%, #0c1018 100%);
  position: relative;
  overflow: hidden;
}

/* Garis START & FINISH */
.start-line {
  position: absolute;
  left: 120px;
  top: 10px;
  bottom: 10px;
  width: 14px;
  background: repeating-linear-gradient(
    0deg,
    #ffffff,
    #ffffff 12px,
    #111111 12px,
    #111111 24px
  );
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
  z-index: 2;
  border-radius: 4px;
}

.start-line-label {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-racing);
  font-size: 0.9rem;
  color: #fff;
  letter-spacing: 2px;
}

.finish-line {
  position: absolute;
  right: 60px;
  top: 10px;
  bottom: 10px;
  width: 24px;
  background: repeating-linear-gradient(
    0deg,
    #ffffff,
    #ffffff 16px,
    #000000 16px,
    #000000 32px
  );
  box-shadow: 0 0 25px rgba(255, 230, 0, 0.6);
  z-index: 2;
  border-radius: 4px;
}

.finish-line-label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-racing);
  font-size: 1.1rem;
  color: var(--neon-yellow);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 230, 0, 0.8);
}

/* Jalur Balap (Lanes) */
.race-lane {
  position: relative;
  height: calc((100vh - 160px) / 5.4);
  min-height: 85px;
  background: linear-gradient(180deg, #1b2434 0%, #111722 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  overflow: visible;
}

/* Garis marka jalan putus-putus */
.lane-divider {
  position: absolute;
  top: 50%;
  left: 140px;
  right: 90px;
  height: 2px;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 50%, transparent 50%);
  background-size: 30px 2px;
  transform: translateY(-50%);
  pointer-events: none;
}

.lane-number {
  width: 80px;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  border-right: 2px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-racing);
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.25);
  user-select: none;
  z-index: 3;
}

/* Motor Pembalap */
.racer-bike-container {
  position: absolute;
  left: 135px; /* Posisi awal START */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 5;
  will-change: left;
}

/* Floating Info di Atas Motor */
.racer-info-tag {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 22, 0.85);
  border: 1px solid var(--racer-color, var(--neon-cyan));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
}

.racer-tag-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
}

.racer-tag-step {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--racer-color, var(--neon-cyan));
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 8px;
}

/* SVG Motor */
.racer-svg {
  width: 90px;
  height: 55px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

/* Efek Nitro & Asap */
.exhaust-smoke {
  position: absolute;
  left: -20px;
  top: 60%;
  width: 25px;
  height: 15px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.nitro-boost .exhaust-smoke {
  animation: smoke-puff 0.5s ease-out;
}

.nitro-flame {
  position: absolute;
  left: -22px;
  top: 55%;
  width: 24px;
  height: 12px;
  background: linear-gradient(270deg, #ff3300 0%, #ffbb00 60%, transparent 100%);
  border-radius: 50% 0 0 50%;
  filter: blur(1px);
  opacity: 0;
  pointer-events: none;
}

.nitro-boost .nitro-flame {
  opacity: 1;
  animation: flame-flicker 0.4s ease-out;
}

@keyframes smoke-puff {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2.5) translateX(-20px); opacity: 0; }
}

@keyframes flame-flicker {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4, 0.8); opacity: 0.9; }
  100% { transform: scale(0.4); opacity: 0; }
}

/* ==========================================
 * OVERLAY PODIUM & HASIL BALAPAN
 * ========================================== */
.podium-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 12, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  padding: 24px;
}

.podium-modal.active {
  opacity: 1;
  visibility: visible;
}

.podium-box {
  background: var(--bg-card);
  border: 2px solid var(--neon-yellow);
  box-shadow: 0 15px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 230, 0, 0.25);
  border-radius: 24px;
  width: 100%;
  max-width: 800px;
  padding: 40px;
  text-align: center;
  transform: scale(0.9);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.podium-modal.active .podium-box {
  transform: scale(1);
}

.podium-title {
  font-family: var(--font-racing);
  font-size: 3rem;
  color: var(--neon-yellow);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.podium-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.podium-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  text-align: left;
}

.podium-table th {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.podium-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 1.1rem;
}

.podium-rank {
  font-weight: 900;
  font-size: 1.4rem;
}

.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

/* Responsive Proyektor */
@media (max-width: 1024px) {
  .start-line { left: 90px; }
  .finish-line { right: 40px; }
  .lane-number { width: 60px; font-size: 1.5rem; }
  .racer-bike-container { left: 100px; }
  .racer-svg { width: 75px; height: 46px; }
}
