@font-face {
    font-family: "Inter";
    src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("fonts/inter-latin-700-normal.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --hintergrund: #f6f7f9;
    --flaeche: #ffffff;
    --flaeche-2: #f2f4f7;
    --flaeche-3: #e7eaef;
    --linie: #e2e5ea;
    --text: #16181d;
    --text-leise: #646b76;
    --akzent: #2f5bea;
    --akzent-hell: #4a71f0;
    --akzent-dunkel: #2347c2;
    --akzent-zart: #edf1fe;
    --gruen: #1d8a4b;
    --rot: #d1392b;
    --radius: 10px;
    --schatten: 0 1px 2px rgba(16, 24, 40, 0.05);
    --schatten-gross: 0 12px 32px rgba(16, 24, 40, 0.14);
    --schrift: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --schrift-mono: "JetBrains Mono", ui-monospace, "Consolas", monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--hintergrund);
    color: var(--text);
    font-family: var(--schrift);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--akzent);
}

.versteckt {
    display: none !important;
}

/* ---------------------------------------------------------------- Kopf */

.kopf {
    background: var(--flaeche);
    border-bottom: 1px solid var(--linie);
}

.kopf-innen {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.logo-schrift {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.3px;
    line-height: 1;
}

.logo-schrift span {
    color: var(--akzent);
}

.logo-unter {
    font-size: 14px;
    color: var(--text-leise);
}

.kopf-rechts {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-leise);
}

/* ---------------------------------------------------------------- Layout */

.inhalt {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.inhalt.schmal {
    max-width: 640px;
}

.fuss {
    border-top: 1px solid var(--linie);
    padding: 18px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-leise);
}

h1, h2, h3 {
    line-height: 1.2;
    margin: 0 0 12px;
    letter-spacing: -0.3px;
}

h1 {
    font-weight: 700;
    font-size: clamp(30px, 6vw, 46px);
    letter-spacing: -0.8px;
}

h2 {
    font-weight: 700;
    font-size: 24px;
}

h3 {
    font-size: 17px;
    font-weight: 600;
}

.etikett {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-leise);
}

.leise {
    color: var(--text-leise);
}

/* ---------------------------------------------------------------- Karten */

.karte {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    box-shadow: var(--schatten);
}

.karte + .karte {
    margin-top: 16px;
}

.raster > .karte,
.zwei-spalten > .karte {
    margin-top: 0;
}

.raster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.schritt-nummer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--akzent-zart);
    color: var(--akzent);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
}

/* ---------------------------------------------------------------- Buttons */

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 8px;
    border: 1px solid var(--linie);
    background: var(--flaeche);
    color: var(--text);
    font-family: var(--schrift);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.knopf:hover {
    background: var(--flaeche-2);
}

.knopf:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.knopf.primaer {
    background: var(--akzent);
    border-color: var(--akzent);
    color: #fff;
}

.knopf.primaer:hover {
    background: var(--akzent-dunkel);
    border-color: var(--akzent-dunkel);
}

.knopf.gefahr {
    border-color: #f1c4bf;
    color: var(--rot);
    background: var(--flaeche);
}

.knopf.gefahr:hover {
    background: #fdf0ee;
}

.knopf.klein {
    padding: 6px 12px;
    font-size: 13px;
}

.knopf.gross {
    padding: 14px 32px;
    font-size: 17px;
}

.knopf.geist {
    background: transparent;
}

.knopf.geist:hover {
    background: var(--flaeche-2);
}

/* ---------------------------------------------------------------- Formulare */

.feld {
    width: 100%;
    padding: 12px 14px;
    background: var(--flaeche);
    border: 1px solid #cfd4db;
    border-radius: 8px;
    color: var(--text);
    font-family: var(--schrift);
    font-size: 16px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.feld:focus {
    border-color: var(--akzent);
    box-shadow: 0 0 0 3px rgba(47, 91, 234, 0.15);
}

.feld.code {
    font-family: var(--schrift-mono);
    font-size: 20px;
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
}

select.feld {
    padding: 10px;
}

.meldung {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
}

.meldung.fehler {
    background: #fdeeec;
    border: 1px solid #f6c9c3;
    color: #9b2a1f;
}

.meldung.erfolg {
    background: #e9f6ef;
    border: 1px solid #bfe3cd;
    color: #166437;
}

.meldung.hinweis {
    background: var(--akzent-zart);
    border: 1px solid #ccd8fb;
    color: #22408f;
}

/* ---------------------------------------------------------------- Abzeichen */

.abzeichen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--linie);
    background: var(--flaeche-2);
    color: var(--text-leise);
    white-space: nowrap;
}

.abzeichen.aktiv {
    border-color: #ccd8fb;
    color: var(--akzent);
    background: var(--akzent-zart);
}

.abzeichen.aktiv::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--akzent);
    animation: pulsieren 1.6s infinite;
}

.abzeichen.gruen {
    border-color: #bfe3cd;
    background: #e9f6ef;
    color: var(--gruen);
}

.abzeichen.rot {
    border-color: #f6c9c3;
    background: #fdeeec;
    color: var(--rot);
}

@keyframes pulsieren {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ---------------------------------------------------------------- Fortschritt */

.fortschritt {
    height: 8px;
    background: var(--flaeche-3);
    border-radius: 999px;
    overflow: hidden;
}

.fortschritt-balken {
    height: 100%;
    width: 0;
    background: var(--akzent);
    border-radius: 999px;
    transition: width 0.3s;
}

/* ---------------------------------------------------------------- Startseite */

.held {
    max-width: 680px;
    margin-bottom: 40px;
}

.held p {
    font-size: 18px;
    color: var(--text-leise);
}

/* ---------------------------------------------------------------- Ergebnisse */

.reiter {
    display: inline-flex;
    gap: 4px;
    background: var(--flaeche-3);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.reiter button {
    background: transparent;
    border: none;
    color: var(--text-leise);
    padding: 8px 16px;
    border-radius: 7px;
    font-family: var(--schrift);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.reiter button.aktiv {
    background: var(--flaeche);
    color: var(--text);
    box-shadow: var(--schatten);
}

.ergebnis-karte h3 {
    font-size: 15px;
    margin-bottom: 14px;
    min-height: 38px;
}

.podest-zeile {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.podest-platz {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--flaeche-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-leise);
}

.podest-zeile.platz-1 .podest-platz {
    background: var(--akzent);
    color: #fff;
}

.podest-name {
    font-weight: 600;
    font-size: 14px;
}

.podest-balken {
    height: 4px;
    background: var(--flaeche-3);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.podest-balken div {
    height: 100%;
    background: var(--akzent);
}

.podest-prozent {
    font-size: 13px;
    color: var(--text-leise);
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- Login */

.ausweis {
    max-width: 440px;
    margin: 30px auto 0;
}

/* ---------------------------------------------------------------- Menü */

.bereich-karte {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bereich-karte .zahl {
    font-size: 14px;
    color: var(--text-leise);
}

.fertig-symbol {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e9f6ef;
    color: var(--gruen);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 6px 0 14px;
}

/* ---------------------------------------------------------------- Quiz */

.quiz-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.quiz-zaehler {
    font-size: 14px;
    color: var(--text-leise);
    font-variant-numeric: tabular-nums;
}

.frage-karte {
    margin-top: 18px;
    min-height: 340px;
    display: flex;
    flex-direction: column;
}

.frage-text {
    font-weight: 700;
    font-size: clamp(22px, 5vw, 30px);
    line-height: 1.2;
    letter-spacing: -0.4px;
    margin: 6px 0 6px;
}

.frage-hinweis {
    font-size: 14px;
    color: var(--text-leise);
    margin-bottom: 18px;
}

.eingabe-zeile {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.eingabe-zeile .vorschlag-feld {
    flex: 1 1 200px;
}

.gruppen-plus {
    align-self: center;
    color: var(--text-leise);
    font-weight: 700;
    font-size: 18px;
}

.vorschlag-feld {
    position: relative;
}

.vorschlag-liste {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--schatten-gross);
    max-height: 290px;
    overflow-y: auto;
}

.vorschlag {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 15px;
}

.vorschlag.markiert, .vorschlag:hover {
    background: var(--akzent-zart);
}

.vorschlag-leer {
    padding: 10px 14px;
    color: var(--text-leise);
    font-size: 14px;
}

.nominiert-liste {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

.nominiert {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--flaeche-2);
    border: 1px solid var(--linie);
    border-radius: 8px;
    padding: 10px 12px;
    animation: einblenden 0.2s ease-out;
}

.nominiert .nummer {
    font-size: 13px;
    font-weight: 700;
    color: var(--akzent);
}

.nominiert .name {
    flex: 1;
    font-weight: 600;
}

.entfernen {
    background: transparent;
    border: none;
    color: var(--text-leise);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
}

.entfernen:hover {
    color: var(--rot);
}

.platzhalter {
    border: 1px dashed #cfd4db;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-leise);
    font-size: 14px;
}

@keyframes einblenden {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.kandidaten-liste {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.kandidat {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--schrift);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.kandidat:hover {
    border-color: #c3c9d2;
}

.kandidat .kreis {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #b7bec8;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kandidat.gewaehlt {
    border-color: var(--akzent);
    background: var(--akzent-zart);
}

.kandidat.gewaehlt .kreis {
    border-color: var(--akzent);
    background: var(--akzent);
}

.kandidat.gewaehlt .kreis::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 24px;
}

.speicher-status {
    font-size: 13px;
    color: var(--text-leise);
    min-height: 18px;
    text-align: right;
    margin-top: 6px;
}

.uebersicht-zeile {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    padding: 10px 6px;
    border-bottom: 1px solid var(--linie);
    cursor: pointer;
}

.uebersicht-zeile:hover {
    background: var(--flaeche-2);
}

.uebersicht-zeile .nr {
    color: var(--text-leise);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.uebersicht-zeile .frage {
    font-weight: 600;
    font-size: 14px;
}

.uebersicht-zeile .antwort {
    font-size: 13px;
    color: var(--akzent);
}

.uebersicht-zeile .antwort.leer {
    color: var(--text-leise);
}

/* ---------------------------------------------------------------- Dialog */

.dialog-hintergrund {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.dialog {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--flaeche);
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--schatten-gross);
}

.dialog.breit {
    max-width: 760px;
}

.dialog h2 {
    font-size: 20px;
}

.dialog-knoepfe {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------- Admin */

.admin-reiter {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--linie);
    margin-bottom: 24px;
    overflow-x: auto;
}

.admin-reiter button {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-leise);
    padding: 12px 16px;
    font-family: var(--schrift);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
}

.admin-reiter button.aktiv {
    color: var(--text);
    border-bottom-color: var(--akzent);
}

.statistik {
    font-weight: 700;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.statistik small {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-leise);
}

.knopf-reihe {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.tabelle-huelle {
    overflow-x: auto;
    border: 1px solid var(--linie);
    border-radius: 8px;
}

table.tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabelle th {
    text-align: left;
    background: var(--flaeche-2);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-leise);
    padding: 10px 12px;
    white-space: nowrap;
}

.tabelle td {
    padding: 9px 12px;
    border-top: 1px solid var(--linie);
    vertical-align: middle;
}

.tabelle tr:hover td {
    background: #fafbfc;
}

.tabelle .aktionen {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tabelle .feld {
    padding: 7px 10px;
    font-size: 14px;
}

.mono {
    font-family: var(--schrift-mono);
}

.formular-zeile {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}

.formular-zeile .feld {
    flex: 1 1 180px;
    width: auto;
}

.mini-fortschritt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-leise);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.mini-fortschritt .fortschritt {
    width: 60px;
    height: 6px;
}

.codes-tabelle td.mono {
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--akzent);
}

.zwei-spalten {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gefahr-karte {
    border-color: #f1c4bf;
}

@media (max-width: 820px) {
    .zwei-spalten {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .eingabe-zeile {
        flex-direction: column;
        gap: 6px;
    }
    .eingabe-zeile .vorschlag-feld {
        flex: 0 0 auto;
    }
    .gruppen-plus {
        line-height: 1;
        text-align: center;
    }
    .eingabe-zeile .knopf {
        margin-top: 4px;
    }
}

@media (max-width: 520px) {
    .logo-unter {
        display: none;
    }
    .inhalt {
        padding: 22px 14px 40px;
    }
    .karte {
        padding: 18px;
    }
    .quiz-navigation .knopf {
        flex: 1;
        padding: 12px 10px;
    }
}
