/* Malfeld – „Karoheft & Leuchtstift“ (Gestaltung beschlossen 25.09.2026, malfeld/docs/GESTALTUNG.md)
   Rechenheft mit Kästchen als Grund, Leuchtstift-Striche hinter dem, worauf es ankommt,
   rechteckige Knöpfe mit 4-px-Ecken und Tintenrand. Leuchtgelb nur als Fläche, Text in Olivtinte.
   Playpen Sans für Titel, Atkinson Hyperlegible für Text und Ziffern – wie in der App. Keine Fremdabrufe. */

@font-face { font-family: "Playpen Sans"; font-weight: 700; font-display: swap;
  src: url("schrift/playpen-sans-bold.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap;
  src: url("schrift/atkinson-hyperlegible-regular.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap;
  src: url("schrift/atkinson-hyperlegible-bold.woff2") format("woff2"); }

:root {
  --heft: #FCFDF6;           /* Heftweiß */
  --kaestchen: #E3E8D2;      /* Kästchenlinie */
  --blatt: #FFFFFF;
  --flaeche: #F4F6E8;
  --tinte: #33380F;          /* Olivtinte – 12 : 1 */
  --tinte-2: #4F5430;        /* Nebentext – 8 : 1 */
  --link: #5A6414;           /* Textstufe – 6,3 : 1 */
  --leucht: #E5EC3F;         /* Leuchtgelb: nur Fläche, darauf Tinte (9,6 : 1) */
  --rand: #8C9170;
  --rot: #D3262E;            /* Wendeplättchen (Funktionsfarben wie im Store-Bild) */
  --blau: #1E4FB4;
  --leer: #DCE3DD;
  --fuss-grund: #33380F;
  --fuss-text: #F4F6E8;
  --fuss-link: #E5EC3F;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --heft: #16180C;
    --kaestchen: #262A16;
    --blatt: #1F2211;
    --flaeche: #262A16;
    --tinte: #EEF1DC;
    --tinte-2: #C5CAA6;
    --link: #E5EC3F;
    --leucht: #D9E03A;
    --rand: #6E7350;
    --rot: #F0646A;
    --blau: #7FA4F2;
    --leer: #3A3F27;
    --fuss-grund: #0C0D06;
    --fuss-text: #EEF1DC;
    --fuss-link: #E5EC3F;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
body {
  margin: 0; color: var(--tinte);
  background-color: var(--heft);
  background-image:
    linear-gradient(var(--kaestchen) 1px, transparent 1px),
    linear-gradient(90deg, var(--kaestchen) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 400 1.0625rem/1.6 "Atkinson Hyperlegible", system-ui, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); font-weight: 700; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { background: var(--leucht); color: #33380F; text-decoration: none; }
:focus-visible { outline: 3px solid var(--tinte); outline-offset: 3px; box-shadow: 0 0 0 6px var(--leucht); }

h1, h2, h3, .marke { font-family: "Playpen Sans", "Atkinson Hyperlegible", sans-serif; font-weight: 700; line-height: 1.15; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 .45em; }
h3 { font-size: 1.2rem; margin: 0 0 .35em; }
p { margin: 0 0 .9em; }

/* Leuchtstift-Strich hinter Titeln: schräg abgesetzt, endet etwas hinter dem Wort */
.strich { background: linear-gradient(176deg, transparent 52%, var(--leucht) 52%, var(--leucht) 90%, transparent 90%);
  padding: 0 .18em; margin: 0 -.18em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (prefers-color-scheme: dark) { .strich { padding-bottom: .12em; background: linear-gradient(178deg, transparent 86%, var(--leucht) 86%, var(--leucht) 97%, transparent 97%); } }

.huelle { max-width: 1128px; margin: 0 auto; padding: 0 20px; }
.ueberspringen { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--leucht); color: #33380F; padding: 10px 14px; border: 2px solid #33380F; border-radius: 4px; }
.ueberspringen:focus { left: 8px; }

/* ---------- Bausteine ---------- */
.blatt { background: var(--blatt); border: 1.5px solid var(--rand); border-radius: 4px; }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 48px; padding: .5em 1em;
  font: 700 1rem/1.2 "Atkinson Hyperlegible", sans-serif; text-decoration: none; cursor: pointer;
  color: #33380F; background: var(--leucht); border: 2px solid #33380F; border-radius: 4px;
}
.knopf--umriss { background: var(--blatt); color: var(--tinte); border-color: var(--tinte); }
.knopf:hover { box-shadow: 3px 3px 0 var(--tinte); }
.vorspann { font-size: 1.12rem; color: var(--tinte-2); max-width: 64ch; }

/* ---------- Kopf ---------- */
.kopf { position: sticky; top: 0; z-index: 10; background: var(--heft); border-bottom: 2px solid var(--tinte); }
.kopf .huelle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.marke { display: flex; align-items: center; gap: 10px; min-height: 48px; color: var(--tinte); text-decoration: none; font-size: 1.3rem; }
.marke:hover { background: none; color: var(--tinte); }
.marke img { border-radius: 4px; border: 1.5px solid var(--rand); }
.kopf ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.kopf nav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 10px; color: var(--tinte); text-decoration: none; }
@media (max-width: 720px) { .kopf nav { display: none; } }

/* ---------- Held ---------- */
.held { padding: 48px 0 56px; }
.held .huelle { display: grid; gap: 40px; align-items: start; }
@media (min-width: 960px) { .held .huelle { grid-template-columns: 1fr 1fr; gap: 56px; } }
.held h1 { font-size: clamp(3rem, 12vw, 5.2rem); margin: 0 0 .2em; white-space: nowrap; }
.leitsatz { font: 700 clamp(1.25rem, 3vw, 1.55rem)/1.3 "Atkinson Hyperlegible", sans-serif; margin-bottom: .6em; }
.versprechen { font-size: 1.15rem; max-width: 44ch; }
.fakten { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 18px 0 24px; padding: 0; }
.fakten li { display: flex; align-items: center; gap: 6px; padding: 2px 4px 0; font-weight: 700; border-bottom: 4px solid var(--leucht); }
.fakten li::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--tinte); border-radius: 1px; }
.fakten { gap: 8px 18px; }
.bald { display: inline-flex; flex-direction: column; gap: 2px; padding: 12px 18px; border: 2px dashed var(--tinte); border-radius: 4px; background: var(--blatt); }
.bald strong { font: 700 1.15rem/1.2 "Playpen Sans", sans-serif; }
.bald span { font-size: .95rem; color: var(--tinte-2); }
.hinweis { font-size: .95rem; color: var(--tinte-2); margin-top: 12px; max-width: 48ch; }

/* Probier: Punktefeld zerlegen */
.feld-buehne { padding: 20px; }
.feld-buehne .aufgabe { font: 700 1.35rem/1.25 "Playpen Sans", sans-serif; margin-bottom: .2em; }
.feld-buehne .anleitung { color: var(--tinte-2); font-size: 1rem; }
.feld { --spalten: 8; display: grid; gap: 6px; justify-content: center; margin: 14px 0 6px; }
.reihe { display: grid; grid-template-columns: repeat(var(--spalten), 26px); gap: 8px; justify-content: center; padding: 3px 6px; }
.reihe span { width: 26px; height: 26px; border-radius: 50%; background: var(--rot); }
.reihe--unten span { background: var(--blau); }
.linie { height: 8px; margin: 2px 0; background: var(--leucht); border-radius: 2px; transform: rotate(-.6deg); box-shadow: 0 0 0 1.5px #33380F; }
@media (max-width: 420px) { .reihe { grid-template-columns: repeat(var(--spalten), 22px); gap: 6px; } .reihe span { width: 22px; height: 22px; } }
.regler { display: grid; gap: 6px; margin-top: 12px; }
.regler label { font-weight: 700; }
.regler-zeile { display: flex; gap: 8px; align-items: center; }
.regler-zeile .knopf { min-width: 48px; padding: .4em .6em; font-size: 1.2rem; }
.regler input { flex: 1; accent-color: #5A6414; min-height: 48px; }
.rechnung { font: 700 1.35rem/1.4 "Atkinson Hyperlegible", sans-serif; text-align: center; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.rechnung .rot { color: var(--rot); }
.rechnung .blau { color: var(--blau); }
@media (prefers-color-scheme: light) { .rechnung .rot { color: #B01E25; } .rechnung .blau { color: #1A46A0; } }
.rechnung .ergebnis { background: var(--leucht); color: #33380F; padding: 0 .25em; border-radius: 2px; }
.lob { text-align: center; color: var(--tinte-2); min-height: 1.6em; margin: 0; }
.feld-buehne .weiter { margin-top: 12px; display: flex; justify-content: center; }
.feld-buehne [hidden] { display: none; }

/* ---------- Abschnitte ---------- */
.abschnitt { padding: 60px 0; }
.abschnitt--blatt { background: color-mix(in srgb, var(--blatt) 86%, transparent); border-top: 2px solid var(--tinte); border-bottom: 2px solid var(--tinte); }
.raster { display: grid; gap: 18px; }
@media (min-width: 700px) { .raster { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .raster--3 { grid-template-columns: repeat(3, 1fr); } }

.schritte { list-style: none; margin: 26px 0 0; padding: 0; counter-reset: s; }
.schritte li { padding: 20px 20px 20px 74px; position: relative; counter-increment: s; }
.schritte li::before { content: counter(s); position: absolute; left: 18px; top: 16px; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--leucht); color: #33380F; border: 2px solid #33380F; border-radius: 4px; font: 700 1.25rem/1 "Playpen Sans", sans-serif; }
.schritte li p:last-child { margin-bottom: 0; }

.thema { padding: 18px 20px; }
.thema .klasse { display: inline-block; font-size: .9rem; font-weight: 700; padding: 1px 8px; margin-bottom: 8px; background: var(--leucht); color: #33380F; border-radius: 2px; }
.thema p:last-child { margin-bottom: 0; }
.thema--gross { grid-column: 1 / -1; }
.zusatz { margin-top: 22px; }

.lehrplan { margin-top: 30px; padding: 22px 24px; border-left: 6px solid var(--leucht); }
.lehrplan p:last-child { margin-bottom: 0; }
.lehrplan blockquote { margin: 0 0 .9em; padding-left: 14px; border-left: 2px solid var(--rand); }
.quellen { font-size: .92rem; color: var(--tinte-2); }

/* Bilder */
.galerie { display: flex; gap: 18px; overflow-x: auto; list-style: none; margin: 26px 0 0; padding: 4px 4px 18px; scroll-snap-type: x mandatory; }
.galerie li { flex: 0 0 220px; scroll-snap-align: start; }
.galerie img, .tablet img { border: 2px solid var(--tinte); border-radius: 4px; }
.galerie figure, .tablet figure { margin: 0; }
figcaption { font-size: .95rem; color: var(--tinte-2); margin-top: 8px; }
.galerie:focus-visible { outline-offset: -3px; }
.tablet { display: grid; gap: 18px; list-style: none; margin: 18px 0 0; padding: 0; }
@media (min-width: 900px) { .tablet { grid-template-columns: 1fr 1fr; } }

.gruppe { padding: 20px; }
.gruppe p:last-child { margin-bottom: 0; }

/* Preise */
.preise { display: grid; gap: 20px; margin-top: 24px; }
@media (min-width: 860px) { .preise { grid-template-columns: 1fr 1.25fr; } }
.preise > div { padding: 22px 24px; }
.preise ul { margin: 0; padding-left: 1.2em; }
.preise li { margin-bottom: .45em; }
.preisliste { width: 100%; border-collapse: collapse; }
.preisliste th, .preisliste td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--kaestchen); vertical-align: top; }
.preisliste tr:last-child th, .preisliste tr:last-child td { border-bottom: 0; }
.preisliste small { display: block; font-weight: 400; color: var(--tinte-2); font-size: .93rem; }
.preisliste .betrag { text-align: right; white-space: nowrap; padding-left: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kleingedruckt { font-size: .93rem; color: var(--tinte-2); margin-top: 12px; }

/* Fragen */
.fragen { display: grid; gap: 10px; margin-top: 22px; max-width: 820px; }
.fragen summary { cursor: pointer; list-style: none; padding: 12px 16px; min-height: 52px; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.06rem; }
.fragen summary::-webkit-details-marker { display: none; }
.fragen summary::before { content: "+"; flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid var(--tinte); border-radius: 2px; font-weight: 700; }
.fragen details[open] summary::before { content: "−"; background: var(--leucht); color: #33380F; border-color: #33380F; }
.fragen details > div { padding: 0 16px 14px 54px; }
.fragen details > div p:last-child { margin-bottom: 0; }

.schluss { text-align: center; }
.schluss .vorspann { margin-inline: auto; }

.fuss { background: var(--fuss-grund); color: var(--fuss-text); padding: 40px 0 46px; font-size: .95rem; }
.fuss ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.fuss a { color: var(--fuss-link); display: inline-flex; align-items: center; min-height: 44px; }
.fuss a:hover { color: #33380F; }
.fuss p { margin: 0 0 .4em; }
