/* Digital Economy quiz · Zonemation charter colours and fonts (tokens from Studio Marques app.css). No logo. */
@font-face { font-family: "Poppins"; font-weight: 300; src: url("fonts/Poppins-Light.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Poppins"; font-weight: 400; src: url("fonts/Poppins-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Poppins"; font-weight: 500; src: url("fonts/Poppins-Medium.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 100 800; src: url("fonts/JetBrainsMono-VF.ttf") format("truetype"); font-display: swap; }

:root {
  --font: "Poppins", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px;
  /* light (default: bright classrooms) */
  --bg: #f3f4ee; --surface: #ffffff; --raised: #e9ebe1;
  --line: rgba(21,23,14,.10); --line2: rgba(21,23,14,.18); --line-strong: rgba(21,23,14,.52);
  --text: #15170e; --text-2: rgba(21,23,14,.74); --text-3: rgba(21,23,14,.64);
  --acc: #496a1a; --acc-fill: #A7D26D; --acc-edge: #496a1a; --acc-bg: rgba(120,165,55,.16); --on: #15170e;
  --warn: #6b4c08; --warn-bg: rgba(138,100,16,.12);
}
.theme-dark {
  --bg: #0f100a; --surface: #181a0e; --raised: #21241a;
  --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.16); --line-strong: rgba(255,255,255,.45);
  --text: rgba(255,255,255,.93); --text-2: rgba(255,255,255,.70); --text-3: rgba(255,255,255,.56);
  --acc: #A7D26D; --acc-fill: #A7D26D; --acc-edge: #A7D26D; --acc-bg: rgba(167,210,109,.15); --on: #15170e;
  --warn: #e0b354; --warn-bg: rgba(224,179,84,.16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.55 var(--font); }
h1, h2, h3 { font-weight: 300; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 19px; font-weight: 500; }
h3.sub { margin-top: 16px; }
p { margin: 0 0 12px; }
b, strong { font-weight: 500; }
a { color: var(--acc); }
.muted { color: var(--text-2); } .small { font-size: 16px; } .mono { font-family: var(--mono); }
.hl { color: var(--acc); }
.arr { font-family: var(--mono); font-weight: 400; }
.ico { display: inline-block; vertical-align: -3px; flex: none; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 560px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 500; font-size: 16px; }
.score-pill { margin-left: auto; font-family: var(--mono); font-size: 16px; color: var(--text-2); }
.score-pill b { color: var(--text); font-weight: 600; }
.progress { display: flex; gap: 4px; max-width: 560px; margin: 0 auto; padding: 0 16px 10px; }
.progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--line2); }
.progress i.done { background: var(--acc); }
.progress i.now { background: var(--acc-fill); box-shadow: inset 0 0 0 1px var(--acc-edge); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin: 16px 0; }
.kicker { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }
.kicker .pts { font-family: var(--mono); color: var(--acc); }

label.field { display: block; margin: 0 0 14px; font-size: 16px; color: var(--text-2); }
label.field input { display: block; width: 100%; margin-top: 6px; font: 400 17px var(--font); color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-md); padding: 12px 14px; }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
textarea { width: 100%; min-height: 150px; font: 400 17px/1.5 var(--font); color: var(--text); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md); padding: 12px 14px; resize: vertical; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px;
  border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: 500 17px var(--font); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--acc-fill); border-color: var(--acc-edge); color: var(--on); }
.btn.block { width: 100%; }
.btn:disabled { background: var(--raised); border-color: var(--line2); color: var(--text-2); cursor: not-allowed; font-weight: 400; }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 6; }
.actionbar .in { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.actionbar .btn { flex: 1; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 8px 0 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--acc); color: var(--acc); font: 500 16px/27px var(--mono); text-align: center; }

.story { font-size: 19px; font-weight: 300; line-height: 1.5; }

/* circuit */
.slot-list { display: grid; gap: 8px; margin: 8px 0 18px; }
.slot { display: grid; grid-template-columns: 140px 1fr; align-items: stretch; border: 1.5px solid var(--line2);
  border-radius: var(--r-md); background: var(--surface); min-height: 64px; overflow: hidden; }
.slot .name { display: flex; align-items: center; gap: 8px; padding: 0 10px; font: 500 16px var(--mono); color: var(--acc);
  background: var(--acc-bg); }
.slot .name span { color: var(--text-2); font-weight: 400; }
.slot button { all: unset; cursor: pointer; padding: 10px 12px; font-size: 16px; line-height: 1.4; color: var(--text); }
.slot button.empty { color: var(--text-2); font-style: italic; }
.slot .slot-txt { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; font-size: 16px; line-height: 1.4; }
.slot .slot-txt .state { margin-top: 2px; }
.slot.ok { border-color: var(--acc-edge); } .slot.ok .state { color: var(--acc); }
.slot.bad { border-color: var(--warn); } .slot.bad .state { color: var(--warn); }
.slot.bad .name { background: var(--warn-bg); color: var(--warn); }
.slot .fb { grid-column: 1 / -1; padding: 8px 12px 10px; border-top: 1px solid var(--line); font-size: 16px; }
.pool { display: grid; gap: 8px; }
.card { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; padding: 12px 14px; font-size: 16px; line-height: 1.4;
  background: var(--surface); border: 1.5px solid var(--line2); border-radius: var(--r-md); }
.card:hover { border-color: var(--line-strong); }
.card.used { opacity: .35; pointer-events: none; }
.loop { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; color: var(--text-2); margin: -6px 0 16px; }

.story-head { display: flex; gap: 14px; align-items: flex-start; }
.story-ico { flex: none; width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--acc-bg); color: var(--acc); border: 1.5px solid var(--acc-edge); }
.c-ico { flex: none; color: var(--acc); display: inline-flex; margin-right: 10px; vertical-align: -4px; }
.card { display: flex !important; align-items: flex-start; }
.slot button .c-ico { margin-right: 8px; }
.vis-wrap { margin: 6px 0 10px; max-height: 120px; }
.vis-wrap svg { display: block; max-height: 120px; }

/* MCQ */
.q { font-size: 20px; font-weight: 400; line-height: 1.4; margin: 4px 0 16px; }
.opts { display: grid; gap: 10px; }
.opt { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; width: 100%;
  padding: 14px; border: 1.5px solid var(--line2); border-radius: var(--r-md); background: var(--surface); font-size: 17px; line-height: 1.4; }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-strong); font: 500 16px/27px var(--mono);
  text-align: center; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.opt .t { flex: 1; }
.opt .tag { display: block; margin-top: 4px; font-size: 16px; font-weight: 500; }
/* selected before Check: neutral, no green */
.opt.sel { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.opt.sel .k { background: var(--text); border-color: var(--text); color: var(--bg); }
/* after Check: verdict colours + icons + text tags */
.opt.right { border-color: var(--acc-edge); background: var(--acc-bg); }
.opt.right .k { background: var(--acc-fill); border-color: var(--acc-edge); color: var(--on); }
.opt.right .tag { color: var(--acc); }
.opt.wrong { border-color: var(--warn); background: var(--warn-bg); }
.opt.wrong .k { border-color: var(--warn); color: var(--warn); }
.opt.wrong .tag { color: var(--warn); }
.opt.dim { opacity: .6; }
.opts.locked .opt { cursor: default; }
.lock { font-size: 16px; color: var(--text-2); margin: 10px 0; display: flex; gap: 6px; align-items: center; }

.verdict { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 19px; margin-bottom: 8px; }
.verdict .mark { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.verdict.ok .mark { background: var(--acc-fill); color: var(--on); border: 1.5px solid var(--acc-edge); }
.verdict.bad .mark { background: var(--warn-bg); color: var(--warn); border: 1.5px solid var(--warn); }
.verdict .pts { margin-left: auto; font-family: var(--mono); font-size: 16px; color: var(--text-2); }
.fb-line { margin: 6px 0; } .fb-line b { font-weight: 500; }
.ref { font-size: 16px; color: var(--text-2); margin-top: 10px; }
.extra { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 16px; }

/* results */
.big-score { font: 300 72px/1 var(--mono); letter-spacing: -.03em; }
.big-score small { font-size: 26px; color: var(--text-2); }
.breakdown { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 17px; }
.breakdown td { padding: 8px 0; border-top: 1px solid var(--line); }
.breakdown td:last-child { text-align: right; font-family: var(--mono); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--acc); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.recs { padding-left: 20px; margin: 8px 0; } .recs li { margin-bottom: 8px; }

.error { color: var(--warn); font-size: 16px; margin: 8px 0; }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
