:root {
  --grund: #f6f4ef;
  --flaeche: #ffffff;
  --text: #1d1b19;
  --leise: #6b665f;
  --linie: #e2ddd4;
  --akzent: #c2410c;
  --akzent-text: #ffffff;
  --gut: #15803d;
  --gut-hell: #dcfce7;
  --mittel: #a16207;
  --mittel-hell: #fef3c7;
  --schlecht: #b91c1c;
  --schlecht-hell: #fee2e2;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #161412;
    --flaeche: #211e1b;
    --text: #f1ede6;
    --leise: #a8a196;
    --linie: #36312b;
    --akzent: #fb923c;
    --akzent-text: #1d1b19;
    --gut: #4ade80;
    --gut-hell: #12321f;
    --mittel: #facc15;
    --mittel-hell: #3a300c;
    --schlecht: #f87171;
    --schlecht-hell: #3b1414;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--grund);
  color: var(--text);
}
a { color: var(--akzent); }
main { max-width: 760px; margin: 0 auto; padding: 16px; outline: none; }

.kopf {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--linie); background: var(--flaeche);
}
.marke { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem; }
.kopf nav { display: flex; gap: 4px; }
.kopf nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--leise); }
.kopf nav a[aria-current="page"] { background: var(--grund); color: var(--text); font-weight: 600; }

h1 { font-size: 1.6rem; margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 20px 0 8px; }
.leise { color: var(--leise); }
.hinweis { padding: 16px; }

.karten { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 16px; }
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px;
}
a.karte { display: block; text-decoration: none; color: var(--text); }
a.karte:hover { border-color: var(--akzent); }
.karte h2 { margin-top: 0; }

.reiter { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0; }
.reiter button { background: transparent; color: var(--leise); border: 1px solid var(--linie); }
.reiter button[aria-pressed="true"] { background: var(--text); color: var(--grund); border-color: var(--text); }

.einstellungen { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; margin-bottom: 12px; }
.einstellungen label { display: flex; flex-direction: column; font-size: .85rem; color: var(--leise); gap: 2px; }
.einstellungen label.haken { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: .95rem; }

button, select, input {
  font: inherit; color: inherit;
}
button {
  border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  background: var(--akzent); color: var(--akzent-text); font-weight: 600; min-height: 44px;
}
button.zweitrangig { background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--akzent); outline-offset: 2px;
}
select, input[type="text"], input[type="number"] {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 8px 10px; min-height: 44px;
}
input[type="range"] { width: 100%; accent-color: var(--akzent); }

.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.zeile.ende { justify-content: flex-end; margin-top: 12px; }
.kennzahlen { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 12px; font-size: .95rem; }
.kennzahlen strong { font-size: 1.2rem; }

.song { text-align: center; padding: 24px 16px; }
.song .titel { font-size: 1.5rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.song .interpret { font-size: 1.1rem; color: var(--leise); margin-top: 4px; overflow-wrap: anywhere; }
.song .anhoeren { display: inline-block; margin-top: 10px; font-size: .9rem; }
.jahr-eingabe { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 12px; }
.jahr-eingabe input[type="number"] { width: 6.5em; font-size: 1.3rem; text-align: center; }

.ergebnis { border-radius: var(--radius); padding: 12px 16px; margin-top: 12px; }
.ergebnis.gut { background: var(--gut-hell); }
.ergebnis.mittel { background: var(--mittel-hell); }
.ergebnis.schlecht { background: var(--schlecht-hell); }
.ergebnis strong { font-size: 1.15rem; }

.balken { height: 8px; background: var(--linie); border-radius: 4px; overflow: hidden; }
.balken span { display: block; height: 100%; background: var(--akzent); }
.statistik { display: grid; grid-template-columns: 4.5em 1fr 3.5em; gap: 6px 10px; align-items: center; font-size: .9rem; }

.leben { letter-spacing: 2px; }
.zeitleiste { list-style: none; margin: 12px 0; padding: 0; }
.zeitleiste li.eintrag {
  display: grid; grid-template-columns: 4em 1fr; gap: 10px; align-items: center;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 8px 12px;
}
.zeitleiste li.eintrag.neu { border-color: var(--gut); }
.zeitleiste .jahr { font-weight: 700; font-size: 1.15rem; }
.zeitleiste .wer { font-size: .9rem; overflow-wrap: anywhere; }
.zeitleiste .wer span { color: var(--leise); }
.zeitleiste li.luecke { padding: 4px 0; }
.zeitleiste li.luecke button {
  width: 100%; min-height: 36px; padding: 4px; background: transparent; color: var(--akzent);
  border: 2px dashed var(--linie); font-weight: 600; font-size: .9rem;
}
.zeitleiste li.luecke button:hover, .zeitleiste li.luecke button:focus-visible { border-color: var(--akzent); }

.lernliste { width: 100%; border-collapse: collapse; font-size: .92rem; }
.lernliste th, .lernliste td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.lernliste td:first-child { font-weight: 700; white-space: nowrap; }
.lernliste .aufdecken { min-height: 32px; padding: 2px 10px; font-size: .85rem; letter-spacing: 2px; }

.buchstabe {
  font-size: 4.5rem; font-weight: 800; line-height: 1; text-align: center; color: var(--akzent); margin: 4px 0;
}
.uhr { text-align: center; font-variant-numeric: tabular-nums; font-size: 1.2rem; }
.uhr.knapp { color: var(--schlecht); font-weight: 700; }
.felder { display: grid; gap: 10px; margin: 12px 0; }
.felder label { display: grid; grid-template-columns: 6.5em 1fr; gap: 10px; align-items: center; font-weight: 600; }
.felder input { width: 100%; }

.auswertung { width: 100%; border-collapse: collapse; }
.auswertung th, .auswertung td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.auswertung .punkte { text-align: right; font-weight: 700; white-space: nowrap; }
.marke-status { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 999px; margin-top: 2px; }
.marke-status.gut { background: var(--gut-hell); color: var(--gut); }
.marke-status.mittel { background: var(--mittel-hell); color: var(--mittel); }
.marke-status.schlecht { background: var(--schlecht-hell); color: var(--schlecht); }
.beispiele { font-size: .85rem; color: var(--leise); margin-top: 2px; overflow-wrap: anywhere; }
.wertung { display: flex; gap: 6px; margin-top: 6px; }
.wertung button { min-height: 36px; padding: 4px 10px; font-size: .85rem; }

.lerntabelle { display: grid; gap: 10px; }
.lerntabelle .karte h2 { font-size: 1rem; margin: 0 0 4px; }

@media (max-width: 480px) {
  main { padding: 12px; }
  h1 { font-size: 1.35rem; }
  .song .titel { font-size: 1.25rem; }
  .felder label { grid-template-columns: 1fr; gap: 4px; }
  .auswertung.einzel th:nth-child(3), .auswertung.einzel td:nth-child(3) { display: none; }
  .buchstabe { font-size: 3.5rem; }
}
.song .marke-status { margin-bottom: 8px; }
.uebergabe { text-align: center; }
.uebergabe button { margin-top: 8px; }

/* Hörproben */
.abspieler { display: flex; align-items: center; gap: 14px; margin: 14px auto 6px; max-width: 420px; }
.abspielen {
  width: 64px; height: 64px; min-height: 64px; border-radius: 50%; padding: 0; flex: none;
  font-size: 1.4rem; display: grid; place-items: center;
}
.hoerrest { flex: 1; text-align: left; }
.hoerbalken { height: 10px; border-radius: 5px; }
.hoerbalken span { transition: width .2s linear; }
.hoerstatus { min-height: 1.4em; font-size: .85rem; margin-top: 4px; }
.bonus { justify-content: center; margin-top: 8px; }
.jahrzehnte { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.jahrzehnte button { font-size: 1.05rem; }

/* Tagestraining */
.faecher { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0 14px; }
.fach { text-align: center; padding: 6px 2px; border-radius: 8px; background: var(--flaeche); border: 1px solid var(--linie); font-size: .75rem; }
.fach strong { display: block; font-size: 1.05rem; }
.fach4, .fach5, .fach6 { border-color: var(--gut); background: var(--gut-hell); }
.jahr-eingabe.einfach { display: flex; gap: 8px; justify-content: center; }
.jahr-eingabe.einfach input { max-width: 8em; }
.merkhilfe { margin-top: 8px; font-size: .85rem; }
.merkset { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.verpasst { text-align: left; padding-left: 1.2em; }
details.karte summary { cursor: pointer; font-weight: 600; }

/* Hören & aufdecken */
.aufdecken-raster { display: grid; gap: 8px; margin: 12px 0; text-align: center; }
.aufdecken-raster .titel, .aufdecken-raster .interpret, .aufdecken-raster .jahr-gross {
  padding: 10px; border: 1px solid var(--linie); border-radius: var(--radius, 10px); background: var(--flaeche);
}
.aufdecken-raster .jahr-gross { font-size: 1.6rem; font-weight: 700; }
.aufdecken-feld { width: 100%; }
.bonus button[aria-pressed="true"] { background: var(--gut-hell); color: var(--gut); border-color: var(--gut); }

/* Geheimtipps (★): gültig, aber selten geschrieben */
.geheimtipp { font-weight: 600; color: var(--akzent); white-space: nowrap; }
.marke-status.geheimtipp-marke { background: var(--akzent); color: var(--akzent-text); }
