/* Georgia przeskalowana do metryk EB Garamond (dane: Capsize, formula: fontaine):
   nagłówki renderują się od razu we właściwym rozmiarze i podmiana webfontu
   (display=swap) nie przesuwa layoutu */
@font-face {
  font-family: "EB Garamond Fallback";
  src: local("Georgia");
  size-adjust: 86.36%;
  ascent-override: 116.61%;
  descent-override: 34.51%;
  line-gap-override: 0%;
}

:root {
  --bg: #f4e9cf;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #9c2a2a;
  --pkt-sily: #2e7d32;
  --rule: #d9c896;
  --card: #ffffff;
  --serif: 'EB Garamond', 'EB Garamond Fallback', Georgia, 'Times New Roman', serif;
  --page-w: 58rem;            /* jedna szerokosc kolumny, identyczna na kazdej podstronie */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }  /* pasek przewijania nie zmienia szerokosci ukladu */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.page {
  width: min(var(--page-w), 92%);
  margin: 0 auto;
  padding-bottom: 2rem;
}
.banner {
  width: 100%;
  margin: 0;
  background: var(--rule);
}
.banner img {
  width: 100%; height: auto;
  display: block;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Naglowek: tytul (60) | odstep (20) | info (20) | menu (20) --- */
.hero-band {
  display: grid;
  grid-template-columns: 1fr auto;   /* tytul | menu (szerokosc dopasowana, bez zawijania) */
  column-gap: 2rem;
  align-items: start;
  padding: 1.75rem 0 1.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 1.5rem 0 2rem;
}
.site-title {
  grid-column: 1;
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.0;
  letter-spacing: -0.01em;
  font-size: clamp(1.6rem, 5vw, 4.5rem);   /* skaluje sie do swojej strefy */
}
.hb-menu { grid-column: 2; }
.hb-menu a {
  display: block;
  padding: 0.35rem 0.6rem;
  margin: 0.15rem 0;
  color: var(--fg);
  font-size: 1.1rem;
  line-height: 1.25;
  white-space: nowrap;
  border-radius: 5px;
}
.hb-menu a:hover {
  color: var(--accent);
  text-decoration: none;
  background: rgba(156, 42, 42, 0.08);
}
.hb-menu a.active {
  color: var(--accent);
  background: rgba(156, 42, 42, 0.14);
}

@media (max-width: 820px) {
  .hero-band {
    grid-template-columns: 1fr;
    row-gap: 1.25rem;
  }
  .site-title, .hb-menu { grid-column: 1; }
}

section { margin: 2.25rem 0; }
section p { text-align: justify; hyphens: auto; }

.closer {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  text-align: center;
  margin: 3.5rem 0 2rem;
  font-style: italic;
  font-weight: 500;
  color: var(--fg);
}
h2 {
  font-family: var(--serif);
  font-size: 1.55rem; font-weight: 600;
  margin: 0 0 0.7rem; letter-spacing: 0;
}
h3 {
  font-family: var(--serif);
  font-size: 1.15rem; font-weight: 600;
  margin: 1.1rem 0 0.3rem; letter-spacing: 0;
}
h4 {
  font-family: var(--serif);
  font-size: 1rem; font-weight: 600;
  margin: 0.9rem 0 0.2rem; letter-spacing: 0;
}
p { margin: 0.4rem 0; }

ul.links { list-style: none; padding-left: 0; margin: 0.4rem 0; }
ul.links li { padding-left: 1.2rem; margin: 0.25rem 0; position: relative; }
ul.links li::before {
  content: ""; position: absolute; left: 0; top: 0.75em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted);
}

/* zdania lamane jak w zrodle (ranking.html ma jedno zdanie na linie) */
.zdania p, .zdania li { white-space: pre-line; }

/* wycinki kart graczy: stala szerokosc (naturalny rozmiar karty A4 przy 96 dpi),
   pismo na karcie ma ~rozmiar tekstu strony. Ramka przykladu poszerza sie ponad
   kolumne tekstu (wysrodkowana), zeby wycinki nie musialy sie przewijac;
   scroll poziomy wewnatrz ramki dopiero, gdy ekran jest wezszy od karty. */
.przyklad {
  overflow-x: auto;
  width: min(calc(194mm + 2.4rem), calc(100vw - 2rem));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
img.wycinek {
  width: 194mm;               /* szerokosc wycinka: karta 190mm + marginesy ciecia */
  max-width: none;
  height: auto;
  display: block;
  margin: 0.8rem 0 0;
}

/* spis tresci pod wstepem: zlota linia + wciecie + wersalikowa etykieta */
.spis {
  margin: 1.4rem 0 2rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--rule);
}
.spis-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.3rem;
}
.spis ul.links { margin: 0; }
.spis ul.links li { padding-left: 0; margin: 0.15rem 0; }
.spis ul.links li::before { display: none; }

/* wyeksponowany link do karty gracza */
.karta-link { font-size: 1.2rem; margin: 1.6rem 0; }
.karta-link a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* nazwy kolumn karty przywolane w tekscie — jak naglowki karty */
.kol {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82em;
  letter-spacing: 0.03em;
}

/* punkty sily: zawsze na zielono — slowo i liczby */
.ps { color: var(--pkt-sily); }
table.sila td + td { color: var(--pkt-sily); }

table.sila { border-collapse: collapse; margin: 0.6rem 0; }
table.sila th, table.sila td {
  border: 1px solid var(--rule);
  padding: 0.25rem 0.9rem;
  text-align: left;
}
table.sila th { background: var(--rule); font-weight: 600; }

/* tabela wyrownania: siatka roznic (PS, zielone), jency dla Czarnego
   w wyroznionych komorkach, ruchy Czarnego w dolnym wierszu */
table.komp td, table.komp th { padding: 0.2rem 0.5rem; text-align: center; }
table.komp th { border-color: color-mix(in srgb, var(--rule) 85%, black); }
table.komp td { color: var(--pkt-sily); }
/* wyroznienie tym samym jasnozlotym tlem: wiersz ruchow i komorki jencow */
table.komp tr.komp-ruchy th { background: color-mix(in srgb, var(--rule) 45%, transparent); font-weight: 600; }
table.komp td.komp-jency { color: var(--fg); background: color-mix(in srgb, var(--rule) 45%, transparent); }

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 2rem;
}
.footer-inner {
  width: min(var(--page-w), 92%);
  margin: 0 auto;
  padding: 1.25rem 0;
  color: var(--muted); font-size: 0.9rem;
}
.footer-inner a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--rule); }

/* druk: sama tresc, bez ozdob nawigacyjnych */
@media print {
  body { background: #fff; }
  .banner, .hb-menu, .site-footer, .spis { display: none; }
  .page, .footer-inner { width: 100%; }
  a { color: inherit; }
  .przyklad { width: auto; left: 0; transform: none; overflow: visible; }
  img.wycinek { width: 100%; }
}

figure { margin: 1.8rem 0; }
figure img {
  width: 100%; height: auto; display: block;
  border-radius: 6px;
  border: 1px solid var(--rule);
}
figcaption {
  color: var(--muted); font-size: 0.9rem; font-style: italic;
  text-align: center; margin-top: 0.5rem;
}

.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.8rem 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.video iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

.stat {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.3;
  font-style: italic;
  color: var(--accent);
  border-left: 3px solid var(--rule);
  padding: 0.1rem 0 0.1rem 1.1rem;
  margin: 1.6rem 0;
  text-align: left;
}

.credit, .przyklad {
  background: rgba(156, 42, 42, 0.06);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
}
.credit {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 2.5rem 0 0;
}
.przyklad {
  font-size: 0.95rem;
  margin: 1.2rem 0;
}
.przyklad p { margin: 0.3rem 0; text-align: left; }
.credit a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
