/* ============================================
   Background fix — block orb bleed
   ============================================ */
main, .quiz-wrap, .tips-wrap {
  position: relative;
  z-index: 1;
  background: #080808;
}

footer {
  position: relative;
  z-index: 2;
  background: #080808;
}

/* ============================================
   CarVerdict — Quiz Page (Premium Upgrade)
   ============================================ */

.quiz-wrap {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
  position: relative;
  z-index: 1;
}

/* ===== NAME ENTRY CARD ===== */
.quiz-card {
  background: #111;
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.quiz-card::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(192,132,252,0.08), transparent 70%);
  pointer-events: none;
}

.quiz-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(251,191,36,0.1);
  border: 0.5px solid rgba(251,191,36,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.quiz-card h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 6vw, 38px);
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.05;
}

.quiz-sub {
  font-size: 14px;
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.quiz-note {
  font-size: 12px;
  color: #555;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.quiz-note.notice-warning { color: #fbbf24; }

.start-btn {
  width: 100%;
  background: #E8FF47;
  border: none;
  border-radius: 14px;
  color: #000;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  padding: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.start-btn:hover { background: #f0ff6b; transform: translateY(-1px); }

/* ===== QUIZ QUESTION SCREEN ===== */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0 2px;
}

.q-counter {
  font-size: 11px;
  color: #555;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.q-timer-text {
  font-size: 12px;
  color: #E8FF47;
  font-weight: 700;
}

.q-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: #E8FF47;
  letter-spacing: 1px;
}

/* Progress bar */
.progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #c084fc;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Timer bar */
.timer-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #E8FF47);
  transition: width 0.25s ease;
  border-radius: 2px;
}
.timer-fill.low { background: linear-gradient(90deg, #ef4444, #f97316); }
.timer-text {
  font-size: 12px;
  color: #E8FF47;
  font-weight: 700;
}

/* Question card */
#question-card {
  text-align: left;
  padding: 1.5rem;
}

.question-text {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

/* Options */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}

.option-btn {
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: #ccc;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 13px 16px;
  text-align: left;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.option-btn:hover:not(:disabled) {
  border-color: rgba(192,132,252,0.4);
  background: rgba(192,132,252,0.06);
  color: #fff;
}
.option-btn.correct {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.3);
  color: #22c55e;
}
.option-btn.wrong {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #ef4444;
}
.option-btn:disabled { cursor: not-allowed; }

.option-letter {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.06);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.5px;
}

/* Explanation */
.explanation-box {
  background: rgba(192,132,252,0.06);
  border: 0.5px solid rgba(192,132,252,0.2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 1rem;
  animation: fadeUp 0.3s ease;
}

.next-btn {
  width: 100%;
  background: #E8FF47;
  border: none;
  border-radius: 12px;
  color: #000;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 13px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.next-btn:hover { background: #f0ff6b; }

/* ===== RESULT SCREEN ===== */
.result-emoji { font-size: 48px; text-align: center; margin-bottom: 0.75rem; }

.result-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 8vw, 40px);
  text-align: center;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.result-score-big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(64px, 18vw, 96px);
  color: #E8FF47;
  text-align: center;
  letter-spacing: 2px;
  line-height: 0.9;
  margin-bottom: 0.25rem;
  text-shadow: 0 0 60px rgba(232,255,71,0.3);
}

.result-label {
  text-align: center;
  font-size: 13px;
  color: #555;
  margin-bottom: 1.5rem;
}

.result-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.rb-box {
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}
.rb-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.rb-label {
  font-size: 10px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.play-again-btn {
  width: 100%;
  background: #E8FF47;
  border: none;
  border-radius: 12px;
  color: #000;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  transition: all 0.2s;
  margin-bottom: 8px;
}
.play-again-btn:hover { background: #f0ff6b; }

.quiz-result-note {
  text-align: center;
  color: #555;
  font-size: 12px;
  margin-bottom: 1rem;
}

/* ===== LEADERBOARD ===== */
.leaderboard-card {
  background: #111;
  border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 24px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.lb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}

.lb-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 1.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-sub { font-size: 12px; color: #777; }

/* Tabs */
.leaderboard-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 4px;
}
.lb-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #555;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.lb-tab.active {
  background: #1a1a1a;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.lb-tab:hover:not(.active) { color: #999; }

.lb-meta {
  font-size: 11px;
  color: #777;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Current user highlight */
.lb-current-summary {
  background: rgba(232,255,71,0.05);
  border: 0.5px solid rgba(232,255,71,0.15);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.lb-current-summary-left, .lb-current-summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lb-current-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: #fbbf24;
}
.lb-current-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.lb-current-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: #E8FF47;
  letter-spacing: 1px;
}
.lb-current-streak {
  font-size: 12px;
  color: #fbbf24;
  background: rgba(251,191,36,0.08);
  border-radius: 100px;
  padding: 3px 10px;
}

/* Leaderboard rows */
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}
.lb-row:hover { background: rgba(255,255,255,0.02); }
.lb-row.lb-current {
  background: rgba(232,255,71,0.04);
  border: 0.5px solid rgba(232,255,71,0.1);
}

.lb-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  color: #777;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.lb-rank.gold { color: #fbbf24; }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #cd7c54; }

/* Avatar circle */
.lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.lb-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-row.lb-current .lb-name { color: #fff; font-weight: 700; }

.lb-score-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: #E8FF47;
  letter-spacing: 1px;
}

.lb-streak {
  font-size: 11px;
  color: #fbbf24;
  min-width: 40px;
  text-align: right;
}

.lb-diff {
  font-size: 10px;
  color: #777;
  background: rgba(255,255,255,0.04);
  padding: 2px 7px;
  border-radius: 100px;
}

.lb-empty {
  text-align: center;
  font-size: 13px;
  color: #777;
  padding: 2rem 0;
}

.lb-hall-row .lb-streak { color: #555; }


/* Mobile */
@media (max-width: 480px) {
  .result-breakdown { grid-template-columns: 1fr 1fr; }
  .quiz-card { padding: 1.5rem 1.25rem; border-radius: 20px; }
  .question-text { font-size: 16px; }
  .option-btn { font-size: 13px; padding: 12px 14px; }
  .leaderboard-card { padding: 1.25rem 1rem; border-radius: 20px; }
  .leaderboard-tabs { gap: 4px; }
  .lb-tab { font-size: 12px; padding: 7px 8px; }
}

/* ===== QUIZ V2 ADDITIONS ===== */

/* Speed bonus flash */
.speed-bonus-flash {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: rgba(232,255,71,.15); color: #E8FF47;
  font-size: 11px; font-weight: 800; letter-spacing: .4px;
  padding: 3px 8px; border-radius: 100px;
  animation: flashUp .9s ease forwards; pointer-events: none;
}
@keyframes flashUp {
  0%   { opacity:1; transform:translateY(-50%) translateY(0); }
  100% { opacity:0; transform:translateY(-50%) translateY(-18px); }
}

/* Confetti container */
.perfect-burst {
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0; pointer-events: none; z-index: 10;
}

/* Result buttons row */
.quiz-result-btns {
  display: flex; gap: 10px; margin-top: 1.2rem; flex-wrap: wrap;
}
.share-score-btn {
  flex: 1; min-width: 130px; padding: 13px; border-radius: 12px;
  background: transparent; color: #E8FF47;
  border: .5px solid rgba(232,255,71,.3);
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .2s, background .2s;
}
.share-score-btn:hover { background: rgba(232,255,71,.07); border-color: rgba(232,255,71,.5); }

/* Override play-again in result context */
.quiz-result-btns .play-again-btn {
  flex: 1; min-width: 130px; width: auto; margin-bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* Explanation box variants */
.explanation-box.correct { border-color: rgba(34,197,94,.25); background: rgba(34,197,94,.05); }
.explanation-box.wrong   { border-color: rgba(239,68,68,.25);  background: rgba(239,68,68,.05); }

/* Timer low pulse */
.timer-fill.low {
  background: linear-gradient(90deg, #ef4444, #f97316) !important;
  animation: timerPulse .5s ease infinite alternate;
}
@keyframes timerPulse { from { opacity:.7; } to { opacity:1; } }

/* Option btn relative for speed badge */
.option-btn { position: relative; }

/* Current rank display */
.lb-current-streak {
  font-size: 11px; color: #f97316; font-weight: 700;
  display: inline-flex; align-items: center; gap: 3px;
}