:root {
  --ink: #1C2333;
  --muted: #5E6677;
  --line: #DADDE3;
  --paper: #FFFFFF;
  --wash: #F3F4F7;
  --accent: #2D5A9A;
  --me: #E0472B;
  --peer: #7A5CC2;
  --open: #C8741E; --enh: #A8325E; --cons: #2D5A9A; --trans: #2E8556;
  --radius-btn: 14px;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 1em; max-width: 62ch; }
.muted { color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 20px 48px; }

.btn-primary {
  background: var(--ink); color: #fff; border: 0; border-radius: var(--radius-btn);
  padding: 16px 26px; font-weight: 700; font-size: 1.05rem;
}
.btn-quiet { background: none; border: 0; color: var(--muted); padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }

.demo-banner {
  background: #FFF4D6; color: #6B4E00; font-size: .85rem; padding: 8px 20px; text-align: center;
}

/* ---- Kezdőképernyő ---- */
.intro-wheel { width: 132px; height: 132px; margin: 8px 0 20px; }
.intro ul { padding-left: 1.1em; color: var(--muted); max-width: 60ch; }

/* ---- Kérdőív ---- */
.progress { height: 6px; background: var(--wash); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.progress > div { height: 100%; background: var(--ink); width: 0; transition: width .25s ease; }
.counter { font-size: .9rem; color: var(--muted); margin-bottom: 28px; display: flex; justify-content: space-between; }
.portrait { font-size: clamp(1.25rem, 4.6vw, 1.6rem); font-weight: 600; line-height: 1.35; margin-bottom: 10px; min-height: 5.4em; }
.prompt { color: var(--muted); margin-bottom: 18px; }
.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-btn);
  padding: 14px 16px; font-size: 1.02rem; transition: border-color .12s, background .12s;
}
.opt .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); }
.opt:hover { border-color: #AEB4C0; }
.opt.selected { border-color: var(--ink); background: var(--wash); }
.opt.selected .dot { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 4px var(--wash); }

/* ---- Eredmény ---- */
.map-wrap { position: relative; margin: 8px -8px 0; }
svg.map { width: 100%; height: auto; display: block; }
svg.map .axis { stroke: var(--line); stroke-width: 2; }
svg.map .axis-end { fill: var(--muted); font-size: 26px; font-style: italic; }
svg.map .arrow { stroke-width: 2.5; opacity: .35; }
svg.map .arrow-label { font-size: 28px; font-weight: 700; opacity: .85; }
svg.map .country { fill: #8B93A3; }
svg.map .country.hl { fill: var(--ink); }
svg.map .leader { stroke: #8B93A3; stroke-width: 1.5; opacity: .7; }
svg.map .country-label { font-size: 28px; fill: #5E6677; font-weight: 600; }
svg.map .country-label.hl { fill: var(--ink); font-weight: 800; }
svg.map .peer { fill: var(--peer); opacity: .5; }
svg.map .peer.out, svg.map .me.out { fill: #fff; stroke-width: 4; }
svg.map .peer.out { stroke: var(--peer); }
svg.map .mean { fill: var(--accent); stroke: #fff; stroke-width: 3; }
svg.map .mean-label { font-size: 24px; font-weight: 800; fill: var(--accent); }
svg.map .me { fill: var(--me); stroke: #fff; stroke-width: 3; }
svg.map .me.out { stroke: var(--me); }
svg.map .me-halo { fill: var(--me); opacity: .18; }
svg.map .me-label { font-size: 30px; font-weight: 800; fill: var(--me); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--muted); margin: 6px 0 22px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: currentColor; }
.legend .l-me { color: var(--me); } .legend .l-country { color: #8B93A3; } .legend .l-peer { color: var(--peer); } .legend .l-mean { color: var(--accent); }

.near { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 28px; }
.near div { background: var(--wash); border-radius: 12px; padding: 12px; }
.near b { display: block; font-size: 1.05rem; }
.near small { color: var(--muted); }

.bars { display: grid; gap: 8px; margin: 10px 0 8px; }
.bar-row { display: grid; grid-template-columns: 7.4em 1fr; align-items: center; gap: 10px; font-size: .92rem; }
.bar-track { position: relative; height: 18px; background: var(--wash); border-radius: 4px; }
.bar-track .zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: #AEB4C0; }
.bar-track .fill { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; }
.bar-track .ref { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--ink); border-radius: 2px; }
.bars-note { font-size: .82rem; color: var(--muted); }

.status { font-size: .9rem; color: var(--muted); margin: 0 0 18px; }
.status.ok { color: #2E8556; } .status.err { color: #B3261E; }

details { margin-top: 30px; color: var(--muted); font-size: .9rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--ink); }

/* ---- Tanári nézet ---- */
.teacher { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; padding: 24px 32px; min-height: 100vh; align-items: start; }
.teacher .map-wrap { margin: 0; }
.teacher svg.map { max-height: calc(100vh - 48px); }
.side h1 { font-size: 2rem; }
.qr { background: #fff; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: inline-block; }
.qr svg { display: block; width: 240px; height: 240px; }
.url { font-size: .85rem; word-break: break-all; color: var(--muted); margin: 8px 0 20px; }
.count { font-size: 3.4rem; font-weight: 800; line-height: 1; }
.side .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn-outline { background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 9px 14px; font-weight: 600; }
.session-input { font: inherit; font-weight: 700; font-size: 1.1rem; border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px; width: 100%; }
@media (max-width: 900px) { .teacher { grid-template-columns: 1fr; padding: 16px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
