/* Lebenslauf – Schulheft-Optik: Karopapier, Tinte, Textmarker, Rotstift. Dunkel = Schultafel. */

:root {
  --papier: #fbfcf8;
  --karo: #e4e9f3;
  --blatt: #ffffff;
  --tinte: #1c2a5e;
  --tinte-2: #56608a;
  --blau: #2547c4;
  --blau-hell: #e9eefc;
  --marker: #ffe14a;
  --marker-zart: #fff4b8;
  --marker-hl: #ffe14a;
  --rot: #c8312b;
  --gruen: #1d8656;
  --linie: #d3daea;
  --rand: #f0b4b0;
  --energie: #e09b12;
  --gesundheit: #1d8656;
  --stress: #c8312b;
  --glueck: #c93f78;
  --schatten: 0 1px 0 var(--linie), 0 8px 24px -18px rgba(28, 42, 94, .35);
  --r: 10px;
  --kopf: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --text: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #1d2925; --karo: #24332d; --blatt: #22302b; --tinte: #eef1e6; --tinte-2: #aebbaf;
    --blau: #9fb6ff; --blau-hell: #2a3a44; --marker: #e7d25a; --marker-zart: rgba(231, 210, 90, .18); --marker-hl: rgba(231, 210, 90, .38);
    --rot: #ff8b7c; --gruen: #7fd3a1; --linie: #3a4a43; --rand: #6b3d3a;
    --energie: #f0bc4c; --gesundheit: #7fd3a1; --stress: #ff8b7c; --glueck: #f08bb5;
    --schatten: 0 1px 0 var(--linie); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papier: #1d2925; --karo: #24332d; --blatt: #22302b; --tinte: #eef1e6; --tinte-2: #aebbaf;
  --blau: #9fb6ff; --blau-hell: #2a3a44; --marker: #e7d25a; --marker-zart: rgba(231, 210, 90, .18); --marker-hl: rgba(231, 210, 90, .38);
  --rot: #ff8b7c; --gruen: #7fd3a1; --linie: #3a4a43; --rand: #6b3d3a;
  --energie: #f0bc4c; --gesundheit: #7fd3a1; --stress: #ff8b7c; --glueck: #f08bb5;
  --schatten: 0 1px 0 var(--linie); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--tinte); font: 16px/1.5 var(--text);
  background-color: var(--papier);
  background-image: linear-gradient(var(--karo) 1px, transparent 1px), linear-gradient(90deg, var(--karo) 1px, transparent 1px);
  background-size: 22px 22px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--kopf); line-height: 1.15; margin: 0; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .6em; }
.leise { color: var(--tinte-2); }
.klein { font-size: .875rem; }
.gut { color: var(--gruen); }
.schlecht { color: var(--rot); }
.versteckt { display: none !important; }

/* ── Knöpfe ─────────────────────────────────────────────── */
.knopf {
  border: 2px solid var(--tinte); background: var(--blatt); border-radius: var(--r); padding: .55em 1em; font-weight: 700;
  min-height: 44px; transition: transform .08s;
}
.knopf:hover { background: var(--blau-hell); }
.knopf:active { transform: translateY(1px); }
.knopf.haupt { background: var(--blau); border-color: var(--blau); color: #fff; }
:root[data-theme="dark"] .knopf.haupt { color: #10203a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .knopf.haupt { color: #10203a; } }
.knopf.haupt:hover { filter: brightness(1.08); }
.knopf.klein { min-height: 36px; padding: .3em .75em; font-size: .9rem; border-width: 1.5px; }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf.zart { border-color: var(--linie); font-weight: 400; }

/* ── Kopfleiste ─────────────────────────────────────────── */
.kopfzeile { display: flex; align-items: center; gap: 12px; padding: 12px 20px; max-width: 1240px; margin: 0 auto; }
@media (max-width: 600px) { .kopfzeile { padding: 10px 16px; } .stepper button { width: 36px; height: 36px; } .stepper output { min-width: 46px; } .zeile { gap: 4px 8px; } }
.wortmarke { font-family: var(--kopf); font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; }
.wortmarke span { color: var(--rot); }
.kopfzeile .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── Spiel-Layout ───────────────────────────────────────── */
.spiel { max-width: 1240px; margin: 0 auto; padding: 0 20px 120px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .spiel { grid-template-columns: minmax(0, 1fr); padding: 0 16px 120px; } }

/* Du-Karte */
.du { background: var(--blatt); border: 1.5px solid var(--linie); border-radius: 14px; box-shadow: var(--schatten); padding: 18px; position: sticky; top: 12px; }
@media (max-width: 900px) { .du { position: static; } }
.du-kopf { display: flex; gap: 14px; align-items: center; }
.avatar { width: 78px; height: 78px; flex: none; }
.alter { font-family: var(--kopf); font-weight: 800; font-size: 4.2rem; line-height: .9; letter-spacing: -.03em; display: inline-block;
  background: linear-gradient(transparent 52%, var(--marker-hl) 52%, var(--marker-hl) 90%, transparent 90%); padding: 0 .08em; }
.alter-text { font-size: .8rem; color: var(--tinte-2); }
.du-name { font-family: var(--kopf); font-weight: 700; font-size: 1.15rem; margin-top: 10px; }
.du-status { color: var(--tinte-2); font-size: .92rem; }
.balken-liste { display: grid; gap: 8px; margin: 14px 0; }
.balken { display: grid; grid-template-columns: 86px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-size: .88rem; }
.balken .spur { height: 8px; border-radius: 4px; background: var(--karo); overflow: hidden; }
.balken .fuell { height: 100%; border-radius: 4px; }
.balken .zahl { text-align: right; font-variant-numeric: tabular-nums; color: var(--tinte-2); }
.geld-kurz { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; font-size: .92rem; border-top: 1.5px dashed var(--linie); padding-top: 10px; }
.geld-kurz b { font-variant-numeric: tabular-nums; text-align: right; }
.lebensband { margin-top: 14px; }
.lebensband svg { width: 100%; height: 34px; display: block; }

/* Blatt mit Heftrand */
.blatt { background: var(--blatt); border: 1.5px solid var(--linie); border-radius: 14px; box-shadow: var(--schatten); min-height: 60vh; position: relative; overflow: hidden; }
.blatt::before { content: ''; position: absolute; top: 0; bottom: 0; left: 30px; width: 1.5px; background: var(--rand); }
@media (max-width: 600px) { .blatt::before { left: 12px; } }
.reiter { display: flex; gap: 4px; padding: 10px 14px 0 44px; border-bottom: 1.5px solid var(--linie); overflow-x: auto; scrollbar-width: none; }
@media (max-width: 600px) { .reiter { padding-left: 22px; } }
.reiter button { border: 0; background: none; padding: 10px 12px; font-weight: 700; color: var(--tinte-2); border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; }
.reiter button[aria-selected="true"] { color: var(--tinte); border-bottom-color: var(--blau); }
.reiter .punkt { display: inline-block; min-width: 8px; height: 8px; border-radius: 4px; background: var(--rot); margin-left: 4px; vertical-align: middle; }
.inhalt { padding: 18px 22px 26px 50px; }
@media (max-width: 600px) { .inhalt { padding: 16px 14px 22px 26px; } }
.abschnitt { margin-bottom: 26px; }
.abschnitt > h2, .abschnitt > h3 { margin-bottom: 10px; }

/* ── Woche ──────────────────────────────────────────────── */
.wochenband { display: flex; height: 30px; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--linie); margin: 6px 0 6px; }
.wochenband div { height: 100%; min-width: 0; }
.wochenband .frei { background: repeating-linear-gradient(45deg, var(--karo) 0 4px, transparent 4px 8px); }
.legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--tinte-2); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.frei-hinweis { margin: 10px 0 4px; font-size: .95rem; }
.frei-hinweis b { font-family: var(--kopf); font-size: 1.15rem; }
.zeile { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--karo); }
.zeile .ico { font-size: 1.35rem; text-align: center; }
.zeile .was b { display: block; }
.zeile .was span { font-size: .85rem; color: var(--tinte-2); }
.zeile .was .tipp { color: var(--blau); }
.zeile .was .warn { color: var(--rot); }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--linie); background: var(--blatt); font-size: 1.25rem; font-weight: 700; line-height: 1; }
.stepper button:hover:not(:disabled) { border-color: var(--blau); color: var(--blau); }
.stepper button:disabled { opacity: .35; }
.stepper output { min-width: 58px; text-align: center; font-family: var(--kopf); font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stepper output small { font-family: var(--text); font-weight: 400; font-size: .75rem; color: var(--tinte-2); }
.farbstrich { width: 4px; height: 26px; border-radius: 2px; display: inline-block; }

/* ── Listen, Tabellen ───────────────────────────────────── */
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle td { padding: 6px 0; border-bottom: 1px solid var(--karo); }
.tabelle td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
.tabelle tr.summe td { font-weight: 700; border-top: 2px solid var(--tinte); border-bottom: 0; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 700px) { .zwei { grid-template-columns: 1fr; } }
.wahl { display: flex; flex-wrap: wrap; gap: 6px; }
.wahl button { border: 1.5px solid var(--linie); background: var(--blatt); border-radius: 999px; padding: .35em .9em; min-height: 40px; }
.wahl button[aria-pressed="true"] { border-color: var(--blau); background: var(--blau-hell); font-weight: 700; }
.feldreihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.feldreihe select, .feldreihe input { border: 1.5px solid var(--linie); border-radius: 8px; padding: .45em .6em; background: var(--blatt); min-height: 40px; }
.feldreihe input { width: 120px; }
.kasten { border: 1.5px solid var(--linie); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.kasten.aus { opacity: .6; }
.kasten h3 { margin-bottom: 4px; }
.grund { color: var(--rot); font-size: .88rem; }
.fortschritt { height: 10px; background: var(--karo); border-radius: 5px; overflow: hidden; margin: 6px 0; }
.fortschritt div { height: 100%; background: var(--blau); border-radius: 5px; }
.leiter { display: flex; gap: 4px; margin: 8px 0; }
.leiter span { flex: 1; height: 8px; border-radius: 4px; background: var(--karo); }
.leiter span.ja { background: var(--blau); }
.leiter span.max { background: repeating-linear-gradient(90deg, var(--karo) 0 3px, transparent 3px 6px); outline: 1px dashed var(--linie); }

/* Menschen */
.leute { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.mensch { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 10px; align-items: center; border: 1.5px solid var(--linie); border-radius: var(--r); padding: 10px; }
.mensch .kreis { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .95rem; }
.mensch b { display: block; line-height: 1.2; }
.mensch .rolle { font-size: .82rem; color: var(--tinte-2); }
.mensch .naehe { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: .8rem; color: var(--tinte-2); }
.mensch .naehe .spur { height: 6px; background: var(--karo); border-radius: 3px; overflow: hidden; }
.mensch .naehe .spur div { height: 100%; background: var(--glueck); border-radius: 3px; }
.mensch.blass { opacity: .5; }
.mensch.blass .kreis { background: var(--tinte-2) !important; }

/* Wissen */
.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.lernkarte { border: 1.5px solid var(--linie); border-radius: 6px; padding: 12px 14px 12px 18px; background: var(--blatt); position: relative;
  background-image: linear-gradient(var(--blatt) 27px, var(--karo) 27px, var(--karo) 28px, var(--blatt) 28px); background-size: 100% 28px; background-position: 0 6px; }
.lernkarte::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 1.5px; background: var(--rand); }
.lernkarte h3 { font-size: 1rem; margin-bottom: 4px; }
.lernkarte p { font-size: .9rem; line-height: 28px; margin: 0; }
.lernkarte.zu { display: grid; place-items: center; min-height: 90px; color: var(--tinte-2); font-family: var(--kopf); font-size: 1.6rem; background-image: none; }

/* ── Leiste unten ───────────────────────────────────────── */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--papier) 88%, transparent); backdrop-filter: blur(6px); border-top: 1.5px solid var(--linie); z-index: 20; }
.leiste .innen { max-width: 1240px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.leiste .info { margin-right: auto; font-size: .9rem; color: var(--tinte-2); }
.leiste .knopf.haupt { font-size: 1.08rem; padding: .6em 1.6em; min-height: 52px; }
@media (max-width: 600px) { .leiste .info { font-size: .8rem; line-height: 1.3; } .leiste .knopf.haupt { white-space: nowrap; padding: .6em 1em; font-size: 1rem; } }

/* ── Dialoge ────────────────────────────────────────────── */
.dialog-grund { position: fixed; inset: 0; background: rgba(20, 28, 60, .45); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.dialog { background: var(--blatt); border-radius: 16px; max-width: 620px; width: 100%; padding: 26px 26px 22px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); position: relative; max-height: calc(100vh - 32px); overflow-y: auto; }
@media (max-width: 600px) { .dialog { padding: 20px 18px 18px; } }
.dialog .bild { font-size: 2.6rem; line-height: 1; }
.dialog h2 { font-size: 1.6rem; margin: 8px 0 8px; }
.dialog .zaehler { position: absolute; top: 18px; right: 22px; font-size: .85rem; color: var(--tinte-2); }
.optionen { display: grid; gap: 8px; margin-top: 16px; }
.option { text-align: left; border: 1.5px solid var(--linie); border-radius: var(--r); background: var(--blatt); padding: 12px 14px; min-height: 52px; }
.option:hover:not(:disabled) { border-color: var(--blau); background: var(--blau-hell); }
.option b { display: block; }
.option span { font-size: .85rem; color: var(--tinte-2); }
.option:disabled { opacity: .5; cursor: not-allowed; }
.option .grund { display: block; }
.ergebnis { font-size: 1.05rem; margin: 14px 0; padding: 12px 14px; border-left: 4px solid var(--blau); background: var(--blau-hell); border-radius: 0 8px 8px 0; }
.neu-karte { margin-top: 12px; }
.neu-karte .titel { font-size: .85rem; color: var(--rot); font-weight: 700; margin-bottom: 6px; }
.dialog .unten { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Zeugnis */
.zeugnis h2 { font-size: 1.5rem; }
.zeugnis .zeugnis-kopf { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--tinte); padding-bottom: 8px; margin-bottom: 10px; gap: 10px; }
.noten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
@media (max-width: 520px) { .noten { grid-template-columns: repeat(2, 1fr); } }
.note { border: 1.5px solid var(--linie); border-radius: 8px; padding: 8px 10px; }
.note small { display: block; color: var(--tinte-2); font-size: .8rem; }
.note b { font-family: var(--kopf); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.meldungen { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.meldungen li { padding-left: 22px; position: relative; }
.meldungen li::before { position: absolute; left: 0; top: 0; }
.meldungen li.gut::before { content: '＋'; color: var(--gruen); font-weight: 700; }
.meldungen li.schlecht::before { content: '－'; color: var(--rot); font-weight: 700; }
.meldungen li.neutral::before { content: '·'; color: var(--tinte-2); font-weight: 700; }
.meldungen li.gut, .meldungen li.schlecht { color: var(--tinte); }
.meldungen li.wichtig { font-weight: 700; }
.rotstift { border: 1.5px solid var(--rot); border-radius: 4px 14px 4px 14px; padding: 10px 14px; color: var(--rot); margin-top: 10px; transform: rotate(-.4deg); }
.rotstift p { margin: 0 0 4px; }
.rotstift button { color: var(--rot); background: none; border: 0; padding: 0; text-decoration: underline; font-size: .88rem; }

/* ── Start ──────────────────────────────────────────────── */
.start { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.start .titel { font-family: var(--kopf); font-weight: 800; font-size: clamp(3rem, 12vw, 6.5rem); letter-spacing: -.04em; line-height: .9; margin: 18px 0 14px; }
.start .titel span { background: linear-gradient(transparent 55%, var(--marker-hl) 55%, var(--marker-hl) 88%, transparent 88%); }
.start .unter { font-size: 1.2rem; max-width: 34em; }
.start .blatt { padding: 22px 22px 24px 50px; margin-top: 22px; min-height: 0; }
@media (max-width: 600px) { .start .blatt { padding: 18px 14px 20px 26px; } }
.start fieldset { border: 0; padding: 0; margin: 0 0 20px; }
.start legend { font-family: var(--kopf); font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; padding: 0; }
.start input[type=text] { border: 0; border-bottom: 2px solid var(--tinte); background: transparent; font-size: 1.4rem; font-family: var(--kopf); padding: 4px 2px; width: min(320px, 100%); }
.so-gehts { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.so-gehts li { padding-left: 30px; position: relative; }
.so-gehts li b { font-family: var(--kopf); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; background: var(--marker); display: grid; place-items: center; font-size: .85rem; color: #1c2a5e; }
.weg-gruppe { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.weg-gruppe button { text-align: left; border-radius: 10px; }

/* ── Ende: der Lebenslauf ───────────────────────────────── */
.ende { max-width: 980px; margin: 0 auto; padding: 10px 16px 120px; }
.cv { background: var(--blatt); border: 1.5px solid var(--linie); border-radius: 14px; box-shadow: var(--schatten); padding: 34px 38px; }
@media (max-width: 600px) { .cv { padding: 22px 18px; } }
.cv-kopf { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; border-bottom: 2px solid var(--tinte); padding-bottom: 18px; }
@media (max-width: 640px) { .cv-kopf { grid-template-columns: auto 1fr; } .cv-kopf .punkte { grid-column: 1 / -1; text-align: left !important; } }
.cv-kopf h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; }
.cv-kopf .punkte { text-align: right; }
.cv-kopf .punkte b { font-family: var(--kopf); font-size: 3.4rem; font-weight: 800; line-height: 1; background: linear-gradient(transparent 55%, var(--marker-hl) 55%, var(--marker-hl) 90%, transparent 90%); }
.cv-titel { font-family: var(--kopf); font-size: 1.5rem; font-weight: 700; margin: 18px 0 4px; }
.cv-grid { display: grid; grid-template-columns: 320px 1fr; gap: 30px; margin-top: 20px; }
@media (max-width: 800px) { .cv-grid { grid-template-columns: 1fr; } }
.rad svg { width: 100%; max-width: 320px; display: block; margin: 0 auto; }
.bereiche { display: grid; gap: 6px; margin-top: 10px; }
.stationen { list-style: none; padding: 0; margin: 0; }
.stationen li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--karo); }
.stationen li b { font-family: var(--kopf); font-variant-numeric: tabular-nums; color: var(--tinte-2); }
.verlauf svg { width: 100%; height: 150px; display: block; }
.wenn { background: var(--marker-zart); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
