/* MoatMath – ruhige Werkstatt: Papier, Holz, dunkle Tinte. Keine externen Schriften, kein JavaScript. */
:root {
  --papier: #f6f0e4; --flaeche: #fffdf8; --tinte: #241b13; --leise: #6b5d4f; --linie: #e2d6c2;
  --fichte: #e2c48f; --eiche: #a8743f; --buche: #c9785a; --akzent: #8a4f24; --akzent-hell: #f0e0cc;
  --gruen: #4d6b3c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --breit: 1060px; --text: 700px;
}
@media (prefers-color-scheme: dark) {
  :root { --papier: #1b1713; --flaeche: #241f1a; --tinte: #efe6d8; --leise: #b3a593; --linie: #3a322a;
          --fichte: #cfae74; --eiche: #b3814b; --buche: #cf8466; --akzent: #e0a66f; --akzent-hell: #3a2c1f;
          --gruen: #9cc286; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--papier); color: var(--tinte); font: 17px/1.6 var(--sans); }
.rahmen { max-width: var(--breit); margin: 0 auto; padding: 0 20px; }
a { color: var(--akzent); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.18; font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); margin: .15em 0 .35em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 0 0 .5em; }
h3 { font-size: 1.12rem; margin: 0 0 .35em; }
.klein { font-size: .85rem; color: var(--leise); }
main > section { padding: 3.2em 0 0; }
main > section > :is(p, ul, ol, details, h2, .dachzeile) { max-width: var(--text); }
.dachzeile { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--akzent); font-weight: 600; margin: 0 0 .4em; }

/* Kopf */
.kopf { border-bottom: 1px solid var(--linie); background: var(--flaeche); }
.kopf-innen { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; flex-wrap: wrap; }
.marke { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--tinte); font: 600 1.35rem var(--serif); }
.marke small { font: .8rem var(--sans); color: var(--leise); }
.kloetze { display: inline-flex; flex-direction: column-reverse; align-items: center; gap: 2px; align-self: center; }
.kloetze i { display: block; height: 5px; border-radius: 1px; }
.kloetze i:nth-child(1) { width: 20px; background: var(--fichte); }
.kloetze i:nth-child(2) { width: 15px; background: var(--eiche); }
.kloetze i:nth-child(3) { width: 10px; background: var(--buche); }
.ki-ecke { font-size: .75rem; border: 1px solid var(--linie); border-radius: 999px; padding: 2px 10px; color: var(--leise); white-space: nowrap; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 10px; font-size: .9rem; }
.nav a { color: var(--leise); text-decoration: none; padding: 2px 0; }
.nav a[aria-current="page"] { color: var(--tinte); border-bottom: 2px solid var(--akzent); }
.nav .sprache { margin-left: auto; }
.vorzeile { font-size: .82rem; color: var(--leise); margin: 1.2em 0 0; }

/* Held */
.held { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-top: 1.4em !important; }
@media (max-width: 820px) { .held { grid-template-columns: 1fr; gap: 24px; } }
.lead { font: 1.22rem/1.45 var(--serif); color: var(--leise); margin: 0 0 1em; }
.nutzen { list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: .35em; }
.nutzen li { padding-left: 1.6em; position: relative; }
.nutzen li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 9px; border-radius: 2px; background: var(--eiche); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin: .4em 0 .5em; }
.knopf { display: inline-block; text-decoration: none; padding: .62em 1.1em; border-radius: 8px; font-weight: 600; font-size: .98rem; line-height: 1.3; }
.knopf.gross { background: var(--akzent); color: var(--flaeche); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.knopf.gross:hover { filter: brightness(1.08); }
.knopf.leise { border: 1.5px solid var(--akzent); color: var(--akzent); }
.knopf.aus { background: var(--linie); color: var(--leise); box-shadow: none; }
.mikro { margin: .2em 0 0; }

/* Turm */
.turm-bild { margin: 0; }
.turm { display: flex; align-items: flex-end; justify-content: center; gap: 16px; padding: 22px 16px 0; border-bottom: 7px solid var(--eiche); background: var(--flaeche); border-radius: 10px 10px 0 0; border: 1px solid var(--linie); border-bottom-width: 7px; border-bottom-color: var(--eiche); min-height: 260px; }
.stapel { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; padding-bottom: 6px; }
.stapel b { display: block; width: 50px; height: 13px; border-radius: 2px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.13); font: 700 .7rem/13px var(--sans); text-align: center; color: var(--leise); }
.fichte b { background: var(--fichte); } .eiche b { background: var(--eiche); } .buche b { background: var(--buche); }
.frage b { background: transparent; border: 1.5px dashed var(--leise); box-shadow: none; }
.stapel span { order: -1; font-size: .72rem; color: var(--leise); margin-top: 6px; text-align: center; white-space: nowrap; }
.stapel span em { display: block; font: 700 1.05rem var(--serif); color: var(--tinte); font-style: normal; }
.turm-bild figcaption { margin-top: .6em; }
@media (max-width: 420px) { .stapel b { width: 40px; } .turm { gap: 10px; } }

/* Umdrehen */
.schritte { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; max-width: var(--text); }
.schritte li { counter-increment: s; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 12px 14px 12px 52px; position: relative; }
.schritte li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--akzent-hell); color: var(--akzent); font: 700 .9rem/26px var(--sans); text-align: center; }

.schritte li.k-fichte::before { background: var(--fichte); color: var(--tinte); }
.schritte li.k-buche::before { background: var(--buche); color: #fff; }
.schritte li.k-eiche::before { background: var(--eiche); color: #fff; }
.schritte li.k-frage::before { content: "?"; background: transparent; border: 1.5px dashed var(--leise); color: var(--tinte); line-height: 23px; }
.schritte li::before { border-radius: 4px !important; }

/* Werkstück */
.mitlesen { background: var(--flaeche); border-left: 4px solid var(--gruen); padding: 10px 14px; border-radius: 0 8px 8px 0; }
.werkstueck { }
.stufen { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 1em 0; }
.stufen article { background: var(--flaeche); border: 1px solid var(--linie); border-top: 5px solid var(--fichte); border-radius: 8px; padding: 14px 16px; }
.stufen article:nth-child(2) { border-top-color: var(--eiche); }
.stufen article:nth-child(3) { border-top-color: var(--buche); }
.stufen p { margin: 0; font-size: .95rem; }
.hinweis-kasten { background: var(--akzent-hell); border-radius: 10px; padding: 16px 18px; margin-top: 1.2em; max-width: var(--text); }
.hinweis-kasten p { margin: 0 0 .7em; }

/* Aufklappen */
details { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; margin: .5em 0; }
details > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; list-style: none; position: relative; padding-right: 36px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; position: absolute; right: 14px; top: 9px; font: 400 1.3rem var(--sans); color: var(--akzent); }
details[open] > summary::after { content: "–"; }
details > :not(summary) { padding: 0 14px; }
details > p:last-child, details > dl:last-child { padding-bottom: 12px; margin-bottom: 0; }
.hilfe { max-width: var(--text); }

/* Werkbank-Check */
.check-liste { list-style: none; padding: 0; max-width: var(--text); }
.check-liste details { margin: .45em 0; }
.nr { display: inline-block; min-width: 1.7em; color: var(--akzent); font-family: var(--serif); font-weight: 700; }
.check-liste dl { margin: 0 0 12px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .95rem; }
.check-liste dt { color: var(--leise); }
.check-liste dd { margin: 0; }
@media (max-width: 560px) { .check-liste dl { grid-template-columns: 1fr; } .check-liste dd { margin-bottom: 6px; } }

/* Post */
.post .zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 860px; margin-bottom: 1em; }
@media (max-width: 640px) { .post .zwei { grid-template-columns: 1fr; } }
.post .zwei > div { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 16px 18px; }
.haken, .kreuz { list-style: none; padding: 0; margin: 0; }
.haken li, .kreuz li { padding-left: 1.5em; position: relative; margin: .4em 0; }
.haken li::before { content: "✓"; position: absolute; left: 0; color: var(--gruen); font-weight: 700; }
.kreuz li::before { content: "✗"; position: absolute; left: 0; color: var(--buche); font-weight: 700; }

.regeln { padding-left: 1.1em; } .regeln li { margin: .35em 0; }
.fahrplan { list-style: none; padding: 0; border-left: 3px solid var(--eiche); margin-left: 6px; }
.fahrplan li { padding: 0 0 .9em 18px; position: relative; }
.fahrplan li::before { content: ""; position: absolute; left: -8px; top: .45em; width: 13px; height: 13px; border-radius: 3px; background: var(--fichte); border: 1px solid var(--eiche); }
.fahrplan span { font-weight: 700; display: block; }
.faq details { max-width: var(--text); }
.schluss { text-align: left; }
.kanaele { margin: .6em 0; }

/* Rechtsseiten */
.recht { padding: 1.5em 0 1em; overflow-wrap: anywhere; max-width: var(--text); }
.recht h1 { font-size: 2rem; }
.recht p { margin: .7em 0; }
.recht strong { font-weight: 600; }

/* Fuß */
.fuss { margin-top: 4em; border-top: 1px solid var(--linie); background: var(--flaeche); padding: 1.4em 0 2em; }
.pflicht { font-size: .9rem; margin: 0 0 .8em; max-width: var(--text); }
.fuss-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; margin: 0 0 .6em; }
.fuss-links a { color: var(--leise); }

/* Drucken: Werkbank-Check und Werkstück aufgeklappt */
@media print {
  .kopf, .nav, .knoepfe, .hinweis-kasten .knopf, .post, .schluss .knoepfe, .held .knoepfe { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  details { border: 0; }
  details > summary::after { content: ""; }
  details:not([open]) > :not(summary) { display: block; }
}
