/* Dispo - Spieltag-Einsatzpläne
   Bildsprache: Stadionbeschilderung und Ticketabriss.
   Ruhig gehalten, ein Signalton (Orange) markiert den nächsten Spieltag. */

:root {
  --ink:        #17191c;
  --ink-2:      #2c3037;
  --ink-3:      #5d626b;
  --concrete:   #e4e5e1;
  --card:       #ffffff;
  --line:       #cfd1cc;
  --line-2:     #e6e7e3;
  --signal:     #f0531c;
  --signal-ink: #b83a0c;
  --muted:      #82857f;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 3px;
  --wrap: 720px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--concrete);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Wortmarke ---------- */

/* Logo links, Schriftzug rechts. Die Grösse steckt nur hier -
   die Bilddatei selbst kann beliebig gross sein. */
.marke {
  display: flex;
  align-items: center;
  gap: 14px;
}
.marke__logo {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.marke__name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0;
}
.marke__zusatz {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 7px 0 0;
  color: var(--ink-3);
}

/* ---------- Anmeldung ---------- */

.login {
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login__karte {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: var(--radius);
  border-top: 5px solid var(--signal);
  padding: 34px 30px 30px;
}

.login .marke__zusatz { color: var(--muted); }

.login__felder { margin-top: 28px; }

.feld { margin-bottom: 16px; }

.feld label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.feld input {
  width: 100%;
  font: inherit;
  padding: 11px 12px;
  color: var(--ink);
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.knopf {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 13px;
  margin-top: 8px;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.knopf:hover { background: var(--signal-ink); }

.fehler {
  font-size: 14px;
  padding: 10px 12px;
  margin-top: 20px;
  color: var(--signal-ink);
  background: #fdefe9;
  border-left: 3px solid var(--signal);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.login__fuss {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Kopfleiste ---------- */

.kopf {
  background: var(--ink);
  color: #fff;
  padding: 20px 24px;
}
.kopf__innen {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.kopf .marke__name { font-size: 22px; }
.kopf .marke { gap: 14px; }
.kopf .marke__zusatz { color: var(--muted); margin-top: 5px; }

.kopf__konto {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.kopf__konto a {
  display: inline-block;
  margin-top: 5px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  border-bottom: 1px solid var(--signal);
  padding-bottom: 1px;
}
.kopf__konto a:hover { color: var(--signal); }

/* ---------- Auswahl ---------- */

.inhalt {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 34px 24px 56px;
}

/* Ein Bereich = eine Liste (RTL, Sportcast, ...) */
.bereich { margin-bottom: 52px; }
.bereich:last-child { margin-bottom: 0; }
.bereich__titel {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
  padding-bottom: 11px;
  border-bottom: 3px solid var(--ink);
}

.gruppe { margin-bottom: 30px; }
.gruppe:last-child { margin-bottom: 0; }
.gruppe > .eyebrow {
  display: block;
  padding-bottom: 9px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.dispo-karte {
  display: flex;
  align-items: stretch;
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 120ms ease, transform 120ms ease;
}
.dispo-karte:hover {
  border-color: var(--ink-3);
  border-left-color: var(--ink);
  transform: translateX(2px);
}
.dispo-karte--aktiv { border-left-color: var(--signal); }
.dispo-karte--aktiv:hover { border-left-color: var(--signal); }

/* Der Abriss: Datum wie auf einem Ticketstub */
.stub {
  flex: 0 0 96px;
  padding: 15px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: #f7f7f5;
  border-right: 1px dashed var(--line);
}
.dispo-karte--aktiv .stub {
  color: #fff;
  background: var(--signal);
  border-right-color: rgba(255, 255, 255, 0.55);
}

.stub__tag {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.dispo-karte--aktiv .stub__tag { color: rgba(255, 255, 255, 0.85); }

.stub__datum { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.stub__zeit  { font-size: 11px; color: var(--ink-3); }
.dispo-karte--aktiv .stub__zeit { color: rgba(255, 255, 255, 0.9); }

.karte__text {
  flex: 1;
  min-width: 0;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.karte__titel {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.karte__zeile {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 3px;
}

.marker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 2px 6px;
  margin-bottom: 6px;
  align-self: flex-start;
  color: #fff;
  background: var(--signal);
  border-radius: 2px;
}
.marker--kommend { color: var(--ink); background: transparent; border: 1px solid var(--ink); }

.karte__pfeil {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding-right: 16px;
  font-size: 17px;
  color: var(--line);
}
.dispo-karte:hover .karte__pfeil { color: var(--signal); }

/* Ein Eintrag: die Karte und - wenn vorhanden - die Zeile zur
   Originaldatei, die direkt darunter haengt und dadurch eindeutig
   zur Karte darueber gehoert. */
.eintrag { margin-bottom: 12px; }
.eintrag .dispo-karte { margin-bottom: 0; }

/* Karte und Stadionkachel nebeneinander, gleich hoch */
.eintrag__zeile {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.eintrag__zeile > .dispo-karte { flex: 1; min-width: 0; }

/* Stadionkachel: so breit wie der Abriss links, gleiche Hoehe wie die Karte */
.stadion {
  position: relative;
  flex: 0 0 96px;
  display: block;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;
}
.stadion:hover { border-color: var(--signal); transform: translateX(2px); }
.stadion--ohne { cursor: default; }

/* Hat eine Dispo der Gruppe ein Bild, bleibt die Spalte auch bei den
   uebrigen frei - sonst franst die Liste rechts aus. Unsichtbar, damit
   keine leeren Kaesten herumstehen. */
.stadion--platz {
  background: transparent;
  border-color: transparent;
}
.stadion--ohne:hover { border-color: var(--line-2); transform: none; }

/* Das Bild ist eine gestaltete Karte mit Ueberschrift und Wappen. Bei
   dieser Kachelgroesse waere die Schrift ohnehin nicht lesbar, deshalb
   wird auf das Stadion gezoomt: Es sitzt bei etwa 62 Prozent der
   Bildhoehe, dieser Punkt kommt in die Mitte der Kachel.
   Als Hintergrund statt als <img>, weil sich nur so waagerecht und
   senkrecht unabhaengig beschneiden laesst. */
.stadion__bild {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-repeat: no-repeat;
  background-size: 280% auto;      /* auf das Stadion zoomen */
  background-position: center 72%;
}

/* Liegt ein bereits zugeschnittenes Bild vor, ist der Zoom unnoetig.
   Dann statt der beiden Werte oben einfach:
   .stadion__bild { background-size: cover; background-position: center; } */
.stadion__bild--ganz {
  background-size: cover;
  background-position: center;
}

/* Name als schmaler Streifen ueber dem unteren Bildrand */
.stadion__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  background: rgba(12, 14, 18, 0.82);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.original {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 0 22px;
  padding: 6px 12px 6px 0;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.3;
}
.original:hover { color: var(--ink); }

.original__pfeil { font-size: 13px; opacity: 0.7; }

.original__typ {
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.original:hover .original__typ { border-color: var(--signal); color: var(--signal); }

.original__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sammelzeile: alle Dispos eines Tages zusammen.
   Bewusst flacher als eine Dispo-Karte - sie ist ein Zugang, kein Inhalt. */
.tag-karte {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding: 11px 16px 11px 13px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink-3);
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.tag-karte:hover {
  background: var(--card);
  border-color: var(--signal);
  color: var(--ink);
}

/* Drei versetzte Kanten als Bild fuer "mehrere Blaetter" */
.tag-karte__stapel {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 18px;
}
.tag-karte__stapel::before,
.tag-karte__stapel::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 1px;
}
.tag-karte__stapel::before { left: 0; top: 0; opacity: 0.45; }
.tag-karte__stapel::after  { left: 4px; top: 4px; background: var(--concrete); }
.tag-karte:hover .tag-karte__stapel::after { background: var(--card); }

.tag-karte__text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
}
.tag-karte__pfeil { font-size: 15px; }

/* Archiv */
details.archiv { margin-top: 6px; }
details.archiv > summary {
  cursor: pointer;
  list-style: none;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
details.archiv > summary::-webkit-details-marker { display: none; }
details.archiv > summary::before { content: "+ "; }
details.archiv[open] > summary::before { content: "– "; }
details.archiv > summary:hover { color: var(--ink); }
details.archiv .eintrag { margin-top: 12px; margin-bottom: 0; }
details.archiv .stub__datum { font-weight: 500; }

.leer {
  padding: 30px 26px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.leer p { margin: 0 0 8px; }
.leer code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: #f2f2f0;
  padding: 1px 5px;
  border-radius: 2px;
}

/* ---------- Dispo-Ansicht ---------- */

body.ansicht {
  display: flex;
  flex-direction: column;
  background: var(--card);
}

.leiste {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
}
.leiste__titel {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}
.leiste__datum {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.leiste__knopf {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 11px;
  color: #fff;
  background: transparent;
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.leiste__knopf:hover { border-color: var(--signal); color: var(--signal); }

.rahmen {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

/* ---------- Tagesansicht: mehrere Dispos gestapelt ---------- */

body.tagesansicht { background: var(--concrete); }
body.tagesansicht .leiste { position: sticky; top: 0; z-index: 5; }

.tagnav {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 20px 4px;
}
.tagnav__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.tagnav__liste {
  list-style: none;
  counter-reset: nav;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tagnav__liste li { counter-increment: nav; }
.tagnav__liste a {
  display: inline-block;
  padding: 6px 11px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 13px;
  text-decoration: none;
}
.tagnav__liste a::before {
  content: counter(nav) " ";
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.tagnav__liste a:hover { border-color: var(--signal); }

.stapel {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px 60px;
}

.blatt {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
  scroll-margin-top: 60px;
}

.blatt__kopf {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 16px;
  background: var(--ink);
  color: #fff;
}
.blatt__zaehler {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--signal);
  white-space: nowrap;
}
.blatt__titel {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}
/* Anstosszeit - die Dispos stehen chronologisch */
.blatt__zeit {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: var(--signal);
  white-space: nowrap;
}
body.monitor .blatt__zeit { color: #6c727c; font-weight: 400; font-size: 12px; }

.tagnav__zeit {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--signal);
}

.blatt__einzeln {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.blatt__einzeln:hover { color: var(--signal); }

.blatt__rahmen {
  display: block;
  width: 100%;
  height: 420px;   /* Startwert, wird per Skript auf den Inhalt gesetzt */
  border: 0;
  background: #fff;
}

@media print {
  body.tagesansicht .leiste, .tagnav { display: none; }
  .stapel { padding: 0; max-width: none; }
  .blatt { border: 0; margin: 0; break-after: page; }
  .blatt:last-child { break-after: auto; }
  .blatt__kopf { background: none; color: var(--ink); padding: 0 0 8px; }
  .blatt__einzeln { display: none; }
}

/* ---------- Monitoransicht: 1080 x 1920, Hochformat ----------
   Ein Bildschirm, der nur anzeigt. Alles Schwarz, damit die dunklen
   Dispos randlos in die Fläche übergehen und aussenherum nichts
   aufblitzt - weder am Rand noch zwischen zwei Dispos. */

html.monitor,
html.monitor body.tagesansicht {
  background: #000;
  overscroll-behavior: none;
}

/* Rollbalken würde als heller Streifen am Rand stehen */
html.monitor { scrollbar-width: none; }
html.monitor::-webkit-scrollbar,
html.monitor body::-webkit-scrollbar { width: 0; height: 0; display: none; }

body.monitor .stapel {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Keine Karte, kein Rahmen, kein Radius - die Dispo liegt direkt auf Schwarz */
body.monitor .blatt {
  background: #000;
  border: 0;
  border-radius: 0;
  margin: 0;
  overflow: visible;
}

/* Nur ein leiser Zähler zwischen zwei Dispos, damit der Übergang
   erkennbar bleibt. Die Dispos bringen eigene Überschriften mit. */
body.monitor .blatt__kopf {
  justify-content: center;
  gap: 10px;
  padding: 22px 24px 14px;
  background: #000;
  color: #4a4f57;
}
body.monitor .blatt:first-child .blatt__kopf { padding-top: 14px; }
body.monitor .blatt__zaehler { color: #6c727c; }
body.monitor .blatt__titel {
  flex: 0 1 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4a4f57;
}

/* Die Bühne begrenzt, was von der skalierten Dispo zu sehen ist */
.blatt__buehne { position: relative; }
body.monitor .blatt__buehne { overflow: hidden; }

body.monitor .blatt__rahmen {
  display: block;
  width: 100%;
  background: #000;          /* bis der Inhalt steht, kein weisses Aufblitzen */
  transform-origin: top left;
}

/* Bedienung erscheint nur bei Mausbewegung und verschwindet wieder */
.msteuerung {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.86);
  border: 1px solid #2a2f37;
  border-radius: var(--radius);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms;
}
.msteuerung.sichtbar { opacity: 1; visibility: visible; }
.msteuerung .leiste__knopf { color: #fff; border-color: #3a4049; }

/* Der Bildschirm steht im Hochformat: 1080 breit, 1920 hoch */
@media (min-width: 1000px) and (orientation: portrait) {
  body.monitor .blatt__kopf { padding: 26px 24px 16px; }
  body.monitor .blatt__titel { font-size: 13px; }
  body.monitor .blatt__zaehler { font-size: 12px; }
}

/* ---------- Werkzeug: Passwort-Hash ---------- */

.werkzeug { max-width: 620px; margin: 0 auto; padding: 40px 24px; }
.werkzeug h1 { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 6px; }
.werkzeug .box {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 22px;
}
.werkzeug .ausgabe {
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
  background: var(--ink);
  color: #fff;
  padding: 14px;
  border-radius: var(--radius);
  margin-top: 14px;
}
.warnung {
  background: #fdefe9;
  border-left: 3px solid var(--signal);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--signal-ink);
  margin: 0;
}

/* ---------- Klein ---------- */

@media (max-width: 560px) {
  .kopf__innen { align-items: flex-start; }
  .kopf .marke__name { font-size: 19px; }
  .marke__logo { flex-basis: 34px; width: 34px; height: 34px; }
  .inhalt { padding: 26px 16px 44px; }
  .bereich__titel { font-size: 19px; }
  .stub { flex-basis: 82px; padding: 13px 8px; }
  .stub__datum { font-size: 17px; }
  .karte__text { padding: 13px; }
  .karte__pfeil { display: none; }
  .original { margin-left: 12px; font-size: 11px; }
  .eintrag__zeile { gap: 8px; }
  .stadion { flex-basis: 76px; }
  .stadion__name { font-size: 8px; }
  .tagnav, .stapel { padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .leiste, .kopf { display: none; }
}
