/* Layout: angelehnt an tlt-event.com. Dunkle Bühne, Bernstein als Akzent, Logo-Blau als zweite Farbe.
   Feste Seitenleiste mit dem Ablauf (Stufen > Module > Cues), rechts die Lektion in Lesebreite.
   Bewusst nur ein dunkles Erscheinungsbild wie die Website. */
:root {
  --bg: #030712;
  --surface: #0B1220;
  --surface-2: #111A2C;
  --ink: #FFF9EB;
  --muted: #A9AFBA;
  --line: #1F2838;
  --line-strong: #2E3A50;
  --accent: #FFAD19;
  --accent-ink: #1A1100;
  --accent-soft: rgba(255, 173, 25, 0.10);
  --blue: #2BA3D6;
  --blue-soft: rgba(43, 163, 214, 0.12);
  --ok: #5FD39A;
  --ok-soft: rgba(95, 211, 154, 0.12);
  --warn: #FF8F6B;
  --warn-soft: rgba(255, 143, 107, 0.10);
  --code-bg: #070D18;
  --font-display: "Bebas Neue", "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-body: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.65;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

.app { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }

/* Seitenleiste */
.rail {
  background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 22px 0 40px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 20px 20px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.brand img { width: 74px; height: auto; flex: none; }
.brand span { display: block; font-family: var(--font-display); font-size: 1.45rem; line-height: 0.95; letter-spacing: .02em; }
.brand small { display: block; font-family: var(--font-body); font-size: 0.68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-top: 3px; }
.overall { padding: 16px 20px; font-size: var(--step--1); color: var(--muted); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #FFC85A); width: 0; transition: width .4s; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 10px; }
.nav-links a { font-size: 0.8rem; font-weight: 600; color: var(--ink); text-decoration: none; border: 1px solid var(--line-strong); padding: 4px 11px; border-radius: 99px; }
.nav-links a.active, .nav-links a:hover { border-color: var(--accent); color: var(--accent); }
.stage-label { font-size: 0.68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 18px 20px 6px; }
.mod-link { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: baseline; padding: 7px 20px; color: var(--ink); text-decoration: none; font-size: 0.93rem; font-weight: 500; line-height: 1.3; }
.mod-link:hover { background: var(--surface-2); }
.mod-link.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.mod-link .n { font-family: var(--font-display); font-size: 1.05rem; color: var(--accent); }
.mod-link .st { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mod-link.soon { color: var(--muted); }
.mod-link.soon .n { color: var(--muted); }
.lesson-list { list-style: none; margin: 0 0 6px; padding: 0 0 0 58px; }
.lesson-list li + li { margin-top: 0; }
.lesson-list a { display: flex; gap: 8px; padding: 4px 20px 4px 0; color: var(--muted); text-decoration: none; font-size: 0.85rem; line-height: 1.35; }
.lesson-list a:hover, .lesson-list a.active { color: var(--ink); }
.lesson-list .chk { flex: none; width: 15px; height: 15px; margin-top: 2px; border: 1.5px solid var(--line-strong); border-radius: 4px; display: inline-grid; place-items: center; font-size: 10px; }
.lesson-list .done .chk { background: var(--ok); border-color: var(--ok); color: var(--bg); }

.topbar { display: none; }

/* Hauptbereich */
main { min-width: 0; padding-block: 44px 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 760px; margin: 0 auto; }
.eyebrow { font-size: 0.74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1; letter-spacing: .01em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 3.6rem); }
h1 em, h2 em { font-style: normal; color: var(--accent); }
h2 { font-size: 2rem; margin-top: 2.4rem; }
h3 { font-size: 1.5rem; margin-top: 1.8rem; }
h4 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; line-height: 1.35; margin: 0; }
p, ul, ol { margin: 0.9rem 0 0; }
li + li { margin-top: 0.35rem; }
b, strong { font-weight: 700; }
.lead { font-size: 1.15rem; color: var(--muted); margin-top: 1rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-top: 14px; }
.meta span::before { content: "● "; color: var(--accent); font-size: 0.6rem; vertical-align: 2px; }
.content { margin-top: 1.6rem; }
.content > :first-child { margin-top: 0; }

/* Bausteine in Lektionen */
.box { border-radius: var(--radius); padding: 18px 20px; margin-top: 1.5rem; }
.box > :first-child { margin-top: 0; }
.task { background: var(--accent-soft); border: 1px solid rgba(255, 173, 25, 0.45); }
.task h4::before { content: "Jetzt bist du dran"; display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.note { background: var(--blue-soft); border: 1px solid rgba(43, 163, 214, 0.4); }
.note h4 { color: var(--blue); }
.warn { background: var(--warn-soft); border: 1px solid rgba(255, 143, 107, 0.45); }
.warn h4 { color: var(--warn); }
.prompt { position: relative; margin-top: 1.3rem; background: var(--code-bg); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.prompt .p-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 0.72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.prompt pre { margin: 0; padding: 16px; white-space: pre-wrap; word-wrap: break-word; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6; color: var(--ink); }
.copy { font: inherit; font-size: 0.72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.copy:hover { background: #FFC24F; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 1.3rem; }
.compare > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.compare .bad h4 { color: var(--warn); }
.compare .good h4 { color: var(--ok); }
.compare p:first-of-type { margin-top: 6px; }
.table-wrap { overflow-x: auto; margin-top: 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; background: var(--surface); }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; background: var(--surface-2); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding-left: 44px; min-height: 30px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--accent); color: var(--accent); font-family: var(--font-display); font-size: 1.1rem; display: grid; place-items: center; }
.steps > li + li { margin-top: 0.85rem; }
.loop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 1.3rem; font-size: 0.88rem; font-weight: 600; }
.loop span { background: var(--surface); border: 1.5px solid var(--accent); border-radius: 8px; padding: 6px 12px; }
.loop i { font-style: normal; color: var(--accent); font-weight: 700; }
.tag { display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-strong); vertical-align: 2px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.soon { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Abschluss einer Lektion */
.finish { margin-top: 2.6rem; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.finish span { min-width: 0; flex: 1 1 260px; }
.donebtn { font: inherit; font-weight: 700; cursor: pointer; padding: 11px 20px; border-radius: 99px; border: 1.5px solid var(--ok); background: transparent; color: var(--ok); }
.donebtn:hover { background: var(--ok-soft); }
.donebtn.is-done { background: var(--ok); color: var(--bg); }
.pager { display: flex; gap: 12px; justify-content: space-between; margin-top: 16px; flex-wrap: wrap; }
.pager a { flex: 1 1 220px; display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; min-width: 0; font-weight: 600; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; font-size: 0.68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.pager .next { text-align: right; }

/* Startseite */
.hero { position: relative; border-radius: 18px; overflow: hidden; padding: 40px 32px 34px; background:
  radial-gradient(120% 90% at 20% 0%, rgba(255, 173, 25, 0.22), transparent 60%),
  radial-gradient(90% 80% at 100% 100%, rgba(43, 163, 214, 0.20), transparent 60%),
  var(--surface); border: 1px solid var(--line); }
.hero img { width: 92px; display: block; margin-bottom: 22px; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 4.4rem); }
.hero .lead { color: var(--ink); opacity: .86; max-width: 58ch; }
.gewerke { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 1.6rem; }
.gewerke div { border: 1.5px solid var(--accent); border-radius: 12px; padding: 12px 12px 10px; text-align: center; background: rgba(3, 7, 18, 0.4); }
.gewerke b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1; color: var(--accent); }
.gewerke span { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-top: 6px; line-height: 1.3; }
.btn { display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; padding: 12px 22px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); border: 0; margin-top: 1.4rem; }
.btn:hover { background: #FFC24F; }
.btn::after { content: "→"; }
.stage-block { margin-top: 2.6rem; }
.stage-block h2 { margin-top: 0; }
.stage-block > p { color: var(--muted); margin-top: 6px; }
.mod-row { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; gap: 14px; align-items: start; padding: 16px; margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.mod-row:hover { border-color: var(--accent); }
.mod-row .num { font-family: var(--font-display); font-size: 2.4rem; line-height: 0.9; color: var(--accent); }
.mod-row.soon .num { color: var(--line-strong); }
.mod-row h3 { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; line-height: 1.35; letter-spacing: 0; }
.mod-row p { margin: 4px 0 0; color: var(--muted); font-size: 0.93rem; }
.mod-row .right { text-align: right; font-size: 0.76rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lessons-overview { list-style: none; padding: 0; margin-top: 1.4rem; border-top: 1px solid var(--line); }
.lessons-overview li { margin: 0; }
.lessons-overview a, .lessons-overview .plain { display: grid; grid-template-columns: 74px minmax(0,1fr) auto; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.lessons-overview a:hover .t { color: var(--accent); }
.lessons-overview .cue { font-family: var(--font-display); font-size: 1.15rem; font-weight: 400; color: var(--accent); line-height: 1.35; }
.lessons-overview .m { font-size: 0.78rem; color: var(--muted); padding-top: 3px; font-weight: 500; }
.lessons-overview .plain { color: var(--muted); font-weight: 500; }
.lessons-overview .plain .cue { color: var(--line-strong); }
.celebrate { margin-top: 1.5rem; padding: 18px 20px; border-radius: var(--radius); background: var(--ok-soft); border: 1px solid rgba(95, 211, 154, 0.4); }
.celebrate h4 { color: var(--ok); }

/* Quiz */
.q { margin-top: 1.5rem; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.q h3 { margin-top: 0; font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; line-height: 1.45; letter-spacing: 0; text-wrap: pretty; }
.q .opts { display: grid; gap: 8px; margin-top: 12px; }
.q label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.q label:hover { border-color: var(--accent); }
.q input { margin-top: 6px; accent-color: var(--accent); }
.q.answered label { cursor: default; }
.q label.right { border-color: var(--ok); background: var(--ok-soft); }
.q label.wrong { border-color: var(--warn); background: var(--warn-soft); }
.q .explain { margin-top: 10px; font-size: 0.95rem; }
.q .explain b { color: var(--ok); }
.q .explain b.no { color: var(--warn); }
.score { margin-top: 1.6rem; padding: 18px 20px; border-radius: var(--radius); background: var(--ok-soft); border: 1px solid rgba(95, 211, 154, 0.4); }
.score h4 { color: var(--ok); }

.dl dt { margin-top: 1.1rem; font-family: var(--font-display); font-size: 1.45rem; color: var(--accent); line-height: 1.1; }
.dl dd { margin: 2px 0 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.checklist input { margin-top: 6px; accent-color: var(--ok); width: 17px; height: 17px; flex: none; }
.footer { margin-top: 4rem; font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

/* Mobil */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(3, 7, 18, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
    padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--bg); }
  .topbar a { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: .02em; }
  .topbar img { width: 54px; height: auto; }
  .topbar button { font: inherit; font-size: 0.85rem; font-weight: 700; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 99px; padding: 7px 16px; cursor: pointer; }
  .rail { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(320px, 88vw); height: 100%; transform: translateX(-102%); transition: transform .25s; padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
  .rail.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.6); }
  main { padding-block: 26px 64px; }
  .hero { padding: 28px 20px 24px; }
  .gewerke { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare { grid-template-columns: minmax(0, 1fr); }
  .mod-row { grid-template-columns: 44px minmax(0,1fr); }
  .mod-row .right { grid-column: 2; text-align: left; white-space: normal; }
  .lessons-overview a, .lessons-overview .plain { grid-template-columns: 60px minmax(0,1fr); }
  .lessons-overview .m { grid-column: 2; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Modultest */
.counter { margin-top: 1.4rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.score.retry { background: var(--accent-soft); border-color: rgba(255, 173, 25, 0.45); }
.score-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.score-top h3 { margin-top: 0; font-size: 2rem; }
.score-top > b { font-family: var(--font-display); font-weight: 400; font-size: 3.4rem; line-height: 0.9; color: var(--ok); white-space: nowrap; }
.score.retry .score-top > b, .score.retry .eyebrow { color: var(--accent); }
.score .eyebrow { color: var(--ok); margin-bottom: 4px; }
.score-top small { font-size: 1.6rem; color: var(--muted); }
.score .bar { margin-top: 12px; height: 8px; }
.score:not(.retry) .bar > span { background: var(--ok); }
.recs { margin-top: 1.2rem; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; }
.recs h4 { color: var(--accent); }
.recs ul { list-style: none; padding: 0; margin-top: 8px; }
.recs li { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); margin: 0; }
.recs li:first-child { border-top: 0; }
.recs a { font-weight: 700; text-decoration: none; }
.recs a:hover { text-decoration: underline; }
.recs span { font-size: 0.9rem; color: var(--muted); }
.wrap > .recs { margin-top: 1.5rem; }
.q .explain a { font-weight: 700; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.ghost::after { content: "↻"; }
.btn.ghost:hover { background: var(--accent-soft); }
.hero img.logo-full { width: 150px; }
