:root{--brand:#264653;--accent:#2a9d8f;--bg:#ffffff;--beige:#fef1de;--pill:#f6d6a8;--green:#b7e4c7;--dark:#0b3d2e}
html,body{height:100%}
*,*::before,*::after{box-sizing:border-box}
body{font-family:"Times New Roman", Times, serif;margin:0;background:var(--bg);color:#111;display:flex;flex-direction:column;min-height:100vh}
.qp-nav-toggle{display:none}
.qp-hamburger{display:none}
.body-wm:before{content:"";position:fixed;inset:0;background:url('https://www.d2dacademy.in/assets/img/watermark.png') center/520px no-repeat;opacity:.08;pointer-events:none;z-index:-1}
.qp-topbar{
  background: var(--bg);
  border: none;
  box-shadow: none;
}

/* Card polish */
.card.frosted{
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.86));
  border:1px solid rgba(0,0,0,.06);
  backdrop-filter:saturate(160%) blur(6px);
  -webkit-backdrop-filter:saturate(160%) blur(6px);
  box-shadow:0 8px 20px rgba(38,70,83,.08);
}

.qp-wrap{max-width:1100px;margin:0 auto;padding:12px 16px;display:flex;align-items:center;justify-content:space-between}
.qp-wrap.qp-wrap--fluid{
  max-width:calc(100vw - 4mm);
  width:calc(100vw - 4mm);
  padding-left:2mm;
  padding-right:2mm;
}
.qp-brand{color:var(--brand);font-weight:700;text-decoration:none;display:flex;align-items:center;gap:10px}
.qp-brand-title{font-family:"Palatino Linotype","Book Antiqua",Palatino,serif;color:#f4a261;font-weight:700}
.qp-logo{height:48px;width:auto;border-radius:50%}
.qp-nav a{margin-left:12px;color:#111;text-decoration:none;border:1px solid #111;border-radius:999px;padding:6px 12px;background:#f3ede6}
/* Header menu button + panel for small screens */
.qp-menu-btn{display:none;margin-left:auto;border:1px solid #111;border-radius:999px;padding:6px 12px;background:#f3ede6;cursor:pointer}
.qp-menu-panel{display:none;position:fixed;right:12px;top:64px;background:#fef1de;border:1px solid #ddd;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12);padding:8px;min-width:180px;z-index:100}
.qp-menu-panel .item{display:block;padding:10px 12px;border-radius:8px;color:#111;text-decoration:none}
.qp-menu-panel .item:hover{background:#f3ede6}
.qp-menu-panel .logout{border-top:1px solid #eee;margin-top:6px;padding-top:12px}
.qp-menu-toggle:checked ~ .qp-menu-btn{background:#e8efe9}
.qp-menu-toggle:checked ~ .qp-menu-panel{display:block}
.card{background:transparent;border:none;border-radius:12px;padding:12px}
.grid{display:grid;gap:12px}
.grid-2{grid-template-columns:2fr 1fr}
.grid-3{grid-template-columns:repeat(3,1fr)}
.btn{display:inline-block;padding:8px 12px;border-radius:12px;background:var(--accent);color:#fef1de;text-decoration:none;border:0;cursor:pointer}
.btn-outline{background:#fef1de;color:#111;border:1px solid #ddd}
.input, select, textarea{width:100%;padding:8px;border-radius:8px;border:1px solid #ddd}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:8px;border-bottom:1px solid #eee;text-align:left}
.palette{display:grid;grid-template-columns:repeat(10,1fr);gap:8px}
.bubble{padding:8px;border-radius:8px;background:var(--pill);color:#222;text-align:center}
.bubble.is-answered{background:#b7e4c7}
.bubble.is-current{outline:3px solid #111}
.question{background:#ffe8cc;border-radius:16px;padding:12px;position:relative;margin-top:14px}
.options label{display:flex;gap:8px;align-items:center;margin:8px 0;padding:8px;border-radius:16px;background:#fef1de}
.options input[type=radio]{accent-color:var(--accent)}
.muted{color:#666}
.flex{display:flex;gap:12px}
.space-between{justify-content:space-between}
.timer{font-variant-numeric:tabular-nums;font-size:28px}

/* Dashboard layout */
.qp-shell{display:grid;grid-template-columns:300px 760px;gap:16px;min-height:60vh;justify-content:center}
.qp-shell.is-fluid{
  grid-template-columns:280px minmax(0,1fr);
  justify-content:stretch;
}
.qp-shell.is-fluid > section.card{width:auto}
.qp-sidebar{width:300px}
/* Fixed width main card on desktop */
.qp-shell > section.card{width:760px}
.qp-sidebar{background:#fef1de;border:1px solid #eee;border-radius:12px;padding:16px}
.qp-sidebar h4{margin-top:0;color:#333}
.qp-menu a{display:block;margin:8px 0;padding:12px 18px;border-radius:999px;text-decoration:none;text-align:center;border:1px solid #ddd}
.qp-menu a.primary{background:var(--green);color:var(--dark)}
.qp-menu a.secondary{background:var(--pill);color:#5b3412}
.qp-menu a.is-active{background:var(--pill);color:#111;border-color:#e4c195}
.qp-watermark{position:relative;background:rgba(255,255,255,0.88);}
.qp-watermark:before{content:"";position:absolute;inset:0;background:url('https://www.d2dacademy.in/assets/img/watermark.png') center/contain no-repeat;opacity:.08;pointer-events:none;border-radius:12px;z-index:-1}
/* When full-page watermark is active, avoid duplicate per-card watermark */
.body-wm .qp-watermark:before{display:none}
.body-wm .qp-watermark.wm-force:before{display:block}
/* UI chips */
.qp-chip{display:inline-block;padding:6px 12px;border-radius:999px;background:var(--green);color:var(--dark);font-weight:600;font-size:14px}
.qp-chip.beige{background:var(--pill);color:#5b3412}
.qp-chip.muted{background:#e7f5ef;color:#0b3d2e}

/* Test page layout */
.qp-test{display:grid;grid-template-columns:280px 1fr 280px;gap:16px;align-items:start;position:relative;background:rgba(255,255,255,0.95);padding:18px;border-radius:24px;box-shadow:0 12px 40px rgba(0,0,0,.04);}
.qp-quick,.qp-qpanel,.qp-qnav{border-radius:16px}
.qp-qpanel{position:relative}
.qp-qno{position:absolute;right:12px;top:8px;background:var(--green);color:var(--dark);padding:6px 10px;border-radius:4px;font-weight:700}
.qp-qno:after{content:"";position:absolute;right:-10px;top:0;border-top:14px solid transparent;border-bottom:14px solid transparent;border-left:10px solid var(--green)}
.qp-question-text{background:#f6d6a8;padding:12px;border-radius:18px;margin-top:14px}
.qp-options{margin-top:14px}
.qp-option{display:flex;align-items:center;gap:8px;margin:10px 0;padding:10px 14px;border-radius:20px;background:#f3ede6;cursor:pointer}
.qp-option input{accent-color:var(--accent)}
.qp-option.is-selected{background:var(--green);color:var(--dark);font-weight:600}
.qp-timer{font-variant-numeric:tabular-nums;font-size:36px;text-align:right}
.qp-nav-arrows{display:flex;justify-content:space-between;align-items:center;margin-top:14px}
.qp-arrow{background:#fef1de;border:1px solid #111;border-radius:999px;padding:8px 12px;cursor:pointer}
.qp-end{background:#e14b4b;color:#fef1de;border:0}

/* Right question navigator */
.qp-qgrid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.qp-qgrid .bubble{border-radius:8px;padding:8px 0}
/* In-test states */
.qp-qgrid .bubble.is-answered{background:#aee79d;color:#0b3d2e}
.qp-qgrid .bubble.is-skipped{background:var(--pill)}
.qp-qgrid .bubble.is-review{background:#264453;color:#fef1de}
.qp-qnav-body{max-height:calc(100vh - 220px);overflow:auto;padding-right:8px}
.qp-legend{margin-top:12px;background:var(--green);color:var(--dark);border-radius:14px;padding:10px}
.qp-legend .row{display:flex;justify-content:space-between}

/* Quick Preview accordion */
.qp-quick details{margin:10px 0}
.qp-quick summary{list-style:none;background:var(--pill);padding:12px 14px;border-radius:20px;cursor:pointer}
.qp-quick summary::-webkit-details-marker{display:none}
.qp-quick summary:after{content:"\25BE";float:right}
/* Buttons */
.qp-mark{background:#f4a261;color:#111}
.btn-mini{padding:4px 8px;border-radius:10px;font-size:12px}
/* Result states */
.bubble.correct{background:#aee79d;color:#0b3d2e}
.bubble.wrong{background:#e14b4b;color:#fef1de}
.bubble.unanswered{background:var(--pill)}
.progress{height:10px;background:#eee;border-radius:999px;overflow:hidden}
.progress > span{display:block;height:100%;background:#2a9d8f}

/* Footer */
.qp-footer{margin-top:auto;background:var(--brand);color:#f0f3f4}
.qp-footer a{color:#cde3ff;text-decoration:none}
.qp-footer .social{display:flex;gap:14px;align-items:center;justify-content:center}
.qp-footer .social-icon{height:24px;width:24px}
/* Breadcrumb */
/* Breadcrumb (removed) */

/* Layout helpers */
.center-page{min-height:calc(100vh - 180px);display:flex;align-items:center;justify-content:center;padding:16px}
.table-responsive{width:100%;overflow-x:auto}
.enroll-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(220px,280px));justify-content:center}

/* Mobile tweaks */
@media (max-width: 1000px){
  .qp-wrap{flex-direction:column;gap:8px}
  .qp-nav{display:none}
  .qp-menu-btn{display:inline-block;align-self:flex-end}
  /* detail/main card spans full width */
  .qp-shell{grid-template-columns:1fr;position:relative}
  .qp-sidebar{width:100%}
  .qp-shell > section.card{width:100%}
  .grid-2{grid-template-columns:1fr}
  .grid-3{grid-template-columns:1fr}
  .enroll-grid{grid-template-columns:1fr}
  /* Make sidebar and main cards span full width on mobile */
  /* remove old hamburger */
  .qp-test{grid-template-columns:1fr}
  .qp-test{padding:14px;border-radius:20px;}
}
/* desktop width rule removed */


/* =========================
}
  .lb-stat-card .v{font-size:18px}
.lb-table td:nth-child(3) .lb-summary-line,
.lb-table td:nth-child(3) .lb-full-list{
  text-align:right;
}
}
/* =========================
   D2D Quiz Portal - Leaderboard (final consolidated CSS)
   ========================= */

.lb-body{margin:0;background:#faf7f1;color:#111;font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif}
.wrap{max-width:1100px;margin:0 auto;padding:12px}

/* Title Bar */
.lb-titlebar{position:relative;display:flex;align-items:center;gap:8px;margin:2mm 0 6px}
.lb-title{margin:0;font-size:28px;line-height:1.2}
.lb-badge{margin-left:8px;background:#e6f4ff;color:#083b73;border:1px solid #c8e1ff;border-radius:20px;padding:6px 10px;font-weight:600}
.lb-download{margin-left:auto}

/* Buttons */
.lb-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border:1px solid #e5e7eb;border-radius:10px;background:#fef1de;cursor:pointer}
.lb-btn:hover{filter:brightness(0.98)}
.lb-btn[disabled]{opacity:.5;cursor:not-allowed}
.lb-btn-outline{background:#fef1de;border-color:#cbd5e1}

/* Filters */
.lb-filters{display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin:8px 0 6px}
.lb-filters label{display:flex;flex-direction:column;gap:4px}
.lb-filters select{min-width:220px;padding:7px 10px;border:1px solid #e5e7eb;border-radius:8px;background:#fef1de}
.lb-refresh{background:#2a9d8f;color:#fef1de;border-color:#2a9d8f}

/* Notes */
.lb-note{margin:0 0 8px;color:#374151;font-size:14px}
.lb-tip{color:#374151;font-size:13px;margin:8px 0 0}

/* Card + Scroll Area */
.lb-card{position:relative;background:#fef1de;border:1px solid #eee;border-radius:12px;overflow:hidden}
.lb-table-wrap{
  --thead-h:42px;
  position:relative;
  max-height:60vh;
  overflow:auto;            /* scrolls both directions on small screens */
  padding:0;
}

/* ---- Stat cards overlay (top-right of leaderboard card) ---- */
.lb-card.has-stats .lb-table-wrap{padding-top:64px}  /* space for floating cards */
.lb-stats{
  position:absolute; top:8px; right:8px; z-index:5;
  display:flex; gap:8px; align-items:stretch;
}
.lb-stat-card{
  min-width:120px; padding:8px 12px; border-radius:12px;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
  color:#fef1de; text-align:center;
}
.lb-stat-card .k{font-size:12px; letter-spacing:.3px; opacity:.9}
.lb-stat-card .v{font-size:22px; font-weight:800; line-height:1.1; margin-top:2px}
.lb-stat-card .s{font-size:11px; opacity:.9; margin-top:2px}
/* D2D palette */
.lb-stat-card.air{background:#264653}    /* charcoal */
.lb-stat-card.state{background:#2A9D8F}  /* emerald */

/* Table */
.lb-table{
  border-collapse:separate;
  border-spacing:0;
  width:100%;
  min-width:760px;
  table-layout:fixed;
}
.lb-table th,
.lb-table td{
  padding:10px 12px;
  border-bottom:1px solid #eee;
  background:rgba(255,255,255,.92);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.lb-table thead th{
  position:sticky;
  top:0;
  z-index:3;
  background:#fef1de;
  border-bottom:1px solid #ecdcc8;
  font-weight:700;
  text-align:center;
}
.lb-table th:nth-child(3){
  width:60%;
  text-align:center;
}
.lb-table td:nth-child(3){
  width:60%;
  white-space:normal;
  word-break:normal;
  overflow-wrap:break-word;
  text-align:right;
}
.lb-table td:nth-child(3) .lb-summary-line,
.lb-table td:nth-child(3) .lb-full-list{
  text-align:right;
}
/* Sticky 'Your Rank' row */
.lb-table tr.is-self td{
  position:sticky; top:var(--thead-h);
  z-index:2; background:#f6faff;
  border-bottom:1px solid #dbeafe;
}
.lb-chip{display:inline-block;margin-left:6px;padding:2px 6px;border-radius:999px;background:#e5f9f3;color:#0d3b2e;border:1px solid #bfeadf;font-size:12px}

/* Pager: three-grid with 2mm side padding */
.lb-pager{
  position:sticky; bottom:0; z-index:4;
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:6px;
  padding:8px 2mm;           /* 2mm as requested */
  border-top:1px solid #eee;
  background:linear-gradient(to top,rgba(254,241,222,0.95) 70%,rgba(255,255,255,.7));
  width:100%; min-width:760px; box-sizing:border-box;
}
.lb-pager .lb-pager-cell:nth-child(1){justify-self:start}
.lb-pager .lb-pager-cell:nth-child(2){justify-self:center}
.lb-pager .lb-pager-cell:nth-child(3){justify-self:end}
.lb-pageinfo{font-size:14px;color:#374151}

/* PDF button on narrow screens (kept slightly outside title span) */
@media (max-width:1200px){
  .lb-titlebar{overflow:visible}
  .lb-download{position:absolute;right:-2mm;top:50%;transform:translateY(-50%)}
}

/* =========================
   < 900px
   ========================= */
@media (max-width:900px){
  .wrap{padding:10px}
  .lb-title{font-size:24px}

  /* Filters in two columns + button on the right */
  .lb-filters{
    display:grid;
    grid-template-columns:1fr 1fr auto;
    gap:8px;
    align-items:end;
  }
  .lb-filters select{min-width:0;width:100%}

  /* Stat cards slightly smaller */
  .lb-stat-card{min-width:108px;padding:8px 10px;border-radius:12px}
  .lb-stat-card .v{font-size:20px}
  .lb-stat-card .k{font-size:11px}
  .lb-stat-card .s{font-size:10px}

  /* Pager compact */
  .lb-pager{gap:6px;padding:8px 2mm}
  .lb-pageinfo{font-size:13px}
}

/* =========================
   < 700px
   ========================= */
@media (max-width:700px){
  /* Title wraps, PDF button drops to new line on the right */
  .lb-titlebar{flex-wrap:wrap}
  .lb-download{
    position:static !important;
    margin-left:auto;
    margin-top:4px;
  }

  /* Filters stack to single column */
  .lb-filters{
    grid-template-columns:1fr;
    gap:10px;
  }

  /* Stat cards stop overlaying; sit above table */
  .lb-stats{position:static;justify-content:flex-end;margin:8px 8px 0}
  .lb-card.has-stats .lb-table-wrap{padding-top:0}

  /* Table slightly denser; keep horizontal scroll if needed */
  .lb-table th,
  .lb-table td{padding:9px 10px}
  .lb-table{min-width:700px}

  /* Pager still 3-grid but tighter */
  .lb-pager{grid-template-columns:1fr auto 1fr;gap:6px}
}

/* =========================
   < 600px
   ========================= */
@media (max-width:600px){
  .lb-title{font-size:20px}

  /* Larger tap targets on filters */
  .lb-filters select{padding:9px 10px}

  /* Table tighter and smaller min-width */
  .lb-table{min-width:640px}
  .lb-table th,
  .lb-table td{padding:8px 9px}

  /* Pager becomes vertical stack; full-width buttons */
  .lb-pager{grid-template-columns:1fr;gap:6px;padding:8px 2mm}
  .lb-pager .lb-pager-cell{justify-self:stretch}
  .lb-pager .lb-pager-cell form .lb-btn{width:100%}
  .lb-pageinfo{text-align:center;font-size:13px}

  /* Ultra-compact stat cards when stacked */
  .lb-stat-card{min-width:100px;padding:7px 9px}
  .lb-stat-card .v{font-size:18px}
}

/* Footer: charcoal background with light text */
.logo{width:62px;height:62px;border-radius:10px;background:linear-gradient(135deg,var(--orange),#ffc278);display:grid;place-items:center;color:#fff;font-weight:800}
.footer{background:var(--charcoal, #264653);border-top:1px solid rgba(255,255,255,.08);padding:20px 0;color:var(--on-dark, #ffffff);margin-top:auto}
.footer a{color:var(--on-dark, #ffffff)}
.footer-grid{display:grid;gap:25px;grid-template-columns:1fr 1fr 1fr;align-items:start;grid-template-areas:'brand brand brand' 'company contact explore'}
.footer-brand{grid-area:brand;text-align:center}
.footer-company{grid-area:company;text-align:center}
.footer-explore{grid-area:explore;text-align:center}
.footer-contact{grid-area:contact;text-align:center}
@media (max-width:900px){
  /* Two-column layout and include contact row to prevent overflow */
  .footer-grid{
    grid-template-columns:1fr;
    grid-template-areas:
      'brand'
      'contact';
  }
  .footer-brand p{display:none}
  /* Avoid awkward spacing due to justify on small screens */
  .footer-company .footer-links,
  .footer-explore .footer-links{
    text-align:center; justify-content:center
  }
}

@media (max-width:600px){
  /* Single-column stack for very small devices */
  .footer-grid{
    grid-template-columns:1fr;
    grid-template-areas:
      'brand'
      'contact'
      
  }
}

.footer .brand{justify-content:center}
.social{display:flex;justify-content:center;gap:25px;margin-top:20px;margin-bottom:4px}
.social .social-icon{width:26px;height:26px;object-fit:contain;display:block}
.footer .brand{display:flex;align-items:center;justify-content:center;gap:10px}
.footer-brand{display:flex;flex-direction:column;align-items:center;text-align:center}
.footer .brand-name{font-weight:800}
.footer p{margin:8px 0}
.footer-links{list-style:none;padding:0;margin:0px 0 0;display:grid;gap:px}
.footer-links a{text-decoration:none}
.footer-links a:hover{text-decoration:underline}
.footer .policies a:hover{text-decoration:underline}
.contact-inline{margin-top:8px}
.contact-inline .policies{margin-top:6px}
