:root {
  --rot: #d52b1e; --rot-dunkel: #a81f15;
  --bg: #f6f5f2; --karte: #ffffff; --text: #1d1d1f; --leise: #6b6b70; --linie: #e4e2dd;
  --gut: #1f7a3d; --gut-bg: #e7f4ec; --schlecht: #b3261e; --schlecht-bg: #fbe9e7;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141416; --karte: #1f1f23; --text: #f2f2f4; --leise: #a0a0a8; --linie: #33333a;
          --gut-bg: #16301f; --schlecht-bg: #3a1a17; --gut: #6fd18f; --schlecht: #ff8a80; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--rot); }

.kopf { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
        padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--rot); color: #fff; }
.marke { display: flex; align-items: center; gap: 10px; font-weight: 650; flex: 1; min-width: 0; }
.marke span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kreuz { width: 26px; height: 26px; flex: none; background: #fff; border-radius: 5px; position: relative; }
.kreuz::before, .kreuz::after { content: ""; position: absolute; background: var(--rot); left: 50%; top: 50%; transform: translate(-50%, -50%); }
.kreuz::before { width: 14px; height: 4.5px; } .kreuz::after { width: 4.5px; height: 14px; }
.zurueck, .kanton-knopf { background: rgba(255,255,255,.18); border: 0; border-radius: 999px; color: #fff; padding: 6px 12px; }
.zurueck { font-size: 22px; line-height: 1; padding: 2px 12px 6px; }

main { max-width: 680px; margin: 0 auto; padding: 16px; outline: none; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
h1 { font-size: 1.4rem; margin: 0 0 6px; } h2 { font-size: 1.12rem; margin: 0 0 12px; }
.leise { color: var(--leise); font-size: .92rem; margin: 6px 0; }
.mitte { text-align: center; }
.fehler { color: var(--schlecht); }
.held { text-align: center; }
.gross { font-size: 2.6rem; font-weight: 750; letter-spacing: -.02em; }

.balken { height: 8px; background: var(--linie); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.balken > span { display: block; height: 100%; background: var(--rot); border-radius: 99px; transition: width .3s; }
.balken.klein { height: 5px; margin: 6px 0 0; }

.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.wahl { padding: 16px; border-radius: 12px; border: 1px solid var(--linie); background: var(--bg); font-weight: 600; }
.wahl.aktiv { border-color: var(--rot); box-shadow: inset 0 0 0 1px var(--rot); }

.aktionen { display: grid; gap: 10px; margin-bottom: 14px; }
.aktionen button, .navi button, .haupt { border: 1px solid var(--linie); background: var(--karte); border-radius: 12px; padding: 14px 16px; text-align: left; font-weight: 600; }
.aktionen small { display: block; font-weight: 400; color: var(--leise); font-size: .85rem; margin-top: 2px; }
button.haupt { background: var(--rot); border-color: var(--rot); color: #fff; }
button.haupt small { color: rgba(255,255,255,.85); }
button.haupt:hover { background: var(--rot-dunkel); }
button:disabled { opacity: .45; cursor: default; }
.breit { width: 100%; text-align: center !important; margin-top: 12px; }
.link { background: none; border: 0; color: var(--rot); text-decoration: underline; padding: 0; font-size: inherit; }

.themen { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.themen button { width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--linie); border-radius: 12px; padding: 12px 14px; display: grid; }
.themen button span:first-child { font-weight: 600; }

.leiste { display: flex; justify-content: space-between; gap: 12px; color: var(--leise); font-size: .9rem; }
.uhr { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text); }
.frage h2 { font-size: 1.2rem; line-height: 1.35; }
.bereich { color: var(--rot); font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.antworten { display: grid; gap: 10px; }
.antwort { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--linie); background: var(--bg); }
.antwort:not(:disabled):hover { border-color: var(--rot); }
.buchstabe { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--linie); font-weight: 700; font-size: .85rem; }
.antwort.gewaehlt { border-color: var(--rot); box-shadow: inset 0 0 0 1px var(--rot); }
.antwort.richtig { border-color: var(--gut); background: var(--gut-bg); opacity: 1; }
.antwort.richtig .buchstabe { background: var(--gut); color: #fff; }
.antwort.falsch { border-color: var(--schlecht); background: var(--schlecht-bg); opacity: 1; }
.antwort.falsch .buchstabe { background: var(--schlecht); color: #fff; }
.antwort.blass { opacity: .55; }
.erklaerung { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: .95rem; }
.erklaerung.gut { background: var(--gut-bg); } .erklaerung.schlecht { background: var(--schlecht-bg); }
.erklaerung a { display: block; margin-top: 6px; font-size: .85rem; word-break: break-word; }
.navi { display: flex; justify-content: space-between; gap: 10px; }
.navi button { flex: 1; text-align: center; }

.fakten { padding-left: 18px; } .fakten li { margin: 6px 0; }
.urteil { font-weight: 700; font-size: 1.1rem; } .urteil.gut { color: var(--gut); } .urteil.schlecht { color: var(--schlecht); }
.aufloesung { padding-left: 20px; } .aufloesung li { margin-bottom: 10px; }
.aufloesung li p { margin: 2px 0; } .aufloesung li.gut::marker { color: var(--gut); } .aufloesung li.schlecht::marker { color: var(--schlecht); font-weight: 700; }

.fuss { max-width: 680px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); color: var(--leise); font-size: .8rem; text-align: center; }

/* Statische Seiten (Kantone, Impressum, Datenschutz) */
.seite { max-width: 680px; margin: 0 auto; padding: 16px; }
.seite p { margin: 0 0 10px; }
a.knopf { display: inline-block; text-decoration: none; padding: 12px 18px; border-radius: 12px; margin-top: 8px; }
a.haupt { background: var(--rot); color: #fff; font-weight: 600; }
a.haupt:hover { background: var(--rot-dunkel); }
.beispiele { padding-left: 20px; } .beispiele > li { margin-bottom: 16px; }
.beispiele ul { margin: 4px 0; padding-left: 18px; } .beispiele .loesung { font-weight: 600; color: var(--gut); }
.fuss a { color: var(--leise); }

/* Hinweis auf die Vollversion */
.pro-hinweis { width: 100%; display: grid; gap: 2px; text-align: left; margin-bottom: 14px; padding: 14px 16px;
  border-radius: 12px; border: 1px dashed var(--rot); background: var(--karte); }
.pro-hinweis b { color: var(--rot); }
.pro-hinweis span { color: var(--leise); font-size: .9rem; }
button.link.breit { border: 0; background: none; text-decoration: underline; color: var(--rot); padding: 10px; }

body.nativ .nur-web { display: none; }

/* Einwilligungs-Banner (nur Web) */
#einwilligung { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; max-width: 640px; margin: 0 auto;
  background: var(--karte); color: var(--text); border: 1px solid var(--linie); border-radius: 14px; padding: 14px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.18); font-size: .92rem; }
#einwilligung p { margin: 0 0 10px; }
#einwilligung div { display: flex; gap: 8px; justify-content: flex-end; }
#einwilligung button { border: 1px solid var(--linie); background: var(--bg); border-radius: 10px; padding: 9px 14px; font-weight: 600; }
#einwilligung button.ja { background: var(--rot); border-color: var(--rot); color: #fff; }
