/* ESP32 Lernportal – Design nach der Prezi „ESP32 Developement Board“
   Dunkler Platinen-Hintergrund, Work Sans, Sechsecke in Lachs (#FFAB92) und Hellgrau (#E6E6E6),
   Folien als helle Karten. Die Übungs-Engine (app.js) nutzt die Variablen unten. */
:root {
  --salmon: #ffab92;
  --orange: #ff7a52;
  --orange-dark: #e85336;
  --dark: #2c2c2e;
  --light: #e6e6e6;
  --lemon: #fafa78;
  --green: #2d9146;
  --night: #121a33;

  /* von app.js genutzt */
  --bg: #121a33;
  --card: #ffffff;
  --navy: #2c2c2e;
  --blue: #ff7a52;
  --blue-dark: #e85336;
  --teal: #646569;
  --red: #c0392b;
  --yellow: #fafa78;
  --text: #2c2c2e;
  --muted: #646569;
  --ok: #d4f5e0;
  --bad: #fbd6dc;
  --radius: 14px;
  --link: #d0451f;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--light);
  line-height: 1.55;
  background-color: var(--night);
  background-image:
    linear-gradient(rgba(16, 24, 52, .86), rgba(16, 24, 52, .9)),
    url("https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=1920&q=70"),
    url("img/bg-fallback.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3 { font-weight: 800; line-height: 1.12; margin: .3em 0 .45em; letter-spacing: .2px; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.4rem, 3.2vw, 2rem); }
h3 { font-size: 1.2rem; }
a { color: var(--salmon); }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(18, 22, 38, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.topbar .inner {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between;
}
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.brand::before {
  content: ""; width: 20px; height: 23px; background: var(--salmon);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.brand span { font-weight: 400; opacity: .75; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 6px; }
.topbar nav a {
  color: var(--light); text-decoration: none; padding: 6px 12px; border-radius: 999px;
  font-size: .92rem; font-weight: 600; background: rgba(255, 255, 255, .07);
}
.topbar nav a:hover { background: rgba(255, 171, 146, .25); }
.topbar nav a.active { background: var(--salmon); color: var(--dark); }
.topbar nav a.fortschritt { border: 1px solid rgba(255, 171, 146, .6); }

main { max-width: 1200px; margin: 0 auto; padding: 28px 16px 80px; }

/* Zoom-Effekt beim Laden wie in Prezi */
@keyframes zoomIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
main > * { animation: zoomIn .55s cubic-bezier(.2, .8, .2, 1) both; }
main > *:nth-child(2) { animation-delay: .08s; }
main > *:nth-child(3) { animation-delay: .16s; }
main > *:nth-child(n+4) { animation-delay: .22s; }
@media (prefers-reduced-motion: reduce) { main > * { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Sechsecke ---------- */
.hex {
  --size: 170px;
  width: var(--size); height: calc(var(--size) * 1.1547);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: rgba(255, 171, 146, .88);
  color: var(--dark);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 800; font-size: calc(var(--size) * .11); line-height: 1.15;
  padding: 0 calc(var(--size) * .12);
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, filter .2s ease;
  flex: 0 0 auto;
}
.hex.light { background: rgba(230, 230, 230, .9); }
.hex.lemon { background: rgba(250, 250, 120, .9); }
.hex.dim { background: rgba(255, 255, 255, .12); color: var(--light); }
a.hex:hover, a.hex:focus-visible { transform: scale(1.07); filter: brightness(1.06); }
a.hex:focus-visible { outline: none; filter: drop-shadow(0 0 0 #fff) brightness(1.15); }

/* ---------- Startseite (Prezi-Übersicht) ---------- */
.overview {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center;
  min-height: calc(100vh - 140px);
}
.title-block { position: relative; }
.title-row { display: flex; align-items: flex-start; gap: 18px; }
.title-row h1 { font-size: clamp(3.4rem, 10vw, 7.5rem); margin: 0; color: var(--light); letter-spacing: 2px; line-height: .95; }
.title-row .subtitle { font-size: clamp(1.3rem, 2.6vw, 2.1rem); font-weight: 400; color: rgba(230, 230, 230, .75); line-height: 1.15; margin-top: .4em; }
.board-circle {
  width: min(440px, 80vw); aspect-ratio: 1; border-radius: 50%;
  background: rgba(44, 44, 46, .55); margin: 26px 0 0 -10px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.board-circle img { width: 92%; height: auto; transform: rotate(-8deg); }
.intro-text { max-width: 520px; color: rgba(230, 230, 230, .85); margin: 18px 0 0; }

.honeycomb { --h: 165px; display: flex; justify-content: center; gap: 10px; }
.honeycomb .col { display: flex; flex-direction: column; gap: 12px; }
.honeycomb .col.shifted { margin-top: calc(var(--h) * 1.1547 / 2 + 6px); }
.honeycomb .hex { --size: var(--h); }
@media (max-width: 520px) { .honeycomb { --h: 128px; } }

@media (max-width: 900px) {
  .overview { grid-template-columns: 1fr; min-height: 0; }
  .board-circle { margin: 20px auto 0; }
}

/* ---------- Themenseiten ---------- */
.topic-head { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 10px; }
.topic-head .hex { --size: 200px; }
.topic-head .lead { flex: 1 1 320px; font-size: 1.08rem; color: rgba(230, 230, 230, .9); }
.topic-head .lead p { margin: 0 0 .7em; }

.subnav { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 8px; }
.subnav .hex { --size: 118px; }

.section-title { display: flex; align-items: center; gap: 14px; margin: 46px 0 14px; scroll-margin-top: 80px; }
.section-title .hex { --size: 70px; font-size: .9rem; }
.section-title h2 { margin: 0; color: #fff; }
section { scroll-margin-top: 80px; }

/* Folien (Prezi-Seiten) */
.slide {
  background: #fff; color: var(--dark); border-radius: 6px;
  padding: clamp(18px, 3vw, 36px); margin: 16px 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.slide h3 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); margin-top: 0; padding-bottom: 10px; border-bottom: 4px solid var(--orange); display: inline-block; }
.slide img { max-width: 100%; height: auto; display: block; border-radius: 4px; }
.slide figure { margin: 0; }
.slide figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.slide a { color: var(--link); word-break: break-word; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; align-items: start; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: start; }
.steps > li::before {
  content: counter(s) "."; font-weight: 800; font-size: 1.5rem; color: var(--orange); line-height: 1.2;
}
.steps > li[value]::before { content: attr(value) "."; }
.pfeil-liste { list-style: none; padding: 0; margin: 0; }
.pfeil-liste li { margin: 0 0 10px; padding-left: 22px; position: relative; }
.pfeil-liste li::before { content: "»"; position: absolute; left: 0; color: var(--orange); font-weight: 800; }
.hinweis { background: #fff4ef; border-left: 5px solid var(--orange); padding: 10px 14px; border-radius: 4px; font-size: .95rem; }
.label { display: inline-block; font-weight: 800; letter-spacing: 1px; color: var(--dark); background: var(--salmon); padding: 3px 12px; border-radius: 4px; }
.textbox { color: rgba(230, 230, 230, .9); max-width: 780px; }

/* Stapel (Prezi-Stack) mit Blättern */
.stack { position: relative; margin: 18px 0 30px; }
.stack-track { position: relative; }
.stack .slide { margin: 0; }
.stack.js .slide { display: none; }
.stack.js .slide.current { display: block; animation: zoomIn .35s ease both; }
.stack.js::before, .stack.js::after {
  content: ""; position: absolute; left: 14px; right: 14px; top: 10px; bottom: -10px;
  background: rgba(255, 255, 255, .5); border-radius: 6px; z-index: -1;
}
.stack.js::after { left: 28px; right: 28px; bottom: -20px; background: rgba(255, 255, 255, .25); }
.stack-ctrl { display: none; align-items: center; justify-content: center; gap: 12px; margin-top: 30px; }
.stack.js .stack-ctrl { display: flex; }
.stack-ctrl button { background: var(--salmon); color: var(--dark); border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.stack-ctrl button:hover { background: var(--orange); color: #fff; }
.stack-ctrl .dots { display: flex; gap: 6px; }
.stack-ctrl .dots button { width: 12px; height: 12px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.stack-ctrl .dots button[aria-current="true"] { background: var(--salmon); }
.stack-ctrl .count { color: var(--light); font-variant-numeric: tabular-nums; min-width: 4em; text-align: center; }

/* Befehls-Tabelle (Code | Erklärung) */
.cmd-table { width: 100%; border-collapse: collapse; display: table; }
.cmd-table td { padding: 8px 10px; border-bottom: 1px solid #eee; vertical-align: top; }
.cmd-table td:first-child { width: 52%; }
.cmd-table code { background: #f3f3f3; color: #b23a14; padding: 2px 6px; border-radius: 4px; }

/* Bilder zum Vergrößern */
img.zoom { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 28, .92);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 4px; }

/* ---------- Karten, Kacheln, Tabellen (auch für Übungen) ---------- */
.card {
  background: var(--card); color: var(--text); border-radius: 6px;
  padding: 22px; margin: 18px 0; box-shadow: 0 18px 40px rgba(0, 0, 0, .3);
}
.card.accent { border-left: 6px solid var(--orange); }
.card.warn { border-left: 6px solid var(--lemon); background: #fffde8; box-shadow: none; }
.card.good { border-left: 6px solid var(--green); }
.card a { color: var(--link); }
.muted { color: var(--muted); }

.hero {
  background: rgba(44, 44, 46, .7); color: #fff; border-radius: 6px;
  padding: 30px 28px; margin-bottom: 24px; border-left: 8px solid var(--salmon);
}
.hero h1 { color: #fff; margin-top: 0; }
.hero p { max-width: 720px; margin: 0; opacity: .95; }
.hero .tag {
  display: inline-block; background: var(--salmon); color: var(--dark);
  font-weight: 800; padding: 4px 12px; border-radius: 4px; margin-bottom: 12px; font-size: .9rem;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 20px 0 30px; }
.tile {
  background: var(--orange); color: #fff; border-radius: 6px; padding: 20px 18px; text-decoration: none;
  min-height: 110px; display: flex; flex-direction: column; justify-content: space-between;
}
.tile .big { font-weight: 800; font-size: 1.35rem; }

code, pre, kbd { font-family: "Fira Code", Consolas, "Courier New", monospace; font-size: .92rem; }
pre { background: #1e1f24; color: #f3e9e4; padding: 12px 14px; border-radius: 6px; overflow-x: auto; margin: 10px 0; }
:not(pre) > code { background: rgba(255, 122, 82, .12); padding: 1px 6px; border-radius: 4px; }

table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; display: block; overflow-x: auto; }
th, td { padding: 9px 10px; border-bottom: 1px solid rgba(100, 101, 105, .25); text-align: left; vertical-align: top; }
th { background: rgba(255, 171, 146, .35); font-weight: 700; }
.vergleich { display: table; }
.vergleich th, .vergleich td { text-align: center; }
.vergleich th:first-child, .vergleich td:first-child { text-align: left; font-weight: 700; }

.pins { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.pins li { background: var(--dark); color: #fff; border-radius: 4px; padding: 2px 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pins li.warn { background: var(--orange); }

/* ---------- Buttons und Eingaben ---------- */
button, .btn {
  font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: 9px 16px;
  background: var(--orange); color: #fff; font-weight: 700; transition: background .15s ease, transform .05s ease;
}
button:hover { background: var(--orange-dark); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--teal); }
button.ghost { background: transparent; color: var(--text); border: 2px solid var(--orange); }
button.small { padding: 4px 10px; font-size: .9rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
input[type="text"], input[type="number"], select {
  font: inherit; padding: 8px 10px; border-radius: 6px; border: 2px solid rgba(255, 122, 82, .4);
  background: #fff; color: var(--text); max-width: 100%;
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--lemon); outline-offset: 2px; }

.feedback { font-weight: 700; margin-top: 10px; min-height: 1.5em; }
.feedback.ok { color: var(--green); }
.feedback.bad { color: var(--red); }

/* Quiz */
.quiz-q { font-size: 1.15rem; font-weight: 600; margin: 8px 0 14px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opts button { background: #fff; color: var(--text); border: 2px solid rgba(255, 122, 82, .3); text-align: left; }
.quiz-opts button:hover:not(:disabled) { border-color: var(--orange); background: rgba(255, 122, 82, .08); }
.quiz-opts button.right { background: var(--ok); border-color: var(--green); }
.quiz-opts button.wrong { background: var(--bad); border-color: var(--red); }
.progress { height: 10px; background: rgba(100, 101, 105, .25); border-radius: 999px; overflow: hidden; margin: 10px 0 18px; }
.progress > div { height: 100%; background: var(--green); width: 0; transition: width .3s ease; }

/* Zuordnen */
.match-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed rgba(100, 101, 105, .35); }
.match-row .match-label { font-weight: 600; }
.match-row select { width: 100%; }
.match-row .mark { font-size: 1.3rem; min-width: 1.4em; text-align: center; }
@media (max-width: 560px) { .match-row { grid-template-columns: 1fr; } }

/* Reihenfolge */
.order-list { list-style: none; padding: 0; margin: 10px 0; }
.order-list li { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid rgba(255, 122, 82, .25); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; cursor: grab; }
.order-list li.dragging { opacity: .5; }
.order-list li.over { border-color: var(--orange); border-style: dashed; }
.order-list .num { font-weight: 800; min-width: 1.8em; text-align: center; background: var(--orange); color: #fff; border-radius: 6px; padding: 2px 6px; }
.order-list .txt { flex: 1; }
.order-list .ok { background: var(--ok); }
.order-list .bad { background: var(--bad); }
.order-list .move { display: flex; gap: 4px; }

/* Kreuzworträtsel */
.cw-wrap { overflow-x: auto; }
.cw { border-collapse: collapse; display: table; margin: 10px auto 16px; width: auto; }
.cw td { padding: 0; border: 1px solid #8e939c; position: relative; width: 44px; height: 44px; background: #fff; }
.cw td.block { background: var(--dark); border-color: var(--dark); }
.cw td input { width: 100%; height: 100%; border: 0; text-align: center; font-weight: 700; font-size: 1.25rem; text-transform: uppercase; background: transparent; color: var(--text); padding: 0; }
.cw td .n { position: absolute; top: 1px; left: 3px; font-size: .6rem; color: var(--muted); pointer-events: none; }
.cw td.good input { background: var(--ok); }
.cw td.bad input { background: var(--bad); }
.clues { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.clues ol { padding-left: 20px; margin: 6px 0; }
.clues li { margin-bottom: 6px; }
@media (max-width: 640px) { .clues { grid-template-columns: 1fr; } }

/* Terminal */
.term { background: #1e1f24; color: #f3e9e4; border: 2px solid var(--orange); border-radius: 8px; padding: 14px; font-family: "Fira Code", Consolas, monospace; font-size: .92rem; min-height: 240px; max-height: 380px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.term .prompt { color: var(--salmon); font-weight: 600; }
.term .err { color: #ff9aa9; }
.term-input-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.term-input-row input { flex: 1 1 160px; min-width: 0; font-family: "Fira Code", Consolas, monospace; background: #1e1f24; color: #f3e9e4; border: 2px solid var(--orange); color-scheme: dark; }
.task-list { list-style: none; padding: 0; }
.task-list li { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; background: rgba(255, 122, 82, .08); display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.task-list li.done { background: var(--ok); }
.task-list li.current { box-shadow: 0 0 0 3px var(--orange); }
.task-list .status { font-weight: 700; }

.pycode { display: block; width: 100%; resize: vertical; min-height: 130px; font-family: "Fira Code", Consolas, monospace; font-size: .92rem; background: #1e1f24; color: #f3e9e4; border: 2px solid var(--orange); border-radius: 8px; padding: 12px; }
.pyout { min-height: 60px; max-height: 220px; margin: 0 0 12px; }
.grade-result { font-weight: 800; font-size: 2rem; margin: 10px 0 0; }
.sb-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed rgba(100, 101, 105, .3); }
.pill { display: inline-block; background: var(--lemon); color: var(--dark); border-radius: 4px; padding: 1px 8px; font-weight: 700; font-size: .85rem; vertical-align: middle; }

/* Seitenmenü auf Übungsseiten */
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; max-width: 1400px; margin: 0 auto; align-items: start; }
.layout main { max-width: none; margin: 0; min-width: 0; }
.toc { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; margin: 28px 0 0 12px; padding: 12px 8px; background: rgba(44, 44, 46, .85); border-radius: 6px; font-size: .84rem; }
.toc h4 { margin: 0 0 6px 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--salmon); }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 5px 6px; border-radius: 6px; color: var(--light); text-decoration: none; line-height: 1.25; }
.toc a:hover { background: rgba(255, 171, 146, .18); }
.toc a.active { background: var(--salmon); color: var(--dark); font-weight: 700; }
.toc .pts { white-space: nowrap; opacity: .8; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; margin: 16px 12px 0; }
  .toc ul { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .toc a { white-space: nowrap; }
}

.footer-note { color: rgba(230, 230, 230, .6); font-size: .9rem; margin-top: 48px; text-align: center; }
.footer-note a { color: var(--salmon); }

@media (max-width: 600px) {
  main { padding: 18px 16px 60px; }
  .card, .slide { padding: 16px; }
  .topic-head .hex { --size: 150px; }
  .subnav .hex { --size: 96px; }
}
@media print {
  body { background: #fff; color: #000; }
  .topbar, .stack-ctrl { display: none; }
  .stack.js .slide { display: block; }
}

/* ---------- Themenseiten: Seitenmenü + immer nur eine Ansicht ---------- */
.topic-layout {
  display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 28px;
  max-width: 1280px; margin: 0 auto; padding: 28px 16px 60px; align-items: start;
}
.topic-layout main.views { max-width: none; margin: 0; padding: 0; min-width: 0; }
.submenu {
  position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto;
  background: rgba(30, 32, 40, .88); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px; padding: 18px 14px;
}
.sm-title { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; color: #fff; margin: 0 4px 14px; }
.sm-title .hex { --size: 34px; padding: 0; }
.sm-toggle { display: none; }
.sm-group { margin: 0 0 10px; }
.sm-head {
  display: flex; align-items: center; gap: 8px; margin: 12px 6px 4px;
  font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--salmon);
}
.sm-head .dot { width: 12px; height: 14px; background: var(--salmon); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.sm-head .dot.light { background: var(--light); }
.sm-head .dot.dim { background: rgba(255, 255, 255, .35); }
.sm-head .dot.lemon { background: var(--lemon); }
.submenu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.submenu li a {
  display: block; padding: 8px 12px 8px 26px; border-radius: 8px; color: var(--light);
  text-decoration: none; font-size: .95rem; line-height: 1.3; position: relative;
}
.submenu li a::before { content: ""; position: absolute; left: 12px; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.submenu li a:hover { background: rgba(255, 171, 146, .15); }
.submenu li a[aria-current="page"] { background: var(--salmon); color: var(--dark); font-weight: 700; }
.submenu li a[aria-current="page"]::before { background: var(--dark); }

.view { display: none; margin: 0; min-height: 360px; }
.view.current { display: block; animation: zoomIn .35s cubic-bezier(.2, .8, .2, 1) both; }
.no-js .view { display: block; margin-bottom: 20px; }
.crumb { margin: 0 0 4px; font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); }
.view h4 { margin: 22px 0 8px; font-size: 1.05rem; }
.view .subnav .hex { --size: 110px; }
.view-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.view-nav a {
  background: var(--salmon); color: var(--dark); font-weight: 700; text-decoration: none;
  padding: 10px 18px; border-radius: 999px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.view-nav a:hover { background: var(--orange); color: #fff; }
.view-nav a[hidden] { display: inline-block; visibility: hidden; }
.view-nav .pos { color: rgba(230, 230, 230, .7); font-variant-numeric: tabular-nums; }
.aufgabe { background: #fff8e0; border-left: 5px solid #e3c000; border-radius: 6px; padding: 12px 16px; margin: 14px 0; }
.aufgabe .label { background: var(--lemon); margin-bottom: 6px; }
a.btn { display: inline-block; text-decoration: none; color: #fff; }
.view .cols img, .view > img { margin-top: 6px; }

@media (max-width: 860px) {
  .topic-layout { grid-template-columns: 1fr; gap: 14px; padding-top: 16px; }
  .submenu { position: static; max-height: none; padding: 12px; }
  .sm-title { margin-bottom: 8px; }
  .sm-toggle { display: block; width: 100%; background: rgba(255, 255, 255, .1); color: #fff; text-align: left; }
  .sm-toggle::after { content: " ▾"; }
  .submenu.closed .sm-nav { display: none; }
}
.slide a.hex { color: var(--dark); }
.slide a.hex.dim { background: #646569; color: #fff; }
/* lange Befehle und Adressen am Handy umbrechen */
.view :not(pre) > code { overflow-wrap: anywhere; }
.steps > li > div { min-width: 0; }
.view img { max-width: 100%; height: auto; }
@media (max-width: 600px) {
  .cmd-table, .cmd-table tbody, .cmd-table tr, .cmd-table td { display: block; width: 100% !important; }
  .cmd-table td:first-child { border-bottom: 0; padding-bottom: 2px; }
  .cmd-table tr { border-bottom: 1px solid #eee; padding: 4px 0; }
}
/* Checks mit Punkten in jeder Übung */
.check-box { margin: 26px 0 0; padding: 18px; border: 2px solid var(--salmon); border-radius: 10px; background: #fffaf7; }
.check-box h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-box .card { background: #fff; }
.check-box label { display: block; }
#scoreboard .grade-result { font-size: 1.5rem; }
/* Punkte im Seitenmenü */
.submenu li a[data-key], .submenu li a[data-total] { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.submenu .pts { font-size: .8rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; opacity: .7; }
.submenu .pts.part { color: var(--lemon); opacity: 1; }
.submenu .pts.full { color: #7be39a; opacity: 1; }
.submenu .pts.full::before { content: "✔ "; }
.submenu li a[aria-current="page"] .pts { color: var(--dark); opacity: .85; }
/* Lösung mit Kopieren-Button */
.loesung { margin: 22px 0 0; border: 2px dashed #8e939c; border-radius: 10px; padding: 0 16px; }
.loesung > summary {
  cursor: pointer; list-style: none; display: inline-block; margin: 14px 0; padding: 9px 18px;
  background: var(--dark); color: #fff; border-radius: 999px; font-weight: 700;
}
.loesung > summary::-webkit-details-marker { display: none; }
.loesung > summary::before { content: "▸ "; }
.loesung[open] > summary::before { content: "▾ "; }
.loesung[open] > summary { background: var(--orange); }
.loesung[open] { padding-bottom: 6px; }
.loesung[open] > summary::after { content: ""; }
.code-wrap { position: relative; }
.copy-btn { position: absolute; top: 8px; right: 8px; padding: 6px 12px; font-size: .85rem; background: var(--salmon); color: var(--dark); }
.copy-btn:hover { background: var(--orange); color: #fff; }
.copy-btn.done { background: #7be39a; color: var(--dark); }
.code-wrap pre { padding-top: 44px; }

/* Meine Punkte: kein Drucken-Button */
.views .sb-print { display: none; }

/* ---------- HTML Builder ---------- */
.anleitung > summary { cursor: pointer; list-style: none; }
.anleitung > summary::-webkit-details-marker { display: none; }
.anleitung > summary h3::after { content: " ▾"; font-size: .8em; color: var(--orange); }
.anleitung:not([open]) > summary h3::after { content: " ▸"; }
.b-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.b-grid .slide { margin: 16px 0; }
.b-rechts { position: sticky; top: 70px; }
.b-einst { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.b-feld { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.b-feld input[type="text"], .b-feld input[type="number"], .b-feld select { width: 100%; }
.b-feld input[type="color"] { width: 100%; height: 40px; padding: 2px; border: 2px solid rgba(255, 122, 82, .4); border-radius: 6px; background: #fff; cursor: pointer; }
.b-check { flex-direction: row; align-items: center; gap: 8px; grid-column: 1 / -1; color: var(--text); font-size: 1rem; }
.b-check input { width: 20px; height: 20px; }
.b-palette { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.b-palette button { background: var(--dark); }
.b-palette button:hover { background: var(--orange); }
.b-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.b-el { border: 2px solid #e4e4e4; border-radius: 10px; background: #fafafa; padding: 10px 12px; }
.b-el.zieht { opacity: .45; }
.b-el.ueber { border-color: var(--orange); border-style: dashed; }
.b-el-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.b-griff { cursor: grab; font-size: 1.3rem; color: #8e939c; user-select: none; }
.b-el-knoepfe { margin-left: auto; display: flex; gap: 4px; }
.b-el-knoepfe button { padding: 2px 9px; }
.b-el-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 12px; }
.b-handy { border: 10px solid var(--dark); border-radius: 26px; overflow: hidden; background: #fff; max-width: 380px; margin: 0 auto; }
.b-handy iframe { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
.builder .code-wrap pre { max-height: 460px; }
@media (max-width: 900px) {
  .b-grid { grid-template-columns: 1fr; }
  .b-rechts { position: static; }
}

/* ---------- Webserver: Sketch-Aufbau, Ablauf, Aufgaben ---------- */
.c1 { --c: #8e8e93; --cb: #f1f1f3; }
.c2 { --c: #8e44ad; --cb: #f3e8f8; }
.c3 { --c: #2a7de1; --cb: #e6f0fc; }
.c4 { --c: #ff7a52; --cb: #fff0ea; }
.c5 { --c: #16a085; --cb: #e3f6f2; }
.c6 { --c: #2d9146; --cb: #e5f4e9; }
.c7 { --c: #d6338a; --cb: #fce8f3; }
.c8 { --c: #c0392b; --cb: #fbe9e7; }
.c9 { --c: #b39500; --cb: #fdf8d8; }
.c10 { --c: #121a33; --cb: #e7e9f0; }
.sk-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0; }
.sk-grp { background: #f7f7f8; border-radius: 8px; padding: 8px 10px; }
.sk-grp > p { margin: 0 0 6px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sk-chip { display: inline-flex; align-items: center; gap: 6px; margin: 3px; padding: 5px 10px; border: 2px solid var(--c); background: var(--cb); color: var(--dark); border-radius: 999px; font: inherit; font-size: .88rem; cursor: pointer; transition: transform .15s, background .2s, color .2s; }
.sk-chip b { background: var(--c); color: #fff; border-radius: 50%; width: 1.4em; height: 1.4em; display: inline-grid; place-items: center; font-size: .78rem; }
.sk-chip:hover { transform: translateY(-2px); }
.sk-chip[aria-pressed="true"] { background: var(--c); color: #fff; }
.sk-chip[aria-pressed="true"] b { background: #fff; color: var(--c); }
.sk-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.sk-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sk-code { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.sk-block { position: relative; border-left: 6px solid var(--c); background: var(--cb); border-radius: 6px; padding: 4px 6px 2px 6px; cursor: pointer; transition: opacity .3s, transform .3s, box-shadow .3s; }
.view.current .sk-block { animation: skIn .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes skIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.sk-block pre { margin: 0 0 4px; background: #1e1f24; font-size: .82rem; padding: 8px 10px; }
.sk-tag { display: block; margin: 0 2px 3px; font-size: .74rem; font-weight: 700; color: var(--c); text-transform: uppercase; letter-spacing: .03em; }
.sk-block.dim { opacity: .35; }
.sk-block.on { opacity: 1; transform: scale(1.015); box-shadow: 0 0 0 3px var(--c), 0 8px 22px rgba(0, 0, 0, .15); animation: skGlow 1.6s ease-in-out infinite; }
@keyframes skGlow { 50% { box-shadow: 0 0 0 5px var(--c), 0 8px 26px rgba(0, 0, 0, .2); } }
.sk-dyn { background: rgba(250, 250, 120, .25); outline: 1px dashed #fafa78; border-radius: 3px; animation: skDyn 1.8s ease-in-out infinite; }
p .sk-dyn, .sk-card .sk-dyn { color: inherit; background: #fafa78; outline: 0; padding: 0 3px; }
@keyframes skDyn { 50% { background: rgba(250, 250, 120, .55); } }
.sk-card { position: sticky; top: 84px; background: #fff; border: 2px solid var(--c, #ddd); border-top-width: 8px; border-radius: 10px; padding: 14px 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.sk-card.pop, .fl-text.pop { animation: skPop .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes skPop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sk-card-head { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; margin: 0 0 8px; color: var(--c); }
.sk-num { background: var(--c); color: #fff; border-radius: 50%; width: 2em; height: 2em; display: grid; place-items: center; flex: none; }
.sk-aendern { background: var(--cb); border-radius: 6px; padding: 8px 10px; font-size: .93rem; }
.sk-bar { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; margin-top: 10px; }
.sk-bar span { display: block; height: 100%; background: var(--c); animation: skBar 5s linear forwards; }
@keyframes skBar { from { width: 0; } to { width: 100%; } }
/* Ablauf */
.fl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sk-mini { max-height: 520px; overflow-y: auto; padding: 4px; }
.sk-mini .sk-block { cursor: default; }
.sk-mini pre { font-size: .72rem; }
.fl-stage { position: sticky; top: 84px; }
.fl-scene { display: grid; grid-template-columns: 130px 1fr 110px; align-items: center; gap: 8px; background: var(--night); border-radius: 12px; padding: 18px 12px; }
.fl-phone { width: 130px; height: 220px; background: #2c2c2e; border-radius: 18px; padding: 10px 7px; box-shadow: 0 0 0 2px #555; }
.fl-screen { height: 100%; background: #fff; border-radius: 10px; overflow: hidden; font-size: 10px; text-align: center; display: flex; flex-direction: column; }
.fl-url { background: #eee; padding: 3px; font-size: 8.5px; color: #555; }
.fl-leer, .fl-laden, .fl-page { display: none; flex: 1; }
.fl-phone[data-ph="leer"] .fl-leer { display: grid; place-items: center; color: #888; }
.fl-phone[data-ph="laden"] .fl-laden { display: grid; place-items: center; }
.fl-laden span { width: 22px; height: 22px; border: 3px solid #ddd; border-top-color: var(--orange); border-radius: 50%; animation: flSpin .8s linear infinite; }
@keyframes flSpin { to { transform: rotate(360deg); } }
.fl-phone[data-ph="seite"] .fl-page { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 12px; background: #e2c6c6; animation: skPop .4s; }
.fl-h { font-size: 12px; }
.fl-btn { color: #fff; padding: 5px 10px; border-radius: 4px; }
.fl-btn.ein { background: #2d9146; }
.fl-btn.aus { background: #c0392b; }
.fl-btn.press { animation: flPress .6s ease; }
@keyframes flPress { 40% { transform: scale(.85); box-shadow: 0 0 0 6px rgba(255, 255, 255, .8); } }
.fl-track { position: relative; height: 70px; border-top: 2px dashed #6b7394; margin-top: 35px; }
.fl-wifi { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); color: #9aa3c4; font-size: .75rem; font-weight: 700; }
.fl-packet { position: absolute; top: -13px; left: 0; white-space: nowrap; background: var(--lemon); color: var(--dark); font: 700 .72rem "Fira Code", monospace; padding: 3px 7px; border-radius: 12px; opacity: 0; }
.fl-packet.go-r { animation: flR 1.6s ease-in-out forwards; }
.fl-packet.go-l { animation: flL 1.6s ease-in-out forwards; background: #9be7b0; }
@keyframes flR { 0% { left: 0; transform: none; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: 100%; transform: translateX(-100%); opacity: .9; } }
@keyframes flL { 0% { left: 100%; transform: translateX(-100%); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: 0; transform: none; opacity: .9; } }
.fl-esp { background: #1e1f24; border: 2px solid #555; border-radius: 8px; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: space-around; color: #fff; padding: 8px 4px; }
.fl-chip { background: #3a3b42; border-radius: 4px; padding: 10px 8px; font-weight: 800; font-size: .85rem; }
.fl-led { width: 26px; height: 26px; border-radius: 50%; background: #4a2020; border: 2px solid #777; transition: background .3s, box-shadow .3s; }
.fl-led.an { background: #ff4b3a; box-shadow: 0 0 18px 6px rgba(255, 75, 58, .75); }
.fl-pin { font-size: .7rem; color: #aaa; }
.fl-ctrl { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.fl-ctrl button:disabled { opacity: .4; cursor: default; }
.fl-pos { font-weight: 700; }
.fl-text { background: #fff8e0; border-left: 5px solid #e3c000; border-radius: 6px; padding: 10px 14px; min-height: 4.5em; margin: 0; }
.fl-n { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--dark); color: #fff; font-weight: 800; margin-right: 8px; font-size: .85rem; }
/* Builder-Übung */
.bd-mock { background: #f7f7f8; border-radius: 10px; padding: 12px; display: grid; gap: 10px; font-size: .85rem; }
.bd-pal { display: flex; flex-wrap: wrap; gap: 5px; }
.bd-pal span { background: #fff; border: 1px solid #ccc; border-radius: 5px; padding: 3px 7px; }
.bd-pal .hl { border-color: var(--orange); animation: skGlowO 1.6s infinite; }
@keyframes skGlowO { 50% { box-shadow: 0 0 0 4px rgba(255, 122, 82, .35); } }
.bd-list { display: grid; gap: 5px; }
.bd-el { background: #fff; border: 1px solid #ddd; border-radius: 5px; padding: 5px 8px; }
.bd-el.drag { animation: bdDrag 3s ease-in-out infinite; border-color: var(--orange); box-shadow: 0 4px 10px rgba(0, 0, 0, .12); }
@keyframes bdDrag { 0%, 15% { transform: none; } 45%, 65% { transform: translate(14px, 31px); } 95%, 100% { transform: none; } }
.bd-out { background: #1e1f24; color: #f3e9e4; border-radius: 6px; padding: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bd-out code { color: #f3e9e4; }
.bd-copy { background: var(--orange); color: #fff; border-radius: 4px; padding: 3px 8px; font-weight: 700; }
/* Aufgaben */
.tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 14px 0; }
.task { border: 2px solid #e2e2e2; border-radius: 10px; padding: 12px 14px; background: #fff; transition: border-color .3s, background .3s; }
.task.done { border-color: var(--green); background: #f1faf3; }
.task-head { display: flex; align-items: center; gap: 8px; }
.task-head h4 { margin: 0; }
.task-ok { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; background: #f7f7f8; border-radius: 6px; padding: 8px; cursor: pointer; }
.task-ok input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
@media (max-width: 900px) {
  .sk-grid, .fl-grid { grid-template-columns: minmax(0, 1fr); }
  .sk-card { position: sticky; bottom: 8px; top: auto; z-index: 5; max-height: 45vh; overflow-y: auto; }
  .fl-stage { position: static; }
  .sk-mini { max-height: 300px; }
}
@media (max-width: 480px) {
  .fl-scene { grid-template-columns: 100px 1fr 80px; padding: 12px 6px; }
  .fl-phone { width: 100px; height: 190px; }
  .fl-packet { font-size: .62rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-block.on, .sk-dyn, .bd-el.drag, .bd-pal .hl, .view.current .sk-block { animation: none; }
}

/* ---------- Freigaben (freigabe.js): gesperrte Übungen und Lösungen ---------- */
.fg-pruefen main { visibility: hidden; }
.fg-zu { position: relative; }
.fg-zu > :not(.fg-karte):not(.crumb):not(h3) { filter: blur(8px); pointer-events: none; user-select: none; }
.fg-karte {
  background: #fff; color: var(--dark); border-radius: 16px; padding: 22px 26px; margin: 10px auto 22px;
  max-width: 460px; text-align: center; box-shadow: 0 18px 44px rgba(0, 0, 0, .28); border-top: 6px solid var(--orange);
}
.fg-karte h2 { color: var(--dark); margin: 10px 0 8px; font-size: 1.4rem; }
.fg-karte p { margin: 0; color: var(--muted); }
.fg-schloss { width: 34px; height: 26px; margin: 18px auto 0; background: var(--orange); border-radius: 5px; position: relative; }
.fg-schloss::before {
  content: ""; position: absolute; left: 7px; top: -16px; width: 20px; height: 20px;
  border: 4px solid var(--orange); border-bottom: 0; border-radius: 12px 12px 0 0; box-sizing: border-box;
}
.fg-lehrer { background: #fff4d6; border-left: 6px solid #f2b705; padding: 10px 14px; border-radius: 8px; margin: 0 0 14px; font-weight: 600; color: #6b4e00; }
.loesung .fg-lehrer { margin: 10px 0; }
.fg-menu { margin-left: 4px; font-size: .85em; }
.loesung-zu { padding: 10px 0 12px; color: var(--muted); }
