/* =========================================================
   LERNSTUDIO, Styles  (Redesign: dunkel, groß, mutig,
   schwarze Buttons mit gelbem Akzent · eigenständig, im
   Qualitäts-/Stimmungs-Stil moderner Lern-Plattformen)
   ========================================================= */

/* ---------- LICHT (Standard-Token) ---------- */
:root{
  --bg:        #f6f5ef;
  --bg-2:      #efeee6;
  --panel:     #ffffff;
  --panel-2:   #f3f2ea;
  --ink:       #191b21;
  --muted:     #5d636f;
  --line:      #e6e4d9;
  --accent:    #f5b400;   /* Signal-Gelb */
  --accent-ink:#1a1400;
  --accent-soft: rgba(245,180,0,.16);
  --brand:     #f5b400;   /* Fortschritt/Akzent = Gelb */
  --brand-ink: #1a1400;
  --btn-black: #14161c;   /* schwarze Buttons auch auf Hell */
  --btn-ink:   #ffffff;
  --good:      #14a865;
  --good-bg:   #e6f7ee;
  --bad:       #e0542f;
  --bad-bg:    #fdeae3;
  --warn:      #c98a15;
  --shadow:    0 10px 30px rgba(25,27,33,.09);
  --shadow-lg: 0 24px 60px rgba(25,27,33,.14);
  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --mono: "Cascadia Code","Consolas","SF Mono",ui-monospace,monospace;
  --sans: "Segoe UI Variable Display","Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
}

/* ---------- DUNKEL (der Star) ---------- */
:root[data-theme="dark"]{
  --bg:        #0a0a0b;
  --bg-2:      #14171e;
  --panel:     #191d26;
  --panel-2:   #212633;
  --ink:       #f3f1e9;
  --muted:     #9aa2b1;
  --line:      #2a2f3b;
  --accent:    #ffd60a;   /* leuchtendes Gelb auf Schwarz */
  --accent-ink:#1c1500;
  --accent-soft: rgba(255,214,10,.15);
  --brand:     #ffd60a;
  --brand-ink: #1c1500;
  --btn-black: #000000;   /* pures Schwarz */
  --btn-ink:   #ffffff;
  --good:      #46cd8f;
  --good-bg:   #10281f;
  --bad:       #ff7f5f;
  --bad-bg:    #2e1a15;
  --warn:      #ffd60a;
  --shadow:    0 16px 40px rgba(0,0,0,.45);
  --shadow-lg: 0 30px 70px rgba(0,0,0,.55);
}

*{ box-sizing:border-box; }
html,body{ margin:0; height:100%; }
body{
  background-color:var(--bg);
  background-image:
    radial-gradient(circle at 50% -8%, color-mix(in srgb,var(--accent) 8%,transparent), transparent 46%),
    radial-gradient(color-mix(in srgb,var(--ink) 8%,transparent) 1.1px, transparent 1.1px);
  background-size:auto, 23px 23px;
  background-attachment:fixed, fixed;
  color:var(--ink);
  font-family:var(--sans);
  font-size:16.5px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

/* ================= HEADER ================= */
header.app{
  display:flex; align-items:center; gap:18px;
  padding:15px 26px;
  background:color-mix(in srgb,var(--panel) 88%,transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:20;
}
.brand{ display:flex; align-items:center; gap:13px; cursor:pointer; }
.brand .logo{
  width:44px;height:44px;border-radius:13px;
  background:linear-gradient(145deg,var(--accent),#ffb020);
  display:grid;place-items:center;font-size:24px;
  box-shadow:0 8px 22px color-mix(in srgb,var(--accent) 40%,transparent);
}
.brand b{ font-size:20px; letter-spacing:-.3px; font-weight:800; }
.brand span{ color:var(--muted); font-size:12.5px; display:block; margin-top:-3px; }
.spacer{ flex:1; }

.xp{
  background:var(--panel-2); border:1px solid var(--line); border-radius:999px;
  padding:8px 15px; font-size:14px; color:var(--muted); white-space:nowrap; font-weight:600;
}
.xp b{ color:var(--accent); }

.ring{ display:flex; align-items:center; gap:10px; }
.ring svg{ transform:rotate(-90deg); }
.ring .track{ stroke:var(--line); }
.ring .val{ stroke:var(--accent); stroke-linecap:round; transition:stroke-dashoffset .7s ease; }
.ring b{ font-size:15px; font-weight:800; }
.ring small{ color:var(--muted); font-size:11px; display:block; }

.account{
  display:flex; align-items:center; gap:10px;
  background:var(--panel-2); border:1px solid var(--line); border-radius:999px;
  padding:6px 14px 6px 7px; cursor:pointer; color:var(--ink); font-family:inherit; font-size:14.5px;
  transition:border-color .15s, transform .15s;
}
.account:hover{ border-color:var(--accent); transform:translateY(-1px); }
.avatar{
  width:34px;height:34px;border-radius:50%; display:grid;place-items:center;font-size:19px;flex:none;
  background:linear-gradient(145deg,var(--accent),#ffb020); color:#1c1500;
}
.account .aname{ font-weight:700; max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account .caret{ color:var(--muted); font-size:11px; }

.iconbtn{
  background:var(--panel-2); border:1px solid var(--line); color:var(--ink);
  width:44px;height:44px;border-radius:13px;cursor:pointer;font-size:18px;
  display:grid;place-items:center; transition:border-color .15s, transform .15s;
}
.iconbtn:hover{ border-color:var(--accent); transform:translateY(-1px); }

/* ================= LAYOUT ================= */
.layout{ display:grid; grid-template-columns:320px 1fr; min-height:calc(100vh - 76px); }
aside.sidebar{
  background:color-mix(in srgb,var(--panel) 70%,transparent);
  border-right:1px solid var(--line);
  padding:18px; overflow-y:auto;
  height:calc(100vh - 76px); position:sticky; top:76px;
}
main.content{ padding:34px 44px; max-width:1140px; margin:0 auto; width:100%; animation:fadeup .45s ease both; }
@keyframes fadeup{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion:reduce){ main.content{ animation:none; } }

/* ================= SIDEBAR ================= */
.sb-home{
  width:100%; text-align:left; border:1px solid var(--line); background:var(--panel-2);
  color:var(--ink); padding:13px 15px; border-radius:14px; cursor:pointer; font-size:15px;
  display:flex; align-items:center; gap:9px; margin-bottom:16px; font-weight:700;
  transition:border-color .15s, transform .15s;
}
.sb-home:hover{ border-color:var(--accent); transform:translateY(-1px); }
.sb-track{ margin-bottom:12px; border:1px solid var(--line); border-radius:16px; overflow:hidden; background:var(--panel); }
.sb-track > .head{ display:flex; align-items:center; gap:11px; padding:13px 15px; cursor:pointer; user-select:none; transition:background .15s; }
.sb-track > .head:hover{ background:var(--panel-2); }
.sb-track .tico{ width:30px;height:30px;border-radius:9px;display:grid;place-items:center;font-size:16px;color:#fff; }
.sb-track .tname{ font-weight:700; font-size:15px; flex:1; }
.sb-track .tpct{ font-size:13px; color:var(--accent); font-weight:700; }
.sb-stagelist{ padding:5px 9px 12px; display:none; }
.sb-track.open .sb-stagelist{ display:block; }
.sb-stage{ margin:8px 0; }
.sb-stage .stitle{ font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.6px; padding:5px 7px; font-weight:700; }
.sb-lesson{
  display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  background:transparent; border:0; color:var(--ink); padding:9px 10px; border-radius:10px;
  cursor:pointer; font-size:14.5px; font-family:inherit; transition:background .12s;
}
.sb-lesson:hover{ background:var(--panel-2); }
.sb-lesson.active{ background:var(--accent-soft); color:var(--ink); font-weight:700; box-shadow:inset 3px 0 0 var(--accent); }
.sb-lesson .dot{
  width:19px;height:19px;border-radius:50%;border:2px solid var(--line);flex:none;
  display:grid;place-items:center;font-size:11px;color:#0c0e13;
}
.sb-lesson.done .dot{ background:var(--accent); border-color:var(--accent); }
.coming{ font-size:12px; color:var(--muted); padding:5px 8px; font-style:italic; }

/* ================= TYPOGRAPHIE / DASHBOARD ================= */
.h1{ font-size:clamp(28px,3.6vw,38px); font-weight:800; letter-spacing:-.8px; margin:0 0 6px; line-height:1.08; text-wrap:balance; }
.sub{ color:var(--muted); margin:0 0 26px; font-size:16px; }

/* HERO, Codecademy-Stil: „Sticker"-Blöcke auf schwarzem Punkte-Grund */
.hero{ padding:24px 2px 20px; margin-bottom:22px; }
.hero-eyebrow{ font-family:var(--mono); font-size:13px; letter-spacing:.16em; color:var(--accent); font-weight:700; margin-bottom:22px; }
.hero-h1{ font-size:clamp(32px,5.6vw,60px); font-weight:800; letter-spacing:-1.5px; line-height:1.32; margin:0; }
.hero-h1 .sticker,.hero-h1 .hl{ padding:.05em .3em; border-radius:14px; box-decoration-break:clone; -webkit-box-decoration-break:clone; }
.hero-h1 .sticker{ background:#fff; color:#0a0a0b; box-shadow:0 8px 26px rgba(0,0,0,.5); }
:root[data-theme="light"] .hero-h1 .sticker{ background:#0a0a0b; color:#fff; }
.hero-h1 .hl{ background:var(--accent); color:#141100; box-shadow:0 8px 26px color-mix(in srgb,var(--accent) 32%,transparent); }
.hero-code{ font-family:var(--mono); color:#7fd4ff; font-size:15px; margin:24px 0 0; }
.hero-code .cd-slash{ color:var(--accent); }
.hero-sub{ color:#c6c8cf; font-size:17px; max-width:60ch; margin:14px 0 24px; }
.hero-sub b{ color:#fff; }
.hero-actions{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.hero-actions .btn.primary{ font-size:17px; padding:16px 30px; }
.hero-stat{ text-align:center; color:#c6c8cf; }
.hero-stat b{ display:block; font-size:25px; font-weight:800; color:var(--accent); line-height:1; }
.hero-stat span{ font-size:12px; }
.grid3{ display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:18px; }
@media(max-width:900px){ .grid3{ grid-template-columns:1fr 1fr; } .layout{ grid-template-columns:1fr; } aside.sidebar{ position:static; height:auto; } }
@media(max-width:560px){ .grid3{ grid-template-columns:1fr; } main.content{ padding:22px 18px; } }

.trackcard{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:22px; box-shadow:var(--shadow); cursor:pointer; position:relative; overflow:hidden;
  transition:transform .18s, border-color .18s, box-shadow .18s;
}
.trackcard::after{ content:""; position:absolute; left:0; right:0; top:0; height:4px; background:var(--accent); opacity:0; transition:opacity .18s; }
.trackcard:hover{ transform:translateY(-5px); border-color:color-mix(in srgb,var(--accent) 55%,var(--line)); box-shadow:var(--shadow-lg); }
.trackcard:hover::after{ opacity:1; }
.trackcard .tc-ico{ width:54px;height:54px;border-radius:15px;display:grid;place-items:center;font-size:27px;color:#fff;margin-bottom:15px; box-shadow:var(--shadow); }
.trackcard h3{ margin:0 0 4px; font-size:20px; font-weight:800; letter-spacing:-.3px; }
.trackcard p{ margin:0 0 16px; color:var(--muted); font-size:14px; min-height:38px; }
.bar{ height:11px; background:var(--panel-2); border:1px solid var(--line); border-radius:99px; overflow:hidden; }
.bar > i{ display:block; height:100%; background:linear-gradient(90deg,var(--accent),#ffb020); width:0; transition:width .7s; }
.trackcard .meta{ display:flex; justify-content:space-between; margin-top:10px; font-size:13px; color:var(--muted); font-weight:600; }

.refcard{
  display:flex; align-items:center; gap:18px; background:var(--panel); border:1px solid var(--line);
  border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow); margin-top:16px;
  transition:transform .18s, border-color .18s;
}
.refcard:hover{ transform:translateY(-3px); border-color:color-mix(in srgb,var(--accent) 45%,var(--line)); }
.refcard-ico{ width:52px;height:52px;border-radius:15px;display:grid;place-items:center;font-size:27px;background:var(--panel-2);border:1px solid var(--line); }

/* Abzeichen */
.badges{ display:flex; flex-wrap:wrap; gap:9px; margin:10px 0 6px; }
.badge-pill{ display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:700; padding:6px 13px; border-radius:999px; background:var(--panel); border:1.5px solid var(--line); box-shadow:var(--shadow); }
.badge-pill span{ font-size:16px; }

/* ================= ROADMAP ================= */
.ladder{ margin-top:12px; }
.rung{
  display:flex; align-items:center; gap:16px; padding:16px 18px; border:1px solid var(--line);
  border-radius:16px; background:var(--panel); margin-bottom:12px; transition:transform .15s, border-color .15s, box-shadow .15s;
}
.rung .no{
  width:46px;height:46px;border-radius:13px;flex:none;display:grid;place-items:center;
  font-weight:800; background:var(--panel-2); border:1px solid var(--line); font-size:16px;
}
.rung.done .no{ background:var(--accent); color:#0c0e13; border-color:var(--accent); }
.rung.active-stage{ border-color:color-mix(in srgb,var(--accent) 60%,var(--line)); box-shadow:var(--shadow); }
.rung .info{ flex:1; }
.rung .info b{ font-size:16.5px; font-weight:800; }
.rung .info small{ display:block; color:var(--muted); font-size:13.5px; margin-top:2px; }
.rung .st{ font-size:12.5px; color:var(--muted); text-align:right; }
.rung .st .pctnum{ font-weight:800; color:var(--accent); font-size:16px; }
.rung.locked{ opacity:.6; }
.rung[style*="pointer"]:hover{ transform:translateY(-2px); border-color:color-mix(in srgb,var(--accent) 50%,var(--line)); box-shadow:var(--shadow); }

.ethics{ background:var(--good-bg); border:1px solid var(--good); border-radius:14px; padding:14px 18px; font-size:14.5px; margin-bottom:18px; }

/* ================= LEKTION ================= */
.crumbs{ color:var(--muted); font-size:14px; margin-bottom:10px; }
.crumbs a{ color:var(--accent); cursor:pointer; text-decoration:none; font-weight:600; }
.crumbs a:hover{ text-decoration:underline; }
.lesson h2{ font-size:27px; font-weight:800; letter-spacing:-.5px; margin:0 0 6px; text-wrap:balance; }
.lesson .theory,.theory{
  background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
  padding:22px 26px; box-shadow:var(--shadow); margin:16px 0 20px; font-size:16px;
}
.theory p{ margin:0 0 13px; }
.theory h4{ margin:20px 0 8px; font-size:17px; font-weight:800; }
.theory ul{ margin:0 0 13px; padding-left:24px; }
.theory li{ margin:5px 0; }
.theory code{ background:var(--panel-2); border:1px solid var(--line); padding:2px 7px; border-radius:7px; font-family:var(--mono); font-size:14px; color:var(--accent); }
.theory pre{ background:#0a0c11; color:#eef1f6; padding:16px 18px; border-radius:13px; overflow:auto; font-family:var(--mono); font-size:14px; line-height:1.55; border:1px solid var(--line); }
.tip{ background:var(--accent-soft); border-left:4px solid var(--accent); padding:12px 16px; border-radius:10px; margin:14px 0; font-size:14.5px; }

/* ---- Aufgabe / Editor ---- */
.task{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; margin-bottom:22px; }
.task .thead{ padding:15px 20px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:11px; }
.task .thead .badge{ font-size:11px; text-transform:uppercase; letter-spacing:.6px; background:var(--accent-soft); border:1px solid color-mix(in srgb,var(--accent) 40%,var(--line)); padding:4px 10px; border-radius:999px; color:var(--accent); font-weight:800; }
.task .thead b{ font-size:16px; font-weight:800; }
.task .prompt{ padding:16px 20px 6px; font-size:15.5px; }
.editor-wrap{ padding:0 20px 16px; }
textarea.editor{
  width:100%; min-height:170px; resize:vertical; background:#0a0c11; color:#eef1f6;
  border:1px solid var(--line); border-radius:13px; padding:16px; font-family:var(--mono);
  font-size:15px; line-height:1.6; tab-size:2;
}
textarea.editor:focus{ outline:2px solid var(--accent); border-color:transparent; }
.editor-actions{ display:flex; gap:11px; align-items:center; padding:0 20px 18px; flex-wrap:wrap; }

/* ---- BUTTONS (schwarz mit gelbem Rand/Akzent) ---- */
.btn{
  border:0; border-radius:13px; padding:13px 22px; font-size:15.5px; font-weight:800; cursor:pointer;
  font-family:inherit; display:inline-flex; align-items:center; gap:9px; letter-spacing:.1px;
  transition:transform .15s, box-shadow .15s, border-color .15s, filter .15s;
}
.btn.primary{
  background:var(--accent); color:#141100;
  border:1.5px solid var(--accent);
  box-shadow:0 6px 18px color-mix(in srgb,var(--accent) 30%,transparent);
}
.btn.primary:hover{ transform:translateY(-2px); filter:brightness(1.06); box-shadow:0 12px 30px color-mix(in srgb,var(--accent) 45%,transparent); }
.btn.primary:active{ transform:translateY(0); }
/* schwarzer Button-Variant (wie „Join Pro") */
.btn.dark{ background:#000; color:#fff; border:1.5px solid #2a2a2e; }
.btn.dark:hover{ transform:translateY(-2px); border-color:var(--accent); }
.btn.ghost{ background:var(--panel-2); color:var(--ink); border:1.5px solid var(--line); }
.btn.ghost:hover{ border-color:var(--accent); transform:translateY(-2px); }
.btn.good{ background:var(--good); color:#04170e; border:1.5px solid transparent; }
.btn.good:hover{ transform:translateY(-2px); filter:brightness(1.06); box-shadow:0 10px 24px rgba(0,0,0,.28); }
.btn:disabled{ opacity:.45; cursor:not-allowed; transform:none !important; box-shadow:none; }
.btn:focus-visible{ outline:3px solid var(--accent-soft); outline-offset:2px; }

.output{ margin:0 20px 20px; }
.output .olabel{ font-size:12.5px; color:var(--muted); margin-bottom:7px; font-weight:600; }
pre.console{ background:#07090d; color:#c9f0d6; border:1px solid var(--line); border-radius:13px; padding:14px 16px; font-family:var(--mono); font-size:14px; min-height:48px; white-space:pre-wrap; margin:0; max-height:300px; overflow:auto; }
iframe.preview{ width:100%; height:230px; border:1px solid var(--line); border-radius:13px; background:#fff; }
.verdict{ margin:0 20px 20px; padding:14px 18px; border-radius:13px; font-size:15px; display:none; align-items:flex-start; gap:11px; }
.verdict.show{ display:flex; }
.verdict.ok{ background:var(--good-bg); border:1px solid var(--good); color:var(--good); }
.verdict.no{ background:var(--bad-bg); border:1px solid var(--bad); color:var(--bad); }
.verdict .vico{ font-size:20px; }
.hintbox{ margin:0 20px 18px; font-size:14.5px; color:var(--muted); }
.hintbox .h{ background:var(--panel-2); border:1px solid var(--line); border-radius:10px; padding:10px 14px; margin-top:7px; }

/* ---- CTF / Flag ---- */
.task.ctf .thead{ background:var(--accent-soft); }
.material-wrap{ padding:8px 20px 0; }
pre.material{ background:#07090d; color:#cfe8ff; border:1px solid var(--line); border-radius:13px; padding:14px 16px; font-family:var(--mono); font-size:13.5px; line-height:1.55; overflow:auto; max-height:300px; white-space:pre-wrap; word-break:break-all; }
.flagrow{ display:flex; gap:11px; padding:16px 20px 6px; flex-wrap:wrap; }
.flag-input{ flex:1; min-width:210px; background:#0a0c11; color:#8effc0; border:1px solid var(--line); border-radius:13px; padding:13px 16px; font-family:var(--mono); font-size:16px; letter-spacing:.5px; }
.flag-input:focus{ outline:2px solid var(--accent); border-color:transparent; }

/* ---- Decoder ---- */
.decoder{ margin:10px 20px 6px; background:var(--panel-2); border:1px dashed var(--line); border-radius:14px; padding:15px 16px; }
.dec-title{ font-size:13.5px; font-weight:800; margin-bottom:9px; }
.dec-title small{ color:var(--muted); font-weight:400; }
.dec-in{ width:100%; background:var(--panel); border:1px solid var(--line); color:var(--ink); border-radius:10px; padding:11px 13px; font-family:var(--mono); font-size:14px; margin-bottom:9px; }
.dec-out{ display:grid; gap:6px; }
.dec-out > div{ display:flex; align-items:baseline; gap:9px; font-size:13.5px; }
.dec-out span{ color:var(--muted); min-width:88px; display:inline-block; }
.dec-out code{ font-family:var(--mono); background:var(--panel); border:1px solid var(--line); border-radius:7px; padding:3px 9px; word-break:break-all; color:var(--accent); }

/* ---- Quiz ---- */
.quiz .q{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px; margin-bottom:15px; box-shadow:var(--shadow); }
.quiz .q .qtext{ font-weight:800; margin-bottom:12px; font-size:16.5px; }
.quiz .opt{ display:flex; align-items:center; gap:11px; padding:12px 15px; border:1.5px solid var(--line); border-radius:12px; margin-bottom:9px; cursor:pointer; background:var(--panel-2); font-size:15px; transition:border-color .12s, transform .12s; }
.quiz .opt:hover{ border-color:var(--accent); transform:translateX(2px); }
.quiz .opt.correct{ border-color:var(--good); background:var(--good-bg); }
.quiz .opt.wrong{ border-color:var(--bad); background:var(--bad-bg); }
.quiz .why{ font-size:14px; color:var(--muted); margin-top:9px; display:none; }
.quiz .why.show{ display:block; }

.lessonnav{ display:flex; justify-content:space-between; margin-top:12px; gap:12px; }

/* Codecademy-Stil: zweispaltiges Lernfenster (links lernen, rechts coden) */
.lesson-split{ display:grid; grid-template-columns:minmax(300px,43%) 1fr; gap:22px; align-items:start; margin:16px 0 20px; }
.lesson-split .ls-left{ min-width:0; }
.lesson-split .ls-right{ min-width:0; position:sticky; top:92px; }
.lesson-split .theory{ margin:0; }
.lesson-split .task{ margin:0; }
@media(max-width:900px){ .lesson-split{ grid-template-columns:1fr; } .lesson-split .ls-right{ position:static; } }

/* ================= WISSENS-DATENBANK ================= */
.search{ width:100%; background:var(--panel); border:1px solid var(--line); color:var(--ink); border-radius:14px; padding:15px 18px; font-size:16px; font-family:inherit; margin:6px 0 20px; box-shadow:var(--shadow); }
.search:focus{ outline:2px solid var(--accent); border-color:transparent; }
.ref-results{ display:flex; flex-direction:column; gap:18px; }
.cheat{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow); }
.cheat-head{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.cheat-ico{ width:30px;height:30px;border-radius:9px;display:grid;place-items:center;color:#fff;font-size:17px; }
.cheat-head b{ font-size:16px; font-weight:800; }
.cheat-table{ width:100%; border-collapse:collapse; }
.cheat-table td{ padding:7px 9px; border-top:1px solid var(--line); vertical-align:top; font-size:14px; }
.cheat-table td:first-child{ width:44%; }
.cheat-table code{ font-family:var(--mono); font-size:13.5px; background:var(--panel-2); border:1px solid var(--line); padding:2px 7px; border-radius:7px; color:var(--accent); word-break:break-word; }
.glossary{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:16px 20px; box-shadow:var(--shadow); }
.gitem{ padding:11px 0; border-top:1px solid var(--line); }
.gitem:first-of-type{ border-top:0; }
.gitem b{ display:block; margin-bottom:3px; font-size:15.5px; }
.gitem span{ color:var(--muted); font-size:14px; }

/* ================= GRUNDLAGEN-KATALOG ================= */
.basics-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:16px; margin-top:8px; }
.bcard{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); cursor:pointer; position:relative; overflow:hidden; transition:transform .18s, border-color .18s, box-shadow .18s; }
.bcard::after{ content:""; position:absolute; left:0;right:0;top:0;height:4px; background:var(--accent); opacity:0; transition:opacity .18s; }
.bcard:hover{ transform:translateY(-5px); border-color:color-mix(in srgb,var(--accent) 50%,var(--line)); box-shadow:var(--shadow-lg); }
.bcard:hover::after{ opacity:1; }
.bcard .bnum{ font-family:var(--mono); font-size:12px; color:var(--accent); letter-spacing:.14em; font-weight:700; }
.bcard .bico{ font-size:30px; margin:5px 0 9px; }
.bcard h3{ margin:0 0 6px; font-size:17.5px; font-weight:800; letter-spacing:-.2px; }
.bcard p{ margin:0; font-size:14px; color:var(--muted); }

.article{ max-width:760px; }
.article > .lead{ font-size:18px; color:var(--muted); margin:4px 0 16px; }
.article section{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:20px 24px; margin:16px 0; box-shadow:var(--shadow); }
.article section > h3{ margin:0 0 12px; font-size:19px; font-weight:800; letter-spacing:-.2px; }
.article section p{ margin:0 0 13px; font-size:16px; } .article section p:last-child{ margin-bottom:0; }
.article .analogy{ border-left:4px solid var(--accent); background:var(--accent-soft); padding:13px 17px; border-radius:10px; font-size:15.5px; }
.article .analogy b{ color:var(--accent); }
.article code{ font-family:var(--mono); background:var(--panel-2); border:1px solid var(--line); padding:2px 7px; border-radius:7px; font-size:14px; color:var(--accent); }
.article .mathex{ font-family:var(--mono); background:#07090d; color:#cfe8ff; border:1px solid var(--line); border-radius:13px; padding:15px 17px; font-size:14px; white-space:pre-wrap; line-height:1.65; margin:4px 0 0; }
.terms{ display:flex; flex-wrap:wrap; gap:9px; margin-top:8px; }
.term{ font-size:12.5px; background:var(--panel-2); border:1px solid var(--line); border-radius:9px; padding:6px 11px; }
.term b{ color:var(--accent); } .term span{ color:var(--muted); }
.takeaway{ background:var(--accent-soft); border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line)); border-radius:14px; padding:14px 18px; font-size:15.5px; margin-top:16px; }
.takeaway b{ color:var(--accent); }
.misconception{ background:var(--bad-bg); border-left:4px solid var(--bad); border-radius:10px; padding:12px 16px; font-size:14.5px; margin:12px 0 0; }
.misconception b{ color:var(--bad); }

/* ---- interaktive Demos ---- */
.demo{ background:var(--panel-2); border:1px dashed var(--line); border-radius:14px; padding:16px; margin:8px 0 0; }
.demo-title{ font-size:13px; font-weight:800; color:var(--muted); margin-bottom:12px; text-transform:uppercase; letter-spacing:.07em; }
.demo label{ font-size:14px; color:var(--muted); }
.demo input[type=number], .demo input[type=text]{ background:var(--panel); border:1px solid var(--line); color:var(--ink); border-radius:10px; padding:9px 12px; font-family:var(--mono); font-size:15px; width:130px; }
.demo input:focus{ outline:2px solid var(--accent); border-color:transparent; }
.bits{ display:flex; gap:7px; flex-wrap:wrap; margin-top:12px; }
.bit{ width:48px; height:60px; border-radius:10px; border:1px solid var(--line); background:var(--panel); display:grid; place-items:center; font-family:var(--mono); font-size:20px; position:relative; cursor:pointer; user-select:none; transition:transform .1s; }
.bit:hover{ transform:translateY(-2px); }
.bit.on{ background:linear-gradient(145deg,var(--accent),#ffb020); color:#1c1500; border-color:transparent; box-shadow:0 6px 16px color-mix(in srgb,var(--accent) 35%,transparent); }
.bit small{ position:absolute; bottom:4px; font-size:9px; color:var(--muted); }
.bit.on small{ color:#5a4600; }
.bitsum{ font-family:var(--mono); font-size:15px; margin-top:12px; color:var(--ink); font-weight:600; }
.hoverbox{ height:104px; border-radius:12px; border:2px dashed var(--line); display:grid; place-items:center; text-align:center; color:var(--muted); transition:background .08s, border-color .08s; user-select:none; font-size:15px; }
.hoverbox.active{ border-color:var(--accent); background:var(--accent-soft); color:var(--ink); }
.readout{ font-family:var(--mono); font-size:13px; color:var(--muted); margin-top:10px; line-height:1.6; }
.readout b{ color:var(--accent); }
.hashout{ font-family:var(--mono); font-size:13.5px; color:var(--good); word-break:break-all; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:11px 13px; margin-top:10px; }
.demo svg{ max-width:100%; height:auto; display:block; }

/* ================= PROFIL ================= */
.profile-overlay{ position:fixed; inset:0; z-index:40; background:transparent; }
.profile-panel{ position:absolute; top:74px; right:18px; width:340px; max-width:calc(100vw - 24px); background:var(--panel); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow-lg); padding:18px; z-index:41; }
.profile-panel h4{ margin:0 0 13px; font-size:16px; font-weight:800; }
.pp-id{ display:flex; align-items:center; gap:13px; margin-bottom:11px; }
.pp-id .avatar{ width:52px; height:52px; font-size:27px; }
.pp-name{ flex:1; background:var(--panel-2); border:1px solid var(--line); color:var(--ink); border-radius:11px; padding:10px 13px; font-size:15px; font-family:inherit; }
.emoji-row{ display:flex; gap:7px; flex-wrap:wrap; margin:2px 0 15px; }
.emoji-row button{ width:38px; height:38px; border-radius:11px; border:1px solid var(--line); background:var(--panel-2); font-size:19px; cursor:pointer; transition:border-color .12s, transform .12s; }
.emoji-row button:hover{ transform:translateY(-2px); }
.emoji-row button.sel{ border-color:var(--accent); background:var(--accent-soft); }
.pp-stats{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:9px; margin-bottom:15px; }
.pp-stat{ background:var(--panel-2); border:1px solid var(--line); border-radius:12px; padding:11px 6px; text-align:center; }
.pp-stat b{ display:block; font-size:20px; font-weight:800; color:var(--accent); } .pp-stat span{ font-size:11px; color:var(--muted); }
.pp-actions{ display:flex; flex-direction:column; gap:9px; }
.pp-actions .btn{ justify-content:flex-start; font-size:14.5px; padding:11px 16px; }
.pp-note{ font-size:12px; color:var(--muted); margin-top:13px; text-align:center; line-height:1.5; }

/* ================= ZERTIFIKAT ================= */
.certwrap{ text-align:center; }
.cert{ background:linear-gradient(135deg,#fffdf6,#fdf4dd); color:#20304a; border:14px solid; border-image:linear-gradient(135deg,#e2b53a,#ffe9a3) 1; border-radius:6px; padding:48px 42px; max-width:740px; margin:16px auto; box-shadow:var(--shadow-lg); }
.cert .seal{ font-size:56px; }
.cert h1{ font-size:33px; margin:12px 0 2px; letter-spacing:2px; font-weight:800; }
.cert .who{ font-size:36px; font-weight:800; margin:18px 0 4px; color:#1c2433; }
.cert .line{ height:3px; width:230px; background:#e2b53a; margin:10px auto 18px; }
.cert p{ margin:7px 0; color:#3a4a63; }
.cert .foot{ display:flex; justify-content:space-between; margin-top:36px; font-size:13px; color:#5b6678; }
@media print{ header.app,aside.sidebar,.no-print{ display:none !important; } body{ background:#fff; } main.content{ max-width:none; animation:none; } }

/* ================= UTIL / ANIMS ================= */
@keyframes pop{ 0%{ transform:scale(.7); opacity:0; } 60%{ transform:scale(1.12); } 100%{ transform:scale(1); opacity:1; } }
.pop{ animation:pop .42s ease; }
.pill{ font-size:11px; padding:4px 11px; border-radius:999px; background:var(--panel-2); border:1px solid var(--line); color:var(--muted); font-weight:700; }
.loadingdots::after{ content:""; animation:dots 1.2s steps(4,end) infinite; }
@keyframes dots{ 0%{content:"";} 25%{content:".";} 50%{content:"..";} 75%{content:"...";} }

/* ===== Beat-Runner (TIEFER-Code): immersives Lektions-Format ===== */
.beatlesson { max-width: 780px; margin: 0 auto; }
.beatlesson > h2 { margin: 2px 0 14px; font-size: 26px; letter-spacing: -.5px; }

/* Fortschritt: schlanke Segmente, aktives glueht */
.beat-prog { display:flex; gap:7px; margin:6px 0 6px; }
.beat-prog .seg { flex:1; height:7px; border-radius:99px; background:rgba(255,255,255,.07); transition:background .4s, box-shadow .4s; }
.beat-prog .seg.done { background:linear-gradient(90deg, var(--accent,#ffd60a), #ffe770); }
.beat-prog .seg.cur { background:rgba(255,214,10,.5); box-shadow:0 0 12px rgba(255,214,10,.45); animation:segPulse 1.6s ease-in-out infinite; }
@keyframes segPulse { 0%,100%{opacity:.75} 50%{opacity:1} }
.beat-step { font-size:12px; color:var(--muted,#9a9ba3); margin-bottom:20px; letter-spacing:.14em; text-transform:uppercase; font-weight:600; }

/* Die schwebende Buehne: ein Beat = eine Karte mit Tiefe */
.beat-stage { position:relative; min-height:140px; }
.beat-stage::before { content:""; position:absolute; left:50%; top:-30px; width:70%; height:200px; transform:translateX(-50%); background:radial-gradient(closest-side, rgba(255,214,10,.10), transparent 72%); filter:blur(14px); pointer-events:none; z-index:0; }
.beat-stage > .beat-block, .beat-stage > .beat-text, .beat-stage > .beat-finish {
  position:relative; z-index:1;
  background:linear-gradient(180deg, rgba(38,40,50,.55), rgba(18,19,25,.72));
  border:1px solid rgba(255,255,255,.08);
  border-radius:22px;
  box-shadow:0 26px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
  padding:clamp(22px, 4vw, 34px);
  backdrop-filter:blur(6px);
  animation:beatIn .5s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes beatIn { from{opacity:0; transform:translateY(16px) scale(.985)} to{opacity:1; transform:none} }

.beat-text { font-size:17px; line-height:1.75; color:var(--ink,#f4f3ee); }
.beat-text p { margin:0 0 12px; } .beat-text p:last-child { margin-bottom:0; }
.beat-text code, .beat-block code { font-family:ui-monospace,Menlo,Consolas,monospace; background:rgba(255,214,10,.12); color:#ffe98a; padding:1px 6px; border-radius:6px; font-size:.9em; }
.beat-text .tip, .beat-block .tip { margin-top:14px; }

/* Prognose: Genie-Stil Auswahl */
.beat-q { font-size:19px; font-weight:650; line-height:1.5; margin-bottom:18px; color:var(--ink,#f4f3ee); }
.beat-opts { display:flex; flex-direction:column; gap:10px; }
.beat-opt { text-align:left; background:rgba(255,255,255,.03); border:1.5px solid rgba(255,255,255,.09); color:var(--ink,#f4f3ee); border-radius:14px; padding:15px 17px; font-size:15.5px; cursor:pointer; transition:transform .12s, border-color .15s, background .15s, box-shadow .15s; display:flex; gap:12px; align-items:center; }
.beat-opt:hover:not(.locked) { border-color:var(--accent,#ffd60a); background:rgba(255,214,10,.06); transform:translateX(4px); }
.beat-opt .ol { display:inline-grid; place-items:center; width:28px; height:28px; border-radius:9px; background:rgba(255,255,255,.08); font-weight:800; font-size:13px; flex:none; }
.beat-opt.locked { cursor:default; }
.beat-opt.correct { border-color:#3fb950; background:rgba(63,185,80,.14); box-shadow:0 0 0 1px rgba(63,185,80,.4), 0 8px 30px rgba(63,185,80,.18); animation:pop .4s ease; }
.beat-opt.correct .ol { background:#3fb950; color:#04210b; }
.beat-opt.wrong { border-color:#ff8a80; background:rgba(255,138,128,.1); }
@keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(1.025)} 100%{transform:scale(1)} }
.beat-reveal:empty { display:none; }
.beat-rev { margin-top:16px; padding:15px 17px; border-radius:14px; line-height:1.62; font-size:15px; animation:beatIn .4s ease both; }
.beat-rev.ok { background:rgba(63,185,80,.1); border:1px solid rgba(63,185,80,.32); }
.beat-rev.no { background:rgba(255,214,10,.07); border:1px solid rgba(255,214,10,.28); }

/* Code-Zelle: echter Editor-Look */
.beat-cellwrap { margin-top:16px; }
.beat-hinweis { font-size:13.5px; color:var(--muted,#9a9ba3); margin:0 0 10px; }
.cell { border:1px solid rgba(255,255,255,.1); border-radius:14px; overflow:hidden; background:#0b0c10; box-shadow:0 12px 34px rgba(0,0,0,.4); }
.cell-chrome { display:flex; align-items:center; gap:10px; padding:9px 13px; background:#15161d; border-bottom:1px solid rgba(255,255,255,.07); }
.cell-chrome .dots { display:flex; gap:6px; } .cell-chrome .dots i { width:11px; height:11px; border-radius:50%; display:block; }
.cell-chrome .dots i:nth-child(1){ background:#ff5f57; } .cell-chrome .dots i:nth-child(2){ background:#febc2e; } .cell-chrome .dots i:nth-child(3){ background:#28c840; }
.cell-chrome .fname { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12.5px; color:var(--muted,#9a9ba3); }
.cell-chrome .clang { margin-left:auto; font-size:10.5px; letter-spacing:.14em; font-weight:700; color:var(--accent,#ffd60a); background:rgba(255,214,10,.1); padding:3px 9px; border-radius:999px; }
.cell .editor { width:100%; box-sizing:border-box; min-height:150px; background:transparent; color:#e9edf6; border:none; outline:none; resize:vertical; padding:15px 16px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:14px; line-height:1.65; caret-color:var(--accent,#ffd60a); tab-size:2; }
.cell .editor-actions { display:flex; flex-wrap:wrap; gap:8px; padding:10px 13px; background:#101118; border-top:1px solid rgba(255,255,255,.06); }
.cell .output { padding:0 13px 13px; }
.cell .output .olabel { font-size:11px; letter-spacing:.14em; text-transform:uppercase; color:var(--muted,#9a9ba3); margin:10px 0 6px; }
.cell .out-target .console { margin:0; padding:12px 14px; background:#07080c; border-radius:10px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; line-height:1.55; color:#cdd6e6; white-space:pre-wrap; }
.cell .out-target .preview { width:100%; min-height:130px; border:none; border-radius:10px; background:#fff; }
.cell .hintbox { padding:0 13px; } .cell .hintbox:empty { padding:0; }
.cell .hintbox .h { background:rgba(255,214,10,.07); border:1px solid rgba(255,214,10,.22); border-radius:10px; padding:11px 13px; font-size:14px; line-height:1.55; margin:8px 0 2px; }

/* Sichtbare Check-Liste */
.checklist { margin:0; padding:2px 13px 4px; display:flex; flex-direction:column; gap:7px; }
.checklist:empty { display:none; }
.chk { font-size:14px; display:flex; gap:11px; align-items:center; color:var(--muted,#9a9ba3); transition:color .25s; }
.chk .chk-i { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:7px; background:rgba(255,255,255,.07); font-size:12px; flex:none; transition:background .25s, transform .25s; }
.chk.ok { color:var(--ink,#f4f3ee); }
.chk.ok .chk-i { background:#3fb950; color:#04210b; animation:pop .35s ease; }
.chk-done { margin:6px 0 2px; font-weight:800; color:#5fd07a; font-size:15px; animation:beatIn .35s ease both; }

/* Navigation + Finale */
.beat-nav { margin-top:26px; display:flex; justify-content:flex-end; }
.beat-weiter { min-width:220px; justify-content:center; font-size:16px; padding:14px 22px; border-radius:14px; box-shadow:0 10px 30px rgba(255,214,10,.22); }
.beat-weiter:disabled { box-shadow:none; }
.beat-finish { text-align:center; padding:34px 20px; }
.beat-finish > div:first-child { animation:finishGlow 2.2s ease-in-out infinite; }
.beat-finish h3 { font-size:24px; margin:8px 0 6px; }
@keyframes finishGlow { 0%,100%{ transform:scale(1); filter:drop-shadow(0 0 0 rgba(255,214,10,0)) } 50%{ transform:scale(1.08); filter:drop-shadow(0 6px 22px rgba(255,214,10,.4)) } }
@media (prefers-reduced-motion: reduce) { .beat-stage > *, .beat-rev, .chk-done { animation:none !important; } .beat-prog .seg.cur, .beat-finish > div:first-child { animation:none !important; } }

/* Flaggen-Beat innerhalb der Karte */
.beat-block .material-wrap { margin-top:14px; }
.beat-block .material { margin:6px 0 0; padding:12px 14px; background:#07080c; border-radius:10px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:13px; line-height:1.55; color:#cdd6e6; white-space:pre-wrap; overflow-x:auto; }
.beat-block .flagrow { display:flex; gap:9px; margin-top:14px; flex-wrap:wrap; }
.beat-block .flag-input { flex:1; min-width:160px; box-sizing:border-box; background:#0c0d11; border:1px solid rgba(255,255,255,.12); color:var(--ink,#f4f3ee); border-radius:12px; padding:13px 15px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:15px; }
.beat-block .decoder-slot:empty { display:none; }
.beat-block .decoder-slot { margin-top:14px; }
