/*
Theme Name: FPL Edge
Theme URI: http://localhost:8080
Author: Fantasy PL Edge
Description: Autorski motyw portalu Fantasy PL Edge — dark sports magazine + dashboard danych FPL. News • Data • Decisions.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fpl-edge
*/

/* ============================================================
   1. FONTY — Inter, hostowany lokalnie (szybkość + RODO).
   Zestawy: latin (angielski) + latin-ext (polskie znaki).
   ============================================================ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/inter-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/inter-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/inter-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/inter-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/inter-latin-ext-800.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/inter-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   2. ZMIENNE — paleta projektu (WIĄŻĄCA, patrz PLAN.md).
   Proporcje: 60% ciemny fiolet / 25% biały / 10% neon / 5% róż.
   ============================================================ */
:root {
  /* Paleta bazowa */
  --bg-main: #070B14;
  --deep-purple: #180020;
  --purple: #38003C;
  --white: #FFFFFF;
  --fpl-green: #00FF85;
  --pink-accent: #E90052;
  --card-bg: #111827;
  --text-muted: #B8A9C9;

  /* Kolory statusów / verdictów */
  --verdict-buy: #00C853;        /* Buy / Strong Buy — zielony */
  --verdict-hold: #FFD600;       /* Hold / Watchlist — żółty */
  --verdict-risky: #FF9100;      /* Risky — pomarańczowy */
  --verdict-sell: #D50000;       /* Sell / Avoid — czerwony (przyciemniony: kontrast AA z białym tekstem) */

  /* Róż do MAŁEGO tekstu na ciemnym tle (jaśniejszy niż --pink-accent,
     żeby spełniać kontrast WCAG AA; --pink-accent zostaje dla przycisków/teł) */
  --pink-text: #FF4D8F;

  /* Oficjalna 5-stopniowa skala trudności meczów (FDR) z gry FPL */
  --fdr-1: #375523;
  --fdr-2: #01FC7A;
  --fdr-3: #E7E7E7;
  --fdr-4: #FF1751;
  --fdr-5: #80072D;

  /* Typografia i layout */
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --content-width: 1200px;
  --radius: 10px;
  --border-subtle: rgba(184, 169, 201, 0.18); /* delikatna linia na bazie text-muted */
}

/* ============================================================
   3. RESET I BAZA
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--white);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--fpl-green); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 0.6em;
  color: var(--white);
}
h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

/* Widoczny fokus klawiatury (dostępność) */
:focus-visible {
  outline: 2px solid var(--fpl-green);
  outline-offset: 2px;
}

::selection { background: var(--purple); color: var(--white); }

/* ============================================================
   4. LAYOUT PODSTAWOWY
   ============================================================ */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-main {
  min-height: 60vh;
  padding: 32px 0 64px;
}

/* Tekst tylko dla czytników ekranu */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Link "przeskocz do treści" — widoczny tylko po fokusie */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  background: var(--fpl-green);
  color: var(--bg-main);
  padding: 10px 16px;
  font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ============================================================
   5. HEADER (tymczasowy — pełny w Task 06)
   ============================================================ */
.site-header {
  background: var(--deep-purple);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

/* Logo tekstowe (do czasu dostarczenia plików logo przez klienta) */
.site-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0; /* cel dotykowy ≥ 24px (WCAG target-size) */
}

/* Logo tekstowe (decyzja klienta 2026-07-07: bez znaku graficznego —
   emblemat z lwem zbyt bliski znakowi Premier League) */
.site-logo:hover { text-decoration: none; }
.site-logo .logo-edge { color: var(--fpl-green); }

.site-tagline {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- 5.1 Breaking News Bar --- */
.breaking-bar {
  background: var(--pink-accent);
  color: var(--white);
  font-size: 0.85rem;
  overflow: hidden;
}
.breaking-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 36px;
}
.breaking-label {
  flex: none;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-main);
  color: var(--fpl-green);
  padding: 2px 10px;
  border-radius: 999px;
}
.breaking-list {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none; /* pasek przewija się palcem, bez widocznego scrollbara */
  white-space: nowrap;
}
.breaking-list::-webkit-scrollbar { display: none; }
/* padding pionowy = łapalny cel dotykowy (WCAG target-size) */
.breaking-list a { color: var(--white); font-weight: 600; display: inline-block; padding: 8px 0; }

/* --- 5.2 Menu główne --- */
.nav-menu {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-menu a {
  display: block;
  padding: 8px 12px;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
}
.nav-menu a:hover { background: var(--purple); text-decoration: none; }
.nav-menu .current-menu-item > a { color: var(--fpl-green); }

/* --- 5.3 Akcje w headerze (lupa + CTA) --- */
.header-actions { display: flex; align-items: center; gap: 10px; }
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--white);
  cursor: pointer;
}
.search-toggle:hover { border-color: var(--fpl-green); color: var(--fpl-green); }
.btn-header-cta { padding: 8px 16px; font-size: 0.85rem; }

/* Rozwijane pole wyszukiwania pod headerem */
.header-search {
  display: none;
  background: var(--purple);
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
}
.header-search.is-open { display: block; }
.header-search form { display: flex; gap: 10px; }
.header-search input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-main);
  font-size: 0.95rem;
}

/* Przełącznik języka EN / PL */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.lang-switch a { color: var(--text-muted); padding: 4px 2px; }
.lang-switch a.is-active { color: var(--fpl-green); }
.lang-switch a:hover { color: var(--white); text-decoration: none; }

/* --- 5.4 Hamburger (widoczny tylko na mobile) --- */
.nav-toggle {
  display: none;
  flex: none; /* nie pozwól flexowi ściskać przycisku obok logo */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 38px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
}

/* ============================================================
   6. STOPKA
   ============================================================ */
.site-footer {
  background: var(--deep-purple);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 32px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--white); }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.footer-tagline {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-heading {
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.footer-menu, .footer-social {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-copy { margin: 0; }

/* --- 6.1 Dolna nawigacja mobilna (tylko małe ekrany) --- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--deep-purple);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}
.mobile-bottom-nav a:hover { text-decoration: none; }
.mobile-bottom-nav a.is-active { color: var(--fpl-green); }

/* Disclaimer o niezależności — wymóg prawny, na KAŻDEJ stronie */
.site-disclaimer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ============================================================
   7. TREŚCI / ARTYKUŁY (baza)
   ============================================================ */
.entry {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.entry-title a { color: var(--white); }
.entry-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.entry-content a { text-decoration: underline; }

/* ============================================================
   8. STRONA 404 (baza — ostylowanie w Task 17)
   ============================================================ */
.error-404 {
  text-align: center;
  padding: 64px 20px;
}
.error-404 .error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--fpl-green);
  line-height: 1;
  margin-bottom: 8px;
}
.error-404 .card-muted { max-width: 460px; margin: 0 auto 20px; }
.error-search {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto 20px;
}
.error-search input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-main);
}
.error-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   9. KOMPONENTY (biblioteka — Task 05; używana przez wszystkie moduły)
   ============================================================ */

/* --- 9.1 Przyciski --- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(1.12); }

/* Główny przycisk — neonowa zieleń, ciemny tekst (dobry kontrast) */
.btn-primary { background: var(--fpl-green); color: var(--bg-main); }

/* Drugorzędny — obrys */
.btn-secondary { background: transparent; color: var(--white); border-color: var(--fpl-green); }
.btn-secondary:hover { background: rgba(0, 255, 133, 0.1); }

/* Akcent (CTA newslettera) — róż */
.btn-accent { background: var(--pink-accent); color: var(--white); }

/* --- 9.2 Karty --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.card-muted { color: var(--text-muted); font-size: 0.875rem; }

/* Nagłówek sekcji z zieloną belką */
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 40px 0 20px;
}
.section-heading::before {
  content: "";
  width: 6px;
  height: 1.4em;
  background: var(--fpl-green);
  border-radius: 3px;
}

/* --- 9.3 Badge verdictów ---
   Kolory statusów (decyzja): Buy=zielony, Hold/Watchlist=żółty,
   Risky=pomarańczowy, Sell/Avoid=czerwony. Ciemny tekst na jasnych
   tłach dla kontrastu (WCAG AA). */
.verdict {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.verdict-strong-buy { background: var(--verdict-buy); color: var(--bg-main); }
.verdict-buy { background: rgba(0, 200, 83, 0.16); color: #69F0AE; border: 1px solid var(--verdict-buy); }
.verdict-hold { background: var(--verdict-hold); color: var(--bg-main); }
.verdict-watchlist { background: rgba(255, 214, 0, 0.14); color: #FFE566; border: 1px solid var(--verdict-hold); }
.verdict-risky { background: var(--verdict-risky); color: var(--bg-main); }
.verdict-sell { background: var(--verdict-sell); color: var(--white); }

/* --- 9.4 Skala FDR (oficjalna 5-stopniowa z gry FPL) ---
   Komórka pojedynczego meczu w tickerze/tabelach.
   FDR 1-2 i 3 są jasne → ciemny tekst; FDR 4-5 ciemne → biały tekst. */
.fdr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 700;
}
.fdr-1 { background: var(--fdr-1); color: var(--white); }
.fdr-2 { background: var(--fdr-2); color: var(--bg-main); }
.fdr-3 { background: var(--fdr-3); color: var(--bg-main); }
.fdr-4 { background: var(--fdr-4); color: var(--bg-main); } /* ciemny tekst — jasna czerwień nie daje AA z białym */
.fdr-5 { background: var(--fdr-5); color: var(--white); }
/* Pusta kolejka (BGW) */
.fdr-blank { background: transparent; border: 1px dashed var(--border-subtle); color: var(--text-muted); }
/* Podwójna kolejka (DGW): dwa mecze w jednej komórce */
.fdr-double { display: inline-flex; flex-direction: column; gap: 2px; }
.fdr-double .fdr { min-width: 52px; }

/* --- 9.5 Pasek klubu (kolory klubu + skrót 3-literowy; BEZ herbów) --- */
.club-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}
.club-chip .club-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--club-color, var(--purple));
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* --- 9.6 Karta zawodnika --- */
.player-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}
.player-card .player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  /* Pasek w kolorze klubu (--club-color ustawiane inline per klub) */
  background: linear-gradient(90deg, var(--club-color, var(--purple)) 0%, var(--deep-purple) 100%);
}
.player-card .player-name { font-weight: 800; font-size: 1.05rem; }
.player-card .player-meta { color: rgba(255,255,255,0.85); font-size: 0.8rem; }
.player-card .player-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.player-card .player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.player-card .player-row .label { color: var(--text-muted); }

/* Duża liczba ratingu */
.rating-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fpl-green);
  line-height: 1;
}

/* --- 9.7 Karta newsa --- */
.news-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-card .news-category {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pink-text);
}
.news-card .news-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.news-card .news-title a { color: var(--white); }
.news-card .news-date { color: var(--text-muted); font-size: 0.8rem; }
.news-card .news-excerpt { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* --- 9.8 Tabela danych --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.data-table th, .data-table td {
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}
.data-table thead th {
  background: var(--purple);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
}
.data-table tbody tr { border-top: 1px solid var(--border-subtle); }
.data-table tbody tr:hover { background: rgba(56, 0, 60, 0.35); }

/* --- 9.9 Formularze --- */
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="search"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-main);
  font-size: 0.95rem;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--fpl-green);
  outline-offset: 0;
  border-color: transparent;
}
.form-field ::placeholder { color: var(--text-muted); opacity: 0.8; }
.form-hint { color: var(--text-muted); font-size: 0.8rem; }

/* --- 9.10 Siatki pomocnicze --- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- 9.11 Strona zawodnika (/players/<slug>) --- */
.player-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--club-color, var(--purple)) 0%, var(--deep-purple) 75%);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}
.player-hero h1 { margin: 6px 0 4px; }
.player-hero .player-fullname { margin: 0; color: rgba(255,255,255,0.85); }
.player-hero-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
  background: rgba(7, 11, 20, 0.55);
  border-radius: var(--radius);
  padding: 16px 26px;
}
.rating-big { font-size: 2.6rem; }
.rating-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.player-why { margin-bottom: 16px; }
.player-why .card-muted { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.player-news-flag { margin-bottom: 16px; border-left: 4px solid var(--verdict-risky); }

.player-fixtures {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.player-fixture-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.gw-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.player-fixture-score { margin-left: auto; }

.stat-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; }
.stat-card .stat-value { font-size: 1.35rem; font-weight: 800; }

/* --- 9.12 Rankingi (/fpl-rankings) --- */
.rankings-intro { max-width: 640px; }
.rankings-snapshot-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-left: 4px solid var(--fpl-green);
}
.rankings-filters {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.rankings-filters .form-field { margin-bottom: 0; }
/* Wydajność: przeglądarka pomija układanie wierszy/kart poza ekranem */
.rankings-table tbody tr,
.rankings-cards .player-card,
.ticker-table tbody tr,
.ticker-cards .player-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 56px;
}
.rankings-cards .player-card,
.ticker-cards .player-card { contain-intrinsic-size: auto 180px; }

.rankings-table .next5-cell { display: flex; gap: 3px; align-items: center; }
.rankings-table .next5-cell .fdr { min-width: 44px; font-size: 0.7rem; padding: 3px 4px; }
.rankings-table .why-cell {
  white-space: normal;
  min-width: 180px;
  max-width: 260px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.rating-cell { font-size: 1.05rem; }
.rank-cell { color: var(--text-muted); font-weight: 700; }
.rank-badge {
  color: var(--fpl-green);
  font-weight: 800;
  margin-right: 6px;
}
.rankings-cards { display: none; }
.rankings-cards .player-card { margin-bottom: 14px; }
.rankings-cards .player-name a { color: var(--white); }
.rankings-cards .why-mobile { text-align: right; max-width: 220px; }
.rankings-archive {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.rankings-archive a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 900px) {
  /* Mobile: tabela znika, wchodzą karty; filtry w 2 kolumnach */
  .rankings-table { display: none; }
  .rankings-cards { display: block; }
  .rankings-filters { grid-template-columns: repeat(2, 1fr); }
}

/* --- 9.13 Fixture Ticker (/fixture-ticker) --- */
.ticker-table .fdr-cell .fdr { min-width: 56px; font-size: 0.72rem; }
.ticker-table .assets-cell { font-size: 0.82rem; white-space: normal; min-width: 220px; }
.ticker-score { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ticker-cards { display: none; }
.ticker-cards .player-card { margin-bottom: 14px; }
.ticker-gws { display: flex; gap: 10px; flex-wrap: wrap; }
.assets-mobile { text-align: right; }

@media (max-width: 900px) {
  .ticker-table { display: none; }
  .ticker-cards { display: block; }
}

/* --- 9.14 Injury Centre (/injury-centre) --- */
/* "Rozwiązane" wpisy przygaszamy grayscalem (opacity psuła kontrast WCAG) */
.injury-card.is-resolved { filter: grayscale(0.7); border-style: dashed; }
.injury-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.injury-player { margin: 0 0 4px; font-size: 1.1rem; }
.injury-player a { color: var(--white); }
.injury-updated { font-size: 0.78rem; }
.injury-facts {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.injury-facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.injury-facts dd { margin: 0; font-size: 0.9rem; }
.confidence { font-weight: 700; }
.confidence-very-high { color: var(--fpl-green); }
.confidence-high { color: #69F0AE; }
.confidence-medium { color: var(--verdict-hold); }
.confidence-low { color: var(--verdict-risky); }
.rating-diff.is-down { color: var(--verdict-sell); font-weight: 700; }
.rating-diff.is-up { color: var(--fpl-green); font-weight: 700; }

/* --- 9.15 Captain Picks (/captain-picks) --- */
.captains-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.captains-list .captain-card:first-child { grid-column: 1 / -1; }
.captain-meters { display: flex; flex-direction: column; gap: 8px; }
.meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.meter-bar {
  height: 8px;
  background: rgba(184, 169, 201, 0.15);
  border-radius: 999px;
  overflow: hidden;
}
.meter-fill { display: block; height: 100%; border-radius: 999px; }
.meter-risk { background: var(--pink-accent); }
.meter-upside { background: var(--fpl-green); }

@media (max-width: 900px) {
  .captains-list { grid-template-columns: 1fr; }
}

/* --- 9.16 Transfer Watch --- */
.benefit-up { color: var(--fpl-green); }
.benefit-down { color: var(--verdict-sell); }

/* --- 9.17 Strona kolejki (/gameweek/...) --- */
.gw-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.gw-result .club-chip { flex: 1; min-width: 0; font-size: 0.85rem; }
.gw-result .club-chip:last-child { justify-content: flex-end; }
.gw-score {
  font-weight: 800;
  font-size: 1.05rem;
  background: var(--purple);
  border-radius: 6px;
  padding: 4px 12px;
  white-space: nowrap;
}
.gw-xi { display: flex; flex-direction: column; gap: 14px; }
.gw-xi-line { display: flex; gap: 14px; align-items: flex-start; }
.gw-xi-line > .gw-label { flex: none; width: 40px; padding-top: 14px; }
.gw-xi-players { display: flex; gap: 10px; flex-wrap: wrap; }
.gw-xi-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px 16px;
  min-width: 110px;
}
.gw-xi-player:hover { text-decoration: none; border-color: var(--fpl-green); }
.gw-xi-player strong { color: var(--white); font-size: 0.85rem; }

/* --- 9.18 Strona główna --- */
.home-hero {
  text-align: center;
  padding: 56px 20px 48px;
}
.home-hero h1 { font-size: 2.8rem; margin-bottom: 12px; }
.home-hero-sub {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 24px;
  font-size: 1.05rem;
}
.home-hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.home-quick-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; }
.quick-card { display: flex; flex-direction: column; gap: 4px; }
.quick-card:hover { text-decoration: none; border-color: var(--fpl-green); }
.quick-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fpl-green);
}
.quick-value { font-size: 1.15rem; font-weight: 800; color: var(--white); }

.home-section { margin-bottom: 8px; }
.home-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.home-section-head .section-heading { flex: 1; }
.home-more { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }

.home-ticker-card { display: flex; flex-direction: column; gap: 10px; }
.home-ticker-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.home-ticker-gws { display: flex; gap: 4px; flex-wrap: wrap; }
.home-ticker-gws .fdr { min-width: 48px; font-size: 0.68rem; padding: 3px 4px; }

.home-newsletter {
  text-align: center;
  background: linear-gradient(135deg, var(--purple) 0%, var(--deep-purple) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 40px 24px;
  margin: 32px 0 8px;
}
.newsletter-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 460px;
  margin: 18px auto 0;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font-main);
}
.newsletter-note { margin-top: 12px; }
.newsletter-ok { color: var(--fpl-green); font-weight: 700; }
.newsletter-err { color: var(--verdict-sell); font-weight: 700; }

@media (max-width: 900px) {
  .home-quick-stats { grid-template-columns: repeat(2, 1fr); }
  .home-hero h1 { font-size: 2rem; }
  .home-rankings .hide-mobile { display: none; }
  .newsletter-form { flex-direction: column; }
}

/* --- 9.19 Pojedynczy artykuł --- */
.single-article { max-width: 760px; margin: 0 auto; }
.article-header { margin-bottom: 24px; }
.article-header .news-category {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pink-text);
}
.article-thumb { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.article-content { font-size: 1.05rem; line-height: 1.75; }
.article-content h2 { margin-top: 1.4em; }

/* ============================================================
   10. MOBILE
   ============================================================ */
@media (max-width: 900px) {
  /* Menu chowa się za hamburgerem */
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    z-index: 90;
    background: var(--deep-purple);
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 20px 16px;
  }
  .site-nav.is-open { display: block; }
  .site-header { position: relative; }
  .nav-menu { flex-direction: column; gap: 0; }
  .nav-menu a { padding: 12px 8px; border-bottom: 1px solid var(--border-subtle); border-radius: 0; }

  /* CTA newslettera w headerze ustępuje miejsca — zostaje lupa */
  .btn-header-cta { display: none; }

  /* Dolna nawigacja widoczna; treść dostaje zapas, żeby nic nie zasłaniała */
  .mobile-bottom-nav { display: flex; }
  body { padding-bottom: 64px; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  .site-tagline { display: none; }

  /* Ciaśniejszy nagłówek: znaczek + nazwa + hamburger + EN/PL + lupa muszą
     zmieścić się w 375px bez poziomego przewijania */
  .site-logo { font-size: 1.05rem; gap: 8px; }
  .site-header .container { gap: 8px; padding-left: 14px; padding-right: 14px; }
  .header-actions { gap: 6px; }

  /* Strona zawodnika: nagłówek w pionie, rating pod nazwiskiem */
  .player-hero { flex-direction: column; align-items: flex-start; }
  .player-hero-rating { align-self: stretch; flex-direction: row; justify-content: space-between; }
  .player-fixture-score { margin-left: 0; }
}

/* =====================================================================
   16. Recommended Squad (moduł "Polecany skład"): boisko, ławka, radar chipów
   ===================================================================== */

.squad-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.squad-summary .stat-chip {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.squad-summary .stat-chip strong { color: var(--fpl-green); font-weight: 800; margin-left: 8px; }

/* Boisko: ciemna karta z lekką zieloną poświatą (bez grafik — sama paleta) */
.squad-pitch {
  background:
    linear-gradient(180deg, rgba(0, 255, 133, 0.07) 0%, rgba(0, 255, 133, 0.02) 100%),
    var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.squad-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

.squad-player {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 108px;
  padding: 10px 12px 8px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--club-color, var(--purple));
  border-radius: var(--radius);
  text-align: center;
  color: var(--white);
}
a.squad-player:hover { border-color: var(--fpl-green); }
.squad-player .squad-club {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.squad-player .squad-name {
  font-weight: 800;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.squad-player .squad-meta { font-size: 0.78rem; color: var(--text-muted); }

/* Znaczki kapitana (C) i wicekapitana (V) */
.cap-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--fpl-green);
  color: var(--bg-main);
  font-size: 0.68rem;
  font-weight: 800;
}
.cap-badge.vice { background: transparent; border: 1px solid var(--fpl-green); color: var(--fpl-green); }

/* Ławka: poziome kafle z numerem kolejności wejścia */
.squad-bench { display: flex; flex-wrap: wrap; gap: 10px; }
.squad-bench .squad-player {
  flex-direction: row;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  border-left: 3px solid var(--club-color, var(--purple));
  text-align: left;
}
.bench-no { color: var(--text-muted); font-weight: 700; font-size: 0.8rem; }

/* Radar chipów */
.chip-box {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--pink-accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}
.chip-box p { margin: 0; }
.chip-box .chip-note { font-size: 0.8rem; }

@media (max-width: 640px) {
  .squad-player { min-width: 88px; padding: 8px 8px 6px; }
  .squad-pitch { padding: 16px 8px; gap: 14px; }
}

/* ============================================================
   BANER ZGODY NA COOKIES (RODO) — GA ładuje się dopiero po zgodzie
   ============================================================ */
.cookie-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--fpl-green);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.cookie-bar[hidden] { display: none; }
.cookie-bar__text {
  margin: 0;
  flex: 1 1 320px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.cookie-bar__link { color: var(--fpl-green); white-space: nowrap; }
.cookie-bar__actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-bar__btn {
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}
.cookie-bar__btn--reject {
  background: transparent;
  color: var(--text-muted);
}
.cookie-bar__btn--reject:hover { color: var(--white); border-color: var(--white); }
.cookie-bar__btn--accept {
  background: var(--fpl-green);
  border-color: var(--fpl-green);
  color: var(--bg-main);
}
.cookie-bar__btn--accept:hover { filter: brightness(1.08); }

@media (max-width: 782px) {
  /* Nad dolną nawigacją mobilną (wysokość ~64px), żeby jej nie zasłaniać */
  .cookie-bar { bottom: 72px; }
}
@media (max-width: 640px) {
  .cookie-bar { flex-direction: column; align-items: stretch; text-align: left; gap: 12px; }
  .cookie-bar__actions { justify-content: flex-end; }
}

/* Link „Ustawienia cookies" w stopce — przycisk ostylowany jak dyskretny link */
.cookie-settings-link {
  background: none;
  border: 0;
  padding: 0;
  margin-left: 10px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
}
.cookie-settings-link:hover { color: var(--fpl-green); }
