/* =====================================================================
   Arena učení v3 – čistý moderní styl (světlý, Inter), volitelně tmavý.
   Barvu lekce lze změnit: <body style="--accent:#0d9488">
   ===================================================================== */
@import url("fonts.css");

:root {
  --accent: #4f46e5;
  --bg: #ffffff; --bg-soft: #f6f7f9; --surface: #ffffff; --surface-2: #f8fafc;
  --line: #e5e7eb; --line-2: #d1d5db;
  --text: #0f172a; --text-2: #334155; --muted: #64748b;
  --ok: #16a34a; --ok-soft: #ecfdf3; --bad: #dc2626; --bad-soft: #fef2f2; --warn: #b45309; --warn-soft: #fffbeb; --info: #0369a1; --info-soft: #f0f9ff;
  --radius: 16px; --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -8px rgba(15,23,42,.1);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22,1,.36,1);
  --wrap: 740px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1020; --bg-soft: #0f1629; --surface: #121a2e; --surface-2: #0f1629;
  --line: #1f2a44; --line-2: #2c3a5c; --text: #e8ecf6; --text-2: #c3cbe0; --muted: #8b95b3;
  --ok-soft: #0f2a1d; --bad-soft: #2d1416; --warn-soft: #2b2010; --info-soft: #0c2233;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -10px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* odvozené barvy se počítají na <body>, aby fungovala barva lekce z atributu style */
body { --accent-2: color-mix(in srgb, var(--accent) 80%, #000); --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff); --accent-line: color-mix(in srgb, var(--accent) 28%, #fff); }
[data-theme="dark"] body { --accent-soft: color-mix(in srgb, var(--accent) 16%, #0b1020); --accent-line: color-mix(in srgb, var(--accent) 45%, #0b1020); }
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text-2); font: 400 17.5px/1.72 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
::selection { background: var(--accent-soft); color: var(--text); }
img, video, iframe, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3, h4 { color: var(--text); font-weight: 750; letter-spacing: -.025em; line-height: 1.18; margin: 0 0 .5em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.25rem; margin-top: 1.9em; letter-spacing: -.015em; }
p, ul, ol { margin: 0 0 1.05em; }
strong { color: var(--text); font-weight: 650; }
li { margin: .3em 0; }
sub, sup { font-size: .72em; line-height: 0; }
hr { border: 0; height: 1px; background: var(--line); margin: 3em 0; }
code { font-family: var(--mono); font-size: .86em; background: var(--bg-soft); border: 1px solid var(--line); padding: .1em .4em; border-radius: 6px; }
pre { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; font-size: .9em; }
kbd { font: 600 .78em var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .87em; }
.f { font-weight: 650; color: var(--text); white-space: nowrap; }            /* chemický vzorec */
mark { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 22%, transparent) 58%); color: inherit; padding: 0 .1em; }
.aurora, .scroll-cue { display: none !important; }

/* tabulky */
.table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: .95em; }
.table-wrap table { margin: 0; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); color: var(--text); font-weight: 650; font-size: .88em; text-transform: none; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); }
td.c, th.c { text-align: center; }

/* ---------- horní lišta, průběh, obsah ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.topbar.scrolled { border-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: .75rem; }
.topbar .t { flex: 1; min-width: 0; font-size: .9rem; font-weight: 550; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .3s; }
.topbar.scrolled .t { opacity: 1; }
.xp { font: 650 .8rem var(--sans); color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.xp.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.15); } }
.icon-btn { width: 38px; height: 38px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: inline-grid; place-items: center; font-size: .9rem; transition: .2s; }
.icon-btn:hover { background: var(--bg-soft); }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 61; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.dots { display: none; }
@media (min-width: 1240px) {
  .dots { display: flex; flex-direction: column; gap: 2px; position: fixed; left: max(18px, calc(50vw - 640px)); top: 96px; width: 230px; max-height: calc(100vh - 120px); overflow: auto; z-index: 40; padding: 4px 0; opacity: 0; pointer-events: none; transition: opacity .35s; }
  body.past-hero .dots { opacity: 1; pointer-events: auto; }
  body.presenting .dots { opacity: 0 !important; pointer-events: none !important; }
  .dots::before { content: "Obsah"; font: 700 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 12px 8px; }
  .dots a { display: block; padding: 6px 12px; border-radius: 8px; font-size: .86rem; line-height: 1.35; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; }
  .dots a span { pointer-events: none; }
  .dots a:hover { color: var(--text); background: var(--bg-soft); }
  .dots a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
  .dots a.done::after { content: " ✓"; color: var(--ok); }
}

/* ---------- scény ---------- */
main.lesson { position: relative; }
.scene { position: relative; padding: 72px 22px; transition: opacity .5s var(--ease), filter .5s var(--ease); }
.scene + .scene { border-top: 1px solid var(--line); }
.scene:nth-of-type(even) { background: var(--bg-soft); }
.wrap { max-width: var(--wrap); margin: 0 auto; position: relative; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font: 650 .78rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.ch-head { margin-bottom: 26px; }
.ch-head .kicker { margin-bottom: 10px; }
.ch-num { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--accent); color: #fff; font: 700 .85rem var(--sans); margin: 0 12px 14px 0; vertical-align: middle; }
.lead { font-size: 1.15rem; color: var(--text-2); }

/* ---------- hero ---------- */
.hero { padding-top: 130px; padding-bottom: 80px; background: radial-gradient(900px 380px at 85% 0%, var(--accent-soft), transparent 70%), var(--bg) !important; }
.hero .wrap { max-width: 1080px; display: grid; grid-template-columns: 1fr; gap: 30px; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.06; margin-bottom: .35em; max-width: 16ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { max-width: 620px; font-size: clamp(1.08rem, 1.5vw, 1.22rem); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 22px 0 30px; }
.meta li { margin: 0; font-size: .87rem; color: var(--text-2); padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-present, .btn { display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; color: #fff; background: var(--accent); font: 650 1rem var(--sans); padding: 14px 24px; border-radius: 12px;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 60%, transparent); text-decoration: none; transition: transform .2s, background .2s; }
.btn-present:hover, .btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-present .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.22); font-size: .7rem; padding-left: 2px; }
.btn-present small { font-weight: 500; opacity: .85; font-size: .88rem; }
.btn { font-size: .95rem; padding: 11px 18px; border-radius: 10px; box-shadow: none; }
.btn.secondary, .btn-ghost { display: inline-flex; align-items: center; gap: 8px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); padding: 13px 20px; border-radius: 12px; font-weight: 600; text-decoration: none; }
.btn.secondary { padding: 10px 16px; border-radius: 10px; }
.btn.secondary:hover, .btn-ghost:hover { background: var(--bg-soft); transform: none; }
.resume { margin-top: 12px; font-size: .86rem; color: var(--muted); }
.resume button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
.orb { display: none; }
@media (min-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr 260px; align-items: center; }
  .orb { display: grid; place-items: center; width: 240px; height: 240px; border-radius: 48px; background: linear-gradient(145deg, var(--surface), var(--accent-soft)); border: 1px solid var(--line); box-shadow: var(--shadow);
    position: absolute; right: max(22px, calc(50vw - 540px)); top: 50%; transform: translateY(-40%) rotate(-4deg); }
  .orb span { font-size: 6.5rem; line-height: 1; }
}

/* ---------- cíle, „co umět“, karty ---------- */
.goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.goals li { margin: 0; display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.goals li::before { content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; background: var(--ok); margin-top: .18em; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 1.5em 0; }
.card { padding: 18px 18px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card .ic { font-size: 1.5rem; display: block; margin-bottom: 8px; }
.card b { display: block; font-size: 1.02rem; color: var(--text); margin-bottom: 4px; }
.card p { margin: 0; font-size: .93rem; line-height: 1.55; }

/* ---------- boxy ---------- */
.box { margin: 1.5em 0; padding: 16px 18px 16px 54px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line); position: relative; }
.box::before { position: absolute; left: 16px; top: 14px; font-size: 1.15rem; }
.box > :last-child { margin-bottom: 0; }
.box .box-title { display: block; font-weight: 700; color: var(--text); margin-bottom: .25em; }
.box.key { background: var(--accent-soft); border-color: var(--accent-line); } .box.key::before { content: "🧠"; }
.box.tip { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); } .box.tip::before { content: "💡"; }
.box.warn { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 22%, transparent); } .box.warn::before { content: "⚠️"; }
.box.example { background: var(--surface); } .box.example::before { content: "🔍"; }
.box.analogy { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 22%, transparent); } .box.analogy::before { content: "🪄"; }
.box.fact { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 22%, transparent); } .box.fact::before { content: "✨"; }
.box.mnemonic::before { content: "🔗"; } .box.story::before { content: "📖"; }
.quote { margin: 1.8em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); font-size: 1.2rem; font-style: italic; color: var(--text); }
.quote cite { display: block; margin-top: 8px; font-size: .85rem; font-style: normal; color: var(--muted); }

/* ---------- postup krok za krokem ---------- */
.steps { list-style: none; padding: 0; margin: 1.4em 0; counter-reset: st; }
.steps > li { counter-increment: st; position: relative; padding: 2px 0 16px 48px; margin: 0; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 .9rem var(--sans); color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 15.5px; top: 36px; bottom: 4px; width: 1px; background: var(--line-2); }
.steps > li b { color: var(--text); }
.worked { margin: 1.6em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.worked .w-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 18px; background: var(--bg-soft); border-bottom: 1px solid var(--line); font-weight: 650; color: var(--text); }
.worked .w-head span { font-weight: 500; color: var(--muted); font-size: .9rem; }
.worked ol { margin: 0; padding: 14px 18px 14px 40px; }
.worked li { margin: .35em 0; }
.worked .w-res { padding: 12px 18px; border-top: 1px dashed var(--line-2); font-weight: 650; color: var(--text); background: var(--ok-soft); }
.ox { font-size: .7em; vertical-align: .9em; color: var(--accent); font-weight: 700; margin-left: 1px; }

/* ---------- čísla, graf ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 1.6em 0; }
.stat { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat .n { display: block; font: 800 2.4rem/1 var(--sans); letter-spacing: -.03em; color: var(--accent); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.stat p { margin: 0; font-size: .92rem; line-height: 1.5; }
.chart { margin: 1.8em 0; padding: 22px 20px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.chart .legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; margin-bottom: 26px; }
.chart .legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart .legend span::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: #cbd5e1; }
.chart .legend .c-a::before { background: var(--accent); } .chart .legend .c-b::before { background: #0891b2; } .chart .legend .c-gold::before { background: #f59e0b; }
.chart .groups { display: flex; flex-wrap: wrap; gap: clamp(28px, 7vw, 80px); justify-content: center; }
.chart .group { display: flex; flex-direction: column; align-items: center; }
.chart .bars { height: 220px; display: flex; gap: 10px; align-items: flex-end; padding: 0 8px; border-bottom: 1px solid var(--line-2); }
.chart .bar { width: clamp(42px, 8vw, 70px); height: 0; border-radius: 8px 8px 2px 2px; position: relative; background: #cbd5e1; transition: height 1.3s var(--ease); }
.chart .bar.c-a { background: var(--accent); } .chart .bar.c-b { background: #0891b2; } .chart .bar.c-gold { background: #f59e0b; }
.chart.in .bar { height: calc(var(--v) * 1%); }
.chart .bar span { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); font: 700 .92rem var(--sans); color: var(--text); white-space: nowrap; opacity: 0; transition: opacity .5s .8s; }
.chart.in .bar span { opacity: 1; }
.chart .label { margin-top: 10px; font-size: .86rem; text-align: center; }
.chart .note { margin: 18px 0 0; font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------- obrázky, video ---------- */
figure { margin: 1.8em 0; }
figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
figcaption { margin-top: 10px; font-size: .85rem; line-height: 1.5; color: var(--muted); }
figcaption .credit { display: block; margin-top: 3px; font-size: .76rem; }
.diagram { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; text-align: center; }
.mermaid { background: none !important; border: 0 !important; margin: 0 !important; }
.video { margin: 1.8em 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.video .player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video .player img, .video .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video .play { position: absolute; inset: 0; border: 0; cursor: pointer; background: rgba(0,0,0,.18); display: grid; place-items: center; }
.video .play span { width: 68px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: #ff0033; font-size: 1.2rem; padding-left: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .2s; }
.video .play:hover span { transform: scale(1.08); }
.video .vinfo { padding: 14px 18px 16px; }
.video .vtitle { font-weight: 700; color: var(--text); line-height: 1.35; }
.video .vmeta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.video .vmeta a { color: var(--muted); }
.video .video-note { margin: 10px 0 0; font-size: .93rem; }

/* ---------- kvízy a test ---------- */
.quiz { margin: 1.6em 0; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.quiz .q { font-weight: 650; color: var(--text); margin: 0 0 14px; font-size: 1.05rem; }
.quiz .opts { display: grid; gap: 8px; counter-reset: opt; }
.quiz .opt { counter-increment: opt; position: relative; text-align: left; font: 500 .97rem/1.45 var(--sans); color: var(--text-2); padding: 12px 14px 12px 50px; border-radius: 10px; cursor: pointer; background: var(--surface); border: 1px solid var(--line-2); transition: border-color .2s, background .2s; }
.quiz .opt::before { content: counter(opt, upper-alpha); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font: 700 .78rem var(--sans); color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); }
.quiz .opt:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-soft); }
.quiz .opt[disabled] { cursor: default; }
.quiz .opt.correct { border-color: var(--ok); background: var(--ok-soft); color: var(--text); }
.quiz .opt.correct::before { content: "✓"; color: #fff; background: var(--ok); border-color: var(--ok); }
.quiz .opt.wrong { border-color: var(--bad); background: var(--bad-soft); animation: shake .4s; }
.quiz .opt.wrong::before { content: "✕"; color: #fff; background: var(--bad); border-color: var(--bad); }
@keyframes shake { 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
.quiz .feedback { margin-top: 12px; font-size: .95rem; }
.quiz .feedback:empty { display: none; }
.quiz .verdict { font-weight: 700; } .quiz .verdict.ok { color: var(--ok); } .quiz .verdict.bad { color: var(--bad); }
.quiz .xp-pop { margin-left: 6px; font: 700 .8rem var(--sans); color: var(--warn); }
.quiz .explain { display: none; }
.quiz.answered .explain { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: .94rem; }
.quiz .p-wait { margin: 10px 0 0; font-size: .85rem; color: var(--accent); font-weight: 600; }
input.fill, .drill input { font: 500 1.05rem var(--sans); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); width: min(100%, 360px); outline: none; }
input.fill:focus, .drill input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quiz .fill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.test { margin: 1.6em 0; padding: 4px 20px 20px; border-radius: calc(var(--radius) + 2px); border: 1px solid var(--accent-line); background: var(--surface); }
.test .score { position: sticky; top: 70px; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 700 .85rem var(--sans); color: var(--text);
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.test .score .lbl { flex: 1; min-width: 180px; font-size: .93rem; } .test .score .lbl b { display: block; color: var(--text); }

/* ---------- trenažér (drill) ---------- */
.drill { margin: 1.6em 0; border-radius: calc(var(--radius) + 2px); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.drill .d-top { padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--bg-soft); display: grid; gap: 10px; }
.drill .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.drill .chips button { font: 600 .84rem var(--sans); padding: 7px 12px; border-radius: 999px; cursor: pointer; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2); transition: .15s; }
.drill .chips button.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.drill .chips .lab { font: 700 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); align-self: center; margin-right: 4px; }
.drill .d-body { padding: 26px 22px 22px; }
.drill .d-type { font: 650 .78rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.drill .d-q { font: 750 clamp(1.4rem, 3.4vw, 2rem)/1.25 var(--sans); color: var(--text); letter-spacing: -.02em; margin-bottom: 18px; }
.drill .d-row { display: flex; flex-wrap: wrap; gap: 8px; }
.drill .d-hint { margin-top: 10px; font-size: .84rem; color: var(--muted); }
.drill .d-fb { margin-top: 16px; padding: 14px 16px; border-radius: 12px; display: none; }
.drill .d-fb.ok { display: block; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.drill .d-fb.bad { display: block; background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); }
.drill .d-fb b.v { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.drill .d-fb.ok b.v { color: var(--ok); } .drill .d-fb.bad b.v { color: var(--bad); }
.drill .d-fb ol { margin: 8px 0 0; padding-left: 22px; font-size: .93rem; }
.drill .d-stats { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--bg-soft); font-size: .84rem; }
.drill .d-stats span { padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.gen-test .gq { display: grid; grid-template-columns: 34px 1fr; gap: 6px 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.gen-test .gq .no { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font: 700 .82rem var(--sans); background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); }
.gen-test .gq .qq { font-weight: 600; color: var(--text); }
.gen-test .gq .qq small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.gen-test .gq input { margin-top: 6px; }
.gen-test .gq.ok .no { background: var(--ok); color: #fff; border-color: var(--ok); }
.gen-test .gq.bad .no { background: var(--bad); color: #fff; border-color: var(--bad); }
.gen-test .gq .res { grid-column: 2; font-size: .92rem; }
.gen-test .gq .res ol { margin: 6px 0 0; padding-left: 20px; }
.gen-test .g-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

/* ---------- vybavování, cvičení ---------- */
details > summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--text); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; width: 18px; color: var(--accent); transition: transform .2s; }
details[open] > summary::before { transform: rotate(90deg); }
.recall { margin: 1.5em 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px dashed var(--accent-line); }
.recall > summary::after { content: " · nejdřív si odpověz v duchu"; font-weight: 400; font-size: .82rem; color: var(--muted); }
.recall[open] > summary::after { content: ""; }
.recall > div { margin-top: 10px; }
.exercise { margin: 1.5em 0; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.exercise > p:first-child { color: var(--text); font-weight: 600; }
.exercise details { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); }
.exercise details.solution > summary { color: var(--ok); }

/* ---------- kartičky ---------- */
.flashcards { margin: 1.6em 0; }
.fc-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fc-stats span { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.fc-card { perspective: 1200px; cursor: pointer; outline: none; }
.fc-inner { position: relative; min-height: 230px; transform-style: preserve-3d; transition: transform .6s var(--ease); }
.fc-card.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; text-align: center; padding: 28px; border-radius: var(--radius);
  font: 700 clamp(1.25rem, 2.6vw, 1.6rem)/1.35 var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: auto; }
.fc-back { transform: rotateY(180deg); font-weight: 500; font-size: 1.05rem; line-height: 1.6; color: var(--text-2); border-color: var(--accent-line); background: var(--accent-soft); }
.fc-face .hint { position: absolute; bottom: 12px; left: 0; right: 0; font: 500 .74rem var(--sans); color: var(--muted); }
.fc-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fc-actions button { font: 600 .92rem var(--sans); padding: 10px 16px; border-radius: 10px; cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); }
.fc-actions .r1:hover { border-color: var(--bad); } .fc-actions .r2:hover { border-color: var(--warn); } .fc-actions .r3:hover { border-color: var(--ok); }
.fc-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.fc-tools button { background: none; border: 0; color: var(--muted); cursor: pointer; font: 500 .82rem var(--sans); text-decoration: underline; }
.fc-done { text-align: center; padding: 34px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }

/* ---------- tahák, plán, slovníček, zdroje ---------- */
.cheatsheet .cs-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.cs-item { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-size: .92rem; line-height: 1.55; }
.cs-item b { display: block; color: var(--text); margin-bottom: 3px; }
.review-plan ol { list-style: none; padding: 0; margin: 0 0 16px; }
.review-plan li { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 14px; margin: 0 0 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.review-plan li.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.review-plan li.past { opacity: .55; }
.review-plan .d { font-weight: 650; color: var(--text); min-width: 9em; }
.review-plan .actions { display: flex; flex-wrap: wrap; gap: 8px; }
dl.glossary { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; margin: 0; border-top: 1px solid var(--line); }
dl.glossary dt, dl.glossary dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.glossary dt { font-weight: 650; color: var(--text); padding-right: 20px; }
@media (max-width: 600px) { dl.glossary { grid-template-columns: 1fr; } dl.glossary dt { border-bottom: 0; padding-bottom: 0; } }
ol.sources { padding-left: 1.2em; font-size: .92rem; }
.done-row { margin-top: 26px; }
.done-btn { font: 600 .85rem var(--sans); padding: 8px 14px; border-radius: 10px; cursor: pointer; color: var(--muted); background: var(--surface); border: 1px solid var(--line-2); }
.done-btn:hover { color: var(--text); border-color: var(--accent); }
.done-btn.is-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }

/* ---------- jemné odhalování ---------- */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
.seq > * { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.seq > .seq-hide { opacity: 0 !important; transform: translateY(10px) !important; }

/* ---------- výklad (prezentace) ---------- */
body.presenting main > .scene:not(.p-active) { opacity: .28; filter: saturate(.6); }
body.presenting .p-active.p-sub .wrap > *:not(.p-root):not(.ch-head) { opacity: .45; transition: opacity .4s; }
.p-focus { position: relative; z-index: 3; border-radius: var(--radius-sm); box-shadow: 0 0 0 3px var(--accent-line), 0 12px 32px -10px color-mix(in srgb, var(--accent) 45%, transparent); transition: box-shadow .4s; }
.p-focus:is(p, ul, ol, li, h3, .lead) { box-shadow: -14px 0 0 -11px var(--accent); border-radius: 0; }
.p-stop { position: fixed; top: 12px; right: 16px; z-index: 90; display: none; align-items: center; gap: 9px; border: 0; cursor: pointer; padding: 10px 16px 10px 13px; border-radius: 999px;
  font: 650 .92rem var(--sans); color: #fff; background: #111827; box-shadow: 0 10px 30px -8px rgba(0,0,0,.45); }
.p-stop i { width: 10px; height: 10px; border-radius: 2px; background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(239,68,68,0); } }
.p-stop:hover { background: #000; }
body.presenting .p-stop { display: inline-flex; }
body.presenting .topbar { visibility: hidden; }
.toast { position: fixed; left: 50%; top: 76px; z-index: 95; transform: translate(-50%, -12px); opacity: 0; padding: 11px 18px; border-radius: 12px; font-size: .92rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: .35s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
canvas.confetti { position: fixed; inset: 0; z-index: 96; pointer-events: none; }

/* ---------- knihovna ---------- */
.lib-hero { text-align: center; padding: 130px 22px 30px; }
.lib-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; letter-spacing: -.035em; margin-bottom: .3em; }
.lib-hero h1 em { font-style: normal; color: var(--accent); }
.lib-hero p { max-width: 600px; margin: 0 auto; font-size: 1.1rem; }
.lib-tools { max-width: 520px; margin: 24px auto 36px; padding: 0 22px; }
.lib-tools input { width: 100%; font: 500 1rem var(--sans); color: var(--text); padding: 13px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); outline: none; }
.lib-tools input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lib-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(290px, 360px)); justify-content: center; max-width: 1200px; margin: 0 auto; padding: 0 22px 90px; }
.lesson-card { display: flex; flex-direction: column; gap: 9px; padding: 22px; border-radius: var(--radius); color: var(--text-2); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s; }
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lesson-card .e { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; background: var(--accent-soft); }
.lesson-card h2 { font-size: 1.25rem; margin: 4px 0 0; }
.lesson-card p { margin: 0; flex: 1; font-size: .94rem; line-height: 1.55; }
.lesson-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-card .tags span { font-size: .72rem; padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); }
.lesson-card .meta2 { display: flex; flex-wrap: wrap; gap: 10px; font-size: .8rem; color: var(--muted); }
.lesson-card .prog { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.lesson-card .prog i { display: block; height: 100%; width: 0; background: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
footer.site { text-align: center; color: var(--muted); font-size: .82rem; padding: 40px 22px 70px; border-top: 1px solid var(--line); }

/* ---------- mobil, tisk, omezený pohyb ---------- */
@media (max-width: 640px) {
  body { font-size: 16.5px; } .scene { padding: 56px 18px; } .hero { padding-top: 104px; padding-bottom: 56px; }
  .topbar { padding: 10px 14px; } .drill .d-body { padding: 20px 16px; } .quiz, .test { padding-left: 16px; padding-right: 16px; }
}
@media print {
  .topbar, .progress, .dots, .p-stop, .cta, .done-row, .video .player, .fc-actions, .fc-tools, .btn, .icon-btn, footer.site, .drill { display: none !important; }
  body { font-size: 11pt; } .scene { padding: 16px 0; background: none !important; } .rv { opacity: 1 !important; transform: none !important; }
  body.print-target main > *:not(.print-me) { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; } .rv { opacity: 1; transform: none; } .chart .bar { height: calc(var(--v) * 1%); } }
