/* ==========================================================================
   VASAI VIRAR CHALLENGE — CLEAN & MODERN GAMING STYLESHEET
   Light & Dark mode, lightweight subtle accents, responsive & accessible.
   ========================================================================== */

/* ── Base Section ──────────────────────────────────────────────────────── */
.challenge-page-section {
  position: relative;
  padding: 40px 0 70px 0;
  min-height: calc(100vh - 72px);
  background-color: var(--bg-primary, #ffffff);
  color: var(--text-primary, #0f172a);
  transition: background-color 0.25s ease, color 0.25s ease;
}

html.dark-theme .challenge-page-section,
body.dark-theme .challenge-page-section {
  background-color: #0b1120;
  color: #f8fafc;
}

.challenge-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Hero Card ────────────────────────────────────────────────────────── */
.challenge-hero-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 44px 32px 36px 32px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  margin-bottom: 32px;
  transition: all 0.25s ease;
}

html.dark-theme .challenge-hero-card,
body.dark-theme .challenge-hero-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.challenge-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: #b45309;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

html.dark-theme .challenge-top-pill,
body.dark-theme .challenge-top-pill {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.challenge-hero-title {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary, #0f172a);
  margin: 0 0 12px 0;
  letter-spacing: -0.01em;
}

html.dark-theme .challenge-hero-title,
body.dark-theme .challenge-hero-title {
  color: #f8fafc;
}

.challenge-hero-title .highlight-text {
  color: #d97706;
}

html.dark-theme .challenge-hero-title .highlight-text,
body.dark-theme .challenge-hero-title .highlight-text {
  color: #fbbf24;
}

.challenge-hero-sub {
  font-size: 1.02rem;
  color: var(--text-secondary, #475569);
  max-width: 620px;
  margin: 0 auto 28px auto;
  line-height: 1.55;
}

html.dark-theme .challenge-hero-sub,
body.dark-theme .challenge-hero-sub {
  color: #94a3b8;
}

.challenge-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.btn-challenge-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  background: #d97706;
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-challenge-primary:hover {
  background: #b45309;
  transform: translateY(-1px);
}

.btn-challenge-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 10px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

html.dark-theme .btn-challenge-secondary,
body.dark-theme .btn-challenge-secondary {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.btn-challenge-secondary:hover {
  border-color: #d97706;
  color: #d97706;
}

html.dark-theme .btn-challenge-secondary:hover,
body.dark-theme .btn-challenge-secondary:hover {
  border-color: #fbbf24;
  color: #fbbf24;
}

/* ── Live Stats Bar ───────────────────────────────────────────────────── */
.challenge-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

html.dark-theme .challenge-stat-grid,
body.dark-theme .challenge-stat-grid {
  border-color: rgba(255, 255, 255, 0.08);
}

.challenge-stat-item {
  text-align: center;
  padding: 4px 8px;
}

.stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1.2;
}

html.dark-theme .stat-num,
body.dark-theme .stat-num {
  color: #f8fafc;
}

.stat-label-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

html.dark-theme .stat-label-text,
body.dark-theme .stat-label-text {
  color: #94a3b8;
}

/* ── Categories Section ───────────────────────────────────────────────── */
.challenge-categories-section {
  margin-bottom: 36px;
}

.section-subhead {
  text-align: center;
  margin-bottom: 20px;
}

.section-subhead h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: var(--text-primary, #0f172a);
}

html.dark-theme .section-subhead h3,
body.dark-theme .section-subhead h3 {
  color: #f8fafc;
}

.section-subhead p {
  color: var(--text-secondary, #64748b);
  font-size: 0.9rem;
  margin: 0;
}

html.dark-theme .section-subhead p,
body.dark-theme .section-subhead p {
  color: #94a3b8;
}

.categories-pills-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.category-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  transition: border-color 0.2s ease;
}

html.dark-theme .category-capsule,
body.dark-theme .category-capsule {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.category-capsule i {
  color: #d97706;
}

html.dark-theme .category-capsule i,
body.dark-theme .category-capsule i {
  color: #fbbf24;
}

/* ── Player Entry Card ────────────────────────────────────────────────── */
.player-entry-card {
  max-width: 520px;
  margin: 0 auto 40px auto;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 34px 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

html.dark-theme .player-entry-card,
body.dark-theme .player-entry-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.entry-card-header {
  text-align: center;
  margin-bottom: 22px;
}

.entry-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

html.dark-theme .entry-badge-icon,
body.dark-theme .entry-badge-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.entry-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: var(--text-primary, #0f172a);
}

html.dark-theme .entry-title,
body.dark-theme .entry-title {
  color: #f8fafc;
}

.entry-sub {
  font-size: 0.88rem;
  color: var(--text-secondary, #64748b);
  margin: 0;
}

html.dark-theme .entry-sub,
body.dark-theme .entry-sub {
  color: #94a3b8;
}

.entry-form-group {
  margin-bottom: 20px;
}

.entry-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary, #0f172a);
}

html.dark-theme .entry-label,
body.dark-theme .entry-label {
  color: #e2e8f0;
}

.char-counter {
  font-size: 0.75rem;
  color: var(--text-tertiary, #94a3b8);
}

.entry-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.entry-input-box i {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary, #94a3b8);
  font-size: 0.9rem;
}

.entry-input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  border-radius: 10px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
  outline: none;
  transition: border-color 0.2s ease;
}

html.dark-theme .entry-input,
body.dark-theme .entry-input {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.entry-input:focus {
  border-color: #d97706;
}

.entry-rules-list {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html.dark-theme .entry-rules-list,
body.dark-theme .entry-rules-list {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-secondary, #475569);
}

html.dark-theme .rule-item,
body.dark-theme .rule-item {
  color: #94a3b8;
}

.rule-item i {
  color: #d97706;
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
}

html.dark-theme .rule-item i,
body.dark-theme .rule-item i {
  color: #fbbf24;
}

/* ── Active Quiz Gameplay ─────────────────────────────────────────────── */
.quiz-active-card {
  max-width: 720px;
  margin: 0 auto 40px auto;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 30px 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

html.dark-theme .quiz-active-card,
body.dark-theme .quiz-active-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.quiz-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.quiz-q-counter {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
}

html.dark-theme .quiz-q-counter,
body.dark-theme .quiz-q-counter {
  color: #94a3b8;
}

.quiz-q-counter span {
  color: #d97706;
  font-size: 1.05rem;
  font-weight: 800;
}

html.dark-theme .quiz-q-counter span,
body.dark-theme .quiz-q-counter span {
  color: #fbbf24;
}

.quiz-util-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #64748b);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

html.dark-theme .quiz-icon-btn,
body.dark-theme .quiz-icon-btn {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.quiz-icon-btn:hover {
  color: #d97706;
  border-color: #d97706;
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
  font-size: 0.88rem;
  font-weight: 700;
}

html.dark-theme .timer-pill,
body.dark-theme .timer-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.timer-pill.timer-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #d97706;
}

.timer-pill.timer-critical {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.quiz-progress-track {
  width: 100%;
  height: 5px;
  background: var(--bg-secondary, #f1f5f9);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

html.dark-theme .quiz-progress-track,
body.dark-theme .quiz-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

.quiz-progress-fill {
  height: 100%;
  background: #d97706;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.question-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

html.dark-theme .question-category-tag,
body.dark-theme .question-category-tag {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

.question-text-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-primary, #0f172a);
  margin: 0 0 22px 0;
}

html.dark-theme .question-text-heading,
body.dark-theme .question-text-heading {
  color: #f8fafc;
}

/* 4 Options */
.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
  font-size: 0.94rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

html.dark-theme .quiz-option-btn,
body.dark-theme .quiz-option-btn {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.09);
  color: #f8fafc;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.04);
}

html.dark-theme .quiz-option-btn:hover:not(:disabled) {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
}

.option-key-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-tertiary, #64748b);
  flex-shrink: 0;
}

html.dark-theme .option-key-badge,
body.dark-theme .option-key-badge {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.option-label-text {
  flex: 1;
}

.option-check-icon {
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.quiz-option-btn.selected {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.08);
}

/* Correct Answer State (Green) */
.quiz-option-btn.correct-choice,
.quiz-option-btn.state-correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.14) !important;
  color: #065f46 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35) !important;
}

html.dark-theme .quiz-option-btn.correct-choice,
body.dark-theme .quiz-option-btn.correct-choice,
html.dark-theme .quiz-option-btn.state-correct,
body.dark-theme .quiz-option-btn.state-correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.24) !important;
  color: #34d399 !important;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.4) !important;
}

.quiz-option-btn.correct-choice .option-key-badge,
.quiz-option-btn.state-correct .option-key-badge {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.quiz-option-btn.correct-choice .option-check-icon,
.quiz-option-btn.state-correct .option-check-icon {
  opacity: 1 !important;
  color: #10b981 !important;
}

/* Wrong Answer State (Red) */
.quiz-option-btn.wrong-choice,
.quiz-option-btn.state-wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.14) !important;
  color: #991b1b !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35) !important;
}

html.dark-theme .quiz-option-btn.wrong-choice,
body.dark-theme .quiz-option-btn.wrong-choice,
html.dark-theme .quiz-option-btn.state-wrong,
body.dark-theme .quiz-option-btn.state-wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.24) !important;
  color: #f87171 !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.4) !important;
}

.quiz-option-btn.wrong-choice .option-key-badge,
.quiz-option-btn.state-wrong .option-key-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

.quiz-option-btn.wrong-choice .option-check-icon,
.quiz-option-btn.state-wrong .option-check-icon {
  opacity: 1 !important;
  color: #ef4444 !important;
}

/* Fact Explanation Box */
.quiz-fact-box {
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.fact-icon {
  color: #d97706;
  font-size: 1rem;
  margin-top: 2px;
  flex-shrink: 0;
}

html.dark-theme .fact-icon,
body.dark-theme .fact-icon {
  color: #fbbf24;
}

.fact-text {
  font-size: 0.85rem;
  color: var(--text-primary, #0f172a);
  line-height: 1.45;
  margin: 0;
}

html.dark-theme .fact-text,
body.dark-theme .fact-text {
  color: #e2e8f0;
}

.fact-text strong {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  color: #b45309;
  margin-bottom: 2px;
}

html.dark-theme .fact-text strong,
body.dark-theme .fact-text strong {
  color: #fbbf24;
}

/* Controls */
.quiz-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
}

.btn-quiz-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  background: #d97706;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-quiz-next:hover {
  background: #b45309;
}

/* ── Results Dashboard ────────────────────────────────────────────────── */
.results-dashboard-card {
  max-width: 680px;
  margin: 0 auto 40px auto;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 38px 28px 32px 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  text-align: center;
}

html.dark-theme .results-dashboard-card,
body.dark-theme .results-dashboard-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.score-circular-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 16px auto;
}

.score-circular-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-circle-bg {
  fill: none;
  stroke: var(--bg-secondary, #f1f5f9);
  stroke-width: 8;
}

html.dark-theme .score-circle-bg,
body.dark-theme .score-circle-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.score-circle-progress {
  fill: none;
  stroke: #d97706;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark-theme .score-circle-progress,
body.dark-theme .score-circle-progress {
  stroke: #fbbf24;
}

.score-center-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-big-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1;
}

html.dark-theme .score-big-number,
body.dark-theme .score-big-number {
  color: #f8fafc;
}

.score-total-denom {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary, #94a3b8);
  text-transform: uppercase;
}

.results-player-congrats {
  font-size: 1rem;
  color: var(--text-secondary, #475569);
  margin-bottom: 6px;
}

html.dark-theme .results-player-congrats,
body.dark-theme .results-player-congrats {
  color: #94a3b8;
}

.results-player-name {
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

html.dark-theme .results-player-name,
body.dark-theme .results-player-name {
  color: #f8fafc;
}

.achievement-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 22px;
}

.tier-legend {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

html.dark-theme .tier-legend,
body.dark-theme .tier-legend {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.tier-expert {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

html.dark-theme .tier-expert,
body.dark-theme .tier-expert {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.tier-local {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

html.dark-theme .tier-local,
body.dark-theme .tier-local {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

.tier-explorer {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

html.dark-theme .tier-explorer,
body.dark-theme .tier-explorer {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.results-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

.metric-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

html.dark-theme .metric-card,
body.dark-theme .metric-card {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
}

.metric-card i {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.metric-val {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

html.dark-theme .metric-val,
body.dark-theme .metric-val {
  color: #f8fafc;
}

.metric-lbl {
  font-size: 0.68rem;
  color: var(--text-tertiary, #64748b);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

html.dark-theme .metric-lbl,
body.dark-theme .metric-lbl {
  color: #94a3b8;
}

/* Action Buttons */
.results-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-cert-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  background: #059669;
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cert-download:hover {
  background: #047857;
}

.btn-share-results {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  background: #16a34a;
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-share-results:hover {
  background: #15803d;
}

/* ── Leaderboard Section ──────────────────────────────────────────────── */
.leaderboard-section {
  max-width: 860px;
  margin: 0 auto 50px auto;
}

.leaderboard-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 34px 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

html.dark-theme .leaderboard-card,
body.dark-theme .leaderboard-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Top Leaders Clean Showcase */
.top-players-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.top-players-grid.count-1 {
  grid-template-columns: 1fr;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.top-players-grid.count-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.top-player-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
  transition: all 0.2s ease;
}

html.dark-theme .top-player-card,
body.dark-theme .top-player-card {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
}

.top-card-rank-1 {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(254, 243, 199, 0.35);
}

html.dark-theme .top-card-rank-1,
body.dark-theme .top-card-rank-1 {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.top-card-rank-2 {
  border-color: rgba(100, 116, 139, 0.25);
}

.top-card-rank-3 {
  border-color: rgba(180, 83, 9, 0.25);
}

.top-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.top-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
}

html.dark-theme .top-card-badge,
body.dark-theme .top-card-badge {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
}

.top-card-rank-1 .top-card-badge {
  color: #b45309;
}

html.dark-theme .top-card-rank-1 .top-card-badge {
  color: #fbbf24;
}

.top-card-rank-2 .top-card-badge {
  color: #475569;
}

html.dark-theme .top-card-rank-2 .top-card-badge {
  color: #94a3b8;
}

.top-card-rank-3 .top-card-badge {
  color: #92400e;
}

html.dark-theme .top-card-rank-3 .top-card-badge {
  color: #f59e0b;
}

.top-card-time {
  font-size: 0.72rem;
  color: var(--text-tertiary, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

html.dark-theme .top-card-time,
body.dark-theme .top-card-time {
  color: #94a3b8;
}

.top-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin: 6px auto 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
}

html.dark-theme .top-card-avatar,
body.dark-theme .top-card-avatar {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.top-card-rank-1 .top-card-avatar {
  border-color: #d97706;
  color: #d97706;
}

html.dark-theme .top-card-rank-1 .top-card-avatar {
  border-color: #fbbf24;
  color: #fbbf24;
}

.top-card-name {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.dark-theme .top-card-name,
body.dark-theme .top-card-name {
  color: #f8fafc;
}

.top-card-score {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #d97706;
}

html.dark-theme .top-card-score,
body.dark-theme .top-card-score {
  color: #fbbf24;
}

.top-card-score .score-unit {
  font-size: 0.72rem;
  color: var(--text-tertiary, #64748b);
  font-weight: 600;
}

/* Tabs & Controls */
.leaderboard-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.leaderboard-tabs-group {
  display: flex;
  gap: 6px;
}

.lb-tab-btn {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
}

html.dark-theme .lb-tab-btn,
body.dark-theme .lb-tab-btn {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.lb-tab-btn.active,
.lb-tab-btn:hover {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
}

html.dark-theme .lb-tab-btn.active,
html.dark-theme .lb-tab-btn:hover,
body.dark-theme .lb-tab-btn.active,
body.dark-theme .lb-tab-btn:hover {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
}

/* Table */
.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.leaderboard-table th {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary, #64748b);
  letter-spacing: 0.04em;
  padding: 6px 12px;
  text-align: left;
}

html.dark-theme .leaderboard-table th,
body.dark-theme .leaderboard-table th {
  color: #94a3b8;
}

.leaderboard-table td {
  padding: 11px 12px;
  background: var(--bg-secondary, #f8fafc);
  font-size: 0.88rem;
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

html.dark-theme .leaderboard-table td,
body.dark-theme .leaderboard-table td {
  background: #1f2937;
  color: #f8fafc;
}

.leaderboard-table tr td:first-child {
  border-radius: 8px 0 0 8px;
}

.leaderboard-table tr td:last-child {
  border-radius: 0 8px 8px 0;
}

.leaderboard-table tr.current-user-row td {
  background: rgba(217, 119, 6, 0.08) !important;
  color: #b45309;
  font-weight: 700;
}

html.dark-theme .leaderboard-table tr.current-user-row td {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24;
}

.lb-score-val {
  font-family: var(--font-heading);
  font-weight: 800;
  color: #d97706;
}

html.dark-theme .lb-score-val,
body.dark-theme .lb-score-val {
  color: #fbbf24;
}

.lb-score-denom {
  font-size: 0.72rem;
  color: var(--text-tertiary, #64748b);
  font-weight: 600;
}

.lb-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 0.76rem;
  font-weight: 700;
}

html.dark-theme .lb-rank-badge,
body.dark-theme .lb-rank-badge {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
}

.lb-player-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-you-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #d97706;
  color: #ffffff;
  text-transform: uppercase;
  font-weight: 800;
  margin-left: 6px;
  vertical-align: middle;
}

.lb-tier-pill {
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #475569);
}

html.dark-theme .lb-tier-pill,
body.dark-theme .lb-tier-pill {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.lb-score-text {
  color: #d97706;
}

html.dark-theme .lb-score-text,
body.dark-theme .lb-score-text {
  color: #fbbf24;
}

/* ── Certificate Preview Modal ────────────────────────────────────────── */
.cert-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

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

.cert-modal-window {
  background: var(--card-bg, #ffffff);
  border-radius: 16px;
  max-width: 860px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
}

html.dark-theme .cert-modal-window,
body.dark-theme .cert-modal-window {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-canvas-container {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 16px;
  background: #ffffff;
}

.cert-canvas-container canvas {
  width: 100%;
  height: auto;
  display: block;
}

.cert-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cert-modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #64748b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

html.dark-theme .cert-modal-close-btn,
body.dark-theme .cert-modal-close-btn {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* ─────────────────────────────────────────────────────────────────────────────
   VASAI VIRAR CHALLENGE — HOME PAGE BOTTOM BANNER CTA (Clean, No blobs)
   ───────────────────────────────────────────────────────────────────────────── */
.challenge-home-banner-section {
  padding: 60px 0 50px 0;
  background: var(--bg-primary, #ffffff);
  position: relative;
}

html.dark-theme .challenge-home-banner-section,
body.dark-theme .challenge-home-banner-section {
  background: #0b1120;
}

.challenge-home-banner-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 40px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

html.dark-theme .challenge-home-banner-card,
body.dark-theme .challenge-home-banner-card {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.challenge-banner-content {
  flex: 1;
  max-width: 600px;
}

.challenge-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: #b45309;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

html.dark-theme .challenge-banner-badge,
body.dark-theme .challenge-banner-badge {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.challenge-banner-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1.25;
  margin: 0 0 10px 0;
}

html.dark-theme .challenge-banner-title,
body.dark-theme .challenge-banner-title {
  color: #f8fafc;
}

.challenge-banner-highlight {
  color: #d97706;
}

html.dark-theme .challenge-banner-highlight,
body.dark-theme .challenge-banner-highlight {
  color: #fbbf24;
}

.challenge-banner-subtitle {
  color: var(--text-secondary, #475569);
  font-size: 0.94rem;
  line-height: 1.5;
  margin: 0 0 18px 0;
}

html.dark-theme .challenge-banner-subtitle,
body.dark-theme .challenge-banner-subtitle {
  color: #94a3b8;
}

.challenge-banner-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.challenge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #475569);
  font-size: 0.78rem;
  font-weight: 600;
}

html.dark-theme .challenge-pill,
body.dark-theme .challenge-pill {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.challenge-pill i {
  color: #d97706;
}

html.dark-theme .challenge-pill i,
body.dark-theme .challenge-pill i {
  color: #fbbf24;
}

.challenge-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.challenge-banner-btn-primary {
  padding: 10px 22px;
  background: #d97706;
  border: none;
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.challenge-banner-btn-primary:hover {
  background: #b45309;
}

.challenge-banner-btn-secondary {
  padding: 9px 20px;
  background: transparent;
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

html.dark-theme .challenge-banner-btn-secondary,
body.dark-theme .challenge-banner-btn-secondary {
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.challenge-banner-btn-secondary:hover {
  border-color: #d97706;
  color: #d97706;
}

html.dark-theme .challenge-banner-btn-secondary:hover,
body.dark-theme .challenge-banner-btn-secondary:hover {
  border-color: #fbbf24;
  color: #fbbf24;
}

/* Modern Right Preview Card (Replaces the circular blob) */
.challenge-banner-visual {
  flex-shrink: 0;
}

.challenge-banner-preview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 12px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
}

html.dark-theme .challenge-banner-preview-card,
body.dark-theme .challenge-banner-preview-card {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
}

.banner-preview-trophy {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

html.dark-theme .banner-preview-trophy,
body.dark-theme .banner-preview-trophy {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.banner-preview-meta {
  display: flex;
  flex-direction: column;
}

.banner-preview-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #d97706;
  letter-spacing: 0.04em;
}

html.dark-theme .banner-preview-tag,
body.dark-theme .banner-preview-tag {
  color: #fbbf24;
}

.banner-preview-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

html.dark-theme .banner-preview-heading,
body.dark-theme .banner-preview-heading {
  color: #f8fafc;
}

.banner-preview-stats {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

html.dark-theme .banner-preview-stats,
body.dark-theme .banner-preview-stats {
  color: #94a3b8;
}

/* ── Responsive Adaptations ───────────────────────────────────────────── */
@media (max-width: 991px) {
  .challenge-hero-title {
    font-size: 2rem;
  }
  .challenge-home-banner-card {
    flex-direction: column;
    text-align: center;
    padding: 32px 20px;
  }
  .challenge-banner-pills,
  .challenge-banner-actions {
    justify-content: center;
  }
  .top-players-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .challenge-page-section {
    padding: 24px 0 45px 0;
  }
  .challenge-hero-card {
    padding: 26px 16px 20px 16px;
  }
  .challenge-hero-title {
    font-size: 1.65rem;
  }
  .challenge-hero-sub {
    font-size: 0.92rem;
  }
  .challenge-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .player-entry-card {
    padding: 24px 18px;
  }
  .quiz-active-card {
    padding: 22px 16px;
  }
  .question-text-heading {
    font-size: 1.12rem;
  }
  .results-dashboard-card {
    padding: 28px 18px;
  }
  .results-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .leaderboard-card {
    padding: 20px 12px;
  }
}

@media (max-width: 480px) {
  .challenge-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat-num {
    font-size: 1.25rem;
  }
  .stat-label-text {
    font-size: 0.72rem;
  }
  .challenge-hero-actions,
  .results-action-row {
    flex-direction: column;
    width: 100%;
  }
  .btn-challenge-primary,
  .btn-challenge-secondary,
  .btn-cert-download,
  .btn-share-results {
    width: 100%;
    justify-content: center;
  }
  .leaderboard-card {
    padding: 16px 8px;
  }
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 7px 5px;
    font-size: 0.75rem;
  }
  .lb-score-val {
    font-size: 0.82rem;
  }
  .lb-score-denom {
    display: none;
  }
}
