:root {
  --bg: #0d1117; --panel: #161b22; --panel2: #1c2330; --border: #2d3748;
  --text: #e6edf3; --muted: #8b949e; --accent: #2f81f7; --accent2: #00d4aa;
  --danger: #f85149; --warn: #d29922; --ok: #3fb950;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard", -apple-system, "Noto Sans KR", "Segoe UI", sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; font-weight: 400; }

/* ---------- 랜딩 ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0f4f8, #dbe7f3); padding: 24px; }
.course-card { background: #fff; border-radius: 20px; padding: 40px; max-width: 480px; width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,.12); color: #1a2330; }
.course-thumb { font-size: 64px; margin-bottom: 12px; }
.course-cat { color: var(--accent); font-weight: 700; margin: 0 0 6px; }
.course-card h1 { margin: 0 0 8px; font-size: 26px; }
.course-meta { color: #6b7a90; margin: 0 0 12px; font-size: 14px; }
.course-desc { color: #4a5a70; font-size: 14px; line-height: 1.7; margin: 0 0 24px; }
.btn-start { background: #1a56db; color: #fff; border: none; border-radius: 12px;
  padding: 14px 28px; font-size: 16px; font-weight: 700; cursor: pointer; width: 100%; }
.btn-start:hover { background: #1648b5; }
.landing-note { color: #6b7a90; font-size: 12px; margin-top: 18px; }

/* ---------- 시뮬레이터 ---------- */
.simulator { min-height: 100vh; display: flex; flex-direction: column; }
.sim-header { display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: var(--panel); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sim-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.sim-title span { font-size: 28px; }
.sim-title h1 { margin: 0; font-size: 17px; }
.sim-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.lesson-tag { background: var(--accent); font-size: 11px; padding: 2px 8px; border-radius: 8px; vertical-align: middle; }
.progress-wrap { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.progress-bar { width: 180px; height: 10px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
#progressFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s; }

.sim-layout { display: flex; gap: 14px; padding: 14px; align-items: flex-start; flex: 1; }
.viewport-wrap { flex: 1; min-width: 0; position: relative; }
#viewport { width: 100%; height: calc(100vh - 130px); min-height: 520px; background: #05070c;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.viewport-hint { position: absolute; bottom: 10px; left: 12px; font-size: 12px; color: var(--muted);
  background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 8px; }
.step-banner { position: absolute; top: 12px; left: 12px; right: 12px; background: rgba(20,40,90,.92);
  border: 1px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; }

.side { width: 400px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 110px); overflow-y: auto; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.panel h2 { margin: 0 0 10px; font-size: 15px; }

.step-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.step-list li { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--panel2);
  border: 1px solid var(--border); color: var(--muted); }
.step-list li.active { border-color: var(--accent); color: var(--text); background: #14284a; font-weight: 600; }
.step-list li.done { color: var(--ok); border-color: #1f4d2e; }
.step-list li .n { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: #333;
  text-align: center; line-height: 20px; font-size: 11px; margin-right: 8px; }
.step-list li.active .n { background: var(--accent); }
.step-list li.done .n { background: var(--ok); }

.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; cursor: pointer; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.ctrl.on { background: #0b3d2e; border-color: var(--accent2); color: #9df0c0; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.metric { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.m-label { display: block; font-size: 11px; color: var(--muted); }
.m-val { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.m-val.ok { color: var(--ok); } .m-val.bad { color: var(--danger); }
#dashChart { width: 100%; height: 120px; background: #0a0e14; border: 1px solid var(--border); border-radius: 8px; }
.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.6; }

#quizBox .q { margin-bottom: 14px; }
#quizBox .q p { font-size: 13px; font-weight: 600; margin: 0 0 8px; line-height: 1.6; }
#quizBox .choices { display: flex; flex-direction: column; gap: 6px; }
#quizBox .choices button { text-align: left; background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
#quizBox .choices button:hover:not(:disabled) { border-color: var(--accent); }
#quizBox .choices button.correct { border-color: var(--ok); background: #0e2e1a; }
#quizBox .choices button.wrong { border-color: var(--danger); background: #3d1d1d; }
#quizBox .explain { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

#resultBox { text-align: center; padding: 10px 0; }
#resultBox .score { font-size: 44px; font-weight: 800; color: var(--accent2); }
#resultBox .grade { font-size: 16px; font-weight: 700; margin: 8px 0; }
#resultBox p { font-size: 13px; color: var(--muted); line-height: 1.7; }

@media (max-width: 980px) {
  .sim-layout { flex-direction: column; }
  .side { width: 100%; max-height: none; }
}
