:root {
  --nacht: #0f1b2d;
  --nacht-2: #17263d;
  --nacht-3: #22344f;
  --schnee: #f4f6f9;
  --grau: #9aa8bc;
  --linie: #2c4160;
  --rot: #e2463c;
  --gold: #f2b544;
  --gruen: #3cc47c;
  --gelb: #f2c94c;
  --radius: 14px;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--nacht); color: var(--schnee); }
body { min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
[hidden] { display: none !important; }

.kopf {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; background: var(--nacht); z-index: 5;
}
.marke { font-weight: 800; letter-spacing: .02em; }
.marke span { font-weight: 500; color: var(--gold); margin-left: 6px; }

main { max-width: 640px; margin: 0 auto; padding: 22px 18px 40px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.05rem; margin: 28px 0 10px; color: var(--gold); }
p { line-height: 1.5; }
.leise { color: var(--grau); }
.klein { font-size: .88rem; }
.label { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--gold); margin: 0 0 4px; font-weight: 700; }

input {
  width: 100%; padding: 14px 16px; font-size: 1.05rem; border-radius: var(--radius);
  border: 1px solid var(--linie); background: var(--nacht-2); color: var(--schnee);
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.stapel { display: grid; gap: 12px; margin-top: 18px; }

button, .neben, .haupt { font: inherit; cursor: pointer; }
.haupt, .neben, .stopp {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  padding: 14px 20px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  border: 0; text-decoration: none; min-height: 50px;
}
.haupt { background: var(--rot); color: white; }
.haupt:disabled { opacity: .5; cursor: wait; }
.neben { background: transparent; color: var(--schnee); border: 1px solid var(--linie); }
.stopp { background: var(--schnee); color: var(--nacht); width: 100%; margin-top: 18px; }
.link { background: none; border: 0; color: var(--grau); text-decoration: underline; }
.knopfzeile { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.knopfzeile .haupt { flex: 1; }

.hinweis {
  background: #3a2d12; border: 1px solid #7a5b1c; color: #ffe2a8;
  padding: 12px 14px; border-radius: var(--radius); font-size: .92rem; line-height: 1.45; margin: 14px 0;
}

/* Einführung über den Runden */
.einfuehrung {
  background: var(--nacht-2); border: 1px solid var(--linie); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 14px 16px; margin: 14px 0 4px; font-size: .95rem;
}
.einfuehrung p { margin: 0 0 10px; }
.einfuehrung ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.einfuehrung li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; line-height: 1.4; }
.einfuehrung li b {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--nacht-3); color: var(--gold); font-size: .85rem;
}

/* Rundenkarten */
.karten { display: grid; gap: 12px; margin-top: 18px; }
.runde {
  text-align: left; width: 100%; padding: 16px; border-radius: var(--radius);
  background: var(--nacht-2); border: 1px solid var(--linie); color: inherit;
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
}
.runde:hover, .runde:focus-visible { border-color: var(--gold); outline: none; }
.runde .nr {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--nacht-3); font-weight: 800; font-size: 1.1rem;
}
.runde.ok .nr { background: var(--gruen); color: var(--nacht); }
.runde h3 { margin: 0 0 3px; font-size: 1.05rem; }
.runde p { margin: 0; font-size: .88rem; color: var(--grau); line-height: 1.35; }
.runde .stand { text-align: right; font-size: .82rem; color: var(--grau); white-space: nowrap; }
.runde .stand b { display: block; font-size: 1.1rem; color: var(--schnee); }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: .82rem; padding: 6px 11px; border-radius: 999px;
  background: var(--nacht-2); border: 1px solid var(--linie); color: var(--grau);
}
.chips li.ja { background: rgba(60,196,124,.14); border-color: var(--gruen); color: var(--schnee); }
.chips li.ja::before { content: "✓ "; color: var(--gruen); font-weight: 700; }

/* Vorbereitung */
.szene {
  margin: 16px 0; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--nacht-3), var(--nacht-2));
  border-left: 4px solid var(--gold); font-size: 1.08rem; line-height: 1.5; font-style: italic;
}
.infos { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 0; }
.infos dt { color: var(--grau); font-size: .88rem; }
.infos dd { margin: 0; line-height: 1.45; }

/* Gespräch */
.gespraech-kopf { display: flex; justify-content: space-between; align-items: flex-start; }
.zustand { margin: 0; font-size: 1.15rem; font-weight: 700; }
.uhr { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 800; }
.uhr.knapp { color: var(--gelb); }
.uhr.vorbei { color: var(--rot); }

.orb { display: grid; place-items: center; height: 150px; }
.orb span {
  width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, var(--gold) 35%, var(--rot) 100%);
  opacity: .35; transition: transform .25s, opacity .25s;
}
.orb.spricht span { opacity: 1; animation: puls 1s ease-in-out infinite; }
.orb.hoert span { opacity: .75; background: radial-gradient(circle at 35% 35%, #fff 0%, #8fd3ff 40%, #2f7fd1 100%); }
@keyframes puls { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.verlauf { display: grid; gap: 8px; max-height: 42dvh; overflow-y: auto; padding: 4px 2px; }
.verlauf.statisch { max-height: none; }
.blase { padding: 10px 13px; border-radius: 14px; max-width: 86%; line-height: 1.4; font-size: .95rem; }
.blase.kunde { background: var(--nacht-3); justify-self: start; border-bottom-left-radius: 4px; }
.blase.verkaeufer { background: #3b2120; justify-self: end; border-bottom-right-radius: 4px; }
.blase small { display: block; font-size: .72rem; color: var(--grau); margin-bottom: 2px; }

/* Ergebnis */
.warten { text-align: center; padding: 60px 0; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 50%;
  border: 4px solid var(--nacht-3); border-top-color: var(--gold); animation: dreh 1s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

.punkte { display: flex; align-items: center; gap: 18px; margin: 10px 0 6px; }
.punkte-zahl {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  font-size: 2.2rem; font-weight: 800; border: 5px solid var(--gold); flex-shrink: 0;
}
.badge { display: inline-block; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: .9rem; }
.badge.ja { background: var(--gruen); color: var(--nacht); }
.badge.nein { background: var(--nacht-3); color: var(--schnee); }
.zusammenfassung { font-size: 1.05rem; }

.liste { display: grid; gap: 10px; }
.eintrag { background: var(--nacht-2); border: 1px solid var(--linie); border-radius: var(--radius); padding: 13px 14px; }
.eintrag-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-weight: 700; }
.eintrag p { margin: 6px 0 0; font-size: .92rem; color: var(--grau); }
.eintrag .zitat { font-style: italic; color: var(--schnee); }
.eintrag .besser { color: #ffe2a8; }
.eintrag .besser::before { content: "Besser: "; font-weight: 700; }
.tag { font-size: .75rem; padding: 3px 9px; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.tag.gut, .tag.ja { background: var(--gruen); color: var(--nacht); }
.tag.teilweise { background: var(--gelb); color: var(--nacht); }
.tag.schwach, .tag.nicht, .tag.nein { background: var(--rot); color: white; }
.tag.neutral { background: var(--nacht-3); color: var(--grau); }

.balken { display: grid; gap: 12px; }
.balken-zeile { display: grid; gap: 4px; font-size: .92rem; }
.balken-zeile .kopf-zeile { display: flex; justify-content: space-between; }
.balken-spur { height: 8px; background: var(--nacht-3); border-radius: 99px; overflow: hidden; }
.balken-spur i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.balken-zeile small { color: var(--grau); }

.zweispaltig { display: grid; gap: 4px 18px; }
@media (min-width: 560px) { .zweispaltig { grid-template-columns: 1fr 1fr; } }
.punktliste { margin: 0; padding-left: 18px; line-height: 1.5; }
.punktliste li { margin-bottom: 6px; }
.punktliste.plus li::marker { content: "+  "; color: var(--gruen); font-weight: 800; }
.punktliste.minus li::marker { content: "→  "; color: var(--gold); font-weight: 800; }

.transkript { margin-top: 26px; background: var(--nacht-2); border-radius: var(--radius); padding: 12px 14px; }
.transkript summary { cursor: pointer; font-weight: 700; }
.transkript .verlauf { margin-top: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--schnee); color: var(--nacht); padding: 12px 18px; border-radius: 12px;
  font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.4); z-index: 20;
}

/* Auswertung (Admin) */
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { padding: 9px 8px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle th { color: var(--grau); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.tabelle td.zahl { font-variant-numeric: tabular-nums; text-align: right; }
.tabelle a { color: var(--gold); }
.breit { max-width: 1100px; }
.scroll { overflow-x: auto; }

/* Persona-Bild */
.persona-bild { display: block; width: min(100%, 340px); margin: 14px auto 0; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--linie); line-height: 0; }
.persona-bild svg { width: 100%; height: auto; display: block; }
.gegenueber { display: flex; align-items: center; gap: 16px; margin: 10px 0; }
.persona-bild.klein { width: 52%; max-width: 260px; margin: 0; }
.gegenueber .orb { flex: 1; height: 120px; }
.gegenueber .persona-bild:not([hidden]) + .orb span { width: 56px; height: 56px; }

/* Namensvorschläge im Login */
.namensfeld { position: relative; }
.vorschlaege {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  list-style: none; margin: 0; padding: 6px; border-radius: var(--radius);
  background: var(--nacht-2); border: 1px solid var(--linie); box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.vorschlaege li {
  padding: 12px 12px; border-radius: 10px; cursor: pointer; font-size: 1.02rem;
}
.vorschlaege li[aria-selected="true"], .vorschlaege li:hover { background: var(--nacht-3); }
.vorschlaege li mark { background: none; color: var(--gold); font-weight: 800; }
#login-form .leise.klein { margin: -4px 2px 0; }

/* Level-Fortschritt Rookie → Pro */
.level {
  background: var(--nacht-2); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 14px 16px; margin: 14px 0 4px;
}
.level-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.level-kopf b { color: var(--gold); font-size: 1.1rem; }
.level-spur { height: 12px; border-radius: 999px; background: var(--nacht-3); overflow: hidden; margin: 10px 0 8px; }
.level-spur i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--rot), var(--gold));
  transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.level-stufen {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  font-size: .72rem; color: var(--grau); text-align: center;
}
.level-stufen li:first-child { text-align: left; }
.level-stufen li:last-child { text-align: right; }
.level-stufen li.erreicht { color: var(--schnee); }
.level-stufen li.aktuell { color: var(--gold); font-weight: 800; }
.level .leise.klein { margin: 8px 0 0; }

/* Verkauf geschafft + Feuerwerk */
.verkauf {
  display: grid; gap: 2px; margin: 12px 0; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, #1e4d34, #2a6b47); border: 1px solid var(--gruen);
  animation: aufpoppen .5s cubic-bezier(.2,1.4,.4,1) both;
}
.verkauf b { font-size: 1.25rem; }
@keyframes aufpoppen { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.feuerwerk { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
@media (prefers-reduced-motion: reduce) {
  .verkauf { animation: none; }
  .level-spur i { transition: none; }
}

/* Schalter Üben | Lernmodus */
.modus-schalter {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 14px 0 6px;
  background: var(--nacht-2); border: 1px solid var(--linie); border-radius: 999px;
}
.modus-schalter button {
  font: inherit; font-weight: 700; padding: 11px 10px; border: 0; border-radius: 999px;
  background: transparent; color: var(--grau); cursor: pointer; min-height: 44px;
}
.modus-schalter button[aria-selected="true"] { background: var(--gold); color: var(--nacht); }
.modus-schalter button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.einfuehrung .einfuehrung-lernen { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--linie); color: var(--grau); }
.einfuehrung-lernen .link { padding: 0; font: inherit; color: var(--gold); font-weight: 700; }

/* Lernmodus */
.lernen-buehne { display: grid; grid-template-columns: 34% 1fr; gap: 12px; align-items: start; margin: 12px 0; scroll-margin-top: 70px; }
.lernen-bild { width: 100%; margin: 0; }
.lernen-gespraech { display: grid; gap: 8px; }
.lernen-frage, .lernen-antwort { margin: 0; padding: 10px 13px; border-radius: 14px; line-height: 1.45; font-size: .95rem; }
.lernen-frage { background: var(--nacht-3); border-bottom-right-radius: 4px; color: var(--schnee); }
.lernen-frage::before { content: "Du als Kunde"; display: block; font-size: .72rem; color: var(--grau); margin-bottom: 2px; }
.lernen-antwort { background: #3b2120; border-bottom-left-radius: 4px; }
.lernen-antwort::before { content: "Profi"; display: block; font-size: .72rem; color: var(--gold); margin-bottom: 2px; font-weight: 700; }
.merke {
  background: rgba(60,196,124,.1); border: 1px solid rgba(60,196,124,.45); border-radius: var(--radius);
  padding: 12px 14px; margin: 0 0 10px; font-size: .92rem;
}
.merke b { color: var(--gruen); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.merke ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; line-height: 1.4; }
.lernen-werkzeug { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 12px; }
.lernen-werkzeug .link { padding: 6px 0; }
.themen { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.themen button {
  flex: none; font: inherit; font-size: .88rem; font-weight: 700; padding: 9px 14px; border-radius: 999px; cursor: pointer;
  background: var(--nacht-2); border: 1px solid var(--linie); color: var(--grau);
}
.themen button[aria-selected="true"] { border-color: var(--gold); color: var(--schnee); background: var(--nacht-3); }
.fragen { display: grid; gap: 8px; }
.fragen button {
  font: inherit; text-align: left; padding: 13px 14px; border-radius: 12px; cursor: pointer; line-height: 1.35;
  background: var(--nacht-2); border: 1px solid var(--linie); color: var(--schnee);
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
}
.fragen button:hover, .fragen button:focus-visible { border-color: var(--gold); outline: none; }
.fragen button.aktiv { border-color: var(--gold); background: var(--nacht-3); }
.fragen button .gehoert { color: var(--gruen); font-weight: 800; font-size: .85rem; }
.lernen-buehne { grid-template-columns: 30% 1fr; align-items: center; }
.lernen-buehne .lernen-antwort::before { content: "Profi"; }
.frage-karte { display: grid; gap: 8px; }
.frage-knopf { width: 100%; }
.frage-knopf .gehoert:empty { display: none; }
.frage-karte.offen .frage-knopf { border-color: var(--gold); background: var(--nacht-3); }
.frage-antwort { display: grid; gap: 8px; padding: 0 0 6px 14px; border-left: 2px solid var(--gold); margin-left: 8px; }
.frage-antwort .merke { margin: 0; }
.frage-antwort:not([hidden]) { animation: aufklappen .25s ease-out both; }
@keyframes aufklappen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .frage-antwort:not([hidden]) { animation: none; } }
