/* ============================================
   PsyVerse Quiz - Component Styles
   ============================================ */

/* ── COUNTDOWN PAGE ──────────────────────────────────────────────────────── */
.countdown-page {
  display: flex; flex-direction: column;
  width: 100%; max-width: 100%;
  background: transparent; min-height: 100vh;
  position: relative;
}

/* Banner ad — vacant, no placeholder text */
.cd-banner-ad {
  width: 100%; background: transparent;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cd-banner-ad:empty { min-height: 0; border: none; }

/* Clock — full width, generous padding */
.cd-clock-section {
  background: transparent; padding: 2rem 1.25rem 1.5rem; text-align: center; width: 100%;
}
.cd-clock-eyebrow {
  font-size: 10px; font-weight: 700; color: #AFA9EC;
  text-transform: uppercase; letter-spacing: 3px; margin-bottom: 1.25rem;
}
.cd-clock-digits {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 14px;
}

/* Frosted glass box around each digit */
.cd-clock-unit { text-align: center; }
.cd-clock-box {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px;
  width: 78px; height: 78px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.cd-clock-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: rgba(255,255,255,0.05);
  border-radius: 14px 14px 0 0;
}
.cd-clock-box::after {
  content: '';
  position: absolute; top: 50%; left: 12px; right: 12px; height: 1px;
  background: rgba(0,0,0,0.18);
}

.cd-clock-num {
  font-size: 42px; font-weight: 900; color: #fff; line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  letter-spacing: -1px;
  position: relative; z-index: 1;
}
.cd-clock-lbl {
  font-size: 10px; color: #AFA9EC; letter-spacing: 2px; margin-top: 7px;
  text-transform: uppercase; font-weight: 700;
}
.cd-clock-sep {
  font-size: 32px; color: rgba(255,255,255,0.35); line-height: 1;
  font-weight: 900; margin-bottom: 26px; padding: 0 6px;
  align-self: center; padding-top: 6px;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Progress bar */
/* Progress bar wrapper — includes label row */
.cd-progress-section {
  margin: 4px 24px 16px;
}
.cd-progress-labels {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 7px;
}
.cd-progress-label-left {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: #7F77DD;
}
.cd-progress-label-right {
  font-size: 10px; font-weight: 700; color: #AFA9EC;
  letter-spacing: 0.5px;
}
.cd-progress-wrap {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px; height: 10px;
  overflow: hidden; position: relative;
}
.cd-progress-fill {
  height: 100%; width: 2%;
  background: linear-gradient(90deg, #534AB7, #AFA9EC, #EEEDFE);
  border-radius: 999px;
  transition: width 1s linear;
  position: relative;
  box-shadow: 0 0 10px rgba(175,169,236,0.6), 0 0 24px rgba(83,74,183,0.4);
}
/* Shimmer sweep animation */
.cd-progress-fill::after {
  content: '';
  position: absolute; top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  border-radius: 999px;
  animation: progress-shimmer 2.2s ease-in-out infinite;
}
@keyframes progress-shimmer {
  0%   { left: -60%; opacity: 0; }
  20%  { opacity: 1; }
  100% { left: 120%; opacity: 0; }
}
/* Pulse glow on the track */
.cd-progress-wrap::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 999px;
  box-shadow: inset 0 0 8px rgba(83,74,183,0.3);
  animation: track-pulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes track-pulse {
  0%, 100% { box-shadow: inset 0 0 8px rgba(83,74,183,0.2); }
  50%       { box-shadow: inset 0 0 14px rgba(175,169,236,0.35); }
}


.cd-clock-sub  { font-size: 13px; color: #AFA9EC; margin-top: 4px; }
.cd-clock-sub strong { color: #EEEDFE; font-weight: 700; }
.cd-clock-pills { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.cd-pill       { padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.cd-pill-amber { background: #FAEEDA; color: #633806; }
.cd-pill-teal  { background: rgba(255,255,255,0.12); color: #AFA9EC; border: 1px solid rgba(255,255,255,0.15); }

/* Rectangle ad — vacant, no placeholder */
.cd-rect-ad {
  width: 100%; background: transparent;
  min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.cd-rect-ad:not(:empty) {
  min-height: 200px;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Scroll nudge — bigger, bolder */
.cd-scroll-nudge {
  background: transparent; padding: 1rem 1.25rem 0.75rem; text-align: center;
}
.cd-scroll-nudge-text {
  font-size: 13px; color: rgba(255,255,255,0.5); font-weight: 700;
  letter-spacing: 0.5px; animation: nudge-pulse 2.5s ease-in-out infinite;
  display: inline-flex; align-items: center; gap: 6px;
}
@keyframes nudge-pulse {
  0%, 100% { opacity: 0.45; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(4px); }
}

/* Leaderboard section */
.cd-lb-section {
  background: transparent; padding: 4px 12px 5rem; width: 100%; max-width: 600px; margin: 0 auto;
}

/* ── TELEGRAM FLOATING BUTTON ────────────────────────────────────────────── */
.cd-tg-btn {
  position: fixed; bottom: 24px; right: 16px; z-index: 200;
  display: flex; align-items: center; gap: 7px;
  background: #3C3489;
  border: 1.5px solid rgba(175,169,236,0.4);
  color: #EEEDFE;
  padding: 10px 16px 10px 13px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  transition: background 0.2s, transform 0.15s;
  font-family: system-ui, -apple-system, sans-serif;
}
.cd-tg-btn:hover {
  background: #534AB7;
  transform: translateY(-2px);
}
.cd-tg-btn svg { flex-shrink: 0; }



/* ── STATS ───────────────────────────────────────────────────────────────── */
.stats-card {
  background: #fff; border-radius: 16px; border: 1.5px solid #CECBF6;
  padding: 1.25rem; margin-bottom: 12px;
}
.stats-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 8px; }
.stats-username { font-size: 15px; font-weight: 700; color: #26215C; }
.stats-streak   { padding: 4px 12px; border-radius: 20px; background: #FAEEDA; color: #633806; font-size: 12px; font-weight: 700; }
.stats-grid     { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 1rem; }
.stat-item      { background: #f9fafb; border-radius: 10px; padding: 10px 8px; text-align: center; }
.stat-val       { font-size: 20px; font-weight: 800; color: #534AB7; }
.stat-lbl       { font-size: 10px; color: #9ca3af; margin-top: 2px; text-transform: uppercase; letter-spacing: .3px; }
.stats-ranks    { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats-rank-item { background: #EEEDFE; border-radius: 10px; padding: 9px 6px; text-align: center; }
.stats-rank-item.rank-top { background: #534AB7; }
.stats-rank-val { font-size: 16px; font-weight: 800; color: #534AB7; }
.stats-rank-item.rank-top .stats-rank-val { color: #EEEDFE; }
.stats-rank-lbl { font-size: 10px; color: #7F77DD; margin-top: 2px; }
.stats-rank-item.rank-top .stats-rank-lbl { color: #AFA9EC; }

@media (max-width: 380px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .stats-ranks { grid-template-columns: repeat(2, 1fr); }
}

/* ── LEADERBOARD ─────────────────────────────────────────────────────────── */
.lb-card   { background: #fff; border-radius: 16px; border: 1.5px solid #CECBF6; margin-bottom: 12px; overflow: hidden; }
.lb-header { padding: 14px 16px; border-bottom: 1px solid #f3f4f6; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.lb-title  { font-size: 15px; font-weight: 700; color: #26215C; }
.lb-tabs   { display: flex; gap: 4px; flex-wrap: wrap; }
.lb-tab    { padding: 5px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; cursor: pointer; border: 1px solid #e5e7eb; background: #f9fafb; color: #6b7280; font-family: inherit; transition: all .15s; }
.lb-tab:hover  { background: #EEEDFE; border-color: #AFA9EC; color: #534AB7; }
.lb-tab.active { background: #534AB7; color: #EEEDFE; border-color: #534AB7; }
.lb-rows   { padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.lb-row    { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: #f9fafb; transition: background .15s; }
.lb-row.lb-me  { background: #EEEDFE; border: 1.5px solid #CECBF6; }
.lb-row.lb-top-1 { background: #FAEEDA; }
.lb-row.lb-top-2 { background: #F1EFE8; }
.lb-row.lb-top-3 { background: #E1F5EE; }
.lb-rank   { width: 28px; font-size: 14px; color: #9ca3af; font-weight: 700; flex-shrink: 0; }
.lb-player { flex: 1; min-width: 0; }
.lb-username { font-size: 14px; font-weight: 700; color: #26215C; }
.lb-acc    { font-size: 11px; color: #9ca3af; margin-top: 1px; }
.lb-you    { font-size: 10px; padding: 1px 6px; border-radius: 20px; background: #534AB7; color: #EEEDFE; margin-left: 5px; vertical-align: middle; font-weight: 700; }
.lb-pts    { font-size: 14px; font-weight: 800; color: #534AB7; white-space: nowrap; }
.lb-pts-lbl { font-size: 10px; color: #AFA9EC; margin-left: 2px; }
.lb-streak { font-size: 13px; font-weight: 700; color: #633806; }
.lb-empty  { text-align: center; padding: 2.5rem 1rem; color: #9ca3af; font-size: 14px; }

/* ── QUIZ SHELL ──────────────────────────────────────────────────────────── */
.quiz-shell {
  min-height: 100vh; display: flex; flex-direction: column;
  max-width: 600px; margin: 0 auto; background: #534AB7;
}
.quiz-hdr {
  background: #534AB7; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0;
}
.quiz-hdr-logo  { display: flex; align-items: center; gap: 8px; }
.quiz-hdr-icon  { width: 30px; height: 30px; border-radius: 8px; background: #7F77DD; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.quiz-hdr-name  { font-size: 14px; font-weight: 700; color: #EEEDFE; }
.quiz-hdr-right { display: flex; align-items: center; gap: 8px; }
.quiz-q-counter { font-size: 13px; font-weight: 700; color: #EEEDFE; background: #3C3489; padding: 5px 12px; border-radius: 20px; }
.quiz-exit-btn  { padding: 6px 12px; border-radius: 8px; background: #7F77DD; border: none; color: #EEEDFE; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.quiz-exit-btn:hover { background: #AFA9EC; color: #26215C; }

.quiz-prog-wrap { background: #3C3489; padding: 0 16px 10px; flex-shrink: 0; }
.quiz-prog-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.quiz-prog-lbl  { font-size: 12px; color: #AFA9EC; font-weight: 600; }
.quiz-prog-track { height: 6px; background: #26215C; border-radius: 3px; overflow: hidden; display: flex; gap: 2px; }
.quiz-prog-seg  { height: 100%; border-radius: 2px; flex: 1; background: #26215C; transition: background .3s; }
.quiz-prog-seg.done { background: #1D9E75; }
.quiz-prog-seg.cur  { background: #AFA9EC; }

.quiz-body { flex: 1; background: #f0effe; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; overflow: hidden; }

.quiz-q-area { padding: 20px 16px 10px; flex-shrink: 0; }
.quiz-topic  { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; background: #EEEDFE; color: #534AB7; font-size: 11px; font-weight: 700; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px; border: 1px solid #CECBF6; }
.quiz-q-text { font-size: 17px; font-weight: 600; color: #26215C; line-height: 1.55; }
.quiz-media-img  { max-width: 100%; border-radius: 10px; margin: 12px 0; }
.quiz-media-audio { width: 100%; margin: 12px 0; }

.quiz-timed-pill { display: inline-flex; align-items: center; gap: 6px; background: #EEEDFE; border: 1px solid #CECBF6; border-radius: 20px; padding: 5px 13px; font-size: 12px; color: #7F77DD; font-weight: 600; margin: 0 16px 10px; }
.quiz-timed-dot  { width: 7px; height: 7px; border-radius: 50%; background: #7F77DD; opacity: 0.6; flex-shrink: 0; }

.quiz-opts { padding: 0 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-bottom: 8px; }
.quiz-opt  {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-radius: 14px; border: 2px solid #CECBF6; background: #fff;
  cursor: pointer; transition: all .15s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.quiz-opt:hover { border-color: #7F77DD; background: #EEEDFE; transform: translateX(3px); }
.quiz-opt:active { transform: scale(.98); }
.quiz-opt.sel    { border-color: #534AB7; background: #EEEDFE; pointer-events: none; }
.quiz-opt.locked { pointer-events: none; }
.quiz-opt.locked:not(.sel) { opacity: .45; }
.quiz-opt-letter { width: 30px; height: 30px; border-radius: 8px; background: #EEEDFE; border: 1.5px solid #CECBF6; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #534AB7; flex-shrink: 0; transition: all .15s; }
.quiz-opt.sel .quiz-opt-letter { background: #534AB7; color: #EEEDFE; border-color: #534AB7; }
.quiz-opt-text { font-size: 14px; color: #374151; font-weight: 500; line-height: 1.4; flex: 1; }
.quiz-opt.sel .quiz-opt-text { color: #26215C; font-weight: 600; }

.quiz-footer { padding: 10px 16px 18px; flex-shrink: 0; }
.quiz-info-btn { width: 44px; height: 44px; border-radius: 12px; background: #EEEDFE; border: 1.5px solid #CECBF6; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; text-decoration: none; }

/* ── RESULTS ─────────────────────────────────────────────────────────────── */
.results-shell { max-width: 600px; margin: 0 auto; background: #f0effe; min-height: 100vh; }
.results-speed-reveal { display: flex; align-items: center; gap: 8px; background: #3C3489; border: 1px solid rgba(175,169,236,0.25); border-radius: 10px; margin: 10px 16px 0; padding: 10px 14px; font-size: 12px; color: #AFA9EC; line-height: 1.4; }
.results-speed-reveal strong { color: #EEEDFE; }
.results-speed-icon { font-size: 16px; flex-shrink: 0; }
.results-hero  { background: #534AB7; padding: 2rem 1.25rem 1.5rem; text-align: center; }
.results-emoji { font-size: 52px; margin-bottom: 8px; }
.results-title { font-size: 14px; font-weight: 700; color: #AFA9EC; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.results-score { font-size: 60px; font-weight: 800; color: #EEEDFE; line-height: 1; }
.results-score-sub { font-size: 13px; color: #AFA9EC; margin-top: 5px; }
.results-pills { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.res-pill      { padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.res-pill-teal   { background: #E1F5EE; color: #085041; }
.res-pill-purple { background: #EEEDFE; color: #3C3489; }
.res-pill-amber  { background: #FAEEDA; color: #633806; }
.results-actions { display: flex; gap: 10px; padding: 1rem 1.25rem; }
.res-btn { flex: 1; padding: 13px; border-radius: 14px; border: none; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all .15s; }
.res-btn:active  { transform: scale(.98); }
.res-btn-score   { background: #EEEDFE; color: #534AB7; border: 2px solid #CECBF6; }
.res-btn-score.active { background: #534AB7; color: #EEEDFE; border-color: #534AB7; }
.res-btn-review  { background: #1D9E75; color: #fff; }
.res-btn-review.active { background: #085041; }
.results-breakdown { padding: 0 1.25rem 1.5rem; }

/* Score breakdown */
.sb-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sb-row  { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1.5px solid #EEEDFE; }
.sb-num  { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.sb-c    { background: #1D9E75; color: #fff; }
.sb-w    { background: #E24B4A; color: #fff; }
.sb-info { flex: 1; min-width: 0; }
.sb-qshort  { font-size: 12px; color: #374151; font-weight: 500; line-height: 1.4; }
.sb-detail  { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.sb-pts     { text-align: right; flex-shrink: 0; }
.sb-pts-val { font-size: 15px; font-weight: 800; color: #534AB7; }
.sb-pts-spd { font-size: 11px; color: #1D9E75; font-weight: 700; }
.sb-pts-zero { font-size: 15px; font-weight: 800; color: #E24B4A; }
.sb-total   { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #534AB7; border-radius: 12px; }
.sb-total-lbl { font-size: 13px; color: #AFA9EC; font-weight: 600; }
.sb-total-val { font-size: 24px; font-weight: 800; color: #EEEDFE; }

/* Review breakdown */
.rv-card { background: #fff; border-radius: 14px; border: 1.5px solid #EEEDFE; overflow: hidden; margin-bottom: 10px; }
.rv-head { padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid #f3f4f6; }
.rv-num  { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.rv-c    { background: #1D9E75; color: #fff; }
.rv-w    { background: #E24B4A; color: #fff; }
.rv-qtext { font-size: 13px; font-weight: 600; color: #26215C; line-height: 1.5; flex: 1; }
.rv-opts  { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.rv-opt   { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #f3f4f6; background: #fafafa; }
.rv-opt.rv-correct { border-color: #1D9E75; background: #E1F5EE; }
.rv-opt.rv-wrong   { border-color: #E24B4A; background: #FCEBEB; }
.rv-opt.rv-missed  { border-color: #1D9E75; background: #E1F5EE; }
.rv-letter { width: 24px; height: 24px; border-radius: 6px; background: #EEEDFE; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #534AB7; flex-shrink: 0; }
.rv-correct .rv-letter { background: #1D9E75; color: #fff; }
.rv-wrong   .rv-letter { background: #E24B4A; color: #fff; }
.rv-missed  .rv-letter { background: #1D9E75; color: #fff; }
.rv-opt-text { font-size: 13px; color: #374151; flex: 1; }
.rv-correct .rv-opt-text { color: #085041; font-weight: 600; }
.rv-wrong   .rv-opt-text { color: #791F1F; font-weight: 600; }
.rv-missed  .rv-opt-text { color: #085041; font-weight: 600; }
.rv-tag     { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; flex-shrink: 0; }
.rv-tag-c   { background: #1D9E75; color: #fff; }
.rv-tag-w   { background: #E24B4A; color: #fff; }
.rv-tag-m   { background: #1D9E75; color: #fff; }
.rv-chips   { padding: 0 14px 12px; display: flex; gap: 7px; flex-wrap: wrap; }
.rv-chip    { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.rv-chip-base { background: #EEEDFE; color: #3C3489; }
.rv-chip-spd  { background: #E1F5EE; color: #085041; }
.rv-chip-zero { background: #FCEBEB; color: #791F1F; }
.rv-expl    { padding: 0 14px 12px; font-size: 12px; color: #6b7280; line-height: 1.6; border-top: 1px solid #f3f4f6; padding-top: 10px; }
.rv-empty   { text-align: center; padding: 2rem; color: #9ca3af; font-size: 14px; }

/* ── CLOCK RESPONSIVE ────────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .cd-clock-box  { width: 64px; height: 64px; border-radius: 12px; }
  .cd-clock-num  { font-size: 34px; }
  .cd-clock-sep  { font-size: 26px; padding: 0 4px; }
  .cd-rect-ad:not(:empty) { min-height: 200px; }
}
@media (max-width: 320px) {
  .cd-clock-box  { width: 54px; height: 54px; border-radius: 10px; }
  .cd-clock-num  { font-size: 28px; }
  .cd-clock-sep  { font-size: 22px; }
}

/* ── COUNTDOWN LEADERBOARD CARD ──────────────────────────────────────────── */
/* Sits on purple gradient so we lighten the card slightly */
.cd-lb-card {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.2) !important;
  backdrop-filter: blur(8px);
}
.cd-lb-card .lb-title  { color: #EEEDFE; }
.cd-lb-card .lb-tab    { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #AFA9EC; }
.cd-lb-card .lb-tab:hover  { background: rgba(255,255,255,0.2); color: #EEEDFE; }
.cd-lb-card .lb-tab.active { background: #EEEDFE; color: #534AB7; border-color: #EEEDFE; }
.cd-lb-card .lb-row    { background: rgba(255,255,255,0.08); }
.cd-lb-card .lb-row.lb-me { background: rgba(238,237,254,0.25); border-color: rgba(255,255,255,0.3); }
.cd-lb-card .lb-row.lb-top-1 { background: rgba(250,238,218,0.2); }
.cd-lb-card .lb-row.lb-top-2 { background: rgba(241,239,232,0.15); }
.cd-lb-card .lb-row.lb-top-3 { background: rgba(225,245,238,0.15); }
.cd-lb-card .lb-username { color: #EEEDFE; }
.cd-lb-card .lb-acc    { color: #AFA9EC; }
.cd-lb-card .lb-pts    { color: #EEEDFE; }
.cd-lb-card .lb-pts-lbl { color: #AFA9EC; }
.cd-lb-card .lb-you    { background: #EEEDFE; color: #534AB7; }
.cd-lb-card .lb-rank   { color: #AFA9EC; }
.cd-lb-card .lb-streak { color: #FAC775; }
.cd-lb-card .lb-empty  { color: #AFA9EC; }

/* ── LEADERBOARD FILTER ROW ──────────────────────────────────────────────── */
.lb-filter-row {
  padding: 8px 16px 0; display: flex; gap: 6px; flex-wrap: wrap;
  border-top: 1px solid #f3f4f6;
}
.lb-filter-btn {
  padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 700;
  cursor: pointer; border: 1.5px solid #e5e7eb;
  background: #f9fafb; color: #6b7280; font-family: inherit; transition: all .15s;
}
.lb-filter-btn:hover  { background: #EEEDFE; border-color: #AFA9EC; color: #534AB7; }
.lb-filter-btn.active { background: #26215C; color: #EEEDFE; border-color: #26215C; }

/* ── USER TYPE PILLS ON LEADERBOARD ROWS ─────────────────────────────────── */
.lb-type-pill {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 20px; margin-left: 5px; vertical-align: middle;
}
.lb-type-undergraduate { background: #E1F5EE; color: #085041; }
.lb-type-postgraduate  { background: #EEEDFE; color: #3C3489; }
.lb-type-professional  { background: #FAEEDA; color: #633806; }

/* ── STATS USER TYPE BADGE ───────────────────────────────────────────────── */
.stats-user-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.stats-type-badge {
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.stats-type-undergraduate { background: #E1F5EE; color: #085041; }
.stats-type-postgraduate  { background: #EEEDFE; color: #3C3489; }
.stats-type-professional  { background: #FAEEDA; color: #633806; }
.stats-rank-label {
  font-size: 11px; color: #9ca3af; margin-bottom: 8px;
  text-align: center; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── COUNTDOWN LEADERBOARD FILTER ON PURPLE BG ───────────────────────────── */
.cd-lb-card .lb-filter-row { border-color: rgba(255,255,255,0.1); }
.cd-lb-card .lb-filter-btn { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #AFA9EC; }
.cd-lb-card .lb-filter-btn:hover  { background: rgba(255,255,255,0.2); color: #EEEDFE; }
.cd-lb-card .lb-filter-btn.active { background: #EEEDFE; color: #26215C; border-color: #EEEDFE; }

/* ── LEADERBOARD TYPE TOGGLE (undergraduate / postgraduate / professional) ── */
.lb-type-toggle {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; border-top: 1px solid #f0f0f0;
}
.lb-type-btn {
  padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid #e5e7eb; background: #f9fafb; color: #6b7280;
  cursor: pointer; transition: all .15s;
}
.lb-type-btn:hover  { background: #f3f4f6; color: #374151; }
.lb-type-btn.active { background: #26215C; color: #fff; border-color: #26215C; }

/* lb-type-toggle on purple-background cards (e.g. countdown leaderboard) */
.cd-lb-card .lb-type-toggle { border-color: rgba(255,255,255,0.1); }
.cd-lb-card .lb-type-btn { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #AFA9EC; }
.cd-lb-card .lb-type-btn:hover  { background: rgba(255,255,255,0.2); color: #EEEDFE; }
.cd-lb-card .lb-type-btn.active { background: #EEEDFE; color: #26215C; border-color: #EEEDFE; }

/* ── YESTERDAY'S QUIZ MODAL ──────────────────────────────────────────────── */
.yd-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(20, 15, 60, 0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.28s ease;
}
.yd-modal-overlay--visible { opacity: 1; }

.yd-modal {
  background: linear-gradient(160deg, #2d1b8e 0%, #534AB7 100%);
  border: 1.5px solid rgba(175,169,236,0.35);
  border-radius: 22px;
  padding: 32px 24px 24px;
  max-width: 320px; width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  transform: translateY(16px);
  transition: transform 0.28s ease;
}
.yd-modal-overlay--visible .yd-modal { transform: translateY(0); }

.yd-modal-icon {
  font-size: 52px; margin-bottom: 12px; line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.yd-modal-title {
  font-size: 18px; font-weight: 800; color: #EEEDFE;
  margin: 0 0 10px; line-height: 1.3;
}
.yd-modal-msg {
  font-size: 13px; color: #AFA9EC; line-height: 1.65;
  margin: 0 0 20px;
}
.yd-modal-msg strong { color: #EEEDFE; }

.yd-modal-countdown-wrap {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 20px;
}
.yd-modal-countdown-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: #AFA9EC; margin-bottom: 6px;
}
.yd-modal-countdown-value {
  font-size: 30px; font-weight: 900; color: #EEEDFE;
  font-variant-numeric: tabular-nums; letter-spacing: 1px;
  font-family: system-ui, -apple-system, sans-serif;
}

.yd-modal-btn {
  width: 100%; padding: 13px;
  background: #EEEDFE; color: #3C3489;
  border: none; border-radius: 12px;
  font-size: 14px; font-weight: 800;
  cursor: pointer; letter-spacing: 0.3px;
  transition: background 0.15s, transform 0.1s;
}
.yd-modal-btn:hover  { background: #fff; }
.yd-modal-btn:active { transform: scale(0.98); }

/* ── COMPLETED CARD — next quiz countdown ────────────────────────────────── */
.qlc-next-wrap {
  background: linear-gradient(135deg, #2D1B8E 0%, #1A1060 100%);
  border: 1.5px solid rgba(180,100,255,0.5);
  border-radius: 18px;
  padding: 20px 16px 16px;
  margin: 20px 0 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 32px rgba(140,80,255,0.25), 0 4px 20px rgba(0,0,0,0.3);
}
/* Top neon glow line */
.qlc-next-wrap::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 2px;
  background: linear-gradient(90deg, transparent, #C084FC, #A78BFA, #C084FC, transparent);
  border-radius: 999px;
  box-shadow: 0 0 12px #C084FC, 0 0 24px rgba(192,132,252,0.5);
}
/* Subtle radial glow behind clock */
.qlc-next-wrap::after {
  content: '';
  position: absolute; top: 30%; left: 50%; transform: translate(-50%,-50%);
  width: 200px; height: 100px;
  background: radial-gradient(ellipse, rgba(167,139,250,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.qlc-next-label {
  font-size: 10px; font-weight: 800; letter-spacing: 3px;
  text-transform: uppercase; color: #C084FC; margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(192,132,252,0.8);
}
.qlc-next-clock {
  display: flex; align-items: center; justify-content: center; gap: 0;
  margin-bottom: 12px; position: relative; z-index: 1;
}
.qlc-next-unit { display: flex; flex-direction: column; align-items: center; }
.qlc-next-box {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(192,132,252,0.5);
  border-radius: 12px;
  width: 70px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 900; color: #fff;
  font-variant-numeric: tabular-nums;
  font-family: system-ui, -apple-system, sans-serif;
  position: relative; overflow: hidden;
  box-shadow: 0 0 16px rgba(192,132,252,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  text-shadow: 0 0 20px rgba(216,180,254,0.9), 0 0 40px rgba(192,132,252,0.5);
  animation: digit-pulse 2s ease-in-out infinite;
}
@keyframes digit-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(192,132,252,0.3), inset 0 1px 0 rgba(255,255,255,0.1); }
  50%       { box-shadow: 0 0 28px rgba(192,132,252,0.55), inset 0 1px 0 rgba(255,255,255,0.15); }
}
.qlc-next-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: rgba(255,255,255,0.06); border-radius: 12px 12px 0 0;
}
/* Shimmer sweep on each box */
.qlc-next-box::after {
  content: '';
  position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  animation: box-shimmer 3s ease-in-out infinite;
  border-radius: 12px;
}
@keyframes box-shimmer {
  0%   { left: -60%; }
  60%, 100% { left: 120%; }
}
.qlc-next-lbl {
  font-size: 9px; color: #A78BFA; letter-spacing: 2.5px;
  text-transform: uppercase; font-weight: 700; margin-top: 7px;
  text-shadow: 0 0 8px rgba(167,139,250,0.6);
}
.qlc-next-sep {
  font-size: 28px; font-weight: 900;
  color: #C084FC;
  padding: 0 6px; margin-bottom: 20px; align-self: center;
  font-family: system-ui, -apple-system, sans-serif;
  text-shadow: 0 0 12px rgba(192,132,252,0.9);
  animation: sep-blink 1s step-end infinite;
}
@keyframes sep-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
.qlc-next-sub {
  font-size: 12px; color: #A78BFA; margin-top: 4px;
  position: relative; z-index: 1;
}
.qlc-next-sub strong { color: #E9D5FF; font-weight: 700; }

/* ── LEADERBOARD PEEK TOGGLE ─────────────────────────────────────────────── */
.lb-peek-row {
  padding: 8px 12px 4px;
  display: flex;
  justify-content: flex-end;
}
.lb-peek-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(175,169,236,0.25);
  border-radius: 999px;
  color: #AFA9EC;
  font-size: 11px; font-weight: 700;
  padding: 5px 14px;
  cursor: pointer;
  font-family: system-ui, -apple-system, sans-serif;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  letter-spacing: 0.3px;
}
.lb-peek-btn:hover {
  background: rgba(175,169,236,0.15);
  color: #EEEDFE;
  border-color: rgba(175,169,236,0.5);
}
.lb-peek-btn.lb-peek-active {
  background: rgba(250,199,117,0.12);
  border-color: rgba(250,199,117,0.35);
  color: #FAC775;
}
.lb-peek-btn.lb-peek-active:hover {
  background: rgba(250,199,117,0.2);
}

/* ══════════════════════════════════════════════
   Pre-quiz preference screen
   ══════════════════════════════════════════════ */
.prequiz-shell {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 1.5rem; background: #0e0030;
}
.prequiz-card {
  background: linear-gradient(160deg,#1a0050 0%,#0e0030 100%);
  border: 1.5px solid rgba(83,74,183,0.6);
  border-radius: 22px; padding: 2rem 1.5rem;
  width: 100%; max-width: 380px; text-align: center;
  animation: prequizIn .5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes prequizIn {
  from { opacity:0; transform:scale(0.9) translateY(16px) }
  to   { opacity:1; transform:scale(1) translateY(0) }
}
.prequiz-icon { font-size: 48px; margin-bottom: 12px; }
.prequiz-title {
  font-size: 22px; font-weight: 800; color: #EEEDFE;
  margin-bottom: 10px;
}
.prequiz-sub {
  font-size: 14px; color: #AFA9EC; line-height: 1.6;
  margin-bottom: 24px;
}
.prequiz-sub strong { color: #EF9F27; }

/* Toggle row */
.prequiz-toggle-wrap {
  display: flex; align-items: center; gap: 14px;
  background: rgba(83,74,183,0.15);
  border: 1px solid rgba(83,74,183,0.35);
  border-radius: 14px; padding: 14px;
  margin-bottom: 14px; text-align: left;
}
.prequiz-toggle-label { flex: 1; }
.prequiz-toggle-title {
  font-size: 13px; font-weight: 700; color: #EEEDFE; margin-bottom: 3px;
}
.prequiz-toggle-desc {
  font-size: 11px; color: #7F77DD; line-height: 1.4;
}
/* Toggle switch */
.prequiz-toggle {
  width: 44px; height: 26px; border-radius: 13px; flex-shrink: 0;
  background: rgba(83,74,183,0.3); border: 1.5px solid rgba(83,74,183,0.5);
  cursor: pointer; position: relative; transition: background .2s, border-color .2s;
  padding: 0;
}
.prequiz-toggle.on {
  background: #1D9E75; border-color: #1D9E75;
}
.prequiz-toggle-knob {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; position: absolute; top: 3px; left: 3px;
  transition: transform .2s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.prequiz-toggle.on .prequiz-toggle-knob { transform: translateX(18px); }

.prequiz-note {
  font-size: 12px; font-weight: 600; color: #7F77DD;
  margin-bottom: 24px; min-height: 18px;
}
.prequiz-start-btn {
  width: 100%; padding: 14px; border-radius: 14px;
  background: linear-gradient(135deg,#534AB7,#1D9E75);
  border: none; color: #fff; font-size: 16px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 20px rgba(83,74,183,0.4);
  transition: opacity .15s, transform .15s;
}
.prequiz-start-btn:hover { opacity: .9; transform: translateY(-1px); }
.prequiz-start-btn:active { transform: scale(.97); }

/* ══════════════════════════════════════════════
   In-quiz timer progress bar + bonus label
   ══════════════════════════════════════════════ */
.quiz-timer-bar-wrap {
  padding: 0 16px 14px;
}
.quiz-timer-bar-row {
  display: flex; align-items: center; gap: 10px;
}
.quiz-timer-bar-track {
  flex: 1; height: 7px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden;
}
.quiz-timer-bar-fill {
  height: 100%; border-radius: 99px;
  width: 100%;
  background: linear-gradient(90deg,#1D9E75,#5DCAA5);
  transition: width 1s linear, background .5s ease;
}
.quiz-timer-bonus {
  font-size: 13px; font-weight: 800;
  color: #5DCAA5; min-width: 36px;
  text-align: right; transition: color .5s ease;
  letter-spacing: -.5px;
}
