:root{
  --bg:#0b0f14; --card:#121825; --text:#e7edf5; --muted:#a9b4c3;
  --line:#223049; --btn:#1b2740;
  --ok:#2ecc71; --bad:#ff5c5c; --warn:#f1c40f;
}
body{
  margin:0; padding:24px;
  background:linear-gradient(180deg, var(--bg), #070a0f);
  color:var(--text);
  font:16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.wrap{ max-width:980px; margin:0 auto; }
header{ display:flex; gap:12px; align-items:baseline; justify-content:space-between; margin-bottom:14px; }
h1{ margin:0; font-size:20px; letter-spacing:.2px; }
.hint{ color:var(--muted); font-size:13px; }

.card{
  background:rgba(18,24,37,.92);
  border:1px solid var(--line);
  border-radius:14px;
  padding:18px 18px 14px;
  margin:14px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* "title" row contains question text + # pill */
.title{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:10px;
}
.title .qtext{
  margin:0;
  white-space:pre-wrap;
  flex: 1 1 auto;
}
.pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:var(--muted);
  font-size:13px;
  flex: 0 0 auto;
}

.qimg{
  width:100%;
  max-width: 920px;
  display:block;
  margin: 10px 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
}

.answers{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin: 10px 0 8px;
}
@media (max-width:720px){ .answers{ grid-template-columns: 1fr; } }

button.option{
  text-align:left;
  background:var(--btn);
  border:1px solid var(--line);
  color:var(--text);
  padding:12px 12px;
  border-radius:12px;
  cursor:pointer;
  transition: transform .03s ease, border-color .15s ease, background .15s ease;
  display:flex;
  gap:10px;
  align-items:flex-start;
}
button.option:hover{ border-color:#35507d; }
button.option:active{ transform: translateY(1px); }
button.option.selected{
  outline: 2px solid rgba(159,194,255,.35);
  border-color: rgba(159,194,255,.45);
}

.badge{
  min-width:28px; height:28px;
  display:inline-grid; place-items:center;
  border-radius:8px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  font-weight:700;
}

.meta{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  border-top:1px dashed rgba(255,255,255,.10);
  padding-top:12px;
}
.controls{ display:flex; gap:8px; flex-wrap:wrap; }

.smallbtn{
  background:transparent;
  border:1px solid rgba(255,255,255,.16);
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  font-size:13px;
}
.smallbtn:hover{ border-color:#3a568a; }

.result{
  font-size:14px;
  color:var(--muted);
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.pill.ok{ border-color: rgba(46,204,113,.45); color: #b9f3cf; background: rgba(46,204,113,.10); }
.pill.bad{ border-color: rgba(255,92,92,.45); color: #ffd0d0; background: rgba(255,92,92,.10); }
.pill.answer{ border-color: rgba(241,196,15,.45); color: #fff2b8; background: rgba(241,196,15,.10); }

/* Per-question correction */
.answered button.option{ opacity:.92; }
.answered button.option.disabled{ pointer-events:none; opacity:.65; }
.option.correct{ border-color: rgba(46,204,113,.65); background: rgba(46,204,113,.12); }
.option.wrong{ border-color: rgba(255,92,92,.65); background: rgba(255,92,92,.10); }
.option.reveal{ border-color: rgba(241,196,15,.55); box-shadow: 0 0 0 2px rgba(241,196,15,.10) inset; }

/* Top bars */
.topbar{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:space-between;
  margin: 10px 0 18px;
}
.search{
  flex: 1 1 420px;
  display:flex; gap:10px; align-items:center;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 10px 12px;
}
.search input{
  width:100%;
  background:transparent;
  border:0;
  outline:none;
  color:var(--text);
  font-size:14px;
}
.count{ color:var(--muted); font-size:13px; }

/* Global score/progress */
#scorePill.ok { border-color: rgba(46,204,113,.45); color: #b9f3cf; background: rgba(46,204,113,.10); }
#scorePill.bad { border-color: rgba(255,92,92,.45); color: #ffd0d0; background: rgba(255,92,92,.10); }

/* Nav */
.nav{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  margin: 18px 0 6px;
}
.nav a{
  color: var(--text);
  text-decoration:none;
  border:1px solid rgba(255,255,255,.16);
  padding:8px 10px;
  border-radius:10px;
}
.nav a:hover{ border-color:#3a568a; }
.nav .center{
  color: var(--muted);
  font-size: 13px;
}

.homebtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 18px;
  border-radius:999px;
  background: linear-gradient(180deg, #1f2f4f, #16233b);
  border:1px solid rgba(255,255,255,.18);
  color: var(--text);
  text-decoration:none;
  font-weight:600;
  font-size:14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.homebtn:hover{
  border-color:#4c72b8;
}
