/* Anmeldung, Verwaltung und Spieleransicht: gleiche Farbwelt wie die SL-Übersicht */
:root {
  --grund: #f4f1ea; --flaeche: #fbfaf7; --flaeche-2: #ece7dc; --linie: #d8d0c0;
  --text: #1f1b26; --text-leise: #5d5667; --gold: #85621a; --gold-hell: #b88b2e;
  --zinnober: #a8391f; --nacht: #24203a; --vorlesen: #f2eadb; --gruen: #3f6b2f;
  --f-anzeige: "Alegreya SC", "Iowan Old Style", Palatino, Georgia, serif;
  --f-text: "Alegreya", "Iowan Old Style", Palatino, Georgia, serif;
  --f-ui: "Alegreya Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #15131d; --flaeche: #1d1a28; --flaeche-2: #262236; --linie: #36304a;
    --text: #ebe4d6; --text-leise: #a49cb2; --gold: #d9b562; --gold-hell: #e8c977;
    --zinnober: #e0715a; --nacht: #0f0d16; --vorlesen: #221e30; --gruen: #a3c784;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--grund); color: var(--text); font: 16px/1.55 var(--f-ui); -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--gold); text-underline-offset: 2px; }
a:hover { color: var(--gold-hell); }
:focus-visible { outline: 2px solid var(--gold-hell); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--f-anzeige); font-weight: 700; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin: .2rem 0 .8rem; }
h2 { font-size: 1.3rem; color: var(--gold); margin: 2rem 0 .6rem; }
code { font-size: 1.05em; background: var(--flaeche-2); padding: .1rem .35rem; border-radius: 4px; user-select: all; }

.oben { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--nacht); color: #f4ead2; padding: .6rem 16px; font-family: var(--f-anzeige); }
.oben .links { display: flex; gap: 1rem; flex-wrap: wrap; font-family: var(--f-ui); font-size: .95rem; }
.oben a { color: #e8c977; text-decoration: none; }
.oben a:hover { text-decoration: underline; }
.rahmen { max-width: 52rem; margin: 0 auto; padding: 1.5rem 16px 4rem; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 1.5rem;
  max-width: 24rem; margin: 2rem auto; display: grid; gap: .45rem; box-shadow: 0 4px 16px rgba(30,25,40,.06); }
.anmelden { margin-top: 12vh; text-align: left; }
.anmelden h1 { text-align: center; margin-bottom: 0; }
.anmelden .leise { text-align: center; margin-top: 0; }
.stern { text-align: center; color: var(--gold); font-size: 2rem; line-height: 1; }
label { font-size: .85rem; color: var(--text-leise); margin-top: .4rem; }
input { font: inherit; color: inherit; background: var(--grund); border: 1px solid var(--linie); border-radius: 6px; padding: .55rem .7rem; width: 100%; }
.knopf { font: inherit; font-weight: 500; background: var(--gold); color: var(--flaeche); border: 0; border-radius: 6px; padding: .6rem 1rem; cursor: pointer; margin-top: .8rem; }
.knopf:hover { background: var(--gold-hell); }
.knopf.klein { padding: .3rem .7rem; font-size: .9rem; margin: 0; }
.knopf.zweit { background: none; color: var(--text); border: 1px solid var(--linie); }
.leise { color: var(--text-leise); }
.fehler { color: var(--zinnober); margin: .3rem 0; }
.ok { background: var(--flaeche-2); border-left: 3px solid var(--gruen); padding: .6rem .9rem; border-radius: 0 6px 6px 0; }

.tabelle { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--text-leise); }
td form { margin: 0; }

/* Spieleransicht */
.held { display: flex; gap: 1.2rem; align-items: center; margin: .5rem 0 1rem; }
.held img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex: none; }
.held p { margin: .15rem 0; }
.reiter { display: flex; gap: .2rem; border-bottom: 1px solid var(--linie); margin: 1rem 0 .5rem; overflow-x: auto; }
.reiter button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: .6rem .9rem;
  cursor: pointer; color: var(--text-leise); font-weight: 500; white-space: nowrap; margin-bottom: -1px; }
.reiter button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }
.bisher { background: var(--vorlesen); border-left: 3px solid var(--gold); border-radius: 0 6px 6px 0; padding: .9rem 1.2rem; margin: 0 0 1.4rem; }
.bisher h3 { margin: 0 0 .4rem; color: var(--gold); font-size: 1.05rem; }
.bisher p { font-family: var(--f-text); font-style: italic; font-size: 1.06rem; line-height: 1.7; margin: .4rem 0; }
.text { font-family: var(--f-text); font-size: 1.05rem; line-height: 1.65; }
.text table { font-family: var(--f-ui); font-size: .95rem; }
.text h1 { font-size: 1.5rem; }
.text h2 { font-size: 1.2rem; }
.gruppe { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; }
.gruppe article { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 1rem; text-align: center; }
.gruppe img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid var(--linie); }
.gruppe h3 { margin: .5rem 0 .2rem; }
.gruppe p { margin: .1rem 0; }
.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.karten figure { margin: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.karten img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.karten figcaption { padding: .5rem .7rem; font-weight: 500; }
.beutel { align-items: center; display: flex; gap: 1.2rem; flex-wrap: wrap; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; }
.beutel span { font-variant-numeric: tabular-nums; }
.beutel strong { font-size: 1.15rem; margin-right: .2rem; }

.hinweis { background: var(--flaeche-2); border-radius: 6px; padding: .6rem .9rem; font-size: .95rem; }
.leer { color: var(--text-leise); border: 1px dashed var(--linie); border-radius: 8px; padding: 2rem 1rem; text-align: center; }
@media (max-width: 560px) { .held img { width: 76px; height: 76px; } }

/* Bearbeiten */
select { font: inherit; color: inherit; background: var(--grund); border: 1px solid var(--linie); border-radius: 6px; padding: .5rem .6rem; width: 100%; }
textarea { font: 1.05rem/1.6 var(--f-text); color: inherit; background: var(--grund); border: 1px solid var(--linie); border-radius: 6px; padding: .6rem .7rem; width: 100%; resize: vertical; }
.formular { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .8rem; }
.formular .breit { grid-column: 1 / -1; }
.formular h2 { margin: 0 0 .3rem; }
.feld { display: grid; gap: .2rem; min-width: 0; }
.feld label { margin-top: .3rem; }
.panel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: .8rem 1rem 1rem; margin: .6rem 0; }
.aktionen { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.aktionen.links { justify-content: flex-start; }
.aktionen .knopf { margin: 0; }
.aktionen .luecke { flex: 1; }
.knopf.gefahr { background: var(--zinnober); }
.knopf:disabled { opacity: .5; cursor: default; }
.textknopf { font: inherit; font-size: .92rem; background: none; border: 0; padding: .25rem .4rem; color: var(--text-leise); cursor: pointer; border-radius: 4px; }
.textknopf:hover { color: var(--text); background: var(--flaeche-2); }
.textknopf.gefahr { color: var(--zinnober); }
.klein { font-size: .85rem; font-family: var(--f-ui); font-weight: 400; }
.beutel .rechts { margin-left: auto; display: flex; gap: .2rem; }
.formular .muenze { grid-column: span 1; }
#geld-form { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#geld-form input { text-align: center; }
.einpacken { margin: 0 0 1rem; }
.einpacken summary { cursor: pointer; font-weight: 500; color: var(--gold); padding: .3rem 0; }
.suche { margin-bottom: .5rem; }
.ding { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: .2rem .7rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--linie); }
.ding .menge { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.ding .name { font-weight: 500; overflow-wrap: anywhere; }
.ding .notiz { color: var(--text-leise); font-size: .92rem; overflow-wrap: anywhere; }
.ding .knoepfe { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.ding .panel { grid-column: 1 / -1; margin: .3rem 0 0; }
.marke { font-size: .72rem; border: 1px solid currentColor; border-radius: 99px; padding: 0 .45rem; color: var(--gold); white-space: nowrap; vertical-align: 1px; font-weight: 400; }
.protokoll { list-style: none; padding: 0; margin: 0; font-size: .93rem; }
.protokoll li { padding: .3rem 0; border-bottom: 1px dotted var(--linie); }
.eintrag { padding: 1rem 0 1.2rem; border-bottom: 1px solid var(--linie); }
.eintrag .meta { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.eintrag h3 { font-family: var(--f-text); font-weight: 600; font-size: 1.3rem; margin: .2rem 0 .4rem; }
.vor { white-space: pre-wrap; overflow-wrap: anywhere; }
.buch { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 1rem; margin: 1rem 0; }
.meldung { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); background: var(--nacht); color: #f4ead2;
  padding: .5rem 1rem; border-radius: 99px; font-size: .92rem; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.meldung.an { opacity: 1; }
.meldung.fehler { background: var(--zinnober); color: #fff; }
@media (prefers-reduced-motion: reduce) { .meldung { transition: none; } }

/* Spielstand der SL */
.breit-rahmen { max-width: 72rem; }
.zuweisen { max-width: 46rem; }
fieldset.an { border: 0; padding: 0; margin: .4rem 0 0; }
fieldset.an legend { font-size: .85rem; color: var(--text-leise); padding: 0; }
.haken { display: inline-flex; align-items: center; gap: .35rem; margin: .3rem 1.2rem 0 0; font-size: 1rem; color: var(--text); }
.haken input { width: auto; }
.spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.spalte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: .4rem 1rem 1rem; }
.spalte h2 { margin-top: .6rem; }
.spalte .geld { display: flex; gap: .7rem; flex-wrap: wrap; margin: .2rem 0 .6rem; }
.spalte .knopf { display: inline-block; text-decoration: none; }
.kompakt { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .95rem; }
.kompakt li { padding: .2rem 0; border-bottom: 1px dotted var(--linie); }
.kompakt .menge { display: inline-block; min-width: 1.8rem; text-align: right; margin-right: .3rem; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .ding { grid-template-columns: 2rem minmax(0, 1fr); }
  .ding .knoepfe { grid-column: 2; justify-content: flex-start; }
  #geld-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .formular { grid-template-columns: minmax(0, 1fr); }
  .beutel .rechts { margin-left: 0; width: 100%; }
}

/* Bild der Spielleitung auf der Spielerseite */
.tisch { position: fixed; inset: 0; z-index: 90; background: rgba(8, 7, 12, .94); display: flex; flex-direction: column; padding: calc(.6rem + env(safe-area-inset-top, 0px)) 16px calc(.6rem + env(safe-area-inset-bottom, 0px)); }
.tisch[hidden] { display: none !important; }
.tisch-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #f4ead2; font-family: var(--f-anzeige); font-size: 1.1rem; padding-bottom: .5rem; }
.tisch img { flex: 1; min-height: 0; width: 100%; object-fit: contain; cursor: zoom-in; }
.tisch-wieder { position: fixed; right: 16px; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 60; box-shadow: 0 4px 16px rgba(0,0,0,.25); margin: 0; }

/* In der SL-Übersicht eingebettet: eigene Kopfleiste ausblenden */
.eingebettet .oben { display: none; }

/* Kartenfreigabe */
.kartenwahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .8rem; }
.kartenknopf { font: inherit; text-align: left; padding: 0; border: 2px solid var(--linie); border-radius: 8px; background: var(--flaeche); color: var(--text); cursor: pointer; overflow: hidden; display: grid; }
.kartenknopf img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; filter: grayscale(.7); opacity: .7; }
.kartenknopf span { padding: .4rem .6rem 0; font-weight: 500; }
.kartenknopf b { padding: 0 .6rem .5rem; font-size: .8rem; color: var(--text-leise); font-weight: 400; }
.kartenknopf.frei { border-color: var(--gruen); }
.kartenknopf.frei img { filter: none; opacity: 1; }
.kartenknopf.frei b { color: var(--gruen); font-weight: 700; }
