/* ===============================
   GLOBAL QUIZ STYLE
   =============================== */

.ql-quiz {
  max-width: 760px;
  margin: 40px auto 60px;
  padding: 32px 28px 36px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Each question card */
.ql-question {
  padding: 20px 18px 22px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  margin-bottom: 18px;
}

.ql-question h4 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

/* Answer buttons */
.ql-answer-btn {
  display: inline-block;
  margin: 0 10px 10px 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
  transition: all 0.16s ease-out;
}

.ql-answer-btn:hover {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.ql-answer-btn.selected {
  background: #eef2ff;
  border-color: #4f46e5;
  color: #111827;
}

.ql-answer-btn.disabled,
.ql-answer-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Per-question feedback line */
.ql-feedback {
  font-size: 14px;
  margin-top: 8px;
  color: #111827;
}

/* Submit area */
.ql-submit-wrap {
  margin-top: 24px;
  text-align: right;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.ql-submit-quiz {
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: #4f46e5;
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ql-submit-quiz:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(79, 70, 229, 0.45);
}

.ql-submit-quiz:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
}

.ql-final-result {
  font-size: 15px;
  color: #111827;
}

/* Monthly total line – keep it visible and slightly bold */
.ql-quiz #my-score {
  font-weight: 700;
}

/* ===============================
   LEADERBOARD STYLING
   =============================== */

.ql-leaderboard {
  max-width: 980px;
  margin: 40px auto;
  padding: 24px;
  border-radius: 24px;
  /* background: radial-gradient(circle at top left, #7c4dff, #4527a0); */
  color: #f9f5ff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.ql-lb-title {
  margin: 0 0 18px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Inner card */
.ql-lb-card {
  background: rgba(7, 5, 22, 0.9);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Header + rows: Rank | Player | Points | Plays */
.ql-lb-header-row,
.ql-lb-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 80px 80px; /* Rank | Player | Points | Plays */
  align-items: center;
  padding: 11px 20px;
  column-gap: 12px;
}

.ql-lb-header-row {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0)
  );
  font-weight: 600;
}

/* Scroll wrapper for rows */
.ql-lb-rows {
  max-height: 420px;
  overflow-y: auto;
}

/* Row visuals */
.ql-lb-row {
  font-size: 14px;
  position: relative;
  color: #f5f3ff;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.ql-lb-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.ql-lb-row:nth-child(even) {
  background: rgba(0, 0, 0, 0.16);
}

.ql-lb-row:hover {
  background: rgba(124, 77, 255, 0.45);
  transform: translateY(-1px);
}

/* generic cell */
.ql-lb-cell {
  display: flex;
  align-items: center;
}

/* Rank + Player left aligned */
.ql-lb-rank,
.ql-lb-player {
  justify-content: flex-start;
}

/* Rank cell extra styling */
.ql-lb-rank {
  gap: 8px;
}

.ql-lb-rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 13px;
}

/* medals top 3 */
.ql-medal {
  font-size: 18px;
}

.ql-medal-gold   { filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.8)); }
.ql-medal-silver { filter: drop-shadow(0 0 4px rgba(224, 224, 224, 0.8)); }
.ql-medal-bronze { filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.8)); }

/* Player column */
.ql-lb-player {
  gap: 10px;
}

.ql-player-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* POINTS / PLAYS — center for both header & rows */
.ql-lb-header-row .ql-lb-cell:nth-child(3),
.ql-lb-header-row .ql-lb-cell:nth-child(4),
.ql-lb-points,
.ql-lb-plays {
  justify-content: center;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ===== Logged-in user highlight (NO "YOU" text) ===== */

.ql-lb-row.ql-lb-me {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.20), rgba(0, 0, 0, 0.75));
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.9);
}

.ql-lb-row.ql-lb-me:hover {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.30), rgba(0, 0, 0, 0.85));
}

/* small green dot before your name */
.ql-me-dot {
  width: 10px;
  height: 10px;
  background: #00e676;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.9);
  display: inline-block;
}

/* empty state */
.ql-lb-empty {
  text-align: center;
  margin: 30px 0;
  opacity: 0.8;
}

/* --- "Your position this month" bar (for ranks > limit) --- */
.ql-lb-me-summary {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(7, 5, 22, 0.9);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #f9fafb;
}

.ql-lb-me-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  opacity: 0.85;
}

.ql-lb-me-rank {
  font-weight: 700;
}

.ql-lb-me-points,
.ql-lb-me-plays {
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}

/* Custom thin scrollbar (rows only) */
.ql-lb-rows::-webkit-scrollbar {
  width: 8px;
}
.ql-lb-rows::-webkit-scrollbar-track {
  background: #111827;
  border-radius: 999px;
}
.ql-lb-rows::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 999px;
}
.ql-lb-rows::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 640px) {
  .ql-leaderboard {
    margin: 24px 12px 40px;
    padding: 18px 14px 20px;
  }

  .ql-lb-title {
    font-size: 22px;
  }

  .ql-lb-header-row,
  .ql-lb-row {
    padding: 10px 12px;
    grid-template-columns: 70px minmax(0, 1.8fr) 70px 70px;
  }

  .ql-lb-rank-number {
    width: 32px;
  }
}

/* Extra responsive tweaks shared with quiz */
@media (max-width: 600px) {
  .ql-quiz,
  .ql-leaderboard {
    margin: 24px 12px 40px;
    padding: 20px 16px 22px;
  }

  .ql-question {
    padding: 16px 12px 18px;
  }

  .ql-submit-wrap {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .ql-submit-quiz {
    width: 100%;
    text-align: center;
  }
}

/* HIDE rank numbers for Top-3 */
.ql-lb-row:nth-child(1) .ql-lb-rank-number,
.ql-lb-row:nth-child(2) .ql-lb-rank-number,
.ql-lb-row:nth-child(3) .ql-lb-rank-number {
  display: none !important;
}

/* Make medal aligned properly when number is removed */
.ql-lb-row:nth-child(1) .ql-lb-rank,
.ql-lb-row:nth-child(2) .ql-lb-rank,
.ql-lb-row:nth-child(3) .ql-lb-rank {
  gap: 4px !important;
}

/* Optional: Slightly enlarge medals for Top-3 */
.ql-lb-row:nth-child(1) .ql-medal,
.ql-lb-row:nth-child(2) .ql-medal,
.ql-lb-row:nth-child(3) .ql-medal {
  font-size: 20px !important;
}

/* LOGIN REQUIRED CARD — Animated Neon + Glow (upgrade) */
.ql-login-card {
  max-width: 980px;
  margin: 60px auto;
  padding: 0 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Animated background + border glow container */
.ql-login-inner {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 50px 48px;
  min-height: 260px;
  color: #e8f8ff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
  /* subtle inner shadow */
  box-shadow: 0 18px 40px rgba(5, 10, 20, 0.45);
}

/* animated gradient background (breathing) */
.ql-login-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 28px;
  background: linear-gradient(135deg,
    rgba(0, 26, 255, 1) 0%,
    rgba(0, 229, 255, 0.85) 40%,
    rgba(6, 29, 47, 1) 100%);
  background-size: 300% 300%;
  animation: ql-bg-breathe 12s ease-in-out infinite;
  filter: saturate(1.05) contrast(1.02);
  transform: translateZ(0);
}

/* soft glowing frame (pulsing) */
.ql-login-inner::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 26px;
  padding: 2px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0,230,255,0.08), rgba(0,140,255,0.06));
  box-shadow:
    0 6px 30px rgba(0,140,255,0.10),
    0 0 60px rgba(0,230,255,0.06) inset;
  mix-blend-mode: screen;
  animation: ql-glow-pulse 6s ease-in-out infinite;
}

/* Sheen / streak moving across */
.ql-login-sheen {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: -30% -40%;
  transform: rotate(-18deg);
  opacity: 0.08;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.28) 50%, transparent 100%);
  filter: blur(20px);
  animation: ql-sheen-move 10s linear infinite;
}

/* content should sit above decorations */
.ql-login-inner > * { position: relative; z-index: 3; }

/* Heading */
.ql-login-heading {
  margin: 0 0 14px;
  font-size: 40px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

/* Subtitle */
.ql-login-text {
  margin: 0 0 28px;
  font-size: 17px;
  line-height: 1.55;
  max-width: 640px;
  color: #dffaff;
  opacity: 0.92;
}

/* Button — stronger glow, subtle bounce */
.ql-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  border-radius: 999px;
  background: linear-gradient(180deg,#ffd429 0%, #ffbf00 100%);
  color: #071019;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow:
    0 12px 30px rgba(255,200,40,0.25),
    0 0 14px rgba(255,200,40,0.20);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  z-index: 3;
}

/* hover / active */
.ql-login-btn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 42px rgba(255,200,40,0.35),
    0 0 26px rgba(255,200,40,0.35);
}
.ql-login-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(255,200,40,0.25);
}

/* micro pulse for primary CTA (slow) */
.ql-login-btn { animation: ql-cta-pulse 6s ease-in-out infinite; }

/* Accessibility / reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ql-login-inner::before,
  .ql-login-inner::after,
  .ql-login-sheen,
  .ql-login-btn { animation: none !important; transition: none !important; }
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .ql-login-inner { padding: 34px 22px; min-height: 220px; border-radius: 18px; }
  .ql-login-heading { font-size: 30px; }
  .ql-login-text { font-size: 15px; max-width: 100%; }
  .ql-login-btn { width: 100%; padding: 14px 0; justify-content: center; }
}

/* ============= KEYFRAMES ============= */
@keyframes ql-bg-breathe {
  0% { background-position: 0% 45%; }
  50% { background-position: 100% 55%; }
  100% { background-position: 0% 45%; }
}
@keyframes ql-glow-pulse {
  0% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.01); }
  100% { opacity: 0.85; transform: scale(1); }
}
@keyframes ql-sheen-move {
  0% { transform: translateX(-60%) rotate(-18deg); opacity: 0.06; }
  50% { transform: translateX(20%) rotate(-18deg); opacity: 0.12; }
  100% { transform: translateX(120%) rotate(-18deg); opacity: 0.06; }
}
@keyframes ql-cta-pulse {
  0% { box-shadow: 0 12px 30px rgba(255,200,40,0.25); transform: translateY(0); }
  50% { box-shadow: 0 20px 44px rgba(255,200,40,0.30); transform: translateY(-2px); }
  100% { box-shadow: 0 12px 30px rgba(255,200,40,0.25); transform: translateY(0); }
}

/* ===============================
   AUTH PAGE (LOGIN / REGISTER) — Purple / Dark Card style (responsive)
   Restores previous purple gradient visual + same mobile stacking
   =============================== */

.ql-auth-shell {
  max-width: 1100px;
  margin: 40px auto 70px;
  padding: 0 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  box-sizing: border-box;
}

/* 2-column layout on desktop */
.ql-auth-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: stretch;
}

/* LEFT: purple gradient visual box (big) */
.ql-auth-visual {
  background: linear-gradient(135deg, #7c4dff 0%, #3b2b6d 48%, #14121a 100%);
  border-radius: 26px;
  position: relative;
  overflow: hidden;
  padding: 36px 36px;
  display: flex;
  align-items: center;
  min-height: 320px;
  color: #fff;
  box-shadow: 0 30px 70px rgba(20, 14, 40, 0.18);
}

/* soft decorative glow */
.ql-auth-visual::before{
  content:"";
  position:absolute;
  inset:-30%;
  background: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.06), transparent 18%),
              radial-gradient(circle at 90% 80%, rgba(255,255,255,0.03), transparent 25%);
  mix-blend-mode: overlay;
  pointer-events:none;
}

/* content inside visual panel */
.ql-auth-visual-content {
  position: relative;
  z-index: 2;
  max-width: 520px;
}

/* small "Quiz Hub" badge */
.ql-auth-mini-badge {
  display:inline-flex;
  padding:6px 12px;
  border-radius:999px;
  background: rgba(255,255,255,0.12);
  color:#fff;
  font-size:11px;
  letter-spacing:0.06em;
  text-transform:uppercase;
  margin-bottom:12px;
}

/* large visual heading */
.ql-auth-visual-content h2{
  margin:0 0 10px;
  font-size:34px;
  line-height:1.02;
  font-weight:800;
  color:#fff;
  text-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

/* small description inside visual */
.ql-auth-visual-content p{
  margin:0;
  font-size:15px;
  color: rgba(255,255,255,0.92);
  opacity:0.92;
  max-width: 460px;
}

/* RIGHT: auth card (dark, but lighter than background) */
.ql-auth-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,255,0.98));
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(12,12,22,0.08);
  border: 1px solid rgba(12,12,22,0.04);
}

/* headings on card */
.ql-auth-title { margin: 0 0 8px; font-size:20px; font-weight:700; color:#0b1220; }
.ql-auth-subtitle { margin:0 0 18px; font-size:14px; color:#4b5563; line-height:1.5; }

/* Tabs style (pill) */
.ql-auth-tabs {
  display:inline-flex;
  background: #f1f4ff;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 16px;
  gap:6px;
}
.ql-auth-tab{
  min-width:110px;
  padding:8px 14px;
  border-radius:999px;
  font-size:13px;
  color:#344054;
  font-weight:600;
  text-decoration:none;
}
.ql-auth-tab.is-active{
  background: linear-gradient(90deg,#111827,#18212b);
  color:#fff;
  box-shadow: 0 10px 30px rgba(17,24,39,0.06);
}

/* Error box */
.ql-auth-errors{
  background:#fff4f4;
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:12px;
  font-size:13px;
  color:#B91C1C;
  border:1px solid rgba(185,28,28,0.06);
}

/* form / inputs */
.ql-auth-form { display:flex; flex-direction:column; gap:12px; }
.ql-auth-field span{ display:block; font-size:12px; margin-bottom:6px; color:#475569; }
.ql-auth-field input{
  width:100%;
  border-radius:12px;
  border:1px solid #e6e9ef;
  padding:12px 14px;
  font-size:15px;
  background:#fff;
  outline:none;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.ql-auth-field input:focus{
  border-color: rgba(124,77,255,0.95);
  box-shadow: 0 8px 30px rgba(124,77,255,0.08);
}

/* helpers row */
.ql-auth-row-between{ display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:13px; color:#6b7280; }
.ql-auth-remember{ display:inline-flex; align-items:center; gap:8px; }

/* primary button */
.ql-auth-btn-primary{
  margin-top:6px;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  padding:12px 18px;
  border-radius:999px;
  border:none;
  background: linear-gradient(90deg,#ffca2c,#ffb200);
  color:#0b1220;
  font-weight:800;
  font-size:15px;
  cursor:pointer;
  text-decoration:none;
  box-shadow: 0 18px 45px rgba(0,0,0,0.12);
}
.ql-auth-btn-primary:hover{ transform: translateY(-2px); }

/* alternative button */
.ql-auth-btn-secondary{
  display:inline-flex;
  padding:10px 16px;
  border-radius:999px;
  border:1px solid rgba(12,12,22,0.06);
  background:#fff;
  color:#0b1220;
  text-decoration:none;
}

/* logged-in card small actions */
.ql-auth-card.ql-auth-logged { text-align:left; }
.ql-auth-logged-actions { display:flex; gap:12px; margin-top:14px; flex-wrap:wrap; }

/* MOBILE: stack and put visual ON TOP */
@media (max-width: 800px) {
  .ql-auth-layout { grid-template-columns: 1fr; gap:18px; }
  .ql-auth-visual { order:-1; min-height:220px; padding:22px; border-radius:18px; }
  .ql-auth-card { order:0; padding:18px; border-radius:18px; }

  /* text scaling */
  .ql-auth-visual-content h2 { font-size:22px; }
  .ql-auth-visual-content p { font-size:14px; }

  /* tabs become full-width pills */
  .ql-auth-tabs{ width:100%; gap:8px; }
  .ql-auth-tab{ flex:1; min-width:0; padding:10px 12px; font-size:14px; }

  /* inputs & buttons full-width for touch */
  .ql-auth-field input{ padding:14px 14px; font-size:15px; }
  .ql-auth-btn-primary, .ql-auth-btn-secondary{ width:100%; display:block; }

  .ql-auth-row-between { flex-direction:column; align-items:flex-start; gap:8px; }
}

/* tiny phones */
@media (max-width:420px){
  .ql-auth-shell { padding: 0 10px; }
  .ql-auth-visual { padding:14px; min-height:180px; }
  .ql-auth-visual-content h2 { font-size:20px; }
  .ql-auth-title { font-size:18px; }
}


/* Modal overlay + card */
.ql-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 10, 14, 0.55);
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  box-sizing: border-box;
}

.ql-modal {
  background: linear-gradient(180deg,#0f1724 0%, #0b1220 100%);
  color: #f8fafc;
  width: 680px;
  max-width: 96%;
  border-radius: 14px;
  padding: 22px 20px;
  box-shadow: 0 20px 60px rgba(2,6,23,0.7);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform .22s cubic-bezier(.2,.9,.3,1), opacity .22s ease;
  position: relative;
}

/* "open" class toggles visible */
.ql-modal.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* close button */
.ql-modal-close {
  position: absolute;
  right: 12px;
  top: 8px;
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.ql-modal-close:hover { color: #fff; }

/* body + title */
.ql-modal-body { padding: 8px 8px 18px; }
.ql-modal-title {
  margin: 6px 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.ql-modal-content {
  color: #e6eef8;
  font-size: 15px;
  margin-bottom: 12px;
}

.ql-modal-summary { margin: 6px 0 12px; font-size: 15px; }

/* stats list */
.ql-modal-stats {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.ql-modal-stats li {
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 14px;
}

/* buttons */
.ql-modal-actions {
  display:flex;
  gap:10px;
  justify-content:flex-end;
  align-items:center;
  margin-top: 10px;
}
.ql-modal-button {
  display:inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: #e6eef8;
}
.ql-modal-button:hover { background: rgba(255,255,255,0.09); }

/* leaderboard CTA */
.ql-modal-leaderboard {
  background: linear-gradient(90deg,#7c3aed,#4f46e5);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
}

/* small responsive tweak */
@media (max-width: 520px) {
  .ql-modal { padding: 18px 12px; width: 96%; }
  .ql-modal-title { font-size: 18px; }
}

/* ---------- GRID ANSWER LAYOUT (2-up / 2-down) ---------- */

/* container of single question */
.ql-question {
  padding: 20px 18px 22px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  margin-bottom: 18px;
  box-sizing: border-box;
}

/* question title */
.ql-question h4 {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

/* the options wrapper becomes a 2-column grid */
.ql-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* two columns always */
  gap: 12px;
  align-items: stretch;
}

/* each option container inside the grid (keeps consistent spacing) */
.ql-opt {
  margin: 0; /* grid handles spacing */
}

/* answer button style — full width of grid cell */
.ql-answer-btn {
  width: 100%;
  height: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e6e6e6;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  text-align: left;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  box-sizing: border-box;
}

/* hover + focus */
.ql-answer-btn:hover,
.ql-answer-btn:focus {
  border-color: #7c4dff;
  box-shadow: 0 6px 20px rgba(124,77,255,0.08);
  transform: translateY(-2px);
  outline: none;
}

/* selected state */
.ql-answer-btn.selected {
  background: linear-gradient(90deg, rgba(79,70,229,0.08), rgba(124,77,255,0.04));
  border-color: #4f46e5;
  box-shadow: 0 10px 24px rgba(79,70,229,0.08);
}

/* disabled look after submit */
.ql-answer-btn.disabled,
.ql-answer-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Option content: optional image on left + label text */
.ql-answer-content {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}

/* image: keep consistent size and cover */
.ql-answer-thumb {
  width: 76px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f3f4f6;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.02);
}
.ql-answer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* label area (text) */
.ql-answer-label {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.ql-answer-label .ql-option-key {
  font-weight: 700;
  color: #374151;
  margin-bottom: 4px;
}
.ql-answer-label .ql-option-text {
  color: #4b5563;
  font-size: 14px;
}

/* If option has no image, hide the thumb and let text take full width */
.ql-answer-btn.no-thumb .ql-answer-thumb { display: none; }

/* Make sure the 2x2 arrangement looks good on small phones:
   keep two columns but reduce gaps and make the option image smaller */
@media (max-width: 420px) {
  .ql-options { gap: 8px; grid-template-columns: repeat(2, 1fr); }
  .ql-answer-thumb { width: 56px; height: 40px; }
  .ql-answer-btn { padding: 12px; font-size: 14px; border-radius: 10px; }
}

/* Single-column fallbacks: if you prefer on tiny phones to force single column,
   change grid-template-columns: repeat(2,1fr) to 1fr here — but you asked to keep 2x2,
   so we intentionally keep two columns on all sizes. */

/* final submit area (styling retained) */
.ql-submit-wrap { margin-top: 20px; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.ql-submit-quiz { padding: 12px 20px; border-radius: 999px; background: #4f46e5; color:#fff; border: 0; }

/* Make answers render 2-up x 2-down even on mobile */
.ql-question .ql-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-items: stretch;
}

/* Each option button full cell */
.ql-answer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e6e6e6;
  background: #fff;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

/* small thumbnail support inside button */
.ql-answer-thumb {
  width: 76px;
  height: 56px;
  overflow: hidden;
  border-radius: 8px;
  background: #f3f4f6;
  flex-shrink: 0;
}
.ql-answer-thumb img { width:100%; height:100%; object-fit:cover; display:block; }

/* If there is no thumb */
.ql-answer-btn.no-thumb .ql-answer-thumb { display: none; }

/* selected appearance */
.ql-answer-btn.selected {
  background: linear-gradient(90deg, rgba(79,70,229,0.06), rgba(124,77,255,0.02));
  border-color: #4f46e5;
  box-shadow: 0 8px 26px rgba(79,70,229,0.06);
}

/* hide other questions */
.ql-hidden-question { display: none; }

/* Pager / Next button */
.ql-pager-wrap { margin-top: 18px; display:flex; justify-content:center; }
.ql-pager { width: 100%; max-width: 760px; display:flex; justify-content:space-between; align-items:center; gap:12px; box-sizing:border-box; }
.ql-next-btn {
  background: #4f46e5;
  color: #fff;
  border: 0;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.ql-next-btn.disabled, .ql-next-btn[disabled] { opacity: 0.6; cursor: default; }

/* smaller devices tweak (keeps two columns but reduces gaps) */
@media (max-width: 420px){
  .ql-question .ql-options { gap: 8px; grid-template-columns: repeat(2, 1fr); }
  .ql-answer-thumb { width: 56px; height:40px; }
  .ql-answer-btn { padding: 12px; font-size: 14px; border-radius: 10px; }
  .ql-pager { padding: 0 12px; }
}

/* Grid layout for answers: 2 columns (2 x 2) */
.ql-answers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}

/* Make answer buttons full width within their grid cell */
.ql-answer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid #e6e7ee;
  background: #fff;
  box-shadow: 0 6px 18px rgba(11, 15, 30, 0.02);
  cursor: pointer;
  text-align: left;
  min-height: 56px;
}

/* If your option includes an image */
.ql-answer-btn img {
  max-width: 72px;
  max-height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* textual part */
.ql-answer-btn .ql-opt-key {
  font-weight:700;
  margin-right:6px;
  color:#222;
}
.ql-answer-btn .ql-opt-body {
  display:block;
  color:#111;
  line-height:1.15;
  overflow:hidden;
}

/* Selected visual */
.ql-answer-btn.selected {
  outline: 0;
  border-color: #5b46ff;
  background: linear-gradient(180deg,#f0f2ff,#eef2ff);
  box-shadow: 0 12px 32px rgba(79,70,229,0.12);
}

/* disabled */
.ql-answer-btn.disabled, .ql-answer-btn:disabled { opacity: .6; cursor: default; }

/* Pager buttons */
.ql-pager { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:18px; }
.ql-pager .ql-prev-btn, .ql-pager .ql-next-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.ql-pager .ql-prev-btn[disabled], .ql-pager .ql-next-btn[disabled] {
  opacity: 0.45;
  cursor: default;
  transform:none;
}

/* Responsive: on small screens keep 2 columns but adjust image sizes */
@media (max-width: 560px) {
  .ql-answers-grid {
    grid-template-columns: 1fr 1fr; /* still 2x2 */
    gap: 10px;
  }
  .ql-answer-btn {
    padding: 12px 12px;
    min-height: 62px;
  }
  .ql-answer-btn img { max-width: 64px; max-height: 48px; }
  .ql-pager { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .ql-pager .ql-prev-btn, .ql-pager .ql-next-btn { width: 100%; }
}

/* Add gap between Prev and Next buttons on mobile */
@media (max-width: 560px) {
  .ql-pager .ql-prev-btn,
  .ql-pager .ql-next-btn {
    margin-bottom: 10px; /* space between buttons */
  }

  /* remove extra space below the last button */
  .ql-pager .ql-prev-btn:last-child,
  .ql-pager .ql-next-btn:last-child {
    margin-bottom: 0;
  }
}


.ql-quiz-locked {
  max-width: 760px;
  margin: 40px auto;
  padding: 24px 22px;
  /* background: #0f172a; */
  color: #e5f2ff;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
}

.ql-quiz-locked h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.ql-quiz-locked p {
  margin: 4px 0;
}

/* === Image inside option buttons (safe addition) === */
/* This makes any <img> inside an option button display nicely
   and stay within ~300x300px without changing your layout. */
.ql-question .ql-answer-btn img {
  max-width: 300px;
  max-height: 300px;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin-top: 8px; /* a bit of space under the A) text */
}

/* ===========================================
   OPTION IMAGE + CAPTION LAYOUT
   Image on top, "A) Naruto" text below
   =========================================== */

.ql-option-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ql-option-image {
  width: 100%;
}

.ql-option-image img {
  display: block;
  max-width: 300px;
  max-height: 300px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

.ql-option-text {
  margin-top: 8px;
  text-align: center;
  font-size: 14px;
  color: #111827;
}

.ql-option-text .ql-option-key {
  font-weight: 600;
  margin-right: 4px;
}
/* -------------------------
   Mobile leaderboard fixes
   Target small screens so header/title, player and numeric columns align
   ------------------------- */
@media (max-width: 640px) {

  /* Make the section title visible and not washed-out on mobile */
  .ql-lb-title {
    color: #111827;        /* darker so it's readable on light backgrounds */
    opacity: 0.98;
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.15;
  }

  /* Reduce internal padding so content fits better on small widths */
  .ql-lb-card {
    padding: 0;
    border-radius: 14px;
  }

  /* Use tighter grid columns: fixed narrow ranks + pts/plays, flexible middle for player */
  .ql-lb-header-row,
  .ql-lb-row {
    grid-template-columns: 56px minmax(0, 1fr) 56px 56px !important;
    padding: 8px 12px;
    gap: 10px;
    align-items: center;
  }

  /* Slightly smaller header text on mobile */
  .ql-lb-header-row {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  /* Make each row slightly taller and keep content vertically centered */
  .ql-lb-row {
    font-size: 13px;
    padding: 10px 12px;
    min-height: 52px;
  }

  /* Ensure the player name truncates neatly and doesn't push numeric columns */
  .ql-player-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
  }

  /* Keep rank & medal area compact */
  .ql-lb-rank {
    gap: 8px;
    min-width: 56px;
  }
  .ql-lb-rank-number { width: 34px; height: 28px; }

  /* Center the numeric columns (Points / Plays) */
  .ql-lb-points,
  .ql-lb-plays {
    justify-content: center;
    text-align: center;
    min-width: 56px;
    font-variant-numeric: tabular-nums;
  }

  /* Slightly increase contrast of the header background so it reads better */
  .ql-lb-header-row {
    background: linear-gradient(
      to right,
      rgba(255,255,255,0.06),
      rgba(255,255,255,0.02)
    );
  }

  /* Reduce extra vertical scroll area on small screens */
  .ql-lb-rows {
    max-height: none;
  }

  /* Avoid the green highlight overflowing - keep box-shadow contained */
  .ql-lb-row.ql-lb-me {
    box-shadow: none;
    outline: 2px solid rgba(0,230,118,0.18);
  }
}

