/* Verwaltung der Turnierleitung (verwaltung.php, Seiten in app/seiten/). Baut auf app.css auf. */
.admin::before { display: none; }   /* kein Wasserzeichen */
.einstellungen { max-width: 1240px; margin: 0 auto; padding: 16px 16px 40px; }
.einstellungen h2 { font: 700 20px var(--titel); text-transform: uppercase; color: var(--schrift-gruen); margin: 28px 0 4px; }
.einstellungen h2:first-child, .hinweis + h2 { margin-top: 8px; }
.einstellungen > p, .erklaerung { color: var(--gedaempft); margin: 0 0 14px; }
code { background: var(--lime-hell); padding: 1px 5px; border-radius: 4px; }

/* Menü fest am linken Rand; unter 900 px als Schublade, die der Menü-Knopf öffnet */
:root { --leiste: 248px; }
.seitenleiste {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--leiste); overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px; padding: calc(16px + env(safe-area-inset-top, 0px)) 12px 16px;
  background: var(--gruen-tief); color: #fff;
}
.marke { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 0 4px; }
.marke .logo { width: 64px; flex: none; }
.marke span { font: 700 19px/1.1 var(--titel); text-transform: uppercase; letter-spacing: .03em; }
.marke small { display: block; margin-top: 3px; font: 500 12px var(--titel); letter-spacing: .06em; color: var(--lime); }
.admin-nav, .leiste-fuss { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a, .leiste-fuss a {
  padding: 10px 14px; border-radius: 10px; color: #fff; text-decoration: none;
  font: 500 16px var(--titel); text-transform: uppercase; letter-spacing: .04em;
}
.admin-nav a:hover, .leiste-fuss a:hover { background: #ffffff1f; }
.admin-nav a[aria-current], .leiste-fuss a[aria-current] { background: var(--lime); color: var(--gruen-tief); font-weight: 700; }
.admin-nav a.abstand { margin-top: 22px; }
.leiste-fuss { margin-top: auto; padding-top: 12px; border-top: 1px solid #ffffff2e; }
.leiste-fuss a { font-size: 14px; color: #d9ecc2; }
.admin-inhalt { margin-left: var(--leiste); }
.menue-knopf { display: none; }
.admin .kopf .strich { margin-top: 8px; }
.admin .kopf h1 { padding: 4px 0; }
.schleier { position: fixed; inset: 0; z-index: 19; background: #0008; }

@media (max-width: 899px) {
  .admin-inhalt { margin-left: 0; }
  .seitenleiste { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; box-shadow: 4px 0 24px #0005; }
  .menue-offen .seitenleiste { transform: none; visibility: visible; }
  .menue-knopf {
    display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: -6px;
    border: 0; border-radius: 10px; background: none; color: var(--schrift-gruen); cursor: pointer;
  }
  .menue-knopf:hover { background: var(--lime-hell); }
}
@media (prefers-reduced-motion: reduce) { .seitenleiste { transition: none; } }

.hinweis { padding: 12px 16px; border-radius: 12px; margin: 12px 0; font-weight: 600; }
.hinweis.ok { background: #dcfce7; color: #14532d; }
.hinweis.fehler { background: #fee2e2; color: #7f1d1d; }
.hinweis.warnung { background: #fef3c7; color: #78350f; font-weight: 400; }
.hinweis pre { white-space: pre-wrap; margin: 8px 0 0; font-size: 14px; }

/* Karten mit Formularen */
.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; padding: 16px; }
.karte h2 { margin-top: 0; }
/* Live-Seite: Karten einer Reihe gleich hoch (jede Reihe nach ihrer höchsten Karte), Knöpfe unten bündig */
.karten.gleich { align-items: stretch; }
.karten.gleich .karte { display: flex; flex-direction: column; }
.karten.gleich .karte > form:last-of-type { flex: 1; display: flex; flex-direction: column; }
.karten.gleich .karte > form:last-of-type .knoepfe,
.karten.gleich .karte > form:last-of-type > .knopf { margin-top: auto; }
.karten.gleich .karte > form:last-of-type > .knopf { align-self: flex-start; }
.karte.aktiv { border-color: var(--gruen); box-shadow: 0 0 0 3px var(--lime); }
.feld { display: block; margin: 0 0 12px; }
.feld > span { display: block; font-weight: 600; margin-bottom: 4px; }
.feld small { display: block; color: var(--gedaempft); margin-top: 3px; }
.feld input:not([type=checkbox]), .feld select, .feld textarea {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--linie); background: var(--grund); color: var(--text);
}
.feld textarea { min-height: 84px; resize: vertical; }
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.haken { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; }
.haken input { width: 20px; height: 20px; flex: none; accent-color: var(--gruen); }
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }

.knopf {
  display: inline-block; border: 0; border-radius: 10px; background: var(--gruen); color: #fff; padding: 12px 22px; text-decoration: none;
  font: 700 17px var(--titel); text-transform: uppercase; letter-spacing: .05em; cursor: pointer;
}
.knopf:hover { background: var(--gruen-tief); }
.knopf.zweit { background: none; color: var(--text); box-shadow: inset 0 0 0 2px var(--linie); }
.knopf.zweit:hover { background: var(--lime-hell); }
.knopf.stopp { background: #b91c1c; }
.knopf.stopp:hover { background: #7f1d1d; }
.knopf.klein { padding: 7px 12px; font-size: 14px; }

/* Aktuell laufend (Durchsage, Siegerehrung) */
.laeuft { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: #fef9c3; color: #713f12; margin: 0 0 12px; font-weight: 600; }
.laeuft::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; animation: blinken 1.2s steps(1) infinite; }
@keyframes blinken { 50% { opacity: .2; } }

/* Skin-Auswahl */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.skin-karte {
  position: relative; display: flex; flex-direction: column; background: var(--flaeche); border: 2px solid var(--linie);
  border-radius: 16px; overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.skin-karte:has(input:checked) { border-color: var(--gruen); box-shadow: 0 0 0 3px var(--lime); }
.skin-karte input { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; accent-color: var(--gruen); z-index: 2; }
/* Live-Vorschau: Handy-Ansicht (390 × 600), mittig auf grauem Grund, verkleinert auf 55 % */
.vorschau { height: 346px; overflow: hidden; border-bottom: 1px solid var(--linie); background: #d9ded3; display: flex; justify-content: center; padding-top: 8px; }
.vorschau iframe { flex: none; width: 390px; height: 600px; border: 0; border-radius: 18px; transform: scale(.55); transform-origin: 50% 0; margin: 0 -88px; pointer-events: none; display: block; box-shadow: 0 6px 20px #0000002e; }
.skin-text { padding: 12px 14px 14px; }
.skin-text strong { font: 700 18px var(--titel); text-transform: uppercase; }
.skin-text .aktiv { font-size: 12px; background: var(--gruen); color: #fff; border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px; }
.skin-text p { margin: 4px 0 8px; color: var(--gedaempft); font-size: 14px; }
.skin-text a { font-size: 14px; color: var(--schrift-gruen); margin-right: 12px; }
.aktionen { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--grund) 30%); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Sponsoren */
.sponsoren { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0 0 16px; }
.sponsor { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.sponsor-bild { aspect-ratio: 3 / 2; background: #fff; border-radius: 8px; padding: 8px; }
.sponsor-bild img { display: block; width: 100%; height: 100%; object-fit: contain; }   /* jedes Logo im gleichen Rahmen */
.sponsor span { font-size: 14px; overflow-wrap: anywhere; }
.sponsor button { margin-top: auto; }

/* Statusseite */
.ampel { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; margin: 4px 0 16px; font: 700 20px var(--titel); text-transform: uppercase; }
.ampel::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px #ffffff88; }
.ampel.gruen { background: #dcfce7; color: #15803d; }
.ampel.gelb { background: #fef3c7; color: #b45309; }
.ampel.rot { background: #fee2e2; color: #b91c1c; }
.ampel small { display: block; font: 400 15px system-ui, sans-serif; text-transform: none; color: #3f3f46; }
.werte { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.werte dt { color: var(--gedaempft); }
.werte dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.gut { color: #15803d; } .mittel { color: #b45309; } .schlecht { color: #b91c1c; }

/* Benutzer, Rollen, Protokoll */
.karte.breit { grid-column: 1 / -1; }
.tabelle-rahmen { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--linie); }
.tabelle th { color: var(--gedaempft); font-weight: 600; white-space: nowrap; }
.tabelle td.zeit { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bearbeiten summary, .rolle summary { cursor: pointer; color: var(--gruen); font-weight: 600; }
.bearbeiten[open] { min-width: min(280px, 70vw); }
.bearbeiten form { margin-top: 10px; }
.bearbeiten form + form { border-top: 1px dashed var(--linie); padding-top: 10px; }
.rolle { border: 1px solid var(--linie); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.rolle summary { color: inherit; }
.rolle summary small { color: var(--gedaempft); font-weight: 400; }
.rolle form { margin-top: 12px; }
.rechte { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 16px; }
.filter { max-width: 280px; }
.tabelle a { color: var(--gruen); font-weight: 600; }
@media (max-width: 700px) {
  /* Benutzerliste als gestapelte Karten statt breiter Tabelle */
  .stapel thead { display: none; }
  .stapel tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--linie); }
  .stapel td { display: block; padding: 2px 0; border: 0; }
  .stapel td[data-titel]::before { content: attr(data-titel) ": "; color: var(--gedaempft); }
}

@media (prefers-color-scheme: dark) {
  .hinweis.ok, .ampel.gruen { background: #14532d; color: #bbf7d0; }
  .hinweis.fehler, .ampel.rot { background: #7f1d1d; color: #fecaca; }
  .hinweis.warnung, .ampel.gelb, .laeuft { background: #713f12; color: #fde68a; }
  .ampel small { color: inherit; opacity: .85; }
  .gut { color: #4ade80; } .mittel { color: #fbbf24; } .schlecht { color: #f87171; }
}

/* QR-Aushang: auf dem Bildschirm als Vorschau, gedruckt als A4-Plakat */
.plakat {
  max-width: 620px; margin: 0 auto; padding: 28px 24px 32px; background: #fff; color: #15191a; text-align: center;
  border-radius: 16px; box-shadow: 0 10px 30px #0000001f;
}
.plakat-logo { display: block; width: min(60%, 9cm); height: auto; margin: 0 auto; }   /* height: auto, sonst verzerrt das width/height-Attribut */
.plakat-titel { font: 700 40px/1.05 var(--titel) !important; text-transform: uppercase; color: #1d6b2c !important; margin: 10px 0 18px !important; }
.qr { width: min(100%, 11cm); margin: 0 auto; }
.qr svg { display: block; width: 100%; height: auto; }
.qr.klein { width: 180px; margin: 0; }
/* Rahmen um den QR-Code des Plakats: der Code selbst bleibt unverändert, Grün und Pfote nur außen herum */
.qr-rahmen {
  width: min(100%, 11.6cm); margin: 0 auto; padding: 10px 10px 0; border-radius: 22px; background: #1d6b2c;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.qr-rahmen .qr { width: 100%; border-radius: 13px; overflow: hidden; }
.qr-band {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 9px 0 11px;
  color: #fff; font: 700 26px/1 var(--titel); text-transform: uppercase; letter-spacing: .05em;
}
.qr-band svg { width: 30px; height: 30px; color: #8dc63f; flex: none; }
.plakat-text { font: 500 22px/1.3 var(--titel); margin: 16px 0 8px; }
.plakat-adresse { font-size: 18px; margin: 0; color: #3f3f46; }
.plakat-passwort { font-size: 20px; font-weight: 700; margin: 10px auto 0; min-height: 1.4em; border-radius: 8px; outline: 2px dashed #cbd5c0; padding: 4px 8px; }
.plakat-passwort:empty::before { content: attr(data-platzhalter); font-size: 14px; font-weight: 400; color: #9ca3af; }
.plakat-passwort:focus { outline-color: var(--lime); }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .kopf, .hinweis, .nur-bildschirm, .seitenleiste, .schleier { display: none !important; }
  .admin-inhalt { margin-left: 0; }
  .einstellungen { padding: 0; max-width: none; }
  /* alles auf genau eine A4-Seite (273 mm nutzbare Höhe) */
  .plakat { box-shadow: none; border-radius: 0; max-width: none; padding: 0; break-inside: avoid; page-break-inside: avoid; }
  .plakat-logo { width: 7.5cm; }
  .plakat-titel { font-size: 32pt !important; margin: 4mm 0 5mm !important; }
  .qr { width: 10.5cm; }
  .qr-rahmen { width: 10.5cm; padding: 2.5mm 2.5mm 0; }
  .qr-rahmen .qr { width: 100%; }
  .qr-band { font-size: 20pt; padding: 2.5mm 0 3mm; }
  .qr-band svg { width: 8mm; height: 8mm; }
  .plakat-text { font-size: 17pt; margin: 5mm 0 2mm; }
  .plakat-adresse { font-size: 13pt; }
  .plakat-passwort { outline: 0; font-size: 16pt; margin-top: 3mm; padding: 0; }
  .plakat-passwort:empty { display: none; }
}
