:root{
  --bg:#0b1020;
  --panel:#0f1730;
  --panel2:#0b1229;
  --text:#ffffff;
  --muted:#c2cbea;
  --border:#26325a;
  --accent:#6ea8ff;
  --ok:#36d27a;
  --bad:#ff4d4d;
  --warn:#ffcf5a;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 15% 10%, #162457 0%, var(--bg) 55%) fixed;
  color:var(--text);
}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}
.container{max-width:1100px; margin:0 auto; padding:28px 18px 48px}
.nav{
  display:flex; gap:12px; flex-wrap:wrap; align-items:center; justify-content:space-between;
  margin-bottom:18px;
}
.brand{
  display:flex; flex-direction:column; gap:2px;
}
.brand .title{font-weight:800; font-size:20px; letter-spacing:.2px}
.brand .sub{color:var(--muted); font-size:13px}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.grid{
  display:grid; gap:14px;
}
.grid.cols-3{grid-template-columns: repeat(3, minmax(0,1fr))}
@media (max-width: 900px){ .grid.cols-3{grid-template-columns:1fr} }
.btn{
  appearance:none; border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:650;
}
.btn:hover{border-color:#3a4a83}
.btn.primary{background: rgba(122,162,255,.15); border-color: rgba(122,162,255,.45)}
.btn.primary:hover{border-color: rgba(122,162,255,.8)}
.btn.ghost{background:transparent}
.badge{
  display:inline-flex; gap:8px; align-items:center;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  padding:8px 10px; border-radius:999px;
  color:var(--muted); font-size:12px;
}
h1,h2,h3{margin:0 0 8px 0}
h1{font-size:26px}
h2{font-size:18px}
p{color:var(--muted); line-height:1.5}
.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  padding:2px 6px; border-radius:7px; border:1px solid var(--border);
  background: rgba(0,0,0,.2);
  color:var(--text);
  font-size:12px;
}
.quiz-top{
  display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:center;
  margin-bottom:12px;
}
.progress{
  width:100%; height:10px; border-radius:999px; overflow:hidden;
  border:1px solid var(--border); background: rgba(255,255,255,.03);
}
.progress > div{
  height:100%; width:0%;
  background: linear-gradient(90deg, rgba(110,168,255,.95), rgba(54,210,122,.95));
}
.qbox{margin-top:10px}
.qmeta{display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; margin-bottom:10px}
.qnum{color:var(--muted); font-size:13px}
.question{font-size:1.25rem; font-weight:700; color:#ffffff; line-height:1.6;}
.options{display:grid; gap:10px}
.opt{width:100%; text-align:left; padding:1rem; border-radius:14px; border:1px solid rgba(255,255,255,.15); background:rgba(255,255,255,.03); color:#ffffff; font-size:1rem; font-weight:600; cursor:pointer; transition:.15s ease;}
.opt:hover{border-color:#3a4a83}
.opt:active{transform: scale(.997)}
.opt.disabled{cursor:default; opacity:.95}
.opt.correct{
  border-color: rgba(54,210,122,.95);
  background: rgba(54,210,122,.18);
  box-shadow: 0 0 0 1px rgba(54,210,122,.25) inset;
}
.opt.incorrect{
  border-color: rgba(255,77,77,.95);
  background: rgba(255,77,77,.18);
  box-shadow: 0 0 0 1px rgba(255,77,77,.22) inset;
}
.explain{margin-top:1rem; padding:1rem; border-radius:12px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.15); color:#ffffff; font-weight:500;}
.controls{display:flex; gap:10px; flex-wrap:wrap; margin-top:14px}
hr.sep{border:none; border-top:1px solid var(--border); margin:16px 0}
pre.msg{
  margin:0;
  white-space:pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size:13px;
  color: #dfe7ff;
  background: rgba(0,0,0,.22);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  overflow:auto;
  max-height: 340px;
}
mark{
  background: rgba(255,204,102,.22);
  color: var(--text);
  padding:0 2px;
  border-radius:4px;
  border: 1px solid rgba(255,204,102,.35);
}
.footer{
  margin-top:18px;
  color:var(--muted);
  font-size:12px;
}
pre.msg mark{background: rgba(110,168,255,.22); color: var(--text); padding: 0 .15em; border-radius: .35em;}

h1, h2, h3, .badge span { color:#ffffff; }


/* Matching exercise */
.imgWrap{margin-top:1rem; display:flex; justify-content:center;}
.matchImg{max-width:520px; width:100%; border-radius:14px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.02);}
.matchTable{display:flex; flex-direction:column; gap:.75rem; margin-top:1rem;}
.matchRow{display:grid; grid-template-columns: 90px 1fr 44px; gap:.75rem; align-items:center; padding:.75rem; border-radius:14px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.02);}
.matchRow.ok{border-color: rgba(34,197,94,.55); box-shadow: 0 0 0 1px rgba(34,197,94,.12) inset;}
.matchRow.bad{border-color: rgba(239,68,68,.55); box-shadow: 0 0 0 1px rgba(239,68,68,.12) inset;}
.matchNum{font-weight:800; color:#ffffff; font-size:1.05rem; text-align:center;}
.matchSelect{width:100%; padding:.75rem .85rem; border-radius:12px; border:1px solid rgba(255,255,255,.15); background:rgba(0,0,0,.25); color:#ffffff; font-weight:600;}
.matchSelect option{background:#0b1220; color:#ffffff;}
.matchStatus{font-size:1.25rem; font-weight:900; text-align:center; color:#ffffff;}
.matchHeader{display:grid; grid-template-columns: 90px 1fr 44px; gap:.75rem; margin-top:1rem; opacity:.9;}
.matchNumHead,.matchDescHead,.matchStatusHead{color:#ffffff; font-weight:700; font-size:.9rem;}
.btnRow{display:flex; gap:.75rem; margin-top:1rem;}
