/* ===========================================================================
   WüM-Einteilung – Board im Admin-Bereich (admin/wuem_einteilung.php) und
   öffentliche Listen (wuem-einteilung.php). Ergänzt assets/style.css und
   benutzt dessen Farbvariablen; alle Klassen tragen das Kürzel „we-“, damit
   nichts mit style.css zusammenstößt.

   Systemschrift wie überall im Portal – keine Webfonts (Besucher-IPs gingen
   sonst an Google).
   =========================================================================== */

:root {
    --we-D: #b0306a; --we-D-bg: #fbe9f1;
    --we-H: #163a8a; --we-H-bg: #e9f0fb;
    --we-M: #6b3fa0; --we-M-bg: #f1eafa;
    --we-V: #1d7a46; --we-V-bg: #e7f5ee;
}

/* ---- Kacheln der Listen (beide Seiten) -----------------------------------
   Zwei feste Zeilen (Wunsch des Sportwarts, 26.09.2026): oben Junioren und
   die Aktiven, darunter die Senioren. Die Senioren-Kachel beginnt deshalb
   immer eine neue Zeile, auch wenn die erste auf schmalen Bildschirmen
   umbricht. */
.we-kacheln { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
@media (max-width: 1000px) { .we-kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .we-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.we-kachel--zeile2 { grid-column-start: 1; }
.we-kachel { display: block; text-decoration: none; color: var(--ink); background: var(--soft);
             border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; }
.we-kachel:hover { border-color: var(--blue); }
.we-kachel.is-aktiv { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.we-kachel--folgt:not(.is-aktiv) { opacity: .65; }
.we-kachel__t { display: block; font-weight: 700; }
.we-kachel__d { display: block; font-size: .78rem; opacity: .85; font-variant-numeric: tabular-nums; }
.we-kachel__z { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: .78rem; }
.we-pill { font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 0 7px; background: var(--line); color: var(--muted); }
.we-pill--oeff  { background: var(--ok-bg); color: var(--ok); }
.we-pill--offen { background: var(--err-bg); color: var(--err); }
.we-kachel.is-aktiv .we-pill { background: rgb(var(--on-accent-rgb) / .2); color: var(--on-accent); }
/* Seit 0.380: „neu“ / „Update“ – auch auf der aktiven Kachel in Bernstein, sonst ginge es dort unter. */
.we-pill--neu, .we-kachel.is-aktiv .we-pill--neu { background: var(--warn-bg); color: var(--warn); }

/* Seit 0.380: geänderte Angaben der letzten Tage (WUEM_EL_MARKIERT_TAGE) */
.we-geaendert { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; padding: 9px 12px;
                background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px;
                color: var(--warn); font-size: .88rem; line-height: 1.45; }
.we-geaendert svg { flex: none; margin-top: 2px; }
mark.we-neu { background: var(--warn-bg); color: inherit; border-radius: 3px; padding: 0 3px;
              box-shadow: inset 0 -2px 0 var(--warn-line); }
.we-st tr.is-neu td.we-nr { background: var(--warn-bg); color: var(--warn); }

/* ---- Board (Admin) ------------------------------------------------------- */
.we-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.we-bar__luft { flex: 1; }
.we-stand { font-size: .85rem; font-weight: 600; color: var(--ok); }
.we-stand--offen { color: var(--warn); }
.we-board { display: grid; gap: 12px; align-items: start; }
@media (max-width: 1150px) { .we-board { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 640px)  { .we-board { grid-template-columns: 1fr !important; } }
.we-col { border: 1px solid var(--line); border-radius: 12px; background: var(--soft); display: flex; flex-direction: column; min-height: 160px; min-width: 0; }
.we-col--pool { background: var(--hover); border-style: dashed; border-color: var(--line-strong); }
.we-col.is-over { outline: 2px solid var(--ok); outline-offset: -2px; background: var(--ok-bg); }
.we-col__kopf { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.we-col__titel { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.we-col__titel strong { color: var(--blue-dark); }
.we-col__zahl { font-weight: 700; font-size: .88rem; font-variant-numeric: tabular-nums; }
.we-col__sub { font-size: .78rem; color: var(--muted); }
.we-col__mix { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.we-col__tools { margin-top: 6px; }
.we-col__liste { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 60px; }
.we-grp { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 6px 2px 0; }
.we-grp:first-child { margin-top: 0; }
.we-leer { color: var(--muted); font-size: .85rem; text-align: center; padding: 18px 6px; }
.we-marker { height: 3px; background: var(--ok); border-radius: 2px; margin: -2px 0; }

.we-chip { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--we-H); border-radius: 8px;
           padding: 6px 8px; display: grid; grid-template-columns: 1fr auto; gap: 6px; cursor: grab; font-size: .86rem; }
.we-chip.is-drag { opacity: .4; }
.we-chip.we-t-D { border-left-color: var(--we-D); }
.we-chip.we-t-M { border-left-color: var(--we-M); }
.we-chip.we-t-V { border-left-color: var(--we-V); }
.we-chip__kopf { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.we-chip__act { display: flex; flex-direction: column; gap: 3px; }
.we-pos { color: var(--muted); font-weight: 700; min-width: 1.3em; font-variant-numeric: tabular-nums; }
.we-kl { font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--we-H-bg); color: var(--we-H); }
.we-t-D .we-kl { background: var(--we-D-bg); color: var(--we-D); }
.we-t-M .we-kl { background: var(--we-M-bg); color: var(--we-M); }
.we-t-V .we-kl { background: var(--we-V-bg); color: var(--we-V); }
.we-wunsch { font-size: .72rem; padding: 1px 6px; border-radius: 5px; background: var(--bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.we-wunsch--daneben { background: var(--err-bg); color: var(--err); font-weight: 700; }
.we-namen { font-weight: 600; margin-top: 2px; }
.we-namen span { display: block; }
.we-ers { font-weight: 400; color: var(--muted); }
.we-mini { border: 1px solid var(--line-strong); background: var(--card); color: var(--blue); border-radius: 5px; font-size: .72rem;
           padding: 0 5px; min-width: 24px; line-height: 18px; cursor: pointer; font-variant-numeric: tabular-nums; }
.we-mini:hover { background: var(--info-bg); }
.we-mini--x { color: var(--err); }
.we-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: .82rem; color: var(--muted); }

.we-felder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; margin-top: 12px; }
.we-felder--zwei { grid-template-columns: 1fr 1fr; margin-top: 16px; }
@media (max-width: 900px) { .we-felder { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .we-felder, .we-felder--zwei { grid-template-columns: 1fr; } }
.we-termine { width: 100%; border-collapse: collapse; min-width: 640px; }
.we-termine th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 4px 6px; }
.we-termine td { padding: 3px 6px; }
.we-termine td:first-child { font-weight: 700; color: var(--blue-dark); white-space: nowrap; }
.we-termine__neu td { border-top: 1px solid var(--line); padding-top: 8px; }
.we-oeff { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.we-oeff .check { align-items: center; font-weight: 600; }
.we-oeff .check input { margin-top: 0; }

.we-toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(20px); z-index: 50;
            background: var(--ink); color: var(--on-accent); padding: 9px 16px; border-radius: 9px; opacity: 0; pointer-events: none;
            transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); }
.we-toast.is-an { opacity: 1; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { .we-toast { transition: none; } }

/* ---- Öffentliche Seite --------------------------------------------------
   Wie die Ergebnisse der Ligaspieltage auf das Handy ausgelegt: Tabellen
   legen dort ihre Spalten zu Zeilen zusammen, statt seitwärts zu rutschen. */
.we-seite { max-width: 1060px; margin: 0 auto; }
.we-suche { margin-top: 16px; }
.we-suche__label { display: block; font-weight: 700; margin-bottom: 4px; }
.we-suche input { width: 100%; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; }
.we-treffer { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.we-treffer a { display: block; background: var(--info-bg); border-radius: 9px; padding: 8px 12px; color: var(--ink); text-decoration: none; }
.we-treffer a:hover { background: var(--info-bg-strong); }
.we-treffer b { color: var(--blue-dark); }
.we-treffer small { display: block; color: var(--muted); }
.we-treffer__nichts { background: var(--soft); border-radius: 9px; padding: 8px 12px; color: var(--muted); }

.we-lkopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 20px; flex-wrap: wrap; }
.we-lkopf h2 { font-size: 1.35rem; margin: 0; }
.we-lkopf__sub { color: var(--muted); }
.we-lkopf__stand { font-size: .8rem; color: var(--muted); }
/* Stand und PDF-Knopf (seit 0.362) rechts untereinander, auf dem Handy links. */
.we-lkopf__rechts { display: grid; justify-items: end; gap: 6px; }
@media (max-width: 560px) { .we-lkopf__rechts { justify-items: start; } }
.we-pdf { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.we-eck { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin: 16px 0 4px; padding: 12px 14px;
          background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
/* Kopf der Einteilungsliste (seit 0.376): Spalten so breit wie ihr Inhalt, der
   Rest gleich verteilt – „6 Spiele“ und das Datum brauchen wenig, das Ölbild
   soll in eine Zeile passen. Info-Seite und Zettel behalten das feste Raster. */
.we-eck--kopf { display: flex; flex-wrap: wrap; column-gap: 32px; }
.we-eck--kopf > div { flex: 1 1 auto; min-width: 0; }
@media (max-width: 760px) { .we-eck, .we-eck--kopf { display: grid; grid-template-columns: 1fr 1fr; } }
.we-eck dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.we-eck dd { margin: 0; font-weight: 600; }
/* Ölbild mit Link (seit 0.374): unterstrichen, damit man sieht, dass es klickbar ist */
.we-eck dd a, .we-kasten__oel a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.we-oel-ende { white-space: nowrap; }
.we-oel-ende::after { content: "\2197"; margin-left: .2em; font-size: .85em; text-decoration: none; display: inline-block; }

.we-gruppe { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.we-gruppe__kopf { background: var(--blue-dark); color: var(--on-accent); padding: 9px 14px; display: flex; flex-wrap: wrap;
                   justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.we-gruppe__name { font-weight: 700; font-size: 1.02rem; }
.we-gruppe__anz { font-size: .8rem; opacity: .8; font-variant-numeric: tabular-nums; }
.we-gruppe__termine { background: var(--soft); border-bottom: 1px solid var(--line); padding: 7px 14px; display: grid; gap: 2px; font-size: .9rem; }
.we-gruppe__termine b { color: var(--blue-dark); }
.we-gruppe__termine span { color: var(--muted); }

.we-st { width: 100%; border-collapse: collapse; font-size: .92rem; }
.we-st th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left;
            padding: 7px 10px; border-bottom: 1px solid var(--line); }
.we-st td { padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.4; }
.we-st tr:last-child td { border-bottom: 0; }
.we-st tr.is-hl td { background: #fff4c7; }
.we-nr { width: 2.4em; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.we-name { font-weight: 600; }
.we-edv, .we-verein { color: var(--muted); font-variant-numeric: tabular-nums; }
.we-edv { white-space: nowrap; font-size: .85em; }
/* Einzellisten in zwei Hälften nebeneinander (we_tabelle), schmaler untereinander.
   Name und Verein passen auf eine Zeile, weil we_tabelle zu lange Gruppen
   einspaltig lässt; die Breitengrenze hier und die Zeichengrenze dort hängen
   zusammen – wer eine ändert, misst neu. Bewusst kein nowrap: Verschätzt sich
   die Grenze, bricht eine Zeile um, statt in die rechte Hälfte zu ragen. */
.we-halb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.we-halb > .we-st + .we-st { border-left: 1px solid var(--line); }
@media (min-width: 1081px) {
    .we-halb .we-st th, .we-halb .we-st td { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 1080px) {
    .we-halb { grid-template-columns: minmax(0, 1fr); }
    .we-halb > .we-st + .we-st { border-left: 0; border-top: 1px solid var(--line); }
}
/* Untereinander sollen die Hälften wie eine Tabelle wirken: gleiche, feste
   Spaltenbreiten statt je eigener, und die zweite Kopfzeile nur optisch weg –
   der Screenreader nennt die Spalten weiter. Unter 700 px gilt die
   Zeilenansicht weiter unten. */
@media (min-width: 701px) and (max-width: 1080px) {
    .we-halb .we-st { table-layout: fixed; }
    .we-halb .we-st :is(th, td):first-child { width: 2.4rem; }
    .we-halb .we-st :is(th, td):nth-child(2):nth-last-child(3) { width: 8rem; }
    .we-halb .we-st :is(th, td):last-child { width: 42%; }
    /* Auf null Höhe gefaltet statt ausgeblendet: Die feste Tabellenberechnung
       liest die Breiten aus dieser ersten Zeile. */
    .we-halb > .we-st + .we-st th { font-size: 0; line-height: 0; padding-top: 0; padding-bottom: 0; border: 0; }
}
@media (max-width: 700px) {
    .we-st thead { display: none; }
    .we-st, .we-st tbody, .we-st tr, .we-st td { display: block; width: 100%; }
    .we-st tr { position: relative; padding: 8px 12px 8px 44px; border-bottom: 1px solid var(--line); }
    .we-st tr:last-child { border-bottom: 0; }
    .we-st td { border: 0; padding: 1px 0; }
    .we-st td.we-nr { position: absolute; left: 12px; top: 8px; width: auto; }
}

.we-kasten { border-radius: 10px; padding: 10px 14px; margin-top: 16px; }
.we-kasten h3 { margin: 0 0 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.we-kasten--gruen { background: var(--ok-bg); border: 1px solid var(--ok-line); }
.we-kasten__oel { margin-top: 4px; }
/* Finale und DM nebeneinander; steht nur einer da, nimmt er die ganze Breite. */
.we-kaesten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-top: 16px; }
.we-kaesten > .we-kasten { margin-top: 0; }
.we-kasten--rot { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err); font-weight: 600; }
.we-folgt { text-align: center; padding: 30px 16px; color: var(--muted); }
.we-folgt strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }
.we-fuss { text-align: center; color: var(--muted); font-size: .88rem; margin: 6px 0 24px; }
