/* StoppiMeter – mobil-first, hell/dunkel-fähig */

:root {
    --bg: #f4f5f7;
    --karte: #ffffff;
    --text: #1a1c20;
    --gedimmt: #5b616e;
    --rand: #e2e5ea;
    --akzent: #2f6bff;
    --akzent-text: #ffffff;
    --ok: #1f9d55;
    --warn: #b7791f;
    --fehler: #d64545;
    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161a;
        --karte: #1e2127;
        --text: #eceef2;
        --gedimmt: #a2a9b6;
        --rand: #2c313a;
        --akzent: #5a86ff;
        --ok: #46c07a;
        --warn: #e0a83d;
        --fehler: #ff6b6b;
    }
}

* { box-sizing: border-box; }

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

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: max(16px, env(safe-area-inset-top)) 16px 32px;
}

.karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 640px;
    margin-top: 6vh;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}

.karte.schmal { max-width: 440px; }

h1 {
    margin: 0 0 4px;
    font-size: 1.6rem;
}

.lead {
    margin: 0 0 20px;
    color: var(--gedimmt);
}

.hinweis {
    color: var(--gedimmt);
    font-size: .95rem;
    margin-top: 18px;
}

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

/* Formulare */
.code-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

label {
    font-weight: 600;
    font-size: .95rem;
}

input, textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--rand);
    border-radius: 10px;
    padding: 14px 16px;
}

input:focus, textarea:focus {
    outline: 3px solid color-mix(in srgb, var(--akzent) 35%, transparent);
    border-color: var(--akzent);
}

/* Zugangscode groß & mittig */
#code {
    font-size: 1.6rem;
    letter-spacing: .12em;
    text-align: center;
}

/* Knöpfe – große Touch-Ziele */
.knopf {
    display: inline-block;
    text-align: center;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 14px 20px;
    background: var(--akzent);
    color: var(--akzent-text);
    text-decoration: none;
}

.knopf.gross {
    padding: 16px 20px;
    font-size: 1.1rem;
}

.knopf:active { transform: translateY(1px); }

/* Statusliste */
.status-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-liste li {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--rand);
    background: var(--bg);
}

.status-liste li::before {
    margin-right: 8px;
    font-weight: 700;
}

.status-liste li.ok    { border-color: color-mix(in srgb, var(--ok) 45%, var(--rand)); }
.status-liste li.ok::before    { content: "✓"; color: var(--ok); }
.status-liste li.warn  { border-color: color-mix(in srgb, var(--warn) 45%, var(--rand)); }
.status-liste li.warn::before  { content: "!"; color: var(--warn); }
.status-liste li.fehler { border-color: color-mix(in srgb, var(--fehler) 55%, var(--rand)); }
.status-liste li.fehler::before { content: "✕"; color: var(--fehler); }

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

code {
    background: var(--bg);
    border: 1px solid var(--rand);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: .9em;
}

/* ---------- Admin ---------- */
.admin-bar {
    position: fixed;
    inset: 0 0 auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--karte);
    border-bottom: 1px solid var(--rand);
    z-index: 10;
}

.admin-bar .marke {
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
}

.seite-admin .karte { margin-top: 64px; }

.inline { display: inline; margin: 0; }

.knopf.klein { padding: 8px 12px; font-size: .9rem; }

.knopf.hell {
    background: transparent;
    color: var(--akzent);
    border-color: var(--akzent);
}

.knopf.gefahr { background: var(--fehler); }

.zurueck { text-decoration: none; color: var(--gedimmt); }

/* Neues-Event-Formular */
.event-neu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    background: var(--bg);
    margin-bottom: 20px;
}

.feld { display: flex; flex-direction: column; gap: 6px; }

select {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: 10px;
    padding: 14px 16px;
}

/* Event-Liste */
.event-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.event-liste li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 14px;
    border: 1px solid var(--rand);
    border-radius: 10px;
}

.event-liste .titel { font-weight: 600; text-decoration: none; }
.event-liste .meta { flex-basis: 100%; color: var(--gedimmt); font-size: .9rem; }

/* Badges */
.badge {
    font-size: .8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--rand);
}
.badge-entwurf { color: var(--gedimmt); }
.badge-aktiv   { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 45%, var(--rand)); }
.badge-beendet { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--rand)); }

/* Detail-Bloecke */
.block {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--rand);
}
.block h2 { font-size: 1.1rem; margin: 0 0 10px; }

.code-gross {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: .12em;
    margin: 4px 0;
}

.url { word-break: break-all; }

.qr-platzhalter {
    margin-top: 14px;
    width: 200px;
    height: 200px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #888;
    border: 1px solid var(--rand);
    border-radius: 10px;
}
.qr-platzhalter canvas, .qr-platzhalter img { display: block; }

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

/* ---------- Teilnehmer ---------- */
textarea { resize: vertical; min-height: 120px; }

/* ---------- Moderator ---------- */
.mod-status {
    font-size: .9rem;
    font-weight: 600;
    color: var(--gedimmt);
    padding: 2px 10px;
    border: 1px solid var(--rand);
    border-radius: 999px;
}
.mod-status.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--rand)); }

.mod-wrap {
    width: 100%;
    max-width: 1000px;
    margin-top: 64px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
@media (min-width: 760px) {
    .mod-wrap { grid-template-columns: 1fr 1fr; align-items: start; }
}

.mod-spalte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 16px;
}
.mod-spalte h2 { margin: 0 0 12px; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.gedimmt-spalte { opacity: .85; }

.zahl {
    font-size: .85rem;
    background: var(--bg);
    border: 1px solid var(--rand);
    border-radius: 999px;
    padding: 1px 9px;
    color: var(--gedimmt);
}

.frage-liste { display: flex; flex-direction: column; gap: 10px; }

.frage-karte {
    border: 1px solid var(--rand);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--bg);
}
.frage-karte.status-vorgelesen { opacity: .6; }

.frage-text { margin: 0 0 8px; white-space: pre-wrap; word-break: break-word; }

.frage-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: .82rem;
    color: var(--gedimmt);
}
.frage-aktionen { display: flex; gap: 8px; }

/* ---------- Beamer ---------- */
.seite-beamer { align-items: center; }
.beamer {
    width: 100%;
    max-width: 1100px;
    text-align: center;
    padding: 2vh 3vw;
}
.beamer-titel { font-size: clamp(1.8rem, 5vw, 3.4rem); margin: 0 0 .2em; }
.beamer-frage { font-size: clamp(1.1rem, 3vw, 1.8rem); color: var(--gedimmt); margin: 0 0 5vh; }

.beamer-inhalt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5vw;
}
.beamer-qr {
    background: #fff;
    padding: 16px;
    border-radius: 16px;
    line-height: 0;
}
.beamer-code-block { text-align: left; }
.beamer-label { font-size: clamp(1rem, 2.2vw, 1.5rem); color: var(--gedimmt); margin: .3em 0; }
.beamer-code {
    font-size: clamp(3rem, 12vw, 8rem);
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1;
    margin: .1em 0;
    color: var(--akzent);
}
.beamer-hinweis {
    margin-top: 5vh;
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    color: var(--warn);
}
.beamer-logo { margin: 0 0 3vh; }
.beamer-logo img { max-height: 14vh; max-width: 60vw; width: auto; }

/* ---------- Logo / Branding ---------- */
.logo-kopf { margin: 0 0 16px; text-align: center; }
.logo-kopf img { max-height: 72px; max-width: 100%; width: auto; }

.logo-vorschau {
    max-height: 90px;
    max-width: 100%;
    background: #fff;
    border: 1px solid var(--rand);
    border-radius: 8px;
    padding: 8px;
}

.logo-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}
.logo-form input[type="file"] { flex: 1 1 200px; font-size: .9rem; }

.flash {
    background: color-mix(in srgb, var(--akzent) 12%, var(--karte));
    border: 1px solid color-mix(in srgb, var(--akzent) 40%, var(--rand));
    border-radius: 8px;
    padding: 10px 14px;
    margin: 0 0 12px;
}
