:root {
  --grund: #f6f5f1;
  --flaeche: #ffffff;
  --text: #1b1d22;
  --leise: #6b6f78;
  --linie: #dedbd3;
  --akzent: #2f5d50;
  --akzent-text: #ffffff;
  --gut: #2f7a4f;
  --mittel: #a8741a;
  --schlecht: #b2453a;
  --strich: #2f5d50;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #14161c;
    --flaeche: #1e2129;
    --text: #eceae4;
    --leise: #9a9ea8;
    --linie: #2f333d;
    --akzent: #7fb8a4;
    --akzent-text: #10221c;
    --gut: #6cc08e;
    --mittel: #e0a94a;
    --schlecht: #e27a6f;
    --strich: #7fb8a4;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right))
           calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
  max-width: 560px;
  margin: 0 auto;
}

.kopf-titel, .kopf-knopf {
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  padding: 8px 0;
  cursor: pointer;
}

.kopf-knopf {
  font-size: 24px;
  line-height: 1;
  padding: 6px 10px;
  margin-right: -10px;
  color: var(--leise);
}

main {
  max-width: 560px;
  margin: 0 auto;
}

h1 { font-size: 26px; line-height: 1.2; margin: 12px 0 6px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); margin: 28px 0 10px; font-weight: 600; }
p { margin: 0 0 12px; }
.leise { color: var(--leise); }
.klein { font-size: 14px; }

.knopf {
  display: block;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: var(--akzent);
  color: var(--akzent-text);
  font: inherit;
  font-weight: 650;
  padding: 12px 16px;
  cursor: pointer;
  margin: 8px 0;
}

.knopf.zweit {
  background: var(--flaeche);
  color: var(--text);
  border: 1px solid var(--linie);
}

.knopf:disabled { opacity: .5; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin: 14px 0;
}

.karte-frage { font-size: 20px; font-weight: 600; line-height: 1.35; }
.karte-antwort { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--linie); }
.karte-quelle { margin-top: 14px; font-size: 14px; color: var(--leise); }
.karte-quelle a { color: inherit; }

.fortschritt-zeile {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--leise);
  margin-top: 4px;
}

.noten {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.noten .knopf { margin: 0; padding: 10px 6px; font-size: 16px; }
.note-0 { background: var(--schlecht); color: #fff; }
.note-1 { background: var(--mittel); color: #1b1d22; }
.note-2 { background: var(--gut); color: #fff; }

@media (prefers-color-scheme: dark) {
  .note-0, .note-2 { color: #14161c; }
}

.striche {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.strich {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--leise);
  line-height: 1.1;
}

.strich.ja { background: var(--strich); border-color: var(--strich); color: var(--akzent-text); }
.strich.ja b { font-size: 18px; }
.strich.zukunft { border-style: dashed; background: transparent; }
.strich.heute { outline: 2px solid var(--text); outline-offset: 1px; }

.zahlen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.zahl {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
}

.zahl b { display: block; font-size: 24px; line-height: 1.2; }
.zahl span { font-size: 13px; color: var(--leise); }

.hinweis {
  border-left: 3px solid var(--mittel);
  background: var(--flaeche);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  margin: 14px 0;
  font-size: 15px;
}

.fehler { border-left-color: var(--schlecht); }

.tabelle { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabelle td { padding: 6px 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle td:last-child { text-align: right; color: var(--leise); }
