/* Planning Poker. Farben der Marke (Blau, Grün), hell und dunkel; die Beamer-Ansicht ist immer dunkel
   und deutlich größer. Keine externen Schriften. */
:root {
  color-scheme: light dark;
  --blau: #2b59c3; --blau-dunkel: #21479c; --gruen: #19c37d; --rot: #c8372d;
  --grund: #f3f5fa; --flaeche: #fff; --flaeche-2: #eef1f8; --rand: #d9deeb; --text: #161b2b; --leise: #5a6378;
  --akzent: var(--blau); --auf-akzent: #fff; --schatten: 0 8px 24px -14px rgba(20, 30, 70, .35);
  --radius: 14px;
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not(.beamer) {
    --grund: #10131d; --flaeche: #191d2b; --flaeche-2: #232839; --rand: #303751; --text: #eceff7; --leise: #a0a8bd;
    --akzent: #6d93f2; --auf-akzent: #0b1020; --schatten: 0 8px 24px -14px #000;
  }
}
:root.beamer {
  color-scheme: dark;
  --grund: #0b0e18; --flaeche: #161a28; --flaeche-2: #212637; --rand: #333a55; --text: #f2f4fb; --leise: #aeb6cb;
  --akzent: #6d93f2; --auf-akzent: #0b1020; --schatten: none;
  font-size: clamp(16px, 1.25vw, 26px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--grund); color: var(--text); font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; min-height: 100vh; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
a { color: var(--akzent); }
[hidden] { display: none !important; }
small { color: var(--leise); }
input[type=text], input[type=url], input[type=password], input[type=search], select {
  width: 100%; min-width: 0; padding: .6rem .7rem; font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid var(--rand); border-radius: 9px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem .9rem; min-height: 2.5rem; font: inherit; font-weight: 600; color: var(--text); text-decoration: none; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 9px; cursor: pointer; white-space: nowrap; }
.knopf:hover { border-color: var(--akzent); }
.knopf:disabled { opacity: .55; cursor: wait; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.knopf.leise { background: transparent; border-color: transparent; color: var(--leise); }
.knopf.leise:hover { color: var(--text); border-color: var(--rand); }
.knopf.gefahr:hover { color: var(--rot); border-color: var(--rot); }
.knopf.gross { padding: .75rem 1.3rem; font-size: 1.05rem; }

/* Rahmen */
.leiste { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .7rem 1rem; background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.marke { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.leiste-rechts, .wer { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.wer-name { font-weight: 600; margin-right: .3rem; }
.seite { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.seite.schmal { max-width: 720px; }
.zwei-wege { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.karte-flaeche, .schritt { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--schatten); }
.karte-flaeche.betonung { border-color: var(--akzent); }
.karte-flaeche > :last-child, .schritt > :last-child { margin-bottom: 0; }
.schritt { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .75rem; scroll-margin-top: 1rem; }
.schritt > h2 { margin: 0; }
.bereich { margin-top: 1.5rem; }
.fuss { margin-top: 2rem; font-size: .85rem; }
.reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.reihe.eng { display: flex; gap: .5rem; align-items: stretch; }
.reihe.eng > input { flex: 1; }
.stapel { display: flex; flex-direction: column; gap: .7rem; }
.feld { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .75rem; }
.schritt .feld { margin-bottom: 0; }
.feld-name { font-weight: 600; font-size: .92rem; }
.feld-hilfe { color: var(--leise); font-size: .85rem; margin: 0; }
.leer { color: var(--leise); margin: .4rem 0; }
.leise-text { color: var(--leise); }
.hinweis { background: var(--flaeche-2); border-radius: 9px; padding: .7rem .9rem; }
.code-eingabe { letter-spacing: .18em; font-weight: 700; text-transform: uppercase; }
.schalter { display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.schalter input { width: 1.1rem; height: 1.1rem; accent-color: var(--akzent); }
.mehr { border: 1px solid var(--rand); border-radius: 9px; padding: .7rem .9rem; }
.mehr summary { cursor: pointer; font-weight: 600; }
.mehr[open] summary { margin-bottom: .8rem; }

/* Auswahl mit Erklärung */
.wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.wahl-punkt { display: flex; gap: .55rem; align-items: flex-start; padding: .6rem .7rem; background: var(--flaeche-2); border: 2px solid transparent; border-radius: 10px; cursor: pointer; }
.wahl-punkt:has(input:checked) { border-color: var(--akzent); }
.wahl-punkt input { margin-top: .25rem; accent-color: var(--akzent); flex: none; }
.wahl-punkt span { display: flex; flex-direction: column; }
.wahl-punkt small { line-height: 1.3; }

/* Listen auf der Startseite */
.raumliste { display: flex; flex-direction: column; gap: .5rem; }
.raumzeile { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 11px; padding: .65rem .8rem; }
.raumzeile-text { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; }
.raumzeile-text small { overflow-wrap: anywhere; }
.raumzeile input { flex: 0 1 170px; }
.auswahlliste { display: flex; flex-direction: column; gap: .3rem; max-height: 320px; overflow: auto; }
.auswahlzeile { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; text-align: left; font: inherit; color: var(--text); padding: .55rem .7rem; background: var(--flaeche-2); border: 1px solid transparent; border-radius: 9px; cursor: pointer; }
.auswahlzeile:hover { border-color: var(--akzent); }
.auswahlzeile b { overflow-wrap: anywhere; }
.auswahlzeile small { grid-column: 1 / -1; }
.marke-klein { font-size: .75rem; padding: 0 .4rem; border: 1px solid var(--rand); border-radius: 6px; color: var(--leise); align-self: start; }
.vorschau-liste { margin: 0; padding: 0; list-style: none; font-size: .92rem; }
.vorschau-liste li { padding: .15rem 0; overflow-wrap: anywhere; }

/* Umrechnungstabelle */
.umrechnung { border-collapse: collapse; width: 100%; max-width: 360px; }
.umrechnung th, .umrechnung td { padding: .35rem .6rem; border-bottom: 1px solid var(--rand); text-align: left; }
.umrechnung tbody th { font-size: 1.05rem; width: 40%; }
.umrechnung input { padding: .35rem .5rem; }

/* Fenster und Meldungen */
.fenster { width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; color: var(--text); background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); }
.fenster::backdrop { background: rgba(5, 8, 20, .6); }
.fenster-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--rand); position: sticky; top: 0; background: var(--flaeche); }
.fenster-kopf h2 { margin: 0; overflow-wrap: anywhere; }
.fenster-inhalt { padding: 1.1rem; display: flex; flex-direction: column; gap: .8rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 2rem); padding: .6rem 1rem; background: var(--text); color: var(--grund); border-radius: 9px; font-weight: 600; }
.toast.fehler { background: var(--rot); color: #fff; }
.getrennt { background: var(--rot); color: #fff; text-align: center; padding: .35rem; font-weight: 600; }

/* Raum */
.raum { display: flex; flex-direction: column; min-height: 100vh; }
.raum-kopf { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .6rem 1rem; background: var(--flaeche); border-bottom: 1px solid var(--rand); }
.raum-titel { flex: 1 1 180px; min-width: 0; }
.raum-titel h1 { font-size: 1.15rem; margin: 0; overflow-wrap: anywhere; }
.raum-titel small { display: block; overflow-wrap: anywhere; }
.raum-stand { display: flex; gap: .8rem; font-size: .9rem; color: var(--leise); }
.raum-stand b { color: var(--text); font-size: 1.05rem; }
.raum-knoepfe { display: flex; gap: .35rem; flex-wrap: wrap; }
.raum-gitter { flex: 1; display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) minmax(190px, 240px); gap: 1rem; padding: 1rem; align-items: start; }
.raum-liste, .raum-leute, .raum-einladung:not(:empty) { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: .8rem; }
.raum-liste { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.raum-mitte { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.raum-seite { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.liste-kopf { margin-bottom: .2rem; }
.issues { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.issue-zeile { display: flex; align-items: stretch; background: var(--flaeche-2); border: 2px solid transparent; border-radius: 9px; }
.issue-zeile.aktiv { border-color: var(--akzent); }
.issue-knopf { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; text-align: left; padding: .5rem .6rem; font: inherit; font-size: .92rem; color: var(--text); background: none; border: 0; cursor: pointer; border-radius: 8px; }
.issue-titel { overflow-wrap: anywhere; }
.issue-werte { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.issue-text-knopf { font: inherit; font-size: .8rem; color: var(--leise); background: none; border: 0; border-left: 1px solid var(--rand); padding: 0 .55rem; cursor: pointer; }
.issue-text-knopf:hover, .issue-knopf:hover .issue-titel { color: var(--akzent); }
.label { display: inline-flex; align-items: center; gap: .25rem; font-size: .76rem; color: var(--leise); }
.label-punkt { width: .55rem; height: .55rem; border-radius: 50%; background: var(--leise); flex: none; }
.wert-chip { font-size: .76rem; font-weight: 700; padding: 0 .4rem; border-radius: 6px; background: var(--flaeche); border: 1px solid var(--rand); }
.wert-chip.punkte { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }

/* Issue */
.warten, .lobby { background: var(--flaeche); border: 1px dashed var(--rand); border-radius: var(--radius); padding: 2.5rem 1.2rem; text-align: center; color: var(--leise); }
.warten h2, .lobby h2 { color: var(--text); }
.raum-issue:empty, .raum-einladung:empty { display: none; }
.issue-kopf { display: flex; align-items: baseline; gap: .6rem; }
.issue-kopf h2 { font-size: 1.45rem; margin: 0; overflow-wrap: anywhere; }
.issue-nummer { color: var(--leise); font-weight: 700; font-size: 1.1rem; }
.issue-details { margin-top: .6rem; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: .6rem .9rem; }
.issue-details summary { cursor: pointer; font-weight: 600; }
.issue-details[open] summary { margin-bottom: .6rem; }
.issue-details .issue-koerper { max-height: 42vh; overflow: auto; }
.ist-offen .issue-details .issue-koerper { max-height: 18vh; }
.issue-angaben { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-bottom: .7rem; font-size: .85rem; color: var(--leise); }
.md { overflow-wrap: anywhere; }
.md > :last-child { margin-bottom: 0; }
.md h3, .md h4, .md h5, .md h6 { font-size: 1.02rem; margin: 1rem 0 .4rem; }
.md pre { overflow: auto; padding: .7rem; background: var(--flaeche-2); border-radius: 8px; font-size: .88em; }
.md code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; }
.md :not(pre) > code { background: var(--flaeche-2); padding: 0 .25rem; border-radius: 4px; }
.md blockquote { margin: 0 0 .75rem; padding-left: .8rem; border-left: 3px solid var(--rand); color: var(--leise); }
.md ul, .md ol { margin: 0 0 .75rem; padding-left: 1.4rem; }
.md li.unter { margin-left: 1.2rem; }
.md li.aufgabe { list-style: none; margin-left: -1.2rem; }
.md-tabelle { overflow-x: auto; margin-bottom: .75rem; }
.md table { border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--rand); padding: .25rem .5rem; text-align: left; }

/* Karten */
.raum-karten { display: flex; flex-direction: column; gap: 1rem; }
.raum-karten:empty { display: none; }
.karten { display: flex; flex-wrap: wrap; gap: .55rem; }
.spielkarte { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; width: 4.3rem; height: 6rem; padding: .25rem; font: inherit; color: var(--text); background: var(--flaeche); border: 2px solid var(--rand); border-radius: 11px; cursor: pointer; box-shadow: var(--schatten); transition: transform .12s ease, border-color .12s ease; }
.spielkarte:hover { border-color: var(--akzent); transform: translateY(-3px); }
.spielkarte.gewaehlt { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); transform: translateY(-5px); }
.spielkarte.gewaehlt small { color: inherit; }
.spielkarte .karten-wert { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.spielkarte small { font-size: .7rem; line-height: 1.1; }
.spielkarte.wort { width: auto; min-width: 5.5rem; height: 3.6rem; padding: .25rem .8rem; }
.spielkarte.wort .karten-wert { font-size: 1.02rem; font-weight: 700; }
.karten.klein .spielkarte:not(.wort) { width: 3.6rem; height: 4.6rem; }
.karten.klein .karten-wert { font-size: 1.2rem; }
.stand-zeile { color: var(--leise); margin: 0; font-weight: 600; }
.steuerung { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.beamer-stand { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; padding: .8rem 1rem; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); font-size: 1.2rem; }

/* Auswertung */
.auswertung { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: .8rem 1rem; }
.auswertung h3 { display: flex; gap: .6rem; align-items: center; }
.einig { font-size: .78rem; color: #06291a; background: var(--gruen); padding: 0 .5rem; border-radius: 6px; }
.balken { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .4rem; }
.balken-zeile { display: grid; grid-template-columns: minmax(3rem, 6rem) 1fr 1.6rem; gap: .5rem; align-items: center; }
.balken-name { font-weight: 700; overflow-wrap: anywhere; }
.balken-spur { height: .8rem; background: var(--flaeche-2); border-radius: 5px; overflow: hidden; }
.balken-fuellung { display: block; height: 100%; background: var(--leise); border-radius: 5px; }
.balken-zeile.vorschlag .balken-fuellung { background: var(--akzent); }
.balken-zahl { text-align: right; font-weight: 700; }
.festgelegt { display: flex; flex-wrap: wrap; gap: 1rem; background: var(--flaeche); border: 2px solid var(--gruen); border-radius: var(--radius); padding: .8rem 1.1rem; }
.festgelegt-wert { display: flex; flex-direction: column; }
.festgelegt-wert b { font-size: 1.7rem; line-height: 1.2; }

/* Teilnehmer */
.leute { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.person { display: flex; align-items: center; gap: .5rem; }
.person.weg { opacity: .5; }
.person-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.person-punkt { width: .55rem; height: .55rem; margin: 0 .5rem; border-radius: 50%; background: var(--gruen); flex: none; }
.person.weg .person-punkt { background: var(--leise); }
.mini-karte { flex: none; min-width: 1.5rem; height: 2rem; padding: 0 .25rem; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; border: 2px dashed var(--rand); border-radius: 5px; }
.mini-karte.voll { background: var(--akzent); border: 2px solid var(--akzent); }
.mini-karte.offen { background: var(--flaeche-2); color: var(--text); border: 2px solid var(--akzent); max-width: 8rem; white-space: nowrap; overflow: hidden; }
.rolle { color: var(--akzent); }
.person-menue { background: none; border: 0; color: var(--leise); font: inherit; font-weight: 800; cursor: pointer; padding: 0 .3rem; }

/* Einladen */
.einladen { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 1.2rem; align-items: start; }
.qr { display: block; width: 100%; height: auto; border-radius: 8px; }
.zugang { display: grid; grid-template-columns: auto 1fr; gap: .15rem .7rem; margin: 0; align-items: baseline; }
.zugang dt { color: var(--leise); font-size: .85rem; }
.zugang dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.gross-code { font-size: 1.35rem; font-weight: 800; letter-spacing: .05em; }

/* Beamer: dieselben Bereiche, groß. Vor dem ersten Issue steht das Einladen im Mittelpunkt */
.beamer .raum-gitter { grid-template-columns: minmax(0, 1fr) minmax(280px, 22rem); }
.beamer .raum-liste { grid-row: 1 / span 2; grid-column: 1; display: none; }
.beamer .raum-mitte { grid-column: 1; }
.beamer .raum-seite { grid-column: 2; grid-row: 1 / span 2; }
.beamer .ist-lobby .raum-gitter, .beamer .raum:not(.liste-zu) .raum-gitter { grid-template-columns: minmax(250px, 24rem) minmax(0, 1fr) minmax(280px, 22rem); }
.beamer .raum:not(.liste-zu) .raum-liste { display: block; }
.beamer .raum:not(.liste-zu) .raum-mitte { grid-column: 2; }
.beamer .raum:not(.liste-zu) .raum-seite { grid-column: 3; }
.beamer .issue-kopf h2 { font-size: 2.2rem; }
.beamer .issue-nummer { font-size: 1.6rem; }
.beamer .issue-rahmen { margin-top: .8rem; padding: 1rem 1.2rem; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); max-height: 50vh; overflow: auto; font-size: 1.1rem; }
/* Nach dem Aufdecken zählt das Ergebnis: Der Text wird klein, damit am Beamer nichts gescrollt werden muss */
.beamer .ist-offen .issue-rahmen { max-height: 16vh; font-size: .95rem; }
.beamer .ist-offen .issue-kopf h2 { font-size: 1.6rem; }
.beamer .ist-offen .raum-karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: .8rem; align-items: start; }
.beamer .ist-offen .steuerung, .beamer .ist-offen .festgelegt, .beamer .ist-offen .stand-zeile { grid-column: 1 / -1; }
.beamer .lobby { padding: 2rem 1.2rem; font-size: 1.3rem; }
.beamer .lobby h2 { font-size: 2.1rem; }
.beamer .gross-code { font-size: 1.9rem; }
.beamer-zugang { display: flex; flex-direction: column; gap: .8rem; }
.beamer .ist-lobby .qr { max-width: 100%; }
.beamer .raum:not(.ist-lobby) .qr { max-width: 11rem; margin: 0 auto; }

@media (max-width: 1000px) {
  .raum-gitter, .beamer .raum-gitter, .beamer .ist-lobby .raum-gitter, .beamer .raum:not(.liste-zu) .raum-gitter { grid-template-columns: minmax(0, 1fr); padding: .75rem; }
  .raum-mitte, .beamer .raum-mitte, .beamer .raum:not(.liste-zu) .raum-mitte { order: 1; grid-column: 1; }
  .raum-seite, .beamer .raum-seite, .beamer .raum:not(.liste-zu) .raum-seite { order: 2; grid-column: 1; grid-row: auto; }
  .raum-liste, .beamer .raum:not(.liste-zu) .raum-liste { order: 3; grid-column: 1; grid-row: auto; position: static; max-height: none; }
  .raum-kopf { gap: .5rem; padding: .5rem .75rem; }
  .raum-stand { order: 3; width: 100%; }
  .einladen { grid-template-columns: minmax(0, 1fr); }
  .einladen .qr { max-width: 240px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .spielkarte:not(.wort) { width: calc((100% - 1.65rem) / 4); height: 5.2rem; }
  .spielkarte.wort { flex: 1 1 40%; }
  .karten.klein .spielkarte:not(.wort) { width: calc((100% - 1.65rem) / 4); }
  .leiste { padding: .5rem .75rem; }
  .raumzeile input { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .spielkarte { transition: none; }
}
