/* =====================================================================
   Wertung – Design-System v2
   Gemeinsame Basis für Verwaltung, Juroren-Tablet und Anzeige.
   Pico CSS v2 liefert Reset und Grundformen; hier liegen Token,
   die Zuordnung auf Pico-Variablen und die Komponenten.
   Offline-first: keine Web-Fonts, System-Schriftstapel.
   ===================================================================== */

/* --- 1. Token: Farben, Light ----------------------------------------- */
:root:not([data-theme=dark]), [data-theme=light] {
  --w-primary: #1d4ed8;            /* kräftiges, sportliches Blau */
  --w-primary-bg: #1d4ed8;
  --w-primary-hover: #1e40af;
  --w-primary-hover-bg: #1e40af;
  --w-primary-soft: #dbeafe;
  --w-primary-strong: #1e3a8a;
  --w-on-primary: #ffffff;

  --w-success: #15803d;
  --w-success-strong: #14532d;
  --w-success-soft: #dcfce7;
  --w-warning: #b45309;
  --w-warning-strong: #78350f;
  --w-warning-soft: #fef3c7;
  --w-danger: #b91c1c;
  --w-danger-hover: #991b1b;
  --w-danger-strong: #7f1d1d;
  --w-danger-soft: #fee2e2;
  --w-info: #1d4ed8;
  --w-info-strong: #1e3a8a;
  --w-info-soft: #dbeafe;

  --w-gold: #b7791f;
  --w-silver: #64748b;
  --w-bronze: #9a5b2e;

  --w-bg: #f3f5f9;
  --w-surface: #ffffff;
  --w-surface-2: #f6f8fb;
  --w-surface-3: #eceff5;
  --w-text: #1b2230;
  --w-text-muted: #5b6474;
  --w-border: #dde2ea;
  --w-border-strong: #b8c1cf;
  --w-focus: rgba(29, 78, 216, .35);
  --w-focus-ring: #1d4ed8;

  --w-sidebar-bg: #14213d;
  --w-sidebar-text: #eef2f8;
  --w-sidebar-muted: #a7b3c9;
  --w-sidebar-line: rgba(255, 255, 255, .12);
  --w-sidebar-active: rgba(255, 255, 255, .12);
  --w-sidebar-accent: #7cb3ff;

  --w-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --w-shadow-md: 0 6px 18px rgba(16, 24, 40, .10);
  color-scheme: light;
}

/* --- 1b. Token: Farben, Dark ----------------------------------------- */
[data-theme=dark] {
  --w-primary: #7cb3ff;
  --w-primary-bg: #2563eb;
  --w-primary-hover: #a5c8ff;
  --w-primary-hover-bg: #1d4ed8;
  --w-primary-soft: rgba(124, 179, 255, .16);
  --w-primary-strong: #bfdbfe;
  --w-on-primary: #ffffff;

  --w-success: #4ade80;
  --w-success-strong: #bbf7d0;
  --w-success-soft: rgba(74, 222, 128, .14);
  --w-warning: #fbbf24;
  --w-warning-strong: #fde68a;
  --w-warning-soft: rgba(251, 191, 36, .14);
  --w-danger: #f87171;
  --w-danger-hover: #ef4444;
  --w-danger-strong: #fecaca;
  --w-danger-soft: rgba(248, 113, 113, .16);
  --w-info: #7cb3ff;
  --w-info-strong: #bfdbfe;
  --w-info-soft: rgba(124, 179, 255, .14);

  --w-gold: #fbbf24;
  --w-silver: #cbd5e1;
  --w-bronze: #d97706;

  --w-bg: #0f141b;
  --w-surface: #171e28;
  --w-surface-2: #1d2531;
  --w-surface-3: #242e3c;
  --w-text: #e6eaf0;
  --w-text-muted: #9aa4b2;
  --w-border: #2a3442;
  --w-border-strong: #3b4759;
  --w-focus: rgba(124, 179, 255, .45);
  --w-focus-ring: #7cb3ff;

  --w-sidebar-bg: #0b111c;
  --w-sidebar-text: #eef2f8;
  --w-sidebar-muted: #97a3b8;
  --w-sidebar-line: rgba(255, 255, 255, .10);
  --w-sidebar-active: rgba(255, 255, 255, .10);
  --w-sidebar-accent: #7cb3ff;

  --w-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --w-shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --w-primary: #7cb3ff;
    --w-primary-bg: #2563eb;
    --w-primary-hover: #a5c8ff;
    --w-primary-hover-bg: #1d4ed8;
    --w-primary-soft: rgba(124, 179, 255, .16);
    --w-primary-strong: #bfdbfe;
    --w-on-primary: #ffffff;

    --w-success: #4ade80;
    --w-success-strong: #bbf7d0;
    --w-success-soft: rgba(74, 222, 128, .14);
    --w-warning: #fbbf24;
    --w-warning-strong: #fde68a;
    --w-warning-soft: rgba(251, 191, 36, .14);
    --w-danger: #f87171;
    --w-danger-hover: #ef4444;
    --w-danger-strong: #fecaca;
    --w-danger-soft: rgba(248, 113, 113, .16);
    --w-info: #7cb3ff;
    --w-info-strong: #bfdbfe;
    --w-info-soft: rgba(124, 179, 255, .14);

    --w-gold: #fbbf24;
    --w-silver: #cbd5e1;
    --w-bronze: #d97706;

    --w-bg: #0f141b;
    --w-surface: #171e28;
    --w-surface-2: #1d2531;
    --w-surface-3: #242e3c;
    --w-text: #e6eaf0;
    --w-text-muted: #9aa4b2;
    --w-border: #2a3442;
    --w-border-strong: #3b4759;
    --w-focus: rgba(124, 179, 255, .45);
    --w-focus-ring: #7cb3ff;

    --w-sidebar-bg: #0b111c;
    --w-sidebar-text: #eef2f8;
    --w-sidebar-muted: #97a3b8;
    --w-sidebar-line: rgba(255, 255, 255, .10);
    --w-sidebar-active: rgba(255, 255, 255, .10);
    --w-sidebar-accent: #7cb3ff;

    --w-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --w-shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

/* --- 2. Token: Abstände, Radien, Typo-Skala (themenneutral) ---------- */
:root {
  --w-sp-1: .25rem;
  --w-sp-2: .5rem;
  --w-sp-3: .75rem;
  --w-sp-4: 1rem;
  --w-sp-5: 1.5rem;
  --w-sp-6: 2rem;
  --w-sp-8: 3rem;

  --w-radius-sm: .375rem;
  --w-radius-md: .5rem;
  --w-radius-lg: .75rem;
  --w-radius-xl: 1rem;

  --w-fs-xs: .78rem;
  --w-fs-sm: .875rem;
  --w-fs-md: 1rem;
  --w-fs-lg: 1.125rem;
  --w-fs-xl: 1.375rem;
  --w-fs-2xl: 1.75rem;
  --w-fs-3xl: 2.25rem;

  --w-touch: 2.75rem;          /* 44px Mindest-Touchziel */
  --w-touch-lg: 4rem;          /* 64px bevorzugt (Juror) */
}

/* --- 3. Zuordnung auf Pico-Variablen ---------------------------------
   Gleiche Spezifität wie Picos Theme-Blöcke, aber später geladen. */
:root:not([data-theme=dark]), :root:not([data-theme=light]) {
  --pico-font-size: 100%;
  --pico-line-height: 1.5;
  --pico-border-radius: var(--w-radius-md);
  --pico-spacing: 1rem;
  --pico-typography-spacing-vertical: .75rem;
  --pico-form-element-spacing-vertical: .55rem;
  --pico-form-element-spacing-horizontal: .8rem;
  --pico-nav-breadcrumb-divider: "›";

  --pico-background-color: var(--w-bg);
  --pico-color: var(--w-text);
  --pico-muted-color: var(--w-text-muted);
  --pico-muted-border-color: var(--w-border);
  --pico-h1-color: var(--w-text);
  --pico-h2-color: var(--w-text);
  --pico-h3-color: var(--w-text);
  --pico-h4-color: var(--w-text);
  --pico-h5-color: var(--w-text);
  --pico-h6-color: var(--w-text);

  --pico-primary: var(--w-primary);
  --pico-primary-background: var(--w-primary-bg);
  --pico-primary-border: var(--w-primary-bg);
  --pico-primary-underline: transparent;
  --pico-primary-hover: var(--w-primary-hover);
  --pico-primary-hover-background: var(--w-primary-hover-bg);
  --pico-primary-hover-border: var(--w-primary-hover-bg);
  --pico-primary-hover-underline: var(--w-primary-hover);
  --pico-primary-focus: var(--w-focus);
  --pico-primary-inverse: var(--w-on-primary);

  --pico-secondary: var(--w-text-muted);
  --pico-secondary-background: var(--w-surface);
  --pico-secondary-border: var(--w-border-strong);
  --pico-secondary-hover: var(--w-text);
  --pico-secondary-hover-background: var(--w-surface-2);
  --pico-secondary-hover-border: var(--w-border-strong);
  --pico-secondary-focus: var(--w-focus);
  --pico-secondary-inverse: var(--w-text);

  --pico-card-background-color: var(--w-surface);
  --pico-card-border-color: var(--w-border);
  --pico-card-box-shadow: var(--w-shadow-sm);
  --pico-card-sectioning-background-color: var(--w-surface-2);

  --pico-table-border-color: var(--w-border);
  --pico-table-row-stripped-background-color: var(--w-surface-2);

  --pico-form-element-background-color: var(--w-surface);
  --pico-form-element-border-color: var(--w-border-strong);
  --pico-form-element-color: var(--w-text);
  --pico-form-element-placeholder-color: var(--w-text-muted);
  --pico-form-element-active-background-color: var(--w-surface);
  --pico-form-element-active-border-color: var(--w-primary);
  --pico-form-element-focus-color: var(--w-focus);
  --pico-form-element-selected-background-color: var(--w-surface-2);
  --pico-switch-background-color: var(--w-border-strong);
  --pico-switch-checked-background-color: var(--w-primary-bg);

  --pico-accordion-border-color: var(--w-border);
  --pico-accordion-open-summary-color: var(--w-text);
  --pico-accordion-close-summary-color: var(--w-text);
  --pico-code-background-color: var(--w-surface-2);
  --pico-code-color: var(--w-text);
}

/* --- 4. Grundtypografie ---------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--w-bg);
  color: var(--w-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1 { font-size: var(--w-fs-2xl); line-height: 1.15; letter-spacing: -.015em; }
h2 { font-size: var(--w-fs-xl); line-height: 1.2; letter-spacing: -.01em; }
h3 { font-size: var(--w-fs-lg); line-height: 1.25; }
h4 { font-size: var(--w-fs-md); }
h1, h2, h3, h4 { margin-bottom: var(--w-sp-3); }
p { margin-bottom: var(--w-sp-3); }
small { font-size: var(--w-fs-sm); }
a { text-underline-offset: .15em; }

.muted { color: var(--w-text-muted); }
.num { font-variant-numeric: tabular-nums; }
.mono, .token { font-family: var(--pico-font-family-monospace); font-size: var(--w-fs-sm); }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Fokus: sichtbarer Ring, nur bei Tastatur/Touch-Fokus */
:where(a, button, [role=button], summary, [tabindex]):focus-visible {
  outline: 3px solid var(--w-focus-ring);
  outline-offset: 2px;
  border-radius: var(--w-radius-sm);
}

/* --- 5. Buttons ------------------------------------------------------- */
button, [role=button], [type=submit], [type=button], [type=reset] {
  font-weight: 600;
  font-size: var(--w-fs-sm);
  line-height: 1.35;
  min-height: 2.25rem;
  white-space: nowrap;
}
button[type=submit] { width: auto; }
.btn-block, button.btn-block { width: 100%; }
.btn-sm, button.btn-sm, [role=button].btn-sm {
  padding: .3rem .7rem; min-height: 1.9rem; font-size: var(--w-fs-xs);
}

/* Sekundär: hell mit Rahmen */
:is(button, [role=button], [type=submit], [type=button]).secondary {
  --pico-background-color: var(--w-surface);
  --pico-border-color: var(--w-border-strong);
  --pico-color: var(--w-text);
}
:is(button, [role=button], [type=submit], [type=button]).secondary:is(:hover, :active, :focus) {
  --pico-background-color: var(--w-surface-2);
  --pico-border-color: var(--w-border-strong);
  --pico-color: var(--w-text);
}
:is(button, [role=button], [type=submit], [type=button]).secondary.outline {
  --pico-background-color: transparent;
  --pico-border-color: var(--w-border-strong);
  --pico-color: var(--w-text);
}
:is(button, [role=button], [type=submit], [type=button]).secondary.outline:is(:hover, :active, :focus) {
  --pico-background-color: var(--w-surface-2);
}

/* Gefährlich: Schließen, Entfernen */
:is(button, [role=button], [type=submit], [type=button]).danger {
  --pico-background-color: var(--w-danger);
  --pico-border-color: var(--w-danger);
  --pico-color: #fff;
}
:is(button, [role=button], [type=submit], [type=button]).danger:is(:hover, :active, :focus) {
  --pico-background-color: var(--w-danger-hover);
  --pico-border-color: var(--w-danger-hover);
  --pico-color: #fff;
}
:is(button, [role=button], [type=submit], [type=button]).danger.outline {
  --pico-background-color: transparent;
  --pico-border-color: var(--w-danger);
  --pico-color: var(--w-danger);
}
:is(button, [role=button], [type=submit], [type=button]).danger.outline:is(:hover, :active, :focus) {
  --pico-background-color: var(--w-danger-soft);
  --pico-color: var(--w-danger);
}

/* Aktionsgruppe: Buttons/Formulare nebeneinander */
.actions { display: flex; flex-wrap: wrap; gap: var(--w-sp-2); align-items: center; }
.actions form { display: inline; margin: 0; }
.actions > a:not([role=button]) { font-size: var(--w-fs-sm); font-weight: 500; }

/* --- 6. Badges, Status, Chips ----------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .12em .6em; border-radius: 999px;
  font-size: var(--w-fs-xs); font-weight: 600; line-height: 1.6;
  white-space: nowrap; vertical-align: middle;
  background: var(--w-surface-3); color: var(--w-text-muted);
}
.badge-planned, .badge-neutral { background: var(--w-surface-3); color: var(--w-text-muted); }
.badge-open, .badge-yes, .badge-mail-sent, .badge-success {
  background: var(--w-success-soft); color: var(--w-success-strong);
}
.badge-closed, .badge-info { background: var(--w-info-soft); color: var(--w-info-strong); }
.badge-no, .badge-mail-failed, .badge-danger { background: var(--w-danger-soft); color: var(--w-danger-strong); }
.badge-warn, .badge-mail-pending { background: var(--w-warning-soft); color: var(--w-warning-strong); }
.badge--wrap { white-space: normal; }

/* Status: Punkt + Text (für längere Beschreibungen) */
.status { display: inline-flex; align-items: baseline; gap: .45em; font-size: var(--w-fs-sm); }
.status::before {
  content: ""; flex: none; width: .6em; height: .6em; border-radius: 50%;
  background: var(--w-border-strong); transform: translateY(-.05em);
}
.status--ok::before { background: var(--w-success); }
.status--warn::before { background: var(--w-warning); }
.status--bad::before { background: var(--w-danger); }
.status--neutral { color: var(--w-text-muted); }

/* Chips: Abgabestatus je Juror */
.chips { display: flex; flex-wrap: wrap; gap: var(--w-sp-2); margin: 0 0 var(--w-sp-4); }
.chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .35rem .8rem; border-radius: 999px;
  border: 1px solid var(--w-border); background: var(--w-surface-2);
  color: var(--w-text-muted); font-size: var(--w-fs-sm); font-weight: 600;
}
.chip::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: var(--w-border-strong); }
.chip--done { background: var(--w-success-soft); color: var(--w-success-strong); border-color: transparent; }
.chip--done::before { background: var(--w-success); }
.chip--open { border-style: dashed; }
.chip small { font-weight: 400; color: inherit; opacity: .8; }

/* --- 7. Hinweise, Fehler, Flash --------------------------------------- */
.error, .warn, .notice, .ok, .info {
  padding: .7rem 1rem; margin: var(--w-sp-2) 0 var(--w-sp-4);
  border: 1px solid; border-left-width: 4px; border-radius: var(--w-radius-md);
  font-size: var(--w-fs-sm);
}
.error { background: var(--w-danger-soft); color: var(--w-danger-strong); border-color: var(--w-danger); }
.warn { background: var(--w-warning-soft); color: var(--w-warning-strong); border-color: var(--w-warning); }
.notice, .ok { background: var(--w-success-soft); color: var(--w-success-strong); border-color: var(--w-success); }
.info { background: var(--w-info-soft); color: var(--w-info-strong); border-color: var(--w-info); }

/* Flash: auffällig, schließbar (PIN-Anzeige) */
.flash {
  display: flex; align-items: flex-start; gap: var(--w-sp-3);
  margin: 0 0 var(--w-sp-5); padding: var(--w-sp-4) var(--w-sp-5);
  border-radius: var(--w-radius-lg); border: 1px solid var(--w-success);
  background: var(--w-success-soft); color: var(--w-text); box-shadow: var(--w-shadow-md);
  font-size: var(--w-fs-md);
}
.flash__body { flex: 1; min-width: 0; }
.flash__close {
  flex: none; width: 2rem; height: 2rem; min-height: 0; margin: 0; padding: 0;
  border-radius: 50%; font-size: 1.1rem; line-height: 1;
  --pico-background-color: transparent; --pico-border-color: transparent;
  --pico-color: var(--w-text);
}
.flash__close:is(:hover, :focus) { --pico-background-color: rgba(0, 0, 0, .08); }
.pin-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--w-sp-3); margin-top: var(--w-sp-3); }
.pin {
  font-family: var(--pico-font-family-monospace);
  font-size: var(--w-fs-3xl); font-weight: 800; letter-spacing: .25em; line-height: 1;
  padding: .3em .35em .3em .55em; border-radius: var(--w-radius-md);
  background: var(--w-surface); border: 1px dashed var(--w-border-strong);
  user-select: all; color: var(--w-text);
}

/* --- 8. Karten, Sektionen, Seitenkopf --------------------------------- */
.card {
  background: var(--w-surface); border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg); box-shadow: var(--w-shadow-sm);
  padding: var(--w-sp-4) var(--w-sp-5); margin-bottom: var(--w-sp-4);
}
.card--tight { padding: var(--w-sp-3) var(--w-sp-4); }
.card__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--w-sp-3); margin-bottom: var(--w-sp-3);
}
.card__title { margin: 0; font-size: var(--w-fs-lg); }
.card > :last-child { margin-bottom: 0; }

.section { margin-top: var(--w-sp-6); }
.section__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--w-sp-3); margin-bottom: var(--w-sp-3);
}
.section__head h2 { margin: 0; }
.section__head .muted { font-size: var(--w-fs-sm); }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: var(--w-sp-3) var(--w-sp-5); margin-bottom: var(--w-sp-5);
}
.page-head__title { margin: 0 0 var(--w-sp-1); display: flex; flex-wrap: wrap; align-items: center; gap: var(--w-sp-3); }
.page-head__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--w-sp-2);
  margin: 0; color: var(--w-text-muted); font-size: var(--w-fs-sm);
}
.page-head__meta .sep { opacity: .5; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--w-sp-2); align-items: center; }
.page-head__actions form { margin: 0; }

.empty {
  padding: var(--w-sp-6) var(--w-sp-4); text-align: center; color: var(--w-text-muted);
  border: 1px dashed var(--w-border-strong); border-radius: var(--w-radius-lg);
  margin-bottom: var(--w-sp-4);
}
.empty p { margin: 0 0 var(--w-sp-3); }

/* Breadcrumb */
nav.crumbs { margin-bottom: var(--w-sp-3); }
nav.crumbs ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0;
  margin: 0; padding: 0; list-style: none; font-size: var(--w-fs-sm); color: var(--w-text-muted);
}
nav.crumbs li { display: inline-flex; align-items: center; margin: 0; padding: 0; }
nav.crumbs li + li::before { content: "›"; margin: 0 .5em; color: var(--w-text-muted); }
nav.crumbs a { margin: 0; padding: 0; color: var(--w-text-muted); text-decoration: none; }
nav.crumbs a:hover { color: var(--w-primary); text-decoration: underline; }
nav.crumbs [aria-current] { color: var(--w-text); font-weight: 600; }

/* --- 9. Tabellen ------------------------------------------------------ */
.table-card {
  background: var(--w-surface); border: 1px solid var(--w-border);
  border-radius: var(--w-radius-lg); box-shadow: var(--w-shadow-sm);
  margin-bottom: var(--w-sp-4);
}
.table-card--scroll { overflow-x: auto; }
.table-card > table { margin: 0; }
table.compact, table.matrix {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: var(--w-fs-sm);
}
table.compact th, table.compact td { padding: .5rem .75rem; vertical-align: middle; }
table.compact th:first-child, table.compact td:first-child,
table.matrix th:first-child, table.matrix td:first-child { padding-left: 1rem; }
table.compact th:last-child, table.compact td:last-child,
table.matrix th:last-child, table.matrix td:last-child { padding-right: 1rem; }
table.compact thead th, table.matrix thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--w-surface-2); color: var(--w-text-muted);
  font-size: var(--w-fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; border-bottom: 1px solid var(--w-border);
}
table.compact thead th:first-child { border-top-left-radius: var(--w-radius-lg); }
table.compact thead th:last-child { border-top-right-radius: var(--w-radius-lg); }
table.compact tbody td, table.matrix tbody td { border-bottom: 1px solid var(--w-border); }
table.compact tbody tr:nth-child(even) td, table.matrix tbody tr:nth-child(even) td { background: var(--w-surface-2); }
table.compact tbody tr:hover td, table.matrix tbody tr:hover td { background: var(--w-primary-soft); }
table.compact tbody tr:last-child td, table.matrix tbody tr:last-child td { border-bottom: 0; }
table.compact td.actions, table.compact td.judge-actions { white-space: nowrap; }
td.num, th.num { font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }

/* Wertungsmatrix */
table.matrix th, table.matrix td { text-align: center; padding: .45rem .55rem; font-variant-numeric: tabular-nums; }
table.matrix td.entry, table.matrix th.entry { text-align: left; }
table.matrix td:first-child { font-weight: 700; }
.discarded { color: var(--w-text-muted); text-decoration: line-through; opacity: .55; }
.total { font-weight: 700; }
td.rank { font-weight: 800; font-size: var(--w-fs-md); }

/* --- 10. Formulare ---------------------------------------------------- */
label { font-size: var(--w-fs-sm); font-weight: 500; }
input:not([type=checkbox], [type=radio]), select, textarea { font-size: var(--w-fs-md); }
.help { display: block; margin-top: .3rem; font-size: var(--w-fs-xs); color: var(--w-text-muted); font-weight: 400; }
.form-grid {
  display: grid; gap: var(--w-sp-3) var(--w-sp-4);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end; margin: 0 0 var(--w-sp-3);
}
.form-grid label { margin-bottom: 0; }
.form-grid input, .form-grid select { margin-bottom: 0; }
.form-grid .form-grid__actions { display: flex; gap: var(--w-sp-2); align-items: center; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--w-sp-2); align-items: center; margin-top: var(--w-sp-3); }
.form-stack { max-width: 32rem; }
.form-stack label { margin-bottom: var(--w-sp-3); }
.check { display: flex; align-items: center; gap: .55rem; font-size: var(--w-fs-md); font-weight: 500; }
.check input { margin: 0; }
fieldset { margin-bottom: 0; }

/* Zahleneingabe kompakt (Platzziffern, Gewichte) */
input.input-num { width: 6rem; margin: 0; text-align: center; font-variant-numeric: tabular-nums; }

/* --- 11. Podium ------------------------------------------------------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--w-sp-3); align-items: end; margin-bottom: var(--w-sp-5); }
.podium__step {
  text-align: center; padding: var(--w-sp-4) var(--w-sp-3);
  background: var(--w-surface); border: 1px solid var(--w-border);
  border-top: 4px solid var(--w-silver); border-radius: var(--w-radius-lg); box-shadow: var(--w-shadow-sm);
}
.podium__step--1 { order: 2; border-top-color: var(--w-gold); padding-top: var(--w-sp-6); }
.podium__step--2 { order: 1; }
.podium__step--3 { order: 3; border-top-color: var(--w-bronze); }
.podium__rank { font-size: var(--w-fs-3xl); font-weight: 800; line-height: 1; }
.podium__step--1 .podium__rank { color: var(--w-gold); }
.podium__step--2 .podium__rank { color: var(--w-silver); }
.podium__step--3 .podium__rank { color: var(--w-bronze); }
.podium__num { display: inline-block; margin: var(--w-sp-2) 0 var(--w-sp-1); font-size: var(--w-fs-sm); color: var(--w-text-muted); }
.podium__name { font-weight: 700; }
.podium__club { font-size: var(--w-fs-sm); color: var(--w-text-muted); }
@media (max-width: 600px) {
  .podium { grid-template-columns: 1fr; }
  .podium__step--1, .podium__step--2, .podium__step--3 { order: initial; padding-top: var(--w-sp-4); }
}

/* --- 12. Zentrierte Einzelseiten (Login, Fehler) ---------------------- */
.centered-page { min-height: 100vh; display: grid; place-items: center; padding: var(--w-sp-5) var(--w-sp-4); }
.centered-card {
  width: 100%; max-width: 24rem; padding: var(--w-sp-6) var(--w-sp-6) var(--w-sp-5);
  background: var(--w-surface); border: 1px solid var(--w-border);
  border-radius: var(--w-radius-xl); box-shadow: var(--w-shadow-md);
}
.centered-card h1 { font-size: var(--w-fs-xl); margin-bottom: var(--w-sp-4); }
.centered-card .brand { justify-content: center; margin-bottom: var(--w-sp-5); }
.centered-card .brand__name { color: var(--w-text); }
.error-code { font-size: var(--w-fs-3xl); font-weight: 800; color: var(--w-text-muted); line-height: 1; margin-bottom: var(--w-sp-2); }

/* Wortmarke (Sidebar, Login, Fehlerseite) */
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; font-weight: 800; font-size: var(--w-fs-lg); letter-spacing: -.01em;
}
.brand__mark {
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
  border-radius: .55rem; background: var(--w-primary-bg); color: #fff; flex: none;
}
.brand__mark svg { width: 1.25rem; height: 1.25rem; display: block; }
.brand__name { line-height: 1; }

/* Bewegung nur, wenn erwünscht */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* Verbindungsstatus der Juroren-Tablets (Presence) */
.chip--online::before { background: var(--w-success); box-shadow: 0 0 0 3px var(--w-success-soft); }
.chip--open:not(.chip--online) { opacity: .75; }
.chip small { font-weight: normal; color: var(--w-text-muted); margin-left: .25em; }
