/**
 * ============================================================================
 * GAME-BALAP.CSS - Gaya Visual Game 5: Balap Lari Kuis (Athletic Sprint Race)
 * ============================================================================
 * Desain:
 * - Arena Stadion Atletik Lintasan Tartan Merah Bata (Olympic Running Track)
 * - 4 Lajur Lari Dinamis (Lajur 1: Siswa, Lajur 2, 3, 4: Lawan / Rival)
 * - Karakter Pelari Atletik dengan Animasi Kaki & Tangan Mengayun Kencang
 * - Efek Turbo Sprint dengan Jejak Angin & Api
 * - Efek Tersandung saat Jawaban Salah
 * - Pita Finish & Selebrasi Juara
 * ============================================================================
 */

/* ================= CONTAINER VIEW ARENA ================= */
#view-game-balap {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 15%, #1e293b 0%, #0f172a 70%, #020617 100%);
  color: #ffffff;
  display: none;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

#view-game-balap.active {
  display: flex !important;
}

/* Dekorasi Latar Belakang Stadion */
.balap-stadium-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.balap-stadium-light {
  position: absolute;
  top: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.05) 50%, transparent 80%);
  filter: blur(40px);
}

.balap-stadium-light.l1 { left: 5%; }
.balap-stadium-light.l2 { right: 5%; }

/* Viewport Konten Utama */
.balap-viewport {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 12px 18px 24px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ================= TOP BAR HUD ================= */
.balap-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  margin-bottom: 14px;
}

.balap-topbar-left,
.balap-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-balap-exit {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-balap-exit:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-1px);
}

.balap-stat-pill {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
}

.balap-stat-pill.pill-rank {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.balap-stat-pill.pill-distance {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.35) 100%);
  border-color: #3b82f6;
  color: #93c5fd;
}

.balap-topbar-center {
  font-size: 1.05rem;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.balap-timer-pill {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.balap-timer-pill.urgent {
  animation: balapPulseTimer 0.6s infinite alternate;
  background: #dc2626;
  color: #ffffff;
  border-color: #ef4444;
}

@keyframes balapPulseTimer {
  0% { transform: scale(1); box-shadow: 0 0 4px rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1.08); box-shadow: 0 0 16px rgba(239, 68, 68, 0.85); }
}

.balap-combo-badge {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
  display: none;
  animation: balapComboBounce 0.4s ease;
}

@keyframes balapComboBounce {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.balap-score-box {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  min-width: 80px;
}

.balap-score-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: 0.9;
}

.balap-score-val {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.1;
}

/* ================= QUESTION CARD / BANNER ================= */
.balap-question-card {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 16px 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.balap-qcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.balap-qnumber-badge {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 14px;
}

.balap-qpoints-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.balap-qclose-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.balap-qclose-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Progress bar waktu di atas kartu soal */
.balap-qprogress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.balap-qprogress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  transition: width 0.1s linear;
}

.balap-qprompt-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 0 8px;
}

.balap-qprompt-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.45;
  margin: 0 0 10px;
  max-width: 900px;
}

.balap-qimage-box {
  display: none;
  max-width: 280px;
  max-height: 160px;
  margin: 6px auto 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.balap-qimage-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================= LINTASAN BALAP LARI ATLETIK ================= */
.balap-track-stage {
  position: relative;
  background: #0f172a;
  border-radius: 20px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 16px 14px;
  margin-bottom: 18px;
  overflow: hidden;
}

/* Garis Rumput Lapangan */
.balap-infield-grass {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, #15803d, #16a34a, #22c55e, #16a34a, #15803d);
}

.balap-track-surface {
  position: relative;
  background: linear-gradient(180deg, #991b1b 0%, #b91c1c 25%, #991b1b 50%, #b91c1c 75%, #7f1d1d 100%);
  border-radius: 14px;
  border: 2px solid #ef4444;
  box-shadow: inset 0 6px 16px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px;
  overflow: hidden;
}

/* Lajur Lari Individu (Lane 1, 2, 3, 4) */
.balap-lane {
  position: relative;
  height: 64px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  padding: 0 50px 0 70px;
}

.balap-lane:last-child {
  border-bottom: none;
}

.balap-lane.player-lane {
  background: rgba(59, 130, 246, 0.18);
  border: 1.5px solid rgba(96, 165, 250, 0.5);
  box-shadow: inset 0 0 14px rgba(59, 130, 246, 0.25);
}

/* Label Nomor Lajur di Start */
.balap-lane-number {
  position: absolute;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #f8fafc;
  font-weight: 900;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  z-index: 5;
}

.balap-lane.player-lane .balap-lane-number {
  background: #2563eb;
  border-color: #93c5fd;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

/* Garis Start & Finish */
.balap-start-line {
  position: absolute;
  left: 60px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  z-index: 4;
}

.balap-finish-line {
  position: absolute;
  right: 50px;
  top: 0;
  bottom: 0;
  width: 14px;
  background: repeating-linear-gradient(
    45deg,
    #ffffff,
    #ffffff 7px,
    #0f172a 7px,
    #0f172a 14px
  );
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
  z-index: 4;
}

/* Pita Merah Garis Finish */
.balap-finish-ribbon {
  position: absolute;
  right: 54px;
  top: 4px;
  bottom: 4px;
  width: 6px;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  z-index: 8;
  transition: all 0.3s ease;
}

.balap-finish-ribbon.is-broken {
  opacity: 0;
  transform: scaleY(0);
}

/* Penanda Meter Jarak (0m, 25m, 50m, 75m, 100m) */
.balap-distance-marks {
  display: flex;
  justify-content: space-between;
  padding: 6px 55px 0 65px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.5px;
}

.balap-distance-marks span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ================= KARAKTER PELARI SPRINT ================= */
.balap-runner {
  position: absolute;
  bottom: 6px;
  left: 65px; /* Dinamis berubah 65px -> ~90% */
  width: 52px;
  height: 52px;
  z-index: 10;
  transition: left 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.balap-runner-label {
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.85);
  padding: 2px 6px;
  border-radius: 6px;
  margin-bottom: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

.balap-runner.player-runner .balap-runner-label {
  background: #1d4ed8;
  border-color: #60a5fa;
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.5);
}

/* Tubuh SVG Pelari */
.balap-runner-body {
  width: 44px;
  height: 44px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.balap-runner-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

/* Animasi Mengayun Kaki & Tangan saat Lari */
.balap-runner.is-running .runner-leg-left {
  animation: runLegSwingLeft 0.35s infinite alternate ease-in-out;
  transform-origin: 22px 28px;
}

.balap-runner.is-running .runner-leg-right {
  animation: runLegSwingRight 0.35s infinite alternate ease-in-out;
  transform-origin: 26px 28px;
}

.balap-runner.is-running .runner-arm-left {
  animation: runArmSwingLeft 0.35s infinite alternate ease-in-out;
  transform-origin: 18px 18px;
}

.balap-runner.is-running .runner-arm-right {
  animation: runArmSwingRight 0.35s infinite alternate ease-in-out;
  transform-origin: 30px 18px;
}

.balap-runner.is-running .runner-headband-tail {
  animation: headbandFlutter 0.25s infinite alternate ease-in-out;
  transform-origin: 14px 10px;
}

@keyframes runLegSwingLeft {
  0% { transform: rotate(-28deg); }
  100% { transform: rotate(32deg); }
}

@keyframes runLegSwingRight {
  0% { transform: rotate(30deg); }
  100% { transform: rotate(-30deg); }
}

@keyframes runArmSwingLeft {
  0% { transform: rotate(35deg); }
  100% { transform: rotate(-35deg); }
}

@keyframes runArmSwingRight {
  0% { transform: rotate(-35deg); }
  100% { transform: rotate(35deg); }
}

@keyframes headbandFlutter {
  0% { transform: rotate(-10deg) scaleX(1); }
  100% { transform: rotate(15deg) scaleX(0.85); }
}

/* Efek Turbo Sprint */
.balap-runner.is-turbo .balap-turbo-aura {
  display: block;
}

.balap-turbo-aura {
  display: none;
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 30px;
  background: radial-gradient(ellipse at right, rgba(249, 115, 22, 0.8), rgba(239, 68, 68, 0.4), transparent 70%);
  pointer-events: none;
  animation: turboWind 0.15s infinite alternate;
}

@keyframes turboWind {
  0% { opacity: 0.6; transform: translateY(-50%) scaleX(0.8); }
  100% { opacity: 1; transform: translateY(-50%) scaleX(1.3); }
}

/* Efek Tersandung (Stumble) */
.balap-runner.is-stumble {
  animation: runnerStumbleAnim 0.5s ease;
}

@keyframes runnerStumbleAnim {
  0% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(25deg) translateY(6px); }
  50% { transform: rotate(-15deg) translateY(4px); }
  75% { transform: rotate(8deg) translateY(2px); }
  100% { transform: rotate(0deg) translateY(0); }
}

/* Selebrasi Pemenang */
.balap-runner.is-winner {
  animation: runnerCelebrateAnim 0.6s infinite alternate ease-in-out;
}

@keyframes runnerCelebrateAnim {
  0% { transform: translateY(0) scale(1.05); }
  100% { transform: translateY(-12px) scale(1.15); }
}

/* ================= GRID PILIHAN GANDA (A, B, C, D) ================= */
.balap-options-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}

@media (max-width: 640px) {
  .balap-options-container {
    grid-template-columns: 1fr;
  }
}

.balap-option-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 14px 18px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-align: left;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.balap-option-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.25);
}

.balap-option-letter {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.balap-option-btn:hover .balap-option-letter {
  transform: scale(1.1);
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.5);
}

.balap-option-text {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #f8fafc;
  flex: 1;
}

/* Opsi Jawaban BENAR */
.balap-option-btn.option-correct {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.95) 0%, rgba(21, 128, 61, 0.95) 100%) !important;
  border-color: #4ade80 !important;
  box-shadow: 0 0 24px rgba(74, 222, 128, 0.6) !important;
  animation: balapCorrectPop 0.4s ease;
}

.balap-option-btn.option-correct .balap-option-letter {
  background: #ffffff !important;
  color: #15803d !important;
}

@keyframes balapCorrectPop {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Opsi Jawaban SALAH */
.balap-option-btn.option-wrong {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%) !important;
  border-color: #f87171 !important;
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.5) !important;
  animation: balapWrongShake 0.4s ease;
}

@keyframes balapWrongShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Floating Toast / Speed Burst Text */
.balap-float-toast {
  position: absolute;
  pointer-events: none;
  font-size: 1.15rem;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(245, 158, 11, 0.8);
  z-index: 100;
  animation: balapFloatUp 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes balapFloatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  25% { opacity: 1; transform: translateY(-16px) scale(1.15); }
  80% { opacity: 1; transform: translateY(-38px) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.85); }
}

/* ================= MODAL RESULT & PODIUM ================= */
.balap-podium-card {
  max-width: 540px;
  text-align: center;
}

.balap-podium-medal {
  font-size: 4rem;
  margin-bottom: 6px;
  animation: balapMedalDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes balapMedalDrop {
  0% { transform: translateY(-50px) scale(0.4); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.balap-result-title {
  color: #ef4444;
  font-weight: 900;
  font-size: 1.9rem;
  margin-bottom: 6px;
}

.balap-result-subtitle {
  color: #475569;
  font-size: 1rem;
  margin-bottom: 18px;
}

.balap-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.balap-stat-item {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: center;
}

.balap-stat-item-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 4px;
}

.balap-stat-item-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
}

/* ================= LAJUR KHUSUS VERSUS ================= */
.balap-lane.balap-lane-p1 {
  background: rgba(239, 68, 68, 0.12);
  border-left: 5px solid #ef4444;
}
.balap-lane.balap-lane-p2 {
  background: rgba(59, 130, 246, 0.12);
  border-left: 5px solid #3b82f6;
}
.balap-lane.balap-lane-p3 {
  background: rgba(16, 185, 129, 0.12);
  border-left: 5px solid #10b981;
}

/* ================= VERSUS ARENA (2 - 3 PLAYERS) ================= */
.balap-versus-arena {
  display: grid;
  gap: 16px;
  width: 100%;
  margin-top: 12px;
  align-items: stretch;
}

.balap-versus-arena.players-1 {
  grid-template-columns: minmax(0, 750px);
  justify-content: center;
}

.balap-versus-arena.players-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.balap-versus-arena.players-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .balap-versus-arena.players-2,
  .balap-versus-arena.players-3 {
    grid-template-columns: 1fr;
  }
}

/* Kolom Konsol Pemain */
.balap-player-col {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.balap-player-col.player-p1 {
  border: 2px solid rgba(239, 68, 68, 0.7);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.22);
}

.balap-player-col.player-p2 {
  border: 2px solid rgba(59, 130, 246, 0.7);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.22);
}

.balap-player-col.player-p3 {
  border: 2px solid rgba(16, 185, 129, 0.7);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.22);
}

/* Header Kolom Konsol */
.balap-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}

.balap-col-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.balap-col-avatar {
  font-size: 1.8rem;
  line-height: 1;
}

.balap-col-player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.balap-col-name {
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.balap-col-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 2px;
}

.player-p1 .balap-col-badge {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.player-p2 .balap-col-badge {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.5);
}

.player-p3 .balap-col-badge {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.balap-col-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.balap-col-stat-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.balap-col-stat-pill.score-pill {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  border-color: #f59e0b;
  color: #fef08a;
}

/* Timer Wrap */
.balap-col-timer-wrap {
  margin-bottom: 10px;
}

.balap-col-timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.balap-col-qbadge {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 2px 8px;
  border-radius: 6px;
}

.balap-col-time-text {
  color: #fca5a5;
  font-weight: 900;
}

.balap-col-time-text.urgent {
  color: #ef4444;
  animation: balapPulseTimer 0.6s infinite alternate;
}

.balap-col-timer-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.balap-col-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  transition: width 0.1s linear;
}

/* Question Card inside Column */
.balap-col-qcard {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  position: relative;
  min-height: 90px;
  display: flex;
  flex-direction: column;
}

.balap-col-qtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.balap-col-qpoints {
  font-size: 0.75rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.balap-col-qtext {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.45;
  margin: 4px 0 0;
}

.balap-col-qimage-box {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  max-height: 130px;
  display: none;
}

.balap-col-qimage-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Options Container inside Column */
.balap-col-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  flex-grow: 1;
}

.players-2 .balap-col-options {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 650px) {
  .players-2 .balap-col-options {
    grid-template-columns: 1fr;
  }
}

.balap-col-opt-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  color: #f1f5f9;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  min-height: 48px;
  user-select: none;
}

.balap-col-opt-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.player-p1 .balap-col-opt-btn:hover:not(:disabled) {
  border-color: #ef4444;
}

.player-p2 .balap-col-opt-btn:hover:not(:disabled) {
  border-color: #3b82f6;
}

.player-p3 .balap-col-opt-btn:hover:not(:disabled) {
  border-color: #10b981;
}

.balap-col-opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.balap-col-opt-text {
  flex-grow: 1;
  line-height: 1.35;
  word-break: break-word;
}

/* Option States */
.balap-col-opt-btn.option-correct {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.95) 0%, rgba(21, 128, 61, 0.95) 100%) !important;
  border-color: #4ade80 !important;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.5) !important;
  color: #ffffff !important;
  animation: balapCorrectPop 0.4s ease;
}

.balap-col-opt-btn.option-correct .balap-col-opt-letter {
  background: #ffffff !important;
  color: #15803d !important;
}

.balap-col-opt-btn.option-wrong {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%) !important;
  border-color: #f87171 !important;
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.5) !important;
  color: #ffffff !important;
  animation: balapWrongShake 0.4s ease;
}

/* Finished Box inside Player Column */
.balap-col-finished-box {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-grow: 1;
  min-height: 200px;
  animation: balapFadeIn 0.4s ease;
}

.balap-col-finished-box .finished-icon {
  font-size: 3rem;
  margin-bottom: 2px;
}

.balap-col-finished-box h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  color: #fef08a;
}

.balap-col-finished-box p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.balap-col-finished-summary {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
}

/* Multi-Player Podium Cards */
.balap-podium-cards {
  display: grid;
  gap: 14px;
}

.podium-rank-card {
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  position: relative;
  transition: transform 0.2s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.podium-rank-card.rank-1 {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2.5px solid #f59e0b;
  transform: scale(1.03);
}

.podium-rank-card.rank-2 {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 2px solid #94a3b8;
}

.podium-rank-card.rank-3 {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  border: 2px solid #ea580c;
}

.podium-medal-emoji {
  font-size: 3.2rem;
  margin-bottom: 4px;
  animation: balapMedalDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.podium-title {
  font-weight: 900;
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.rank-1 .podium-title { color: #b45309; }
.rank-2 .podium-title { color: #475569; }
.rank-3 .podium-title { color: #c2410c; }

.podium-player-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: #0f172a;
  margin-bottom: 10px;
}

.podium-stats-list {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
