:root{
  --y:#FFD700;
  --b:#2A4365;
  --sb:#EBF8FF;
  --r:#F56565;
  --g:#48BB78;
  --bg:#F7FAFC;
  --tx:#1F2937;
  --mut:#64748B;
  --card:#FFFFFF;
  --shadow: 0 16px 40px rgba(0,0,0,.14);
  --ring: 0 0 0 3px rgba(42,67,101,.18);
  --radius: 22px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--y);
  background-image:
    radial-gradient(circle at 18% 16%, #ffec85 0%, transparent 42%),
    radial-gradient(circle at 82% 84%, #ffec85 0%, transparent 42%);
  color: var(--tx);
}

.shell{
  min-height:100%;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:18px;
  align-items:center;
  justify-content:center;
}

.topbar{
  width: min(960px, 100%);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo{
  width:44px;height:44px;
  border-radius:14px;
  background: var(--b);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  letter-spacing:.5px;
  box-shadow: 0 10px 22px rgba(0,0,0,.16);
}

.brand-title{ font-weight:900; color:var(--b); font-size:16px; }
.brand-sub{ color:rgba(31,41,55,.75); font-size:12px; }

.hud{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.hud-item{
  background: rgba(255,255,255,.85);
  border:1px solid rgba(42,67,101,.12);
  border-radius:14px;
  padding:10px 12px;
  min-width:88px;
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}
.hud-label{ display:block; font-size:11px; color:var(--mut); font-weight:800; text-transform:uppercase; letter-spacing:.9px; }
.hud-value{ display:block; font-weight:900; color:var(--b); font-size:16px; }

.card{
  width: min(960px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
  overflow:hidden;
}

.meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom:12px;
  border-bottom:1px solid rgba(42,67,101,.10);
}

.progress{ flex:1; min-width: 220px; }
.progress-track{
  height:12px;
  border-radius:999px;
  background: var(--sb);
  overflow:hidden;
}
.progress-fill{
  height:100%;
  width:0%;
  background: var(--b);
  transition: width .35s ease;
}
.progress-text{
  margin-top:8px;
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
  color: var(--b);
}
.pill{
  padding:6px 10px;
  border-radius:999px;
  background: rgba(235,248,255,.9);
  border: 1px solid rgba(42,67,101,.12);
  color: var(--b);
  font-size:12px;
}

.timer{
  background: rgba(42,67,101,.06);
  border: 1px solid rgba(42,67,101,.14);
  border-radius:16px;
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  min-width:120px;
}
.timer-label{ font-size:11px; color:var(--mut); font-weight:900; text-transform:uppercase; letter-spacing:1px; }
.timer-value{ font-weight:900; font-size:18px; color:var(--b); }

.stage{ padding:18px 4px; }

.qTitle{
  font-size: 20px;
  line-height:1.25;
  color: var(--b);
  font-weight:950;
  margin: 0 0 14px 0;
}

.options{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.opt{
  border:2px solid rgba(235,248,255,1);
  background:#fff;
  border-radius:16px;
  padding:14px 14px;
  text-align:left;
  cursor:pointer;
  font-weight:750;
  color: var(--b);
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
  outline:none;
}
.opt:focus{ box-shadow: var(--ring); }
.opt:hover{
  border-color: rgba(255,215,0,.85);
  background: rgba(235,248,255,.6);
  transform: translateY(-1px);
}
.opt[disabled]{ cursor:not-allowed; opacity:.95; }

.opt.correct{
  border-color: rgba(72,187,120,1);
  background: rgba(72,187,120,.10);
}
.opt.wrong{
  border-color: rgba(245,101,101,1);
  background: rgba(245,101,101,.10);
}

.feedback{
  border-top:1px solid rgba(42,67,101,.10);
  padding-top:14px;
  margin-top:10px;
}
.feedback-head{
  font-weight:950;
  color: var(--b);
  margin-bottom:6px;
}
.feedback-body{
  color: rgba(31,41,55,.88);
  line-height:1.55;
  background: rgba(235,248,255,.55);
  border:1px solid rgba(42,67,101,.12);
  padding:12px 12px;
  border-radius:16px;
}

.confidence{ margin-top:12px; }
.confidence-title{
  font-weight:950;
  color: var(--b);
  margin-bottom:8px;
}
.confidence-row{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{
  border-radius:999px;
  padding:10px 12px;
  border: 1px solid rgba(42,67,101,.16);
  background:#fff;
  font-weight:900;
  cursor:pointer;
}
.chip:focus{ box-shadow: var(--ring); outline:none; }
.chip.selected{
  border-color: rgba(42,67,101,.55);
  background: rgba(42,67,101,.08);
}
.confidence-hint{ margin-top:8px; font-size:12px; color: var(--mut); }

.actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  justify-content:space-between;
  flex-wrap:wrap;
}

.btn{
  border: none;
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--b);
  color:#fff;
  font-weight:950;
  cursor:pointer;
}
.btn:focus{ box-shadow: var(--ring); outline:none; }
.btn:active{ transform: translateY(1px); }

.ghost{
  background:#fff;
  color: var(--b);
  border:1px solid rgba(42,67,101,.16);
}

.result{
  padding: 10px 2px 2px 2px;
}
.result-hero{
  display:grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items:center;
}
.scoreRing{
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,215,0,.85), rgba(255,215,0,.45));
  border: 6px solid var(--b);
  display:flex;
  align-items:center;
  justify-content:center;
}
.scoreRing-inner{
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  border: 1px solid rgba(42,67,101,.12);
}
.scorePct{ font-weight:950; font-size:26px; color: var(--b); }
.scoreSub{ font-size:12px; color: var(--mut); font-weight:900; text-transform:uppercase; letter-spacing:1px; }

.result-text h2{ margin:0 0 6px 0; color: var(--b); font-weight:950; }
.result-text p{ margin:0 0 12px 0; color: rgba(31,41,55,.85); }

.result-stats{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 10px 0 12px 0;
}
.stat{
  background: rgba(235,248,255,.55);
  border:1px solid rgba(42,67,101,.12);
  border-radius:16px;
  padding:10px 12px;
  min-width: 140px;
}
.stat-k{ font-weight:950; color: var(--b); font-size:18px; }
.stat-v{ font-size:12px; color: var(--mut); font-weight:900; text-transform:uppercase; letter-spacing:1px; }

.result-cta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.cta{
  display:inline-flex;
  text-decoration:none;
  background: var(--r);
  color:#fff;
  padding:12px 14px;
  border-radius:16px;
  font-weight:950;
}

.shareBox{
  margin-top:14px;
  background: rgba(255,255,255,.7);
  border:1px solid rgba(42,67,101,.12);
  border-radius: 18px;
  padding: 12px;
}
.shareTitle{ font-weight:950; color: var(--b); margin-bottom:10px; }
.shareRow{ display:flex; gap:10px; flex-wrap:wrap; }
.sharePreview{
  margin-top:10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size:12px;
  white-space:pre-wrap;
  background: rgba(235,248,255,.55);
  border:1px solid rgba(42,67,101,.12);
  padding:10px;
  border-radius:16px;
  color: rgba(31,41,55,.9);
}

.footer{
  width: min(960px, 100%);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 0 4px;
}
.small{ font-size:12px; color: rgba(31,41,55,.80); font-weight:800; }
.dot{ opacity:.6; }

.linkBtn{
  border:none;
  background: transparent;
  color: var(--b);
  font-weight:950;
  cursor:pointer;
  text-decoration: underline;
}

@media (max-width: 640px){
  .result-hero{ grid-template-columns: 1fr; }
  .timer{ align-items:flex-start; }
  .hud-item{ min-width: 86px; }
}