/* Wspólna góra serwisu: barwy, kroje, tytuł, pasek podsumowania, menu oraz
   komponent wyniku meczu. Każda strona wczytuje ten arkusz przed własnym, więc
   nagłówek wygląda i mierzy tak samo na statystykach i na szczegółach meczu. */
:root {
  --bg: #05080f;
  --panel: #0a1520;
  --panel-2: #0d1b28;
  --row: #0e1a26;
  --row-alt: #091420;
  --header: #1e4370;
  --line: #16324a;
  --text: #e8eef5;
  --muted: #cfe3f2;
  --gold: #ffc72e;
  --green: #5ce6b8;
  --red: #ff7361;
}
/* Same display face the game uses. Letters only in the title — this is a
   trial build whose digits and punctuation are foundry watermarks.
   The URL is relative to this stylesheet, which is served from assets/ —
   an absolute /assets/... would resolve outside the /tf-lobby/ prefix nginx
   mounts the service under. */
@font-face {
  font-family: "Rocabe";
  src: url("rocabe.ttf") format("truetype");
  font-display: swap;
}
/* Handel Gothic carries the whole Polish alphabet, so headings and tabs can
   use it without a fallback for diacritics. */
@font-face {
  font-family: "Handel Gothic";
  src: url("handel-gothic.ttf") format("truetype");
  font-display: swap;
}
* { box-sizing: border-box; }
/* Miejsce na pionowy pasek przewijania jest zarezerwowane zawsze, więc krótsza
   zakładka nie poszerza strony i cała treść nie przesuwa się przy przełączaniu. */
html { scrollbar-gutter: stable; }
body {
  margin: 0; padding: 16px;
  background: var(--bg);
  color: var(--text);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 16px;
  line-height: 1.45;
}
.wrap { max-width: 1000px; margin: 0 auto; }
.site-header a { text-decoration: none; }
.site-header { position: relative; }
/* PL/EN switch in the page foot — a plain link to the other language (see
   requestLang in localization.go) so it also works on the Vita's
   no-JavaScript page. */
.lang-switch {
  display: flex; justify-content: center; gap: 4px; margin: 26px 0 90px;
  font-family: "Handel Gothic", "Courier New", monospace;
  font-size: 12px; letter-spacing: 1px;
}
.lang-switch a {
  color: var(--muted); border: 2px solid var(--line); background: var(--panel);
  padding: 3px 7px;
}
.lang-switch a.active { color: var(--gold); border-color: var(--gold); }
.lang-switch a { display: inline-flex; align-items: center; gap: 6px; }
.lang-switch img { display: block; image-rendering: pixelated; }

h1 {
  margin: 8px 0 4px;
  font-family: "Rocabe", "Courier New", monospace;
  font-size: clamp(30px, 7vw, 52px);
  letter-spacing: 3px;
  color: var(--green);
  text-align: center;
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 18px;
}

.stats-strip {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-bottom: 22px;
}
.chip {
  background: var(--panel); border: 2px solid var(--line);
  box-shadow: 3px 3px 0 #000; padding: 8px 16px; text-align: center; min-width: 120px;
}
.chip b { display: block; font-size: 26px; color: var(--gold); }
/* Data pierwszego meczu czyta się jak podpis, nie jak wynik: biała i o tyle
   mniejsza od liczb, żeby zmieściła się w jednej linii kafelka. */
.chip b.chip-date { font-size: 19px; color: #fff; letter-spacing: 1px; }
/* Direct children only: the ticker's own spans carry kit colours, and a
   descendant selector here would outrank the .tc-* classes. */
.chip > span { font-size: 12px; letter-spacing: 1px; color: var(--muted); }

.tabs {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--line);
}
/* Zakładki są odnośnikami (każda ma własny adres), więc wyglądają jak przyciski
   dopiero po zdjęciu domyślnego stylu linku. Każda ma ikonę Material Symbols
   i dwie nazwy: pełną na szerokim ekranie i krótką dla dolnego paska telefonu. */
.tab-button {
  padding: 12px 16px; background: transparent; border: none; color: var(--muted);
  font-family: "Handel Gothic", "Courier New", monospace; font-size: 15px; font-weight: bold;
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s;
  text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
}
.tab-button:hover { color: var(--text); }
.tab-button.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-icon { font-size: 20px; }
.tab-button.active .tab-icon { font-variation-settings: "FILL" 1; }
.tab-short { display: none; }
/* Ikony Material Symbols: jedna reguła dla wszystkich stron, bo nagłówek
   z menu jest wspólny. Czcionkę ładuje <link> w head każdej strony. */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}

/* --- Wynik meczu ----------------------------------------------------------
   One component, three homes: the history table spreads it over three cells,
   the records table and the ticker keep it inline. Everything about how a
   result looks is decided here. */
/* Stadionowa tablica jest wspólna dla detalu meczu i historii wyników. */
.scoreboard {
  --led: #ffe14d;
  display: inline-block; min-width: 170px; padding: 3px; background: #141c26;
  box-shadow: 3px 3px 0 #000; white-space: nowrap; text-decoration: none;
}
.scoreboard .board-face {
  display: block; padding: 8px 22px 6px; background-color: #030507;
  background-image:
    radial-gradient(ellipse at center, rgba(21, 23, 22, 0) 0%, rgba(0, 0, 0, 0.35) 100%),
    radial-gradient(circle, #151a1f 0.6px, transparent 0.9px);
  background-size: 100% 100%, 3px 3px; border-bottom: 1px solid #27313b;
}
.scoreboard .board-score, .scoreboard .board-clock {
  font-family: "JetBrains Mono", "Courier New", monospace;
  color: var(--led); font-weight: bold; text-align: center;
  text-shadow: 1px 1px 0 rgba(255, 140, 10, 0.35), 0 0 6px rgba(255, 225, 77, 0.35);
}
.scoreboard .board-score { display: flex; justify-content: center; gap: .35em; font-size: clamp(30px, 6vw, 44px); line-height: 1; }
.scoreboard .board-dash { font-size: .75em; align-self: center; }
.scoreboard .board-clock { display: block; margin-top: 4px; font-size: clamp(13px, 2.4vw, 17px); letter-spacing: 1px; }
.scoreboard-small { min-width: 76px; box-shadow: 2px 2px 0 #000; }
.scoreboard-small .board-face { padding: 5px 8px 3px; }
.scoreboard-small .board-score { font-size: 22px; gap: .22em; }
.scoreboard-small .board-clock { font-size: 11px; margin-top: 2px; }
.scoreboard-small:hover .board-face, .scoreboard-small:focus-visible .board-face { box-shadow: inset 0 0 0 1px var(--gold); }
.match-result-name {
  font-family: "Handel Gothic", "Courier New", monospace;
  letter-spacing: 1px;
}
.match-result-name.win { font-weight: bold; }
.match-result-score {
  color: var(--gold); font-weight: bold; letter-spacing: 1px;
}
.match-result-score a {
  color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted);
}
.match-result-score a:hover, .match-result-score a:focus-visible { color: var(--green); }
/* The inline arrangement: two nicknames around the score, never wrapped. */
.match-result {
  display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap;
}
.match-result .match-result-name { font-size: 14px; }
.match-result .match-result-score { font-size: 14px; }

/* Ikona platformy przy nazwie: białe glify z portu Vita, przygaszone jak
   tekst obok, z pikselowym skalowaniem, żeby zostały ostre. */
.platform-icon {
  display: inline-block; vertical-align: -2px; margin-right: 4px;
  opacity: 0.75; image-rendering: pixelated;
}
footer { text-align: center; color: var(--muted); font-size: 12px; margin: 26px 0 10px; }

@media (max-width: 620px) {
  body { padding: 10px; font-size: 14px; }
  /* Absolutely positioned top-right, the switch sat on top of the title on a
     narrow screen (h1 already stretches close to the edges via clamp()).
     Drop it back into normal flow so it lands centred under the title
     instead — the .lang-switch div already comes right after <h1> in the
     markup, so this is the only rule needed. */

}
/* Telefon: kafelki podsumowania w siatce dwóch kolumn zamiast luźnego
   zawijania, które zostawiało jeden kafelek samotnie w wierszu; pasek wyników
   zajmuje całą szerokość. Mniejsze liczby, żeby menu było widoczne bez
   przewijania. */
@media (max-width: 719px) {
  /* Telefon nie może być szerszy niż ekran: gdyby coś wystawało, Safari
     rysowałby stronę pomniejszoną, a przyklejony pasek menu nie sięgałby
     prawej krawędzi. */
  html, body { overflow-x: hidden; max-width: 100vw; }
  /* Tytuł w jednym wierszu: mniejszy krój i ciaśniejsze litery, żeby
     „TACTICS FOOTBALL” nie łamało się na dwa wiersze i nie zjadało ekranu. */
  h1 { font-size: clamp(18px, 5.4vw, 30px); letter-spacing: 1px; white-space: nowrap;
       text-shadow: 2px 2px 0 #000; margin: 4px 0 12px; }
  .stats-strip { margin-bottom: 12px; }
  .chip { min-width: 0; padding: 6px 8px; box-shadow: 2px 2px 0 #000; }
  .chip > span { font-size: 11px; }
  /* Menu jako pasek przyklejony do dołu ekranu, jak w aplikacjach: siedem
     ikon, podpis tylko pod aktywną — siedem podpisów obok siebie stykałoby
     się na szerokości telefonu. Aktywna zakładka dostaje więcej miejsca,
     żeby podpis się zmieścił. Strona dostaje dolny margines, żeby pasek nie
     zasłaniał ostatniego wiersza ani stopki. */
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; width: 100vw;
    margin: 0; gap: 0; border-bottom: none; border-top: 2px solid var(--line);
    background: var(--panel); box-shadow: 0 -3px 0 #000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tab-button {
    flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px;
    padding: 7px 2px 6px; font-size: 9px; letter-spacing: 0.3px;
    border-bottom: none; border-top: 3px solid transparent; margin-top: -2px;
  }
  .tab-button.active { border-top-color: var(--gold); flex-grow: 2.2; }
  .tab-icon { font-size: 24px; }
  .tab-label, .tab-short { display: none; }
  .tab-button.active .tab-short { display: inline; }
}
/* Tablet: zachowaj jeden wiersz nawigacji. Przy szerokości pośredniej
   pełne etykiety są ciaśniejsze, a węższy ekran przewija pasek poziomo. */
@media (min-width: 720px) and (max-width: 1439px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; }
  .tab-button {
    flex: 0 0 auto; padding-left: 8px; padding-right: 8px;
    gap: 5px; font-size: 13px; letter-spacing: 0.4px;
  }
}
/* iPad portrait: use the compact names for every destination so all seven
   links fit on screen without clipping or a horizontal scrollbar. */
@media (min-width: 720px) and (max-width: 1023px) and (orientation: portrait) {
  .tabs { overflow-x: visible; justify-content: stretch; }
  .tab-button {
    flex: 1 1 0; min-width: 0; justify-content: center;
    padding-left: 2px; padding-right: 2px; gap: 3px;
    font-size: 11px; letter-spacing: 0;
  }
  .tab-label { display: none; }
  .tab-short { display: inline; }
}
@media (min-width: 1440px) {
  .wrap { max-width: 75vw; }
  body { font-size: 18px; }
  .tab-button { font-size: 16px; }
  .chip b { font-size: 28px; }
  .chip b.chip-date { font-size: 21px; }
}
/* Mniejsze ekrany: dane zajmują 95% dostępnej szerokości, bez limitu 1000 px
   ani dodatkowych bocznych paddingów odejmowanych od szerokości kontenera. */
@media (max-width: 1600px) {
  body { padding-left: 0; padding-right: 0; }
  .wrap { width: 95%; max-width: none; }
}

/* Nick gracza zawsze prowadzi do jego profilu, ale nie zmienia własnych
   kolorów miejsca, w którym stoi: link dziedziczy barwę otoczenia. */
a.nick-link { color: inherit; text-decoration: none; }
a.nick-link:hover, a.nick-link:focus-visible { text-decoration: underline; }
