/* Grundlage für alle Seiten: Farben, Schriften und Bausteine im Stil des ScoreBoards.
   Farbwerte und Bausteine (.btn, .field, Dialoge, Listen) sind von dort übernommen. */
@import url("./fonts.css");

:root {
  --bg: #0d1117;
  --panel: #151b24;
  --panel-2: #1d2531;
  --line: #2a3442;
  --ink: #eef2f7;
  --muted: #8b97a9;
  --led: #ffb224;
  --danger: #ff6b5e;
  --ok: #5fd38a;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--led); outline-offset: 2px; }
[hidden] { display: none !important; }
/* Nur für Screenreader sichtbar */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: .03em; margin: 0; }

/* Marke: «ScreenBoard» wie «ScoreBoard», zweiter Teil in der Akzentfarbe */
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .06em; text-transform: uppercase; }
.brand span { color: var(--led); }

/* Knöpfe */
.btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  padding: 8px 14px; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .4; cursor: default; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.btn-primary { background: var(--led); color: #1a1205; border-color: var(--led); font-weight: 600; }
.btn-primary:hover { background: var(--led); filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: rgba(255, 107, 94, .5); }

/* Reiter (wie die Sportarten im ScoreBoard) */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 7px; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: .03em; color: var(--muted);
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 -2px 0 var(--led); }

/* Formulare */
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .85rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.field input:disabled { color: var(--muted); background: transparent; border-style: dashed; }
.check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; }
.check.wide { grid-column: 1 / -1; }
.check input { accent-color: var(--led); width: 16px; height: 16px; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
.form-error {
  margin: 0; padding: 8px 12px; border-radius: 8px; font-size: .92rem; color: var(--danger);
  background: rgba(255, 107, 94, .12); border: 1px solid rgba(255, 107, 94, .4);
}
@media (max-width: 620px) { .fields { grid-template-columns: 1fr; } }

/* Dialoge (natives <dialog>, sieht aus wie .modal im ScoreBoard) */
dialog.modal {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  width: min(500px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 22px;
}
dialog.modal::backdrop { background: rgba(4, 6, 10, .7); }
.modal form { display: flex; flex-direction: column; gap: 16px; }
.modal h2 { font-size: 1.6rem; text-wrap: balance; }
.modal p { margin: 0; color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-actions .spacer { flex: 1; }

/* Listen in der Verwaltung */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.list:empty { display: none; }
.row {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: center;
  padding: 10px 14px; background: var(--bg);
}
.row + .row { border-top: 1px solid var(--line); }
.row .name { font-weight: 600; overflow-wrap: anywhere; }
.row .sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 620px) { .row { grid-template-columns: 1fr; gap: 8px; } .row-actions { justify-content: flex-start; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .78rem; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.tag-ok { color: var(--ok); border-color: rgba(95, 211, 138, .5); }
.tag-off { color: var(--danger); border-color: rgba(255, 107, 94, .5); }
.tag-warn { color: var(--led); border-color: rgba(255, 178, 36, .5); }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

/* Kurze Meldung unten (z. B. «Gespeichert») */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); font-weight: 600; padding: 10px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #1a0705; }

/* Hintergründe der Textfolien: dieselben Klassen in Vorschau (Verwaltung) und Player */
.slide-dark { background: var(--bg); color: var(--ink); }
.slide-light { background: var(--ink); color: var(--bg); }
.slide-accent { background: var(--led); color: #1a1205; }
