/* Oberflaeche des Karteikartensystems.
   Dunkel als Grundton, weil Lernsessions oft abends stattfinden.
   Bewusst ohne Framework - die App hat drei Ansichten. */

:root {
  --bg: #14161a;
  --panel: #1d2026;
  --panel-hoch: #262a32;
  --rand: #333842;
  --text: #e8eaed;
  --text-leise: #9aa1ac;
  --akzent: #6ba3f5;
  --again: #e5534b;
  --hard: #d29922;
  --good: #3fb950;
  --easy: #58a6ff;
  --radius: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8; --panel: #ffffff; --panel-hoch: #eef0f4;
    --rand: #d8dce3; --text: #1a1d22; --text-leise: #5c636e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

header {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--rand);
  position: sticky; top: 0; z-index: 10;
}
header h1 { font-size: 1.05rem; margin: 0; font-weight: 600; letter-spacing: .01em; }
header nav { margin-left: auto; display: flex; gap: .4rem; }

button {
  font: inherit; cursor: pointer; color: var(--text);
  background: var(--panel-hoch); border: 1px solid var(--rand);
  border-radius: 8px; padding: .45rem .9rem;
  transition: filter .12s ease, transform .06s ease;
}
button:hover:not(:disabled) { filter: brightness(1.2); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.aktiv { border-color: var(--akzent); color: var(--akzent); }

main { max-width: 780px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.versteckt { display: none !important; }

/* --- Fortschritt --- */
.fortschritt {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; color: var(--text-leise); font-size: .875rem;
}
.balken {
  flex: 1; height: 6px; background: var(--panel-hoch);
  border-radius: 999px; overflow: hidden;
}
.balken > div {
  height: 100%; background: var(--akzent);
  transition: width .3s ease; width: 0;
}

/* --- Karte --- */
.karte {
  background: var(--panel); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 1.75rem;
  min-height: 220px; display: flex; flex-direction: column;
}
.feldname {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-leise); margin-bottom: .5rem;
}
.inhalt { font-size: 1.15rem; white-space: pre-wrap; word-break: break-word; }
.inhalt ul { margin: .4rem 0; padding-left: 1.3rem; }
.inhalt img { max-width: 100%; border-radius: 8px; }
.inhalt code {
  background: var(--panel-hoch); padding: .1rem .35rem;
  border-radius: 4px; font-size: .9em;
}
hr.trenner { border: 0; border-top: 1px solid var(--rand); margin: 1.25rem 0; }

.tipp {
  margin-top: 1rem; padding: .75rem 1rem;
  background: var(--panel-hoch); border-left: 3px solid var(--hard);
  border-radius: 0 8px 8px 0; font-size: .95rem;
}

/* --- Bewertung --- */
.aktionen { margin-top: 1.25rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.aktionen button { flex: 1; min-width: 110px; padding: .7rem .5rem; }
.bewertung { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.bewertung .taste { font-size: .7rem; color: var(--text-leise); }
.bewertung .intervall { font-size: .72rem; color: var(--text-leise); }
#b-again { border-color: var(--again); }
#b-hard  { border-color: var(--hard); }
#b-good  { border-color: var(--good); }
#b-easy  { border-color: var(--easy); }

/* --- Meldungen --- */
.hinweis {
  background: var(--panel); border: 1px solid var(--rand);
  border-left: 3px solid var(--hard);
  border-radius: 0 8px 8px 0; padding: .75rem 1rem;
  margin-bottom: 1rem; font-size: .9rem;
}
.leer { text-align: center; padding: 3.5rem 1rem; color: var(--text-leise); }
.leer .gross { font-size: 2.5rem; margin-bottom: .5rem; }

/* --- Dashboard --- */
.kacheln {
  display: grid; gap: .75rem; margin-bottom: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.kachel {
  background: var(--panel); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 1rem;
}
.kachel .wert { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.kachel .name { font-size: .78rem; color: var(--text-leise); margin-top: .15rem; }

.prognose { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin-top: .5rem; }
.prognose .tag { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.prognose .saeule { background: var(--akzent); border-radius: 3px 3px 0 0; min-height: 2px; }
.prognose .beschriftung { font-size: .6rem; color: var(--text-leise); text-align: center; margin-top: .25rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rand); }
th { color: var(--text-leise); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }

.suchfeld {
  width: 100%; padding: .6rem .85rem; font: inherit;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--rand); border-radius: 8px; margin-bottom: 1rem;
}

/* --- Anmeldung --- */
.anmelde-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 1.25rem;
}
.anmelde-box {
  background: var(--panel); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 2rem;
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: .5rem;
}
.anmelde-box h2 { margin: 0 0 .25rem; font-size: 1.25rem; }
.anmelde-box label {
  font-size: .78rem; color: var(--text-leise); margin-top: .5rem;
}
.anmelde-box input {
  padding: .6rem .75rem; font: inherit;
  background: var(--panel-hoch); color: var(--text);
  border: 1px solid var(--rand); border-radius: 8px;
}
.anmelde-box button { margin-top: 1rem; padding: .65rem; }
.anmelde-hinweis { font-size: .85rem; color: var(--text-leise); margin: 0; }
.anmelde-fehler {
  font-size: .85rem; color: var(--again); margin: .5rem 0 0;
}
