:root {
    --hg: #f4f1ea;
    --karte: #ffffff;
    --text: #2b2a33;
    --leise: #6f6d78;
    --linie: #e3dfd5;
    --akzent: #3b6fd8;
    --ok: #1f9d55;
    --ok-hg: #e3f6ea;
    --fehler: #d64545;
    --fehler-hg: #fde8e8;
    --zeit: #c77700;
    --zeit-hg: #fff1d6;
    --archiv: #7a5bc7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--hg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

main { max-width: 960px; margin: 0 auto; padding: 16px; }

h1, h2, h3 { line-height: 1.2; }
h3 { margin: 24px 0 8px; color: var(--leise); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }

.karte {
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.knopf {
    font: inherit;
    font-weight: 600;
    background: var(--akzent);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 10px 22px;
    cursor: pointer;
}
.knopf:hover { filter: brightness(1.08); }
.knopf.gross { font-size: 1.4rem; padding: 14px 40px; }
.knopf kbd { background: rgba(255,255,255,.2); color: #fff; border: 0; }

kbd {
    font-family: inherit;
    font-size: .8em;
    border: 1px solid var(--linie);
    border-radius: 4px;
    padding: 1px 6px;
    background: #f7f7f7;
}

select, input[type="password"] {
    font: inherit;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--linie);
    background: #fff;
}

/* Startseite */
.start { max-width: 420px; text-align: center; padding-top: 10vh; }
.start h1 { font-size: 2.4rem; margin-bottom: 0; }
.untertitel { color: var(--leise); margin-top: 4px; }
.auswahl { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auswahl label { font-weight: 600; font-size: 1.1rem; }
.auswahl select, .auswahl input { font-size: 1.1rem; }
.hinweis-fehler { color: var(--fehler); margin: 0; }

/* Kopf */
.kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 16px 0;
}
.logo { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tabs a, .filter a {
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
}
.tabs a.aktiv { background: var(--karte); border: 1px solid var(--linie); font-weight: 600; }
.filter { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0; }
.filter a { padding: 4px 12px; border: 1px solid var(--linie); }
.filter a.aktiv { background: var(--akzent); color: #fff; border-color: var(--akzent); }

/* Üben */
.ueben { text-align: center; min-height: 420px; display: flex; flex-direction: column; }
.leiste { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--leise); }
.zustand { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; padding: 24px 0; }
.zustand[hidden] { display: none; }

.uhr { width: 100%; max-width: 480px; height: 14px; background: var(--linie); border-radius: 7px; overflow: hidden; }
#balken { height: 100%; width: 100%; background: var(--ok); border-radius: 7px; }
#balken.knapp { background: var(--fehler); }
.sekunden { color: var(--leise); font-variant-numeric: tabular-nums; margin-top: -8px; }

#antwort-form { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.frage {
    font-size: clamp(2.6rem, 10vw, 4.5rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
#eingabe {
    font: inherit;
    width: 3.2ch;
    text-align: center;
    border: 3px solid var(--akzent);
    border-radius: 12px;
    padding: 0 4px;
    outline: none;
}

.meldung { font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 700; }
.meldung.ok { color: var(--ok); }
.meldung.fehler { color: var(--fehler); }
.meldung.zeit { color: var(--zeit); }
.erklaerung { font-size: 1.6rem; font-variant-numeric: tabular-nums; }

.punkte { display: flex; gap: 6px; justify-content: center; }
.punkte span { width: 14px; height: 14px; border-radius: 50%; background: var(--linie); }
.punkte span.voll { background: var(--ok); }
.punkte.klein span { width: 8px; height: 8px; }
.punkte.klein { gap: 3px; }

.sitzung { color: var(--leise); font-size: .9rem; }

/* Karteikasten */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.kaertchen {
    border: 1px solid var(--linie);
    border-radius: 10px;
    padding: 8px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.kf { font-weight: 600; font-variant-numeric: tabular-nums; }
.kaertchen.wackelig { border-color: var(--fehler); background: var(--fehler-hg); }
.kaertchen.archiviert { background: #f1edfa; border-color: #d9cff2; color: var(--archiv); }
.mini {
    font: inherit;
    font-size: .75rem;
    border: 1px solid #d9cff2;
    background: #fff;
    color: var(--archiv);
    border-radius: 6px;
    padding: 0 6px;
    cursor: pointer;
}

/* Protokoll */
.summen { display: flex; gap: 12px; flex-wrap: wrap; }
.summe { border: 1px solid var(--linie); border-radius: 10px; padding: 8px 14px; display: flex; gap: 12px; align-items: baseline; }
.summe .st { font-weight: 600; }
.summe .ok { color: var(--ok); }
.summe .fehler { color: var(--fehler); }
.summe .zeit { color: var(--zeit); }

.tabelle-wrap { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabelle th, .tabelle td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle th { color: var(--leise); font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.marke { display: inline-block; border-radius: 6px; padding: 0 8px; font-size: .85rem; font-weight: 600; }
.marke.ok { background: var(--ok-hg); color: var(--ok); }
.marke.fehler { background: var(--fehler-hg); color: var(--fehler); }
.marke.zeit { background: var(--zeit-hg); color: var(--zeit); }
.marke.archiv { background: #f1edfa; color: var(--archiv); }
.leer { color: var(--leise); }

@media (max-width: 600px) {
    .karte { padding: 16px; }
    .tabs { margin-left: 0; }
}

/* Rundenende */
.sterne { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; font-size: 2rem; color: var(--linie); }
.sterne .voll { color: #f2b300; }
.knopf:disabled { opacity: .5; cursor: default; }

.zurueck { color: var(--leise); text-align: center; font-size: .95rem; }
