/* GTA6-Guide — fürs Handy gebaut (Bezugsbreite 390 px), am Rechner breiter (R-14).
   Keine fremden Schriften, keine Bilder; hell/dunkel nach Systemeinstellung. */

:root {
  --grund: #ffffff;
  --flaeche: #f4f5f7;
  --linie: #d9dce1;
  --text: #1b1d21;
  --leise: #5d636d;
  --akzent: #0b5cad;
  --aus: #9aa0a8;
  /* Sicherungsstand: Farbe immer zusammen mit Text (Maxime 1) */
  --st-sb-g: #dbe9ff; --st-sb-t: #0a3d82;   /* selbst bestätigt */
  --st-g-g: #dcf3e3;  --st-g-t: #135c2c;    /* gesichert */
  --st-u-g: #fdf0d2;  --st-u-t: #7a4b00;    /* ungesichert */
  --st-w-g: #fde0df;  --st-w-t: #8f1d18;    /* Widerspruch */
  --st-l-g: #eceef1;  --st-l-t: #4d535c;    /* keine Angabe */
  --nav-hoehe: 3.5rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #121417;
    --flaeche: #1c1f24;
    --linie: #343941;
    --text: #e6e8eb;
    --leise: #a2a8b2;
    --akzent: #7ab4f5;
    --aus: #6b717a;
    --st-sb-g: #19335a; --st-sb-t: #c4dcff;
    --st-g-g: #163b24;  --st-g-t: #b5ecc6;
    --st-u-g: #45330f;  --st-u-t: #f7dc9e;
    --st-w-g: #4d1a18;  --st-w-t: #ffc4c0;
    --st-l-g: #2a2e34;  --st-l-t: #c0c5cc;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-hoehe) + env(safe-area-inset-bottom) + 1rem);
  overflow-wrap: anywhere;
}

a { color: var(--akzent); }
h1 { font-size: 1.4rem; margin: .75rem 0; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: .75rem 0 .25rem; }
code { font-size: .9em; background: var(--flaeche); padding: 0 .2em; border-radius: 3px; }

main { padding: 0 1rem; max-width: 60rem; margin: 0 auto; }

/* ---------------------------------------------------------------- Rahmen */

.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem 1rem; border-bottom: 1px solid var(--linie); background: var(--flaeche);
}
.app-name { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.kopf-rechts { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.sprache { display: inline-flex; align-items: center; gap: .2rem; }
.sprache-label { color: var(--leise); }
.sprache button { padding: .1rem .4rem; min-height: 0; }
.profilname { color: var(--leise); white-space: nowrap; }

.hauptnav { display: none; }
.fussnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-hoehe) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--flaeche); border-top: 1px solid var(--linie);
}
.fussnav a, .hauptnav a {
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--leise); text-decoration: none; font-size: .8rem; line-height: 1.15; padding: 0 .2rem;
}
.fussnav a[aria-current], .hauptnav a[aria-current] { color: var(--akzent); font-weight: 700; }

@media (min-width: 48rem) {
  body { padding-bottom: 2rem; }
  .fussnav { display: none; }
  .hauptnav { display: flex; gap: 1.25rem; flex: 1; margin-left: 1.5rem; }
  .hauptnav a { font-size: .95rem; }
  main { padding: 0 2rem; }
}

/* ---------------------------------------------------------------- Bausteine */

button, input, select, textarea { font: inherit; color: inherit; }
button {
  min-height: 2.25rem; padding: .3rem .75rem; border: 1px solid var(--linie);
  border-radius: 6px; background: var(--grund);
}
button:disabled, input:disabled, select:disabled, textarea:disabled {
  color: var(--aus); cursor: not-allowed; background: var(--flaeche); border-color: var(--linie);
}
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: .45rem .55rem; border: 1px solid var(--linie); border-radius: 6px;
}
input[type=checkbox] { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; }

.stand {
  display: inline-block; padding: 0 .45rem; border-radius: 999px; font-size: .75rem;
  font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle;
}
.stand-selbst_bestaetigt { background: var(--st-sb-g); color: var(--st-sb-t); }
.stand-gesichert { background: var(--st-g-g); color: var(--st-g-t); }
.stand-ungesichert { background: var(--st-u-g); color: var(--st-u-t); }
.stand-widerspruch { background: var(--st-w-g); color: var(--st-w-t); }
.stand-leer { background: var(--st-l-g); color: var(--st-l-t); }

.marke {
  display: inline-block; padding: 0 .4rem; border: 1px solid var(--linie); border-radius: 4px;
  font-size: .75rem; color: var(--leise); white-space: nowrap;
}
.marke-warn { border-color: var(--st-w-t); color: var(--st-w-t); }
.klein { font-size: .8rem; color: var(--leise); }
.keine { color: var(--leise); font-style: italic; }
.leer { color: var(--leise); }
.zurueck { margin: .75rem 0 0; font-size: .9rem; }

.block { margin: 1rem 0; padding: .75rem; border: 1px solid var(--linie); border-radius: 8px; }

/* ---------------------------------------------------------------- Übersichten */

.zaehler { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: .5rem; margin: .5rem 0; }
.zahl { background: var(--flaeche); border-radius: 8px; padding: .4rem .6rem; }
.zahl b { display: block; font-size: 1.05rem; }
.zahl span { font-size: .8rem; color: var(--leise); }

.filter { display: grid; gap: .5rem; margin: .75rem 0; }
.filter-felder { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .6rem; }
.filter-felder label { font-size: .8rem; color: var(--leise); }
.filter > button { justify-self: start; }
@media (min-width: 48rem) {
  .filter-felder { grid-template-columns: repeat(6, 1fr); }
}

.liste { list-style: none; margin: 0; padding: 0; }
.zeile-eintrag, .zeile-objekt {
  display: flex; align-items: center; gap: .65rem; padding: .45rem 0; border-bottom: 1px solid var(--linie);
}
.eintrag-link { flex: 1; min-width: 0; color: inherit; text-decoration: none; display: block; }
.z1 { display: flex; align-items: center; gap: .4rem; justify-content: space-between; }
.z1 .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z2 { display: block; font-size: .8rem; color: var(--leise); }
.name-de { font-style: italic; }
.gruppe h2 { margin-top: 1.25rem; }

/* ---------------------------------------------------------------- Detail */

.detail-kopf h1 { margin-top: .25rem; }
.erledigt { display: inline-flex; align-items: center; gap: .4rem; color: var(--leise); font-size: .9rem; margin-top: .5rem; }
.untertitel { margin: 0 0 .25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.marken { margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }

.angabe { padding: .55rem 0; border-bottom: 1px solid var(--linie); }
.angabe:last-child { border-bottom: 0; }
.angabe-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.angabe-label { font-weight: 600; font-size: .9rem; }
.angabe-wert { margin-top: .15rem; }
.angabe-quellen { font-size: .8rem; color: var(--leise); }
.angabe-aktionen { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.angabe-aktionen button { min-height: 1.9rem; padding: .1rem .55rem; font-size: .8rem; }
.je-quelle { list-style: none; margin: .2rem 0 0; padding: 0; }
.je-quelle li { padding: .15rem 0 .15rem .6rem; border-left: 3px solid var(--linie); margin-bottom: .25rem; }
.quellname { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--leise); margin-right: .3rem; }
.ziele { margin: .2rem 0 0; padding-left: 1.3rem; }

details > summary { cursor: pointer; font-weight: 600; padding: .25rem 0; }
.spoiler > summary { color: var(--akzent); }
.spoiler[open] > summary { margin-bottom: .25rem; }

.hinweis { padding: .5rem 0; border-bottom: 1px solid var(--linie); }
.hinweis p { margin: 0; white-space: pre-wrap; }
.hinweis footer { font-size: .8rem; color: var(--leise); }
.hinweis-neu { display: grid; gap: .4rem; margin-top: .5rem; }
.hinweis-neu label { font-size: .85rem; color: var(--leise); }
.zeile { display: flex; align-items: center; gap: .4rem; }
.aktionen { display: flex; flex-wrap: wrap; gap: .4rem; }

.quellenlinks { margin: 0; padding-left: 1.1rem; }
.quellenlinks li { margin-bottom: .25rem; }

.objekte .zeile-objekt { padding: .35rem 0; }
.objekt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.objekt-text .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile-objekt button { min-height: 1.9rem; padding: .1rem .5rem; font-size: .8rem; }
.objekte + button { margin-top: .5rem; }

/* ---------------------------------------------------------------- Formulare, Verwaltung */

.formular { display: grid; gap: .6rem; max-width: 28rem; }
.formular label { display: grid; gap: .2rem; font-size: .9rem; }
.formular button { justify-self: start; }
.einfach { list-style: none; margin: 0 0 .5rem; padding: 0; }
.einfach li { padding: .35rem 0; border-bottom: 1px solid var(--linie); }
.zeile-aktion { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; }
.tabelle-rahmen { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { color: var(--leise); font-weight: 600; }
.lauf h3 { margin-top: .25rem; }
th, td { overflow-wrap: normal; }
td[data-ergebnis] { text-align: right; white-space: nowrap; }

/* ---------------------------------------------------------------- Spielansicht (P2) */

.meldung { padding: .5rem .75rem; border-radius: 6px; background: var(--st-g-g); color: var(--st-g-t); }
.meldung-fehler { background: var(--st-w-g); color: var(--st-w-t); }
.warnzeile { padding: .5rem .75rem; border-radius: 6px; background: var(--st-u-g); color: var(--st-u-t); font-weight: 600; }

.balken { width: 100%; height: .6rem; accent-color: var(--akzent); }
.aktuelles-kapitel { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; margin: 0 0 .25rem; font-size: 1.05rem; }
.aktuelles-kapitel a { color: inherit; }

.kapitel-liste { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .4rem;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.kapitel-liste a { display: grid; gap: .15rem; padding: .45rem .6rem; border: 1px solid var(--linie);
  border-radius: 8px; color: inherit; text-decoration: none; min-height: 2.75rem; }
.kapitel-liste .aktuell a { border-color: var(--akzent); }
.kapitel-liste a[aria-current] { background: var(--flaeche); }
.kapitel-liste .balken { height: .35rem; }
.kapitel-name { font-weight: 600; }
.kapitel-wahl { margin-top: .75rem; }

.quests { list-style: none; margin: 0; padding: 0; }
.quest { display: flex; align-items: flex-start; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--linie); }
.quest:last-child { border-bottom: 0; }
.quest-text { flex: 1; min-width: 0; }
.quest-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.quest-name { font-weight: 600; color: inherit; }
.ist-erledigt .quest-name { color: var(--leise); text-decoration: line-through; }
.kurz { margin: .15rem 0 0; font-size: .9rem; color: var(--leise); }
.quest .kurz { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bis-hierher { font-size: .8rem; }

.haken-form { margin: 0; flex: none; }
.haken-knopf { width: 2.5rem; height: 2.5rem; min-height: 0; padding: 0; border-radius: 50%;
  border: 2px solid var(--linie); background: var(--grund); color: transparent; font-size: 1.2rem; line-height: 1; }
.haken-knopf.an { background: var(--akzent); border-color: var(--akzent); color: var(--grund); }
.haken-knopf:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.quest-titel { display: flex; align-items: flex-start; gap: .75rem; margin-top: .5rem; }
.quest-titel h1 { margin: .2rem 0 0; }
.name-zweit { margin: 0; font-size: .85rem; color: var(--leise); }
.tipps { margin: 0; padding-left: 1.2rem; }
.tipps li { margin-bottom: .35rem; }
.umschalter { display: flex; gap: .5rem; margin: 0 0 .5rem; }
.umschalter a { padding: .2rem .7rem; border: 1px solid var(--linie); border-radius: 999px; text-decoration: none; }
.umschalter a[aria-current] { background: var(--akzent); border-color: var(--akzent); color: var(--grund); }
.nachbarn { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; font-size: .9rem; }
.nachbarn a[rel=next] { text-align: right; }
details.gruppe > summary h2 { display: inline; }

/* ---------------------------------------------------------------- Eigenes Wissen (P3) */

.marke-ok { border-color: var(--st-g-t); color: var(--st-g-t); }
.tipps .marke { margin-left: .3rem; }
.abfrage { display: grid; gap: .75rem; }
.frage { margin: 0; padding: .6rem .75rem; border: 1px solid var(--linie); border-radius: 8px; }
.frage legend { font-weight: 600; padding: 0 .25rem; }
.frage .bezug { margin: .1rem 0 .4rem; font-size: .85rem; color: var(--leise); }
.antworten { display: flex; flex-wrap: wrap; gap: .35rem; }
.antworten label { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; min-height: 2.5rem;
  border: 1px solid var(--linie); border-radius: 999px; cursor: pointer; }
.antworten input { margin: 0; }
.antworten label:has(input:checked) { border-color: var(--akzent); background: var(--flaeche); font-weight: 600; }
.frage-stand { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .2rem 0 .4rem; }
.tipp-eigen { padding: .5rem 0; border-bottom: 1px solid var(--linie); }
.tipp-eigen:last-of-type { border-bottom: 0; }
.tipp-eigen p { margin: 0; white-space: pre-wrap; }
.tipp-eigen footer { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .8rem; color: var(--leise); }
.tipp-eigen footer form { margin: 0; }
.tipp-eigen footer button, .tipp-eigen footer a { min-height: 1.9rem; padding: .1rem .55rem; font-size: .8rem; }
.inline { display: inline; margin: 0; }
.sprache form { display: inline-flex; gap: .25rem; margin: 0; }
.sprache button[aria-pressed=true] { background: var(--akzent); border-color: var(--akzent); color: var(--grund); }

/* ---------------------------------------------------------------- Weg zum Ende (P3b) */

.ergebnis { font-weight: 600; margin: 0 0 .5rem; }
.ergebnis-im_plan { color: var(--st-g-t); }
.ergebnis-dahinter { color: var(--st-u-t); }
.ergebnis-verfehlt { color: var(--st-w-t); }
.leiste, .zahlleiste { margin: .5rem 0; display: grid; gap: .2rem; }
.leiste-name { font-weight: 600; font-size: .9rem; }
.stufen { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.stufe { padding: .3rem .25rem; font-size: .72rem; text-align: center; background: var(--flaeche); border: 1px solid var(--linie);
  overflow-wrap: anywhere; line-height: 1.2; }
.stufe:first-child { border-radius: 6px 0 0 6px; }
.stufe:last-child { border-radius: 0 6px 6px 0; }
.stufe.vorlaeufig { border-style: dashed; }
.stufe.an { background: var(--akzent); border-color: var(--akzent); color: var(--grund); font-weight: 700; }
.stufe .marke { display: block; border: 0; padding: 0; font-size: .62rem; color: inherit; }
.zahl-balken { position: relative; height: .8rem; border-radius: 999px; background: var(--flaeche); border: 1px solid var(--linie); }
.zahl-balken .fuell { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--akzent); }
.zahl-balken .soll-marke { position: absolute; top: -.25rem; bottom: -.25rem; width: 3px; margin-left: -1px; background: var(--st-w-t); }
.endweg-eingabe { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.endweg-eingabe label { display: grid; gap: .2rem; font-size: .85rem; }
.hinweisbox { border-color: var(--st-u-t); }
.hinweisbox > p { margin: 0 0 .25rem; }

/* ---------------------------------------------------------------- Medien (P3c) */

.anhaenge { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); margin: .5rem 0; }
.anhang { margin: 0; display: grid; gap: .25rem; align-content: start; }
.anhang img, .anhang video { width: 100%; height: auto; max-height: 22rem; object-fit: contain; border-radius: 6px;
  background: var(--flaeche); border: 1px solid var(--linie); }
.anhang video { aspect-ratio: 16 / 9; }
.anhang figcaption { font-size: .8rem; overflow-wrap: anywhere; }
.anhang figcaption a { margin-left: .3rem; }
.anhang-zustand { margin: 0; padding: .75rem; border: 1px dashed var(--linie); border-radius: 6px; font-size: .85rem; }
.anhang-neu { margin-top: .4rem; }
.anhang-neu > summary { font-weight: 400; font-size: .9rem; color: var(--akzent); }
.fund-knopf { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--akzent); border-radius: 999px;
  text-decoration: none; font-weight: 600; }
