* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
body {
  min-height: 100vh; background: #11181d; color: #f4f4f8;
  display: flex; flex-direction: column;
}

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02); flex-wrap: wrap; gap: 10px;
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo {
  width: 32px; height: 32px; border-radius: 9px; background: #43a1db;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 16px;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.12); color: #c4c4d4;
  padding: 8px 14px; border-radius: 9px; font-size: 14px; cursor: pointer;
  transition: .15s;
}
.tab-btn:hover { border-color: rgba(255,255,255,.3); color: #fff; }
.tab-btn.active { background: #43a1db; border-color: #43a1db; color: #06232e; font-weight: 700; }

main { flex: 1; max-width: 780px; width: 100%; margin: 0 auto; padding: 22px 18px 60px; }

.footer {
  text-align: center; font-size: 11px; color: #6b6b7a; padding: 16px;
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
}

/* ---- generic cards / buttons ---- */
.card {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px; padding: 22px; margin-bottom: 16px;
}
h1 { font-size: 24px; margin-bottom: 6px; letter-spacing: -.3px; }
h2 { font-size: 18px; margin-bottom: 10px; }
p { color: #c4c4d4; line-height: 1.55; font-size: 14.5px; }
.muted { color: #8f8fa1; font-size: 13px; }

.btn {
  background: #43a1db; color: #06232e; border: none; padding: 12px 20px;
  border-radius: 10px; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: .15s; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: rgba(255,255,255,.08); color: #f4f4f8; border: 1px solid rgba(255,255,255,.15); }
.btn.ghost { background: transparent; color: #43a1db; border: 1px solid rgba(67,161,219,.4); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---- home ---- */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
@media (max-width: 560px) { .home-grid { grid-template-columns: 1fr; } }
.mode-card { cursor: pointer; }
.mode-card:hover { border-color: rgba(67,161,219,.5); }
.mode-card .icon { font-size: 26px; margin-bottom: 8px; }

.domain-bar { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.domain-bar .track { flex: 1; height: 8px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; }
.domain-bar .fill { height: 100%; background: #43a1db; border-radius: 5px; }
.domain-bar .label { width: 230px; font-size: 13px; color: #d8d8e2; flex-shrink: 0; }
.domain-bar .pct { width: 60px; text-align: right; font-size: 12.5px; color: #8f8fa1; }

/* ---- setup (checkbox pickers) ---- */
.check-grid { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.check-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; cursor: pointer; font-size: 14px;
}
.check-item input { width: 17px; height: 17px; accent-color: #43a1db; }
.count-pill {
  margin-left: auto; background: rgba(255,255,255,.08); color: #8f8fa1;
  font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
}
.field-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.field-row label { font-size: 14px; color: #d8d8e2; }
select, input[type=number] {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); color: #fff;
  padding: 8px 10px; border-radius: 8px; font-size: 14px;
}

/* ---- question card ---- */
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tag {
  font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 600;
  background: rgba(67,161,219,.15); color: #6fc0f0; border: 1px solid rgba(67,161,219,.3);
}
.tag.scenario { background: rgba(61,220,151,.12); color: #6fe0b0; border-color: rgba(61,220,151,.3); }
.q-progress { font-size: 12.5px; color: #8f8fa1; margin-bottom: 14px; }
.q-text { font-size: 17px; line-height: 1.5; margin-bottom: 18px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px; cursor: pointer; font-size: 14.5px; line-height: 1.4;
  transition: .12s;
}
.opt:hover { border-color: rgba(67,161,219,.5); background: rgba(67,161,219,.06); }
.opt .bullet {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; border: 1px solid rgba(255,255,255,.25);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #8f8fa1;
}
.opt.selected { border-color: #43a1db; background: rgba(67,161,219,.12); }
.opt.selected .bullet { background: #43a1db; color: #06232e; border-color: #43a1db; }
.opt.correct { border-color: #3ddc97; background: rgba(61,220,151,.12); }
.opt.correct .bullet { background: #3ddc97; color: #06231a; border-color: #3ddc97; }
.opt.incorrect { border-color: #e0607a; background: rgba(224,96,122,.12); }
.opt.incorrect .bullet { background: #e0607a; color: #2a0611; border-color: #e0607a; }
.opt.disabled { cursor: default; }

.explain {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,.04); border-left: 3px solid #43a1db; font-size: 14px; line-height: 1.55;
}
.explain.wrong { border-left-color: #e0607a; }
.explain b { color: #fff; }

/* ---- results ---- */
.score-big { font-size: 52px; font-weight: 800; text-align: center; margin: 10px 0; }
.score-big.pass { color: #3ddc97; }
.score-big.fail { color: #e0607a; }
.score-sub { text-align: center; color: #8f8fa1; margin-bottom: 10px; }

/* ---- flashcard (study) ---- */
.flash { text-align: center; }
.flash .q-text { text-align: left; }
.flash .reveal-hint { color: #6fc0f0; font-size: 13px; margin-top: 10px; cursor: pointer; }

.empty { text-align: center; padding: 40px 20px; color: #8f8fa1; }
