/* GhostMap – style strony. Style samych map: assets/world-map/src/maps.css
   Motyw ciemny („noc duchów”: fiolet i dynia – znaczniki zjawisk świecą na tle mapy jak świeczki) albo jasny;
   domyślnie jak w systemie, przełącznik w nagłówku (layout.php) ustawia <html data-theme="light|dark">.
   Tryb Halloween (klasa hw) działa w obu motywach. */

:root {
  /* Jasny motyw („blady świt”) – kolory zależne od motywu; ciemny niżej */
  --bg: #f5f2f8;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f0f8;
  --surface-3: #e9e2f1;
  --ink: #221a2e;
  --ink-2: #463a57;
  --muted: #6b5e7f;
  --heading: #160f20;           /* nagłówki, pogrubienia, tekst po najechaniu */
  --line: #e4ddec;
  --line-2: #d0c5de;
  --accent: #a64f0a;            /* dynia – linki i akcenty */
  --accent-ink: #ffffff;        /* tekst na przyciskach w kolorze akcentu / kategorii */
  --accent-hover: #7a3a06;
  --brand: #ff9a3c;             /* dynia w pełnym blasku – podstawa kolorów kategorii (--c) */
  --land: #ddd5e7;
  --land-focus: #c4b7d7;
  --land-border: #f8f6fb;
  --ocean: #f8f6fb;
  --sphere: #e3dcec;
  --header-bg: rgba(255, 255, 255, .85);
  --glass: rgba(255, 255, 255, .9);
  --tip-bg: rgba(255, 255, 255, .97);
  --hint-bg: rgba(255, 255, 255, .97);
  --glow-1: rgba(255, 154, 60, .12);
  --glow-2: rgba(150, 90, 255, .08);
  --fog: 120, 90, 170;          /* mgła nad mapą (rgb) */
  --hw-field-bg: #fffaf5;       /* pola formularza w trybie Halloween */
  --hw-field-line: #e2c7aa;
  --shadow: 0 1px 2px rgba(34, 26, 46, .06), 0 12px 32px -14px rgba(34, 26, 46, .25);
  /* Kolory kategorii są jasne (do świecenia na ciemnym tle) – w jasnym motywie tekst i ikony w nich przyciemniamy */
  --shade: 38%;
  --mk-shade: 12%;              /* znaczniki na mapie – lekko, żeby odcinały się od jasnych lądów */
  --mk-sel: #160f20;            /* środek wybranego znacznika */
  --mk-ring: 1px;               /* obwódka znacznika w kolorze oceanu (oddziela sąsiednie) */
  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 56px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  /* Oceny przypadków */
  --st-niewyjasnione: #9a6300;
  --st-sporne: #4b5f93;
  --st-legenda: #8443bf;
  --st-wyjasnione: #1d7d3e;
  --st-mistyfikacja: #c23535;
  color-scheme: light;
}
/* Ciemny motyw („noc duchów”): według systemu albo wybrany przełącznikiem w nagłówku (<html data-theme>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b0811;
    --bg-2: #110c19;
    --surface: #150f1e;
    --surface-2: #1c1528;
    --surface-3: #261d35;
    --ink: #efe9f6;
    --ink-2: #cfc4de;
    --muted: #9a8db0;
    --heading: #fff;
    --line: #271e36;
    --line-2: #3a2d4f;
    --accent: #ff9a3c;
    --accent-ink: #2b1200;
    --accent-hover: #ffc48f;
    --land: #201830;
    --land-focus: #33264a;
    --land-border: #120d1b;
    --ocean: #0e0a15;
    --sphere: #241b33;
    --header-bg: rgba(11, 8, 17, .82);
    --glass: rgba(21, 15, 30, .88);
    --tip-bg: rgba(21, 15, 30, .96);
    --hint-bg: rgba(28, 21, 40, .97);
    --glow-1: rgba(255, 154, 60, .07);
    --glow-2: rgba(150, 90, 255, .06);
    --fog: 205, 190, 235;
    --hw-field-bg: rgba(11, 8, 17, .75);
    --hw-field-line: #4a3758;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px -14px rgba(0, 0, 0, .8);
    --shade: 0%;
    --mk-shade: 0%;
    --mk-sel: #fff;
    --mk-ring: 1.5px;
    --st-niewyjasnione: #ffd166;
    --st-sporne: #a9b8e0;
    --st-legenda: #d9a5ff;
    --st-wyjasnione: #7be29a;
    --st-mistyfikacja: #ff7a7a;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0b0811;
  --bg-2: #110c19;
  --surface: #150f1e;
  --surface-2: #1c1528;
  --surface-3: #261d35;
  --ink: #efe9f6;
  --ink-2: #cfc4de;
  --muted: #9a8db0;
  --heading: #fff;
  --line: #271e36;
  --line-2: #3a2d4f;
  --accent: #ff9a3c;
  --accent-ink: #2b1200;
  --accent-hover: #ffc48f;
  --land: #201830;
  --land-focus: #33264a;
  --land-border: #120d1b;
  --ocean: #0e0a15;
  --sphere: #241b33;
  --header-bg: rgba(11, 8, 17, .82);
  --glass: rgba(21, 15, 30, .88);
  --tip-bg: rgba(21, 15, 30, .96);
  --hint-bg: rgba(28, 21, 40, .97);
  --glow-1: rgba(255, 154, 60, .07);
  --glow-2: rgba(150, 90, 255, .06);
  --fog: 205, 190, 235;
  --hw-field-bg: rgba(11, 8, 17, .75);
  --hw-field-line: #4a3758;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px -14px rgba(0, 0, 0, .8);
  --shade: 0%;
  --mk-shade: 0%;
  --mk-sel: #fff;
  --mk-ring: 1.5px;
  --st-niewyjasnione: #ffd166;
  --st-sporne: #a9b8e0;
  --st-legenda: #d9a5ff;
  --st-wyjasnione: #7be29a;
  --st-mistyfikacja: #ff7a7a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: 0; font-variant-numeric: lining-nums; margin: 0 0 .5em; color: var(--heading); }
h1 { font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.2rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
code { font-size: .9em; padding: .1em .35em; border-radius: 5px; background: var(--surface-3); }

.lead { font-size: 1.06rem; color: var(--ink-2); }
.kicker { margin: 0 0 .35rem; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); }
.notice { padding: .75rem 1rem; border-radius: var(--radius-sm); background: rgba(255, 154, 60, .1); border: 1px solid rgba(255, 154, 60, .3); font-size: .9rem; }

.button {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .62em 1.1em; border-radius: 999px;
  background: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); color: var(--accent-ink); text-decoration: none; font-weight: 600; font-size: .92rem;
  transition: filter .15s, transform .15s;
}
.button:hover { color: var(--accent-ink); filter: brightness(1.12); }
.button-ghost { background: transparent; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); box-shadow: inset 0 0 0 1px currentColor; }
.button-ghost:hover { color: var(--heading); background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* ---------- Nagłówek i menu ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 32px);
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--heading); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: .01em; }
.brand:hover { color: var(--heading); }
.brand-mark { width: 30px; height: 30px; color: var(--accent); filter: drop-shadow(0 0 6px rgba(255, 154, 60, .55)); }

.site-nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .86rem; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--heading); }
.site-nav a[aria-current='page'] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 7px; }
.nav-toggle { display: none; }
.site-nav { margin-left: auto; }

/* „Inne mapy” – rozwijana lista (details/summary, bez JS poza zamykaniem kliknięciem obok) */
.maps-menu { position: relative; }
.maps-menu summary {
  display: inline-flex; align-items: center; gap: .3em; list-style: none; cursor: pointer;
  color: var(--muted); font-size: .86rem; font-weight: 500; user-select: none;
}
.maps-menu summary::-webkit-details-marker { display: none; }
.maps-menu summary:hover, .maps-menu details[open] > summary { color: var(--heading); }
.maps-menu summary svg { width: 12px; height: 12px; transition: transform .15s; }
.maps-menu details[open] > summary svg { transform: rotate(180deg); }
.site-nav .maps-menu ul {
  display: flex; flex-direction: column; gap: 0; position: absolute; z-index: 30; right: 0; top: calc(100% + 16px); min-width: 220px;
  padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow);
}
.site-nav .maps-menu a { display: block; padding: .55rem .75rem; border-radius: 8px; color: var(--ink-2); font-size: .88rem; white-space: nowrap; }
.site-nav .maps-menu a:hover { background: var(--surface-2); color: var(--heading); }
/* Mapa bez wersji w języku strony – plakietka języka linku (EN) */
.maps-lang { margin-left: .35em; padding: .05em .4em; border-radius: 4px; font-size: .68rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line-2); }

/* Tryb Halloween – przełącznik w nagłówku */
.hw-toggle {
  display: inline-flex; align-items: center; gap: .35em; margin-left: 1.4rem; padding: .28em .75em .28em .5em; border-radius: 999px; cursor: pointer;
  font: 600 .74rem/1.2 var(--font); letter-spacing: .04em; color: var(--muted); background: none; border: 1px solid var(--line-2);
  transition: color .15s, border-color .15s, box-shadow .15s;
}
.hw-toggle svg { width: 16px; height: 16px; }
.hw-toggle:hover { color: var(--heading); }
.hw-toggle[aria-pressed='true'] { color: var(--accent); border-color: rgba(255, 154, 60, .5); box-shadow: 0 0 16px -6px var(--accent); }
.lang-switch { display: flex; gap: 2px; margin: 0 0 0 .6rem; padding: 2px; border: 1px solid var(--line-2); border-radius: 999px; }
.lang-switch a { padding: .15em .55em; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 600; letter-spacing: .04em; }
.lang-switch a:hover { color: var(--heading); }
.lang-switch a[aria-current] { background: var(--surface-3); color: var(--heading); }

/* Przełącznik motywu: moduł theme (assets/theme/theme.css) – tu tylko wygląd GhostMap przez zmienne (pigułka jak
   przełącznik języków; na telefonie jeden przycisk z bieżącym trybem) */
.site-header {
  --theme-switch-bg: transparent; --theme-switch-size: 24px; --theme-switch-icon: 15px; --theme-switch-compact-icon: 17px;
  --theme-switch-fg-active: var(--heading); --theme-switch-gap-left-compact: .5rem; --theme-switch-bg-compact: transparent;
}

@media (max-width: 640px) {
  .lang-switch { margin-left: .5rem; }
  .hw-toggle { margin-left: .6rem; padding: .3em; }
  .hw-toggle-label { display: none; }
  .nav-toggle {
    display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
    border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink-2); cursor: pointer;
  }
  .nav-toggle svg { width: 20px; height: 20px; }
  .site-nav { position: relative; }
  .site-nav ul {
    display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px;
    flex-direction: column; gap: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow);
  }
  .site-nav.is-open ul { display: flex; }
  .site-nav ul a { display: block; padding: .55rem .75rem; font-size: .95rem; border-radius: 8px; }
  .site-nav ul a:hover { background: var(--surface-2); }
  /* W menu na telefonie „Inne mapy” rozwijają się w miejscu, z wcięciem */
  .maps-menu summary { display: flex; padding: .55rem .75rem; font-size: .95rem; border-radius: 8px; }
  .maps-menu summary:hover { background: var(--surface-2); }
  .site-nav .maps-menu ul { position: static; min-width: 0; padding: 0 0 0 .75rem; background: none; border: 0; box-shadow: none; }
}

/* Podpowiedź języka (layout.php) – pływający pasek, nie przesuwa układu strony głównej. */
.lang-hint {
  position: fixed; z-index: 40; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: .6rem; max-width: calc(100% - 32px); padding: .55rem .6rem .55rem 1rem;
  border-radius: 999px; background: var(--hint-bg); border: 1px solid var(--line-2); box-shadow: var(--shadow), 0 0 24px -10px var(--accent);
  font-size: .86rem; color: var(--ink-2);
}
.lang-hint[hidden] { display: none; }
.lang-hint a { font-weight: 600; white-space: nowrap; }
.lang-hint button { width: 28px; height: 28px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.lang-hint button:hover { background: var(--surface-3); color: var(--heading); }
@media (max-width: 640px) {
  .lang-hint { left: 12px; right: 12px; bottom: 12px; transform: none; max-width: none; border-radius: 16px; }
  .lang-hint span { flex: 1; }
}

.site-footer { padding: 24px clamp(16px, 3vw, 32px) 32px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); text-align: center; }
.site-footer p { margin: 0; }
.site-footer p + p { margin-top: .4rem; }
.site-footer a { color: var(--ink-2); }
/* Ikonki kanałów marki w stopce (Series::socialLinks, moduł series): kolor tekstu stopki, przy najechaniu i fokusie jaśniej */
.series-social-link { transition: opacity .15s; }
.series-social-link:hover, .series-social-link:focus-visible { opacity: .7; }

/* ---------- Mapy: ciemne lądy, znaczniki w kolorach kategorii ---------- */

.world-map {
  --wm-ocean: var(--ocean);
  --wm-sphere-stroke: var(--sphere);
  --wm-land: var(--land);
  --wm-land-hover: var(--land);
  --wm-land-inactive: var(--land);
  --wm-border: var(--land-border);
  --wm-border-width: .5px;
  --wm-hover-outline: transparent;
  --wm-control-bg: var(--surface-2);
  --wm-control-fg: var(--ink);
  --wm-control-border: var(--line-2);
  --wm-font: var(--font);
}
.world-map .wm-country[data-fill] { fill: var(--wm-fill); }

/* Kropki są ostre – ciemna obwódka oddziela sąsiednie. Poświata tylko przy najechaniu, wyborze i pojawieniu się. */
.world-map .mk circle {
  fill: color-mix(in oklab, var(--mk), #000 var(--mk-shade));
  stroke: var(--ocean);
  stroke-opacity: .9;
  stroke-width: var(--mk-ring);
  vector-effect: non-scaling-stroke;
  transition: opacity .35s;
}
.world-map .mk:hover circle, .world-map .mk.is-hot circle { stroke: var(--heading); stroke-opacity: 1; stroke-width: 2px; }
.world-map .mk.is-off { display: none; }
.world-map .mk.is-past circle { opacity: .3; }
.world-map .mk.is-dim circle { opacity: .5; }
.world-map .mk.is-new circle { animation: flare 1.2s ease-out; }
.world-map .mk.is-sel circle { fill: var(--mk-sel); stroke: var(--mk); stroke-opacity: 1; animation: beacon 1.8s ease-out infinite; }
@keyframes flare {
  0% { stroke: var(--mk); stroke-width: 18px; stroke-opacity: .55; }
  100% { stroke: var(--mk); stroke-width: var(--mk-ring); stroke-opacity: 0; }
}
@keyframes beacon {
  0% { stroke-width: 3px; stroke-opacity: 1; }
  80%, 100% { stroke-width: 30px; stroke-opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .world-map .mk circle { animation: none !important; }
}
/* Obrazek PNG (moduł export – klasa .is-exporting na czas kopiowania mapy): bez animacji, wybrane zjawisko z wyraźną
   obwódką w kolorze kategorii, przygaszone – lepiej widoczne */
.world-map svg.is-exporting .mk circle { animation: none !important; transition: none !important; }
.world-map svg.is-exporting .mk.is-sel circle { stroke-width: 5px; stroke-opacity: 1; }
.world-map svg.is-exporting .mk.is-dim circle { opacity: .75; }

.map-tip {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  max-width: 280px; padding: .5rem .7rem; border-radius: 9px;
  background: var(--tip-bg); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: .8rem; line-height: 1.35;
}
.map-tip strong { display: block; color: var(--heading); font-size: .86rem; }
.map-tip span { color: var(--muted); }

/* ---------- Strona główna: mapa, panel i oś czasu ---------- */

.map-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: 'map panel' 'time time';
  gap: 14px 18px;
  padding: 14px clamp(16px, 2vw, 28px) 16px;
  height: calc(100dvh - var(--header-h));
  min-height: 600px;
}
.map-area { grid-area: map; position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.map-area .world-map { position: relative; flex: 1; min-height: 0; border-radius: var(--radius); overflow: hidden; }
/* Mgła nad mapą: dwie miękkie smugi, które bardzo wolno dryfują (bez ruchu przy prefers-reduced-motion). */
.map-area .world-map::after {
  content: ''; position: absolute; inset: -12%; z-index: 1; pointer-events: none;
  background:
    radial-gradient(38% 26% at 28% 72%, rgba(var(--fog), .075), transparent 70%),
    radial-gradient(32% 22% at 72% 30%, rgba(var(--fog), .06), transparent 70%),
    radial-gradient(45% 30% at 55% 95%, rgba(255, 154, 60, .035), transparent 70%);
  animation: fog 80s ease-in-out infinite alternate;
}
@keyframes fog {
  from { transform: translate3d(-5%, 1%, 0); }
  to { transform: translate3d(5%, -2%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .map-area .world-map::after { animation: none; }
}

/* Mapa jako PNG – przycisk w lewym dolnym rogu mapy, menu formatów otwiera się w górę (moduł export) */
.map-area > .map-export-wrap { position: absolute; z-index: 5; left: 10px; bottom: 10px; }
.map-toolbar { position: absolute; z-index: 4; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 70px); }
.chip-cat {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .38em .8em .38em .6em; border-radius: 999px; cursor: pointer;
  font: 500 .8rem/1.2 var(--font); color: var(--ink-2);
  background: var(--glass); border: 1px solid var(--line-2); backdrop-filter: blur(6px);
  transition: border-color .15s, color .15s, opacity .15s;
}
.chip-cat svg { width: 16px; height: 16px; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); }
.chip-cat[aria-pressed='true'] { color: var(--heading); border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 0 14px -6px var(--c); }
.chip-cat[aria-pressed='false'] { opacity: .55; }
.chip-cat[aria-pressed='false'] svg { color: var(--muted); }
.chip-count { font-variant-numeric: lining-nums tabular-nums; color: var(--muted); font-size: .75rem; }

.panel {
  grid-area: panel; min-height: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.panel-intro h1 { font-size: 2.4rem; margin-bottom: .4rem; }
.panel-intro .lead { font-size: .93rem; }
.search input {
  width: 100%; margin-top: 1rem; padding: .7em 1em; font: inherit; font-size: .92rem; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 154, 60, .15); }

/* Licznik do Halloween i „losowa historia” */
.hw-badge {
  display: inline-flex; align-items: center; gap: .45em; margin: 0 0 .9rem; padding: .3em .8em .3em .55em; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: var(--accent);
  background: rgba(255, 154, 60, .1); border: 1px solid rgba(255, 154, 60, .35); box-shadow: 0 0 18px -8px var(--accent);
}
.hw-badge svg { width: 18px; height: 18px; }
.random {
  display: inline-flex; align-items: center; gap: .5em; margin-top: .7rem; padding: .45em .9em .45em .7em; border-radius: 999px; cursor: pointer;
  font: 500 .84rem/1.2 var(--font); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2);
  transition: color .15s, border-color .15s;
}
.random svg { width: 18px; height: 18px; color: var(--accent); }
.random:hover { color: var(--heading); border-color: var(--accent); }
.random.is-done { color: var(--st-wyjasnione); border-color: var(--st-wyjasnione); }
.random:hover svg { animation: flicker 1.2s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { opacity: 1; }
  40% { opacity: .55; }
  60% { opacity: .9; }
  75% { opacity: .4; }
}
@media (prefers-reduced-motion: reduce) {
  .random:hover svg { animation: none; }
}

.stats { display: flex; gap: .6rem; margin: 1rem 0 0; }
.stats div { flex: 1; display: flex; flex-direction: column-reverse; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.stats dt { font-size: .74rem; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--heading); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.stats-wide { max-width: 480px; margin-bottom: 2rem; }

.panel-list { margin-top: 1.1rem; }
.panel-foot { margin: 1.2rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.panel-foot a { color: var(--muted); }
.panel-foot a:hover { color: var(--heading); }
.list-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .78rem; font-family: var(--font); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.list-head span { color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.list-empty { font-size: .9rem; color: var(--muted); }

.case-list { list-style: none; margin: 0 -8px; padding: 0; }
.case-list button {
  display: grid; grid-template-columns: 86px 1fr; gap: 8px; align-items: baseline; width: 100%;
  padding: 7px 8px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.case-list button:hover, .case-list button:focus-visible { background: var(--surface-2); }
/* Po angielsku „1431–present” jest dłuższe niż „1431–dziś”; przy większej czcionce rok zawija się po myślniku. */
:lang(en) .case-list button { grid-template-columns: 104px 1fr; }
.cl-year { position: relative; padding-left: 14px; font-size: .78rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; }
.cl-year::before { content: ''; position: absolute; left: 0; top: .42em; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.cl-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cl-text strong { font-size: .9rem; font-weight: 600; color: var(--heading); }
.cl-text em { font-style: normal; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Podgląd przypadku w panelu */
.pv { position: relative; }
.pv-cat { display: flex; align-items: center; gap: .4em; margin: 0 0 .5rem; font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); }
.pv-cat svg { width: 18px; height: 18px; flex: none; }
.pv-cat a { color: inherit; text-decoration: none; }
.pv-cat a:hover { text-decoration: underline; }
.pv h2 { font-size: 1.9rem; margin-bottom: .5rem; padding-right: 2rem; }
.pv h2 a { color: inherit; text-decoration: none; }
.pv h2 a:hover { text-decoration: underline; text-decoration-color: var(--c); }
.pv h3 { margin: 1.6rem 0 .3rem; font-size: .78rem; font-family: var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pv-when { font-size: .88rem; color: var(--ink-2); margin-bottom: .6rem; }
.pv-short { font-size: .95rem; }
.pv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pv-actions .random { margin-top: 0; }

/* Start na stronie głównej: podróż w czasie (główna akcja) i losowa historia */
.intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: .2rem; }
.intro-actions .random { margin-top: 0; }
.cta-play { border: 0; cursor: pointer; font: 600 .95rem/1.2 var(--font); padding: .75em 1.25em; box-shadow: 0 0 24px -6px var(--accent); }
.cta-play svg { width: 13px; height: 13px; fill: currentColor; }
.cta-hint { margin: .55rem 0 0; font-size: .82rem; color: var(--muted); }

/* Ścieżki: lista na starcie i pasek nad podglądem historii */
.trails { margin-top: 1.1rem; }
.trails ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.trails-toggle { margin-top: 6px; padding: .3em 0; border: 0; background: none; color: var(--accent); font: 500 .82rem/1.3 var(--font); cursor: pointer; }
.trails-toggle:hover { text-decoration: underline; }
.trail-btn {
  display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; row-gap: 2px; width: 100%; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s;
}
.trail-btn svg { grid-row: span 3; width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.trail-btn strong { color: var(--heading); font-size: .92rem; font-weight: 600; line-height: 1.3; }
.trail-btn span { font-size: .8rem; line-height: 1.4; color: var(--ink-2); }
.trail-btn em { font-style: normal; font-size: .74rem; color: var(--accent); }
.trail-btn:hover, .trail-btn:focus-visible { border-color: var(--accent); }
.hw .trail-btn.is-featured { border-color: rgba(255, 154, 60, .45); background: linear-gradient(135deg, rgba(255, 154, 60, .12), var(--surface-2) 60%); box-shadow: 0 0 22px -12px var(--accent); }

.tour { margin: 0 0 1.1rem; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.tour-head { display: flex; align-items: center; gap: .4em; margin: 0; font-size: .78rem; color: var(--muted); }
.tour-head svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.tour-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--heading); font-weight: 600; }
.tour-count { flex: none; color: var(--accent); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.tour-progress { height: 3px; margin: 9px 0; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.tour-progress i { display: block; width: 0; height: 100%; background: var(--accent); }
.tour-progress i.is-running { animation: tour-progress var(--dwell) linear forwards; }
@keyframes tour-progress { to { width: 100%; } }
.tour-end { margin: .55rem 0; font-size: .84rem; color: var(--ink-2); }
.tour-end button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.tour-nav { display: flex; gap: 6px; }
.tour-nav button {
  min-width: 34px; padding: .35em .75em; border-radius: 999px; cursor: pointer;
  font: 500 .78rem/1.2 var(--font); color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line-2);
}
.tour-nav button:hover:not(:disabled) { color: var(--heading); border-color: var(--muted); }
.tour-nav button:disabled { opacity: .4; cursor: default; }
.tour-nav .tour-close { margin-left: auto; }

/* Strona przypadku: oś czasu i udostępnianie */
.case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.case-actions .random { margin-top: 0; }
.pv-close {
  position: absolute; top: -10px; right: -10px; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.pv-close:hover { background: var(--surface-2); color: var(--heading); }

.status {
  display: inline-block; padding: .18em .6em; border-radius: 999px; white-space: nowrap;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5;
  color: var(--st); background: color-mix(in srgb, var(--st) 13%, transparent); border: 1px solid color-mix(in srgb, var(--st) 35%, transparent);
}
.status-niewyjasnione { --st: var(--st-niewyjasnione); }
.status-sporne { --st: var(--st-sporne); }
.status-legenda { --st: var(--st-legenda); }
.status-wyjasnione { --st: var(--st-wyjasnione); }
.status-mistyfikacja { --st: var(--st-mistyfikacja); }

/* ---------- Oś czasu ---------- */

.timeline { grid-area: time; min-width: 0; }
.tl {
  padding: 10px 16px 6px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  user-select: none; -webkit-user-select: none;
}
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tl-play {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; cursor: pointer;
  border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 18px -4px rgba(255, 154, 60, .7);
  transition: transform .15s;
}
.tl-play:hover { transform: scale(1.06); }
.tl-play svg { width: 18px; height: 18px; fill: currentColor; }
.tl-icon-pause, .is-playing .tl-icon-play { display: none; }
.is-playing .tl-icon-pause { display: inline; }
.tl-speed, .tl-loop, .tl-trail, .tl-preset {
  padding: .35em .75em; border-radius: 999px; cursor: pointer;
  font: 500 .78rem/1.2 var(--font); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2);
  white-space: nowrap;
}
.tl-speed { min-width: 44px; font-variant-numeric: lining-nums tabular-nums; }
/* Pętla odtwarzania (moduł timeline, opcja loop) */
.tl-loop { display: inline-grid; place-items: center; padding-block: .3em; }
.tl-loop svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tl-loop[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); }
.tl-speed:hover, .tl-loop:hover, .tl-trail:hover, .tl-preset:hover { color: var(--heading); border-color: var(--muted); }
.tl-trail[aria-pressed='true'] { color: var(--accent); border-color: rgba(255, 154, 60, .5); }
.tl-readout { margin: 0 auto 0 8px; display: flex; align-items: baseline; gap: .6rem; }
.tl-years { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--heading); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.tl-info { font-size: .82rem; color: var(--muted); }
.tl-presets { display: flex; gap: 6px; flex-wrap: wrap; }

.tl-track { position: relative; height: 62px; cursor: pointer; touch-action: none; }
.tl-bars { position: absolute; inset: 0 0 0 0; }
.tl-bar { position: absolute; bottom: 0; display: flex; flex-direction: column-reverse; padding: 0 1px; opacity: .28; transition: opacity .2s; }
.tl-bar i { display: block; min-height: 1px; border-radius: 1px; }
.tl-bar i:last-child { border-radius: 2px 2px 1px 1px; }
.tl-bar.is-on { opacity: 1; }
.tl-track::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-2); }

.tl-window {
  position: absolute; top: -4px; bottom: -4px; min-width: 4px;
  background: rgba(255, 154, 60, .07); border: 1px solid rgba(255, 154, 60, .55); border-radius: 6px;
  cursor: grab;
}
.is-dragging .tl-window { cursor: grabbing; }
.is-all .tl-window { background: transparent; border-color: rgba(255, 154, 60, .25); }
.tl-handle {
  position: absolute; top: 50%; width: 14px; height: 30px; margin-top: -15px; cursor: ew-resize;
  border-radius: 5px; background: var(--accent); box-shadow: 0 0 0 3px var(--surface);
}
.tl-handle::after { content: ''; position: absolute; inset: 8px 5px; border-left: 1px solid var(--accent-ink); border-right: 1px solid var(--accent-ink); opacity: .55; }
.tl-handle-from { left: -8px; }
.tl-handle-to { right: -8px; }
.tl-handle:focus-visible { outline: 2px solid var(--heading); outline-offset: 2px; }
.is-playing .tl-window { border-color: var(--accent); box-shadow: 0 0 22px -6px var(--accent); }

.tl-axis { position: relative; height: 22px; margin-top: 4px; font-size: .7rem; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.tl-axis span { position: absolute; top: 2px; transform: translateX(-50%); }
.tl-axis span::before { content: ''; position: absolute; left: 50%; top: -6px; height: 4px; border-left: 1px solid var(--line-2); }

@media (max-width: 900px) {
  .map-stage {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: 'map' 'time' 'panel';
    height: auto; min-height: 0; padding-top: 10px;
  }
  /* Wysokość (ok. połowa ekranu) i przewijanie pasa mapy w bok – tryb phone modułu world-map (home.js) */
  .map-area .world-map { flex: none; }
  .map-toolbar { position: static; max-width: none; margin-bottom: 8px; }
  .panel { overflow: visible; scroll-margin-top: calc(var(--header-h) + 12px); }
  .tl-readout { order: -1; flex-basis: calc(100% - 50px); margin: 0; }
  .tl-presets { order: 5; flex-basis: 100%; min-width: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
}

/* ---------- Podstrony ---------- */

.page { max-width: 1200px; margin: 0 auto; padding: 20px clamp(16px, 3vw, 32px) 56px; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .84rem; color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--heading); }
.crumbs [aria-current] { color: var(--ink-2); }
.page-head { max-width: 760px; margin-bottom: 2rem; }

/* Przypadek */
.case-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 36px; align-items: start; margin-bottom: 40px; }
.case-head h1 { margin: .2rem 0 1.1rem; }
.case-facts { display: grid; gap: .55rem; margin: 0 0 1.3rem; }
.case-facts div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: baseline; }
.case-facts dt { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.case-facts dd { margin: 0; color: var(--ink); }
.case-map { position: relative; margin: 0; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.case-map .world-map { height: clamp(260px, 36vw, 420px); border-radius: 9px; overflow: hidden; }
.case-map figcaption { margin: .5rem .2rem 0; font-size: .76rem; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
/* Podpis mapy z przyciskiem PNG po prawej (menu formatów – moduł export) */
.case-map .map-caption { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.map-caption .map-export-wrap { position: relative; flex: none; }

.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; }
.case-body { max-width: 720px; }
.case-body h2 { margin-top: 2rem; font-size: 1.55rem; }
.case-body h2:first-child { margin-top: 0; }
.case-body p { color: var(--ink-2); font-size: 1.04rem; line-height: 1.7; }
.status-note { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .9rem !important; color: var(--muted) !important; }
.case-dating { display: block; margin-top: .15rem; font-size: .8rem; color: var(--muted); }
.sources { margin: 0; padding-left: 1.3rem; font-size: .9rem; color: var(--ink-2); }
.sources li { margin-bottom: .35rem; overflow-wrap: anywhere; }
.more { margin-top: 1.6rem; font-size: .92rem; }
.more a { margin-left: .6rem; }

.time-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 2.6rem; }
.time-nav a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.time-nav a:hover { border-color: var(--c); }
.time-nav strong { color: var(--heading); line-height: 1.3; }
.time-nav span { font-size: .8rem; color: var(--muted); }
.time-nav .time-nav-label { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); }
.time-nav-next { text-align: right; }

.case-side h2 { font-size: .8rem; font-family: var(--font); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.case-side h2:not(:first-child) { margin-top: 2rem; }
.side-note { font-size: .88rem; color: var(--muted); }
.mini-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 2px; }
.mini-list a { display: flex; flex-direction: column; padding: 7px 10px 7px 22px; position: relative; border-radius: var(--radius-sm); text-decoration: none; line-height: 1.3; }
.mini-list a::before { content: ''; position: absolute; left: 8px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.mini-list a:hover { background: var(--surface-2); }
.mini-list strong { color: var(--heading); font-size: .9rem; font-weight: 600; }
.mini-list span { color: var(--muted); font-size: .78rem; }

/* Rodzaj zjawiska i kraj: mapa + chronologiczna lista */
.listing-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: start; margin-bottom: 44px; }
.listing-hero .lead { font-size: 1rem; }
.listing-hero .stats { max-width: 360px; }
.status-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1rem; }

.timeline-list { list-style: none; margin: 0; padding: 0; max-width: 900px; }
.tg { display: grid; grid-template-columns: 120px 1fr; gap: 24px; position: relative; }
.tg::before { content: ''; position: absolute; left: 120px; margin-left: 11px; top: 0; bottom: 0; border-left: 1px dashed var(--line-2); }
.tg-label { position: sticky; top: calc(var(--header-h) + 14px); align-self: start; margin: 18px 0 0; font-size: 1.15rem; color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; text-align: right; }
.tg > ol { list-style: none; margin: 0; padding: 10px 0 10px 0; display: grid; gap: 10px; }
.tcard { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px 18px 14px 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.tcard::before { content: ''; position: absolute; left: -18px; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.tcard:hover, [data-slug]:hover > .tcard { border-color: color-mix(in srgb, var(--c) 60%, transparent); color: inherit; transform: translateX(2px); }
.tcard-year { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); font-variant-numeric: lining-nums tabular-nums; }
.tcard-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tcard-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tcard strong { font-size: 1.32rem; line-height: 1.15; color: var(--heading); font-family: var(--font-display); }
.tcard em { font-style: normal; font-size: .85rem; color: var(--muted); }
.tcard-short { margin-top: 4px; font-size: .9rem; color: var(--ink-2); }

/* Katalog */
.cat-section { margin-bottom: 3rem; }
.cat-head { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; max-width: 860px; margin-bottom: 1.2rem; }
.cat-icon { width: 48px; height: 48px; padding: 10px; border-radius: 14px; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.cat-head h2 { font-size: 1.9rem; margin-bottom: .3rem; }
.cat-head h2 span { font-family: var(--font); font-size: .9rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.cat-head p { color: var(--ink-2); margin: 0; }
.type-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.type-card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--c); color: inherit; text-decoration: none; transition: transform .15s, border-color .15s; }
.type-card:hover { color: inherit; transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 50%, transparent); border-top-color: var(--c); }
.type-card strong { font-family: var(--font-display); font-size: 1.32rem; line-height: 1.15; color: var(--heading); }
.type-short { font-size: .86rem; color: var(--ink-2); flex: 1; }
.type-meta { font-size: .76rem; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; gap: .45em; padding: .35em .85em; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-size: .88rem; }
.chips a:hover { border-color: var(--accent); color: var(--heading); }
.chips a span { color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }

/* Strony tekstowe */
.prose-page { max-width: 760px; }
.prose-page h2 { margin-top: 2.2rem; }
.prose-page h2[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
.prose-page li { margin-bottom: .45rem; color: var(--ink-2); }
.legend-list { list-style: none; padding: 0; }
.legend-list li { display: flex; align-items: center; gap: .5rem; }
.legend-list li .status, .legend-list li svg { flex: none; }
.legend-list svg { width: 20px; height: 20px; color: color-mix(in oklab, var(--c, var(--brand)), #000 var(--shade)); }
.error-page { text-align: center; padding-top: 12vh; }

/* Kontakt */
.contact-page { max-width: 680px; }
.contact-page h1 { display: flex; align-items: center; gap: .35em; }
.contact-mark { width: .8em; height: .8em; flex: none; color: var(--accent); filter: drop-shadow(0 0 8px rgba(255, 154, 60, .45)); }
.contact-form {
  display: grid; gap: 1.1rem; margin: 1.6rem 0 1.4rem; padding: clamp(18px, 3vw, 28px);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .3s, border-color .3s;
}
.field { display: grid; gap: .4rem; }
.field label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.field input[type='text'], .field input[type='email'], .field textarea {
  width: 100%; padding: .7em .9em; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 10rem; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 154, 60, .15); }
.field.has-error input, .field.has-error textarea { border-color: var(--st-mistyfikacja); }
.field-check { grid-template-columns: auto 1fr; align-items: start; column-gap: .7rem; }
.field-check input { width: 18px; height: 18px; margin: .2rem 0 0; accent-color: var(--accent); }
.field-check label { font-weight: 400; font-size: .86rem; color: var(--ink-2); line-height: 1.55; }
.field-check .field-error { grid-column: 2; }
.req { color: var(--accent); }
.field-error { margin: 0; font-size: .84rem; color: var(--st-mistyfikacja); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; }
.form-note { font-size: .8rem; color: var(--muted); }
button.button { border: 0; cursor: pointer; font-family: inherit; }
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-alert, .form-success { margin: 1.4rem 0 0; padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .92rem; color: var(--ink); }
.form-alert { background: rgba(255, 122, 122, .1); border: 1px solid rgba(255, 122, 122, .35); }
.form-success { background: rgba(123, 226, 154, .09); border: 1px solid rgba(123, 226, 154, .35); font-size: 1.02rem; margin-bottom: 1.4rem; }
.form-clause { font-size: .8rem; color: var(--muted); line-height: 1.55; }
.form-clause a { color: var(--ink-2); }
/* W trybie Halloween: dynia zamiast ducha w nagłówku, formularz z dyniową poświatą jak wyróżniona ścieżka */
.hw .contact-mark:not(.hw-only) { display: none; }
.hw .contact-mark { filter: drop-shadow(0 0 10px rgba(255, 154, 60, .85)); }
.hw .contact-form {
  border-color: rgba(255, 154, 60, .38);
  background: linear-gradient(160deg, rgba(255, 154, 60, .09), var(--surface-2) 45%, var(--surface));
  box-shadow: var(--shadow), 0 0 34px -16px var(--accent);
}
.hw .field input[type='text'], .hw .field input[type='email'], .hw .field textarea { background: var(--hw-field-bg); border-color: var(--hw-field-line); }
.hw .field input:focus, .hw .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 154, 60, .2), 0 0 18px -6px var(--accent); }
.hw .contact-form .button { box-shadow: 0 0 20px -6px var(--accent); }
.hw .form-success { border-color: rgba(255, 154, 60, .45); background: rgba(255, 154, 60, .1); }

/* „Więcej map na Ominuvo” – ostatnia pozycja menu „Inne mapy”, oddzielona linią */
.site-nav .maps-menu .maps-more { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line-2); }
.site-nav .maps-menu .maps-more a { color: var(--accent); }

@media (max-width: 900px) {
  .case-hero, .listing-hero, .case-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .case-hero .case-map { order: -1; }
  .tg { grid-template-columns: 1fr; gap: 0; }
  .tg::before { display: none; }
  .tg-label { position: static; text-align: left; margin-top: 1.2rem; }
  .tcard { grid-template-columns: 1fr; gap: 4px; padding-left: 18px; }
  .tcard::before { display: none; }
  .time-nav { grid-template-columns: 1fr; }
}

/* ---------- Tryb Halloween (klasa hw na <html>, zob. layout.php) ---------- */
/* Poza trybem strona jest spokojnym atlasem duchów; w trybie dochodzą licznik, dyniowa poświata, cieplejsza mgła i nietoperze. */

html:not(.hw) .hw-only { display: none !important; }
.hw body {
  background:
    radial-gradient(1200px 650px at 80% -10%, rgba(255, 130, 40, .14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(150, 90, 255, .09), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.hw .brand-mark { filter: drop-shadow(0 0 9px rgba(255, 154, 60, .85)); }
.hw .map-area .world-map::after {
  background:
    radial-gradient(38% 26% at 28% 72%, rgba(var(--fog), .09), transparent 70%),
    radial-gradient(32% 22% at 72% 30%, rgba(var(--fog), .07), transparent 70%),
    radial-gradient(55% 34% at 55% 100%, rgba(255, 130, 40, .09), transparent 70%);
}

/* Nietoperze: co kilkadziesiąt sekund jeden przelatuje nad mapą (bez ruchu przy prefers-reduced-motion). */
.hw-bats { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; border-radius: var(--radius); }
/* Księżyc w pełni za nietoperzami */
.hw-bats::before {
  content: ''; position: absolute; right: 12%; top: 10%; width: clamp(40px, 5vw, 72px); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 64% 40%, rgba(190, 120, 50, .35) 0 9%, transparent 10%),
    radial-gradient(circle at 36% 62%, rgba(190, 120, 50, .28) 0 13%, transparent 14%),
    radial-gradient(circle at 40% 36%, #fff6e2, #f7d49a 60%, #e9a95c);
  box-shadow: 0 0 30px 6px rgba(255, 190, 110, .35), 0 0 110px 36px rgba(255, 150, 60, .12);
  opacity: .82;
}
.hw-bats svg {
  position: absolute; left: -40px; top: 30%; width: 26px; height: 26px; color: #120c1a;
  filter: drop-shadow(0 0 5px rgba(255, 154, 60, .55));
  animation: bat-fly 38s linear infinite, bat-flap .22s ease-in-out infinite alternate;
}
.hw-bats svg:nth-child(2) { top: 18%; width: 20px; height: 20px; animation-duration: 47s, .19s; animation-delay: -14s, 0s; }
.hw-bats svg:nth-child(3) { top: 52%; width: 18px; height: 18px; animation-duration: 61s, .25s; animation-delay: -35s, 0s; }
@keyframes bat-fly {
  0% { left: -40px; margin-top: 0; }
  6% { margin-top: -28px; }
  12% { margin-top: 10px; }
  18% { margin-top: -18px; }
  24%, 100% { left: calc(100% + 40px); margin-top: 0; }
}
@keyframes bat-flap { to { transform: scaleY(.55); } }
@media (prefers-reduced-motion: reduce) {
  .hw-bats { display: none; }
}

/* ---------- Quiz (/quiz – moduł quiz z assets; mapa – kolory .world-map) ---------- */
.quiz-stage { margin: 18px 0 28px; }
.quiz-stage .quiz { --quiz-accent: var(--accent); --quiz-accent-ink: var(--accent-ink); --quiz-surface: var(--surface); --quiz-target: var(--glow-1); }
.quiz-map { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.quiz-about { max-width: 70ch; color: var(--ink-2); }
