/* teamfilz Redesign: Design-Tokens und Basis-Komponenten (Quelle: docs/redesign/tokens.css) */

/* Selbst gehostet statt Google-Fonts-CDN (DSGVO: keine IP-Übertragung an Google).
   Nur latin-Subset — deckt Deutsch inkl. Umlaute/ß ab. Lizenz: SIL OFL 1.1 (fonts/OFL-*.txt). */
/* Archivo ist die einzige Schrift: Fließtext/UI in Breite 100 %, Überschriften schmal
   (--tf-stretch-head), Schriftzug und Anzeigetafel noch schmaler (--tf-font-brand). */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(/fonts/archivo-latin-var.woff2) format('woff2');
}


:root, [data-theme="hartplatz"] {
  /* Farben */
  --tf-night: #13244A;        /* Header, Primärtext, dunkle Flächen */
  --tf-court: #2F5FAF;        /* Hartplatz-Blau: Links, Platzfläche im Logo */
  --tf-court-surround: #234885; /* Umrandung des Platzes im Logo (Logo-Update F2) */
  --tf-clay: #B4532A;         /* Sandplatz: Trainings (Kontrast zu Weiß 5:1) */
  --tf-ball: #E4F64A;         /* Filzball-Gelb: Primär-CTA, aktive Zustände */
  --tf-chalk: #F3F5F8;        /* Kreide: App-Hintergrund, kühl wie die Platzlinien (vorher warmes #F4F2EA) */
  --tf-white: #FFFFFF;        /* Karten, Platzlinien */
  --tf-board: #1B1B1B;        /* Anzeigetafel-Kacheln */
  --tf-board-on-night: #0B1530; /* Kacheln auf Nachtblau */
  --tf-footer: #0E1B3A;
  /* Logo-Platz: eigene Werte, weil das Logo-Grün/-Orange nicht immer der UI-Farbe entspricht.
     Quelle für scripts/generate_theme_logos.mjs (logo/themes/<id>/*.svg). */
  --tf-logo-court: #2F5FAF;
  --tf-logo-surround: #234885;
  /* Terminarten (Datumskachel, Kalender-Chip, Art-Label): je Theme unterscheidbar halten */
  --tf-kind-training: var(--tf-clay);
  --tf-kind-match: var(--tf-night);
  --tf-kind-team: var(--tf-court);

  --tf-text: #13244A;
  --tf-text-2: #3B4560;
  --tf-muted: #5B6478;
  --tf-on-dark: #FFFFFF;
  --tf-on-dark-2: #C9D6EE;
  --tf-on-dark-3: #A9C2EC;

  --tf-border: #D8DEE7;
  --tf-divider: #E9EDF3;
  --tf-divider-2: #DFE4EC;

  /* Status */
  --tf-yes-bg: #DCEFE3;  --tf-yes-fg: #1D6B43;
  --tf-open-bg: #ECEFF4; --tf-open-fg: #5B6478;
  --tf-no-bg: #F6DED8;   --tf-no-fg: #9A3220;
  --tf-no-on-dark: #FF8F7A; /* Warnpunkt auf Nachtblau (--tf-no-fg wäre dort zu dunkel) */
  --tf-info-bg: #E8EEF9; --tf-info-fg: #2F5FAF;
  --tf-warn-bg: #FBF3D5; --tf-warn-fg: #7A5800; --tf-warn-border: #E9D48A; /* Hinweis, SpielerPlus, ausstehend; Kontrast fg auf bg 5,8:1 */

  /* Schrift */
  --tf-font: 'Archivo', system-ui, sans-serif;
  --tf-stretch-head: 80%;     /* Überschriften: schmale Archivo-Breite */
  --tf-font-brand: 'Archivo', system-ui, sans-serif; /* Schriftzug "teamfilz" + Anzeigetafel */

  /* Radien */
  --tf-r-chip: 8px;
  /* Schriftgrößen-Skala: Mindestgröße 12px; nur diese Werte nutzen (Test: design-tokens.test.mjs) */
  --tf-fs-xs: 12px; --tf-fs-sm: 14px; --tf-fs-md: 16px; --tf-fs-lg: 18px; --tf-fs-xl: 22px; --tf-fs-2xl: 30px; --tf-fs-3xl: 34px;
  --tf-r-control: 12px;
  --tf-r-cta: 14px;
  --tf-r-card: 16px;
  --tf-r-card-lg: 20px;

  /* Abstände */
  --tf-gutter: 16px;          /* Inhalt links/rechts */
  --tf-header-pad: 20px;      /* Header links/rechts */
  --tf-nav-h: 84px;           /* untere Navigation */
  --tf-touch: 44px;           /* Mindesthöhe für Bedienelemente */

}

/* ── Platz-Themes ──────────────────────────────────────────────────────────────
   Der Ball bleibt gelb, nur der Platz wechselt: --tf-ball (CTA, aktive Zustände), Weiß, Status-
   Farben (yes/no/warn) und die Typografie sind in jedem Theme gleich. Hier stehen nur die
   Überschreibungen der Defaults (= "hartplatz"). Auswahl: <html data-theme="…">, gesetzt von
   js/theme-boot.js (vor dem ersten Paint) und js/themes.js. Der Selektor gilt für jedes Element,
   damit die Vorschau-Kacheln unter "Darstellung" ihr Theme lokal tragen. Im UI nur Namen von
   Platzbelägen, keine Turniernamen. Kontrast-Pflicht: tests/theme-contrast.test.mjs. */

/* Rasen: angelehnt an das Farbsystem von wimbledon.com (Stand 10/2026):
   Kopf #0B2917, Markengrün #006633, Violett #540082, Dunkelviolett #240330, Gold #816C3C,
   kühles Grau #F2F4F8 als Fläche, Text #121619 / #697077 */
[data-theme="rasen"] {
  --tf-night: #0B2917;  --tf-court: #006633;  --tf-court-surround: #00331A;
  --tf-chalk: #F2F4F8;  --tf-board-on-night: #240330;  --tf-footer: #00331A;
  --tf-logo-court: #006633;  --tf-logo-surround: #540082;
  --tf-kind-training: #816C3C;  --tf-kind-match: #0B2917;  --tf-kind-team: #540082;
  --tf-text: #121619;  --tf-text-2: #3E454B;  --tf-muted: #697077;
  --tf-on-dark-2: #D3F0E0;  --tf-on-dark-3: #B5D6C4;
  --tf-border: #DDE1E6;  --tf-divider: #E4E9F1;  --tf-divider-2: #DDE1E6;
  --tf-open-bg: #F2F4F8;  --tf-open-fg: #697077;
  --tf-info-bg: #EDE7FF;  --tf-info-fg: #540082;
}

/* Sand: angelehnt an das Farbsystem von rolandgarros.com (Stand 10/2026):
   Ziegelmehl-Orange #CC4E0E / #AB3D16, Grün #00503C, FFT-Dunkelgrün #033629,
   Fläche #FAFAFA, Text #242424 / #6E6E6E. Kopf orange, Anzeigetafel grün wie das Logo */
[data-theme="sand"] {
  --tf-night: #BA4710;  --tf-court: #00503C;  --tf-court-surround: #033629;
  --tf-chalk: #FAFAFA;  --tf-board-on-night: #00503C;  --tf-footer: #033629;
  --tf-logo-court: #CC4E0E;  --tf-logo-surround: #00503C;
  --tf-kind-training: #AB3D16;  --tf-kind-match: #033629;  --tf-kind-team: #4D4D4D;
  --tf-text: #242424;  --tf-text-2: #4D4D4D;  --tf-muted: #6E6E6E;
  --tf-on-dark-2: #FFFFFF;  --tf-on-dark-3: #FFF1E8;
  --tf-no-on-dark: #FFD9C7;
  --tf-border: #E1E1E1;  --tf-divider: #F3F3F3;  --tf-divider-2: #E8E8E8;
  --tf-open-bg: #F3F3F3;  --tf-open-fg: #6E6E6E;
  --tf-info-bg: #EBF6F3;  --tf-info-fg: #00503C;
}

/* Blauer Hartplatz: angelehnt an das Farbsystem von ausopen.com (Stand 10/2026):
   Petrolblau #003A5D für dunkle Flächen, Link-Blau #0073B2, leuchtendes Platz-Blau #0091D2,
   Hellblau #D9EAF3, neutrale Flächen #F2F2F2, Text #333333 / #696969 */
[data-theme="blau"] {
  --tf-night: #003A5D;  --tf-court: #0073B2;  --tf-court-surround: #005A8C;
  --tf-chalk: #F2F2F2;  --tf-board-on-night: #0073B2;  --tf-footer: #002A44;
  --tf-logo-court: #0091D2;  --tf-logo-surround: #003A5D;
  --tf-kind-match: #003A5D;  --tf-kind-team: #0073B2;
  --tf-text: #333333;  --tf-text-2: #4D4D4D;  --tf-muted: #696969;
  --tf-on-dark-2: #D9EAF3;  --tf-on-dark-3: #A9CFE6;
  --tf-border: #DDDDDD;  --tf-divider: #EEEEEE;  --tf-divider-2: #E3E3E3;
  --tf-open-bg: #EEEEEE;  --tf-open-fg: #696969;
  --tf-info-bg: #D9EAF3;  --tf-info-fg: #005A8C;
}

/* Padel: Türkis-Teal */
[data-theme="padel"] {
  --tf-night: #0D3940;  --tf-court: #0E7570;  --tf-court-surround: #0C6360;
  --tf-chalk: #EEF4F2;  --tf-board-on-night: #08262B;  --tf-footer: #082C32;
  --tf-logo-court: #1A9A94;  --tf-logo-surround: #0E6E6A;
  --tf-text: #0D3940;  --tf-text-2: #34504F;  --tf-muted: #4F6A69;
  --tf-on-dark-2: #C5E4E2;  --tf-on-dark-3: #92CFCA;
  --tf-border: #CBDAD6;  --tf-divider: #E5EFEC;  --tf-divider-2: #D6E3DF;
  --tf-open-bg: #E5EFEC;  --tf-open-fg: #4F6A69;
  --tf-info-bg: #DFF1EF;  --tf-info-fg: #0C6360;
}

/* Browser-Standard wäre 700; erlaubt sind nur 400/600/800 (Test: design-tokens.test.mjs) */
/* Browser-Standard wäre 700; erlaubt sind nur 400/600/800 (Test: design-tokens.test.mjs) */
strong, b, th { font-weight: 600; }
h4, h5, h6 { font-weight: 600; }
body { margin: 0; background: var(--tf-chalk); color: var(--tf-text); font-family: var(--tf-font); }
a { color: var(--tf-court); }

/* Typografie */
.tf-h1 { margin: 0; font-size: var(--tf-fs-3xl); font-weight: 800; font-stretch: var(--tf-stretch-head); letter-spacing: 0; }
.tf-h2 { margin: 0; font-size: var(--tf-fs-lg); font-weight: 800; font-stretch: var(--tf-stretch-head); letter-spacing: 0; }
.tf-display { font-weight: 800; letter-spacing: -3px; line-height: 0.98; }
.tf-label { font-family: var(--tf-font); font-weight: 600; font-size: var(--tf-fs-sm); letter-spacing: 0; color: var(--tf-text-2); }
/* Anzeigetafel-Stimme: Großbuchstaben nur auf der Startkarte "Nächstes Spiel" und im Liga-Board */
.tf-label--board { font-size: var(--tf-fs-xs); letter-spacing: 0.6px; text-transform: uppercase; color: var(--tf-muted); }
.tf-meta { font-size: var(--tf-fs-xs); color: var(--tf-muted); }

/* Header: einfarbig Nachtblau (Platzlinien entfallen mit dem Logo-Update; das Logo zeigt den Platz) */
.tf-header { position: relative; overflow: hidden; background: var(--tf-night); color: var(--tf-on-dark); padding: 12px var(--tf-header-pad) 16px; }
.tf-header > * { position: relative; }

/* Anzeigetafel-Kachel: Zahlen, Platzierungen, Positionen */
.tf-tile {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 40px; border-radius: 5px;
  background: var(--tf-board); color: #fff;
  font-family: var(--tf-font-brand); font-weight: 800; font-stretch: 65%; font-size: 30px; line-height: 1;
}
.tf-tile::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 0.75px); height: 1.5px; background: #000; opacity: 0.5; }
.tf-tile--sm { width: 22px; height: 30px; font-size: 20px; }
.tf-tile--lg { width: 56px; height: 76px; font-size: 62px; border-radius: 8px; }
.tf-tile--on-night { background: var(--tf-board-on-night); }
.tf-tile--ball { background: var(--tf-ball); color: #111; }
.tf-tile--doubles { width: 34px; background: var(--tf-night); color: var(--tf-ball); font-size: 20px; }

/* Buttons */
.tf-btn { height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px;
  border-radius: var(--tf-r-cta); font: 600 var(--tf-fs-md) var(--tf-font); text-decoration: none; cursor: pointer; border: 1.5px solid transparent; }
.tf-btn--primary { background: var(--tf-ball); color: var(--tf-text); font-weight: 800; }
.tf-btn--outline { background: #fff; color: var(--tf-text); border-color: var(--tf-night); }
.tf-btn--quiet { background: #fff; color: var(--tf-text); border-color: var(--tf-border); }
.tf-btn--sm { height: 44px; font-size: var(--tf-fs-sm); border-radius: var(--tf-r-control); }

/* Zu-/Absage */
.tf-rsvp { display: flex; gap: 8px; }
.tf-rsvp button { flex: 1 1 0; height: 48px; border-radius: var(--tf-r-control); font: 600 var(--tf-fs-sm) var(--tf-font);
  background: #fff; color: var(--tf-text); border: 1.5px solid var(--tf-border); cursor: pointer; }
.tf-rsvp button[aria-pressed="true"].is-yes { background: var(--tf-ball); border-color: var(--tf-ball); font-weight: 800; }
.tf-rsvp button[aria-pressed="true"].is-no { background: var(--tf-night); border-color: var(--tf-night); color: #fff; }

/* Chips */
.tf-chip { flex-shrink: 0; font-family: var(--tf-font); font-weight: 600; font-size: var(--tf-fs-xs); padding: 5px 8px; border-radius: var(--tf-r-chip); }
.tf-chip--yes { background: var(--tf-yes-bg); color: var(--tf-yes-fg); }
.tf-chip--open { background: var(--tf-open-bg); color: var(--tf-open-fg); }
.tf-chip--no { background: var(--tf-no-bg); color: var(--tf-no-fg); }
.tf-chip--info { background: var(--tf-info-bg); color: var(--tf-info-fg); }

/* Karten und Listen */
.tf-card { background: #fff; border-radius: var(--tf-r-card); overflow: hidden; }
.tf-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border-bottom: 1px solid var(--tf-divider); text-decoration: none; color: inherit; }
.tf-row:last-child { border-bottom: 0; }

/* Datums-Kachel in Terminlisten (Spiel = Nachtblau/Gelb, Training = weiß) */
.tf-date { width: 46px; height: 52px; box-sizing: border-box; border-radius: 10px; border: 1.5px solid var(--tf-divider-2);
  background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.tf-date small { font-family: var(--tf-font); font-weight: 600; font-size: var(--tf-fs-xs); letter-spacing: 1px; }
.tf-date strong { font-size: 20px; font-weight: 800; line-height: 1.1; }
.tf-date--match { background: var(--tf-kind-match); border-color: var(--tf-kind-match); color: var(--tf-ball); }

/* Segment-Umschalter im Header (Liste/Kalender/Archiv, Tabelle/Spielplan) */
.tf-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--tf-r-control); background: rgba(255,255,255,0.08); }
.tf-seg button { flex: 1 1 0; height: 40px; border: 0; border-radius: 9px; background: transparent; color: #fff; font: 600 var(--tf-fs-sm) var(--tf-font); cursor: pointer; }
.tf-seg button[aria-selected="true"] { background: #fff; color: var(--tf-text); font-weight: 600; }

/* Filter-Pillen im Header */
.tf-pill { height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: rgba(255,255,255,0.08); color: #fff; font: 600 var(--tf-fs-sm) var(--tf-font); cursor: pointer; }
.tf-pill[aria-pressed="true"] { background: var(--tf-ball); color: var(--tf-text); }

/* Untere Navigation */
.tf-nav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tf-nav-h); box-sizing: border-box;
  padding: 8px 8px env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--tf-divider-2);
  display: flex; justify-content: space-around; align-items: flex-start; }
.tf-nav a { width: 70px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--tf-muted); font-size: var(--tf-fs-xs); font-weight: 600; }
.tf-nav a .tf-nav-pill { width: 52px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }
.tf-nav a[aria-current="page"] { color: var(--tf-text); font-weight: 600; }
.tf-nav a[aria-current="page"] .tf-nav-pill { background: var(--tf-ball); }

/* Schalter */
.tf-switch { position: relative; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 16px; background: var(--tf-border); cursor: pointer; }
.tf-switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 12px; background: #fff; transition: left .15s; }
.tf-switch[aria-pressed="true"] { background: var(--tf-night); }
.tf-switch[aria-pressed="true"]::after { left: 24px; background: var(--tf-ball); }

/* Formulare */
.tf-input { height: 48px; box-sizing: border-box; width: 100%; padding: 0 14px; border: 1.5px solid var(--tf-border);
  border-radius: var(--tf-r-control); background: #fff; font: var(--tf-fs-md) var(--tf-font); color: var(--tf-text); }
.tf-input:focus { outline: 2px solid var(--tf-court); outline-offset: 1px; }
.tf-field-label { font-size: var(--tf-fs-sm); font-weight: 600; }
