@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=Kaushan+Script&display=swap');

:root {
  --primary:   #c4922a;
  --dark:      #0f1117;
  --surface:   #1a1e27;
  --muted:     #8a8f9a;
  --gold:      #f5e1a4;
  --gold-dim:  #c9a84c;
  --text:      #e2d5a8;
  --radius:    12px;
  --border:    rgba(196,146,42,0.28);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  background-color: var(--dark);
  color: var(--text);
  overflow-x: hidden;
  font-size: 1.2rem;
}

/* =============================================
   LOADER
   ============================================= */
#loader {
  position: fixed;
  inset: 0;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  gap: 1.2rem;
  transition: opacity 0.6s ease;
}
#loader .loader-rune {
  font-size: 3.4rem;
  color: var(--primary);
  animation: runeFlicker 1.4s ease-in-out infinite;
  letter-spacing: 0.3em;
  text-shadow: 0 0 24px rgba(196,146,42,0.8);
}
#loader .loader-bar {
  width: 160px; height: 2px;
  background: rgba(196,146,42,0.15);
  border-radius: 2px; overflow: hidden;
}
#loader .loader-bar::after {
  content: "";
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: loaderSweep 1.2s ease-in-out infinite;
}
@keyframes runeFlicker {
  0%,100% { opacity: 0.4; transform: scale(1);   }
  50%     { opacity: 1;   transform: scale(1.1); }
}
@keyframes loaderSweep {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(400%);  }
}

/* =============================================
   HERO — obsługuje zarówno <img> jak i <video>
   ============================================= */
.hero {
  position: relative;
  width: 100%;
  height: 62vh;
  min-height: 340px;
  overflow: hidden;
}
.hero-img,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  /* centered both vertically and horizontally */
  object-position: center center;
  display: block;
  filter: brightness(0.8) saturate(0.92);
  transition: filter 1.4s ease;
  transform: scale(1.03);
}
.hero:hover .hero-img,
.hero:hover .hero-video { filter: brightness(0.92) saturate(1.05); }

.hero-veil {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 68%;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(15,17,23,0.55) 55%,
    var(--dark) 100%);
}

/* =============================================
   PAGE WRAPPER
   ============================================= */
.page-wrap {
  width: 92%;
  max-width: 960px;
  margin: -4rem auto 0;
  background: rgba(15,17,23,0.97);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow:
    0 -4px 40px rgba(0,0,0,0.5),
    0 24px 70px rgba(0,0,0,0.85),
    inset 0 1px 0 rgba(196,146,42,0.08);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

/* List page — no hero, normal margin. */
.page-wrap.lista-wrap {
  margin-top: 3.5rem;
  margin-bottom: 3.5rem;
}

/* Inner padding for content. */
.page-content {
  padding: 2.4rem 2.8rem 0;
  position: relative;
}

/* =============================================
   LANG SWITCH
   ============================================= */
.switch {
  position: absolute;
  top: 1rem; right: 1.5rem;
  display: flex; gap: 0.4rem;
  z-index: 10;
}
.switch button {
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border);
  color: var(--gold);
  padding: 0.22rem 0.65rem;
  cursor: pointer; border-radius: 4px;
  font-family: 'Playfair Display', serif;
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.08em;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.switch button:hover,
.switch button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* =============================================
   LANG VISIBILITY
   ============================================= */
.lang { opacity: 0; transition: opacity 0.4s ease; display: none; width: 100%; }
.lang.active { display: block; opacity: 1; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 700; text-align: center;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin: 1rem 0 0.25rem;
  line-height: 1.12;
  text-shadow: 0 2px 24px rgba(196,146,42,0.35);
  animation: riseUp 0.9s ease both;
}
.lista-title {
  font-size: clamp(2.9rem, 6.5vw, 4.3rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
h1::after {
  content: '';
  display: block; width: 52px; height: 2px;
  background: linear-gradient(90deg, var(--primary), #e0b060);
  margin: 10px auto 0; border-radius: 2px;
}
.lista-title::after { width: 80px; }

.subtitle {
  text-align: center;
  font-family: 'Kaushan Script', cursive;
  font-size: 1.25rem;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin: 0.7rem 0 1.8rem;
  animation: fadeIn 1.4s ease both;
}

p {
  font-size: 1.3rem;
  line-height: 1.82;
  margin-bottom: 1rem;
  color: var(--text);
}
a       { color: var(--gold-dim); text-decoration: underline; }
a:hover { color: var(--gold); }

/* =============================================
   WYRAJ INTRO
   ============================================= */
.wyraj-intro {
  max-width: 38rem;
  margin: 0 auto 0.5rem;
  text-align: center;
  animation: fadeIn 1.2s ease both;
}
.wyraj-intro p {
  font-size: 1.15rem;
  line-height: 1.9;
  font-style: italic;
  color: var(--text);
}
.wyraj-intro p:last-child {
  font-style: normal;
  font-family: 'Kaushan Script', cursive;
  font-size: 1.35rem;
  color: var(--gold-dim);
  margin-top: 0.4rem;
}

/* =============================================
   SECTION TITLE
   ============================================= */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700;
  margin: 2.2rem 0 0.7rem;
  color: var(--gold); letter-spacing: 0.05em;
  text-align: center;
  animation: fadeIn 1.5s ease both;
}
.section-title::after {
  content: '';
  display: block; width: 36px; height: 2px;
  background: linear-gradient(90deg, var(--primary), #e0b060);
  margin: 6px auto 0; border-radius: 2px;
}

/* =============================================
   CONTENT
   ============================================= */
.tresc { animation: fadeIn 1s ease both; }

.tresc ul, .zrodla ul {
  padding-left: 1.5rem;
  line-height: 1.95; font-size: 1.25rem;
  margin: 0.4rem 0 1rem;
}
.tresc li, .zrodla li { margin-bottom: 0.65rem; }

/* ── Box: text only, no background ── */
.box {
  border-radius: 10px;
  padding: 1.2rem 1.6rem; margin: 1.3rem 0;
  /* No background and no border — plain text */
  position: relative;
  z-index: 2;
}

.highlight {
  font-weight: bold; color: var(--primary);
  text-shadow: 0 0 8px rgba(196,146,42,0.5);
}

/* =============================================
   TRESC-WITH-BG
   Static image behind the "About the Feast" and "Rites" boxes,
   with top/bottom fades
   ============================================= */
.tresc-with-bg {
  position: relative;
  /* distance from the left/right edge of page-content */
  margin-left: -2.8rem;
  margin-right: -2.8rem;
  padding-left: 2.8rem;
  padding-right: 2.8rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Background: static image, masked only on this element */
.tresc-with-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--bg-img, none);
  background-size: cover;
  background-position: center center;
  background-attachment: local;
  /* strong darkening so the text stays readable */
  filter: brightness(0.22) saturate(0.7);
  /* mask applies only to the background — text in .box is not darkened */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 12%,
    black 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 12%,
    black 88%,
    transparent 100%
  );
  z-index: 0;
}

/* Top fade */
.tresc-with-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: none;
  z-index: 1;
  pointer-events: none;
}

/* Pseudo-elements aren't enough for two gradients — handled via box-shadow on ::before instead */
/* Top gradient */
.tresc-with-bg > .fade-top,
.tresc-with-bg > .fade-bottom {
  display: none; /* handled via CSS masks instead */
}

/* Mask that fades out the edges (top and bottom) — background only, not the text */

/* When --bg-img is missing: hide the pseudo-element */
.tresc-with-bg:not([style])::before,
.tresc-with-bg[style="--bg-img: url('');"]::before {
  display: none;
}

/* =============================================
   SOURCES
   ============================================= */
.zrodla {
  margin-top: 2.8rem; padding-top: 1rem;
  border-top: 1px solid rgba(196,146,42,0.18);
  animation: fadeIn 1.6s ease both;
}
.zrodla .section-title { margin-top: 0; }
.zrodla li { font-size: 1.1rem; color: var(--muted); line-height: 1.75; }
.zrodla a  { color: var(--gold-dim); }
.zrodla a:hover { color: var(--gold); }

/* =============================================
   ORNAMENT
   ============================================= */
.ornament {
  text-align: center; font-size: 1.44rem;
  margin: 2rem 0; color: var(--primary);
  opacity: 0.7; letter-spacing: 0.25em;
  animation: pulse 4s ease-in-out infinite;
}

/* =============================================
   FEAST GRID
   ============================================= */
.swieta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.3rem;
  margin: 1.4rem 0 2.2rem;
}
.swieto-card {
  display: block; text-decoration: none;
  color: var(--text); background: var(--surface);
  border: 1px solid rgba(196,146,42,0.18);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.3s ease;
}
.swieto-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.8);
  border-color: var(--primary);
}
.card-img-wrap { overflow: hidden; aspect-ratio: 2/3; position: relative; }

/* Shared style for the img and video inside a card */
.swieto-card img,
.card-video {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  filter: brightness(0.85) saturate(0.9);
  transition: filter 0.35s ease, transform 0.45s ease;
}
.swieto-card:hover img,
.swieto-card:hover .card-video {
  filter: brightness(1) saturate(1.05);
  transform: scale(1.06);
}

.card-body {
  padding: 0.9rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 700; color: var(--gold);
}
.card-sub {
  font-family: 'Kaushan Script', cursive;
  font-size: 0.94rem; color: var(--primary);
}

/* =============================================
   FOOTER — inside .page-wrap
   ============================================= */
.footer {
  background: rgba(8,10,15,0.98);
  text-align: center;
  padding: 2.4rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.footer p {
  font-size: 1rem;
  margin: 0.6rem 0 0;
  color: rgba(255,255,255,0.45);
}
.site-credits {
  width: 92%;
  max-width: 960px;
  margin: 0 auto 2.5rem;
  padding: 1.4rem 1.5rem 0;
  border-top: 1px solid rgba(196,146,42,0.25);
  text-align: center;
  box-sizing: border-box;
}
.site-credits p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  font-style: italic;
  margin: 0 auto;
  max-width: 42rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.24);
}
.site-credits a {
  color: rgba(255,255,255,0.34);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.2);
  transition: color 0.2s, border-color 0.2s;
}
.site-credits a:hover {
  color: var(--gold);
  border-color: var(--gold);
}
.back-button {
  display: inline-block;
  margin-bottom: 1.4rem;
  padding: 0.6rem 1.7rem;
  border: 1px solid var(--border);
  color: var(--gold); text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.96rem; font-weight: 700;
  border-radius: 4px;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.2s;
}
.back-button:hover {
  background: var(--primary); border-color: var(--primary);
  color: #fff; transform: scale(1.04);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes riseUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes pulse {
  0%,100% { opacity: 0.5; transform: scale(1);    }
  50%     { opacity: 0.9; transform: scale(1.06); }
}
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* =============================================
   RESPONSIVE — tablet & mobile
   ============================================= */
@media (max-width: 768px) {
  body { font-size: 1.1rem; }

  .hero             { height: 46vh; min-height: 260px; }
  .hero-veil        { height: 58%; }

  .page-wrap        { width: 96%; margin-top: -3rem; }
  .page-wrap.lista-wrap { margin-top: 1.2rem; margin-bottom: 1.5rem; }
  .page-content     { padding: 1.6rem 1.1rem 0; }

  h1                { font-size: 2.6rem; }
  .lista-title      { font-size: 3.2rem; letter-spacing: 0.1em; }
  .subtitle         { font-size: 1.35rem; }
  .section-title    { font-size: 1.3rem; }
  p                 { font-size: 1.1rem; line-height: 1.75; }
  .wyraj-intro p    { font-size: 1.02rem; }
  .wyraj-intro p:last-child { font-size: 1.2rem; }
  .tresc ul,
  .zrodla ul        { font-size: 1.1rem; }
  .zrodla li        { font-size: 1rem; }

  .box              { padding: 1rem 1.1rem; }
  .switch           { top: 0.7rem; right: 0.9rem; }
  .switch button    { font-size: 0.78rem; padding: 0.2rem 0.5rem; }

  .swieta-grid      { grid-template-columns: repeat(2,1fr); gap: 0.85rem; }
  .card-title       { font-size: 1.05rem; }
  .ornament         { font-size: 1.2rem; margin: 1.4rem 0; }
  .back-button      { font-size: 0.85rem; padding: 0.5rem 1.2rem; }
  .footer p         { font-size: 0.9rem; }

  .tresc-with-bg {
    margin-left: -1.1rem;
    margin-right: -1.1rem;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

@media (max-width: 400px) {
  h1           { font-size: 1.7rem; }
  .lista-title { font-size: 1.95rem; }
  .swieta-grid { grid-template-columns: 1fr; }
}

/* =============================================
   KOLO PANEL — active feast display
   ============================================= */
#kolo-panel {
  width: min(380px, 92%);
  margin: 0 auto;
  padding: 0 0.5rem;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}
#kolo-panel.kolo-panel-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.kolo-panel-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: rgba(26,30,39,0.85);
  border: 1px solid rgba(196,146,42,0.28);
  border-radius: 10px;
  padding: 0.9rem 1.4rem;
  backdrop-filter: blur(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  min-height: 72px;
  text-align: center;
}
#kolo-panel.kolo-panel-changing .kolo-panel-inner {
  opacity: 0;
  transform: translateY(4px);
}

.kolo-panel-rune { display: none; }

.kolo-panel-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  width: 100%;
}
.kolo-panel-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  width: 100%;
}
.kolo-panel-sub {
  font-family: 'Kaushan Script', cursive;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--primary);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem; /* fixed — reserves room for 2 lines always, so a
                          long subtitle (e.g. "obchodzony na przełomie...")
                          never pushes the wheel below it further down than
                          a short one does */
}

.kolo-panel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.45rem 1.3rem;
  background: rgba(196,146,42,0.1);
  border: 1px solid rgba(196,146,42,0.4);
  border-radius: 6px;
  color: var(--gold);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.kolo-panel-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: scale(1.04);
  text-decoration: none;
}

.kolo-panel-btn-label-en { display: none; }
.kolo-panel-btn-label-pl { display: inline; }

/* =============================================
   WHEEL OF THE YEAR (Koło Roku)
   ============================================= */
.kolo-wrap {
  position: relative;
  width: min(600px, 96%);
  margin: 0.5rem auto;
}
#kolo-svg {
  width: 100%; height: auto;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 0 30px rgba(196,146,42,0.15));
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
#kolo-svg:active   { cursor: grabbing; }
#kolo-svg.spinning { cursor: default; }

#kolo-nodes { transition: none; }

.kolo-node  { outline: none; cursor: pointer; }
.kolo-node:hover .node-halo { opacity: 0.22; }
.node-halo  { transition: opacity 0.25s ease, r 0.25s ease; }
.node-label {
  pointer-events: none;
  transition: fill 0.25s, font-weight 0.25s, opacity 0.3s ease;
  font-size: 13px;
  paint-order: stroke;
  stroke: rgba(15,17,23,0.98);
  stroke-width: 3px;
  font-weight: 700;
}

/* Tooltip shown when hovering/tapping a dot whose label is hidden */
.kolo-tooltip {
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -135%);
  background: rgba(26,30,39,0.95);
  border: 1px solid rgba(196,146,42,0.4);
  border-radius: 6px;
  padding: 0.32rem 0.7rem;
  font-family: 'Playfair Display', serif;
  font-size: 0.78rem;
  color: var(--gold);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 6;
}
.kolo-tooltip-visible { opacity: 1; }

/* Prev/next navigation flanking the wheel */
.kolo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 6.5rem;
  background: transparent;
  border: none;
  padding: 0.3rem;
  cursor: pointer;
  z-index: 5;
  font-family: inherit;
}
.kolo-nav-prev { left: -6.6rem; }
.kolo-nav-next { right: -6.6rem; }

.kolo-nav-arrow {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(196,146,42,0.35);
  background: rgba(15,17,23,0.6);
  color: var(--gold);
  font-size: 1.3rem;
  line-height: 1;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.kolo-nav:hover .kolo-nav-arrow,
.kolo-nav:focus-visible .kolo-nav-arrow {
  border-color: var(--gold);
  background: rgba(196,146,42,0.16);
  transform: scale(1.08);
}
.kolo-nav-name {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* Fixed MINIMUM (not exact) height reserved for up to 2 lines — this is
     what keeps the rune's position constant regardless of a 1-word vs.
     3-word feast name, without ever clipping a name that needs the full
     2 lines (that was the previous bug: a hard total height on .kolo-nav
     squeezed this into too little room and overflow:hidden cut it off). */
  min-height: 2.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 0.92rem;
  line-height: 1.2;
  color: rgba(245,225,164,0.78);
  text-align: center;
  transition: color 0.2s ease;
}
.kolo-nav:hover .kolo-nav-name,
.kolo-nav:focus-visible .kolo-nav-name { color: var(--gold); }

/* Below ~1000px the page container doesn't have enough margin beside the
   wheel to fit the side arrows without page-wrap's overflow:hidden clipping
   them — so switch to the safer on-wheel diagonal placement earlier than
   the usual 768px breakpoint. */
@media (max-width: 1000px) {
  .kolo-nav {
    top: auto;
    bottom: 4%;
    transform: none;
    width: 4.6rem;
    gap: 0.2rem;
  }
  .kolo-nav-prev { left: 2%; }
  .kolo-nav-next { right: 2%; }
  .kolo-nav-arrow {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.1rem;
    background: rgba(15,17,23,0.82);
  }
  .kolo-nav-name { font-size: 0.72rem; min-height: 2rem; }
}

.kolo-wrap::before {
  content: "▾";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  color: var(--primary);
  z-index: 5;
  text-shadow: 0 0 10px rgba(196,146,42,0.7);
  pointer-events: none;
}

/* =============================================
   WHEEL SPIN-IN INTRO ANIMATION
   ============================================= */
@keyframes koloSpinIn {
  0%   { transform: rotate(0deg);    filter: blur(7px) brightness(1.5); opacity: 0.25; }
  30%  { opacity: 1; }
  100% { transform: rotate(1080deg); filter: blur(0px) brightness(1);   opacity: 1; }
}
@keyframes koloGlow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(196,146,42,0.12)); }
  50%      { filter: drop-shadow(0 0 40px rgba(196,146,42,0.30)); }
}

#kolo-svg.spinning {
  animation:
    koloSpinIn 3.4s cubic-bezier(0.22, 1, 0.36, 1) both,
    koloGlow   4s  ease-in-out 3.4s infinite;
  transform-origin: center center;
}
#kolo-svg.spinning .kolo-node { pointer-events: none; }

@keyframes nodeFadeIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
#kolo-svg.spinning #kolo-nodes {
  animation: nodeFadeIn 0.6s ease 2.8s both;
}

/* =============================================
   SPIRITS & DEITIES (Duchy / Bóstwa)
   ============================================= */
.duchy-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 1.6rem;
  justify-content: center;
}
.duchy-label {
  font-size: 0.88rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Playfair Display', serif;
}
.duch-tag {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border: 1px solid rgba(196,146,42,0.35);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--gold-dim);
  background: rgba(196,146,42,0.07);
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.04em;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.duch-tag:hover {
  background: rgba(196,146,42,0.18);
  border-color: var(--primary);
  color: var(--gold);
}

/* Clickable chip variant (linked to a Bostwo record) */
button.duch-tag-bostwo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
button.duch-tag-bostwo:hover,
button.duch-tag-bostwo:focus-visible {
  background: rgba(196,146,42,0.18);
  border-color: var(--primary);
  color: var(--gold);
  outline: none;
}
.duch-tag-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(196,146,42,0.5);
  flex-shrink: 0;
  position: relative;
}

/* Breathing glow — signals "there's more here, tap me" without adding
   any text clutter. The ring is a ::before on a wrapping <span>, not on the
   <img> itself: <img> is a replaced element and browsers don't render
   generated content (::before/::after) on it. Animates opacity/transform
   (GPU-composited) rather than box-shadow blur/spread, since that tends to
   get throttled or skipped on mobile browsers and ends up looking static. */
button.duch-tag-bostwo {
  position: relative;
}
.duch-tag-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.duch-tag-avatar {
  box-shadow: 0 0 6px 1px rgba(196,146,42,0.4); /* static base glow, always visible */
}
.duch-tag-avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(196,146,42,0.75);
  opacity: 0;
  transform: scale(0.85);
  animation: duchRingPulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes duchRingPulse {
  0%   { opacity: 0.75; transform: scale(0.85); }
  70%  { opacity: 0;    transform: scale(1.6);  }
  100% { opacity: 0;    transform: scale(1.6);  }
}
@media (prefers-reduced-motion: reduce) {
  .duch-tag-avatar-wrap::before { animation: none; display: none; }
  /* keep a static glow so there's still a visible affordance without motion */
  .duch-tag-avatar { box-shadow: 0 0 8px 2px rgba(196,146,42,0.5); }
}

/* =============================================
   PANEL BÓSTWA — modal (desktop) / bottom-sheet (mobile)
   ============================================= */
.bostwo-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8,10,15,0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.bostwo-overlay[hidden] { display: none; }
.bostwo-overlay.bostwo-visible { opacity: 1; }

.bostwo-panel {
  width: min(480px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0,0,0,0.85);
  position: relative;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(196,146,42,0.5) transparent;
}
.bostwo-panel::-webkit-scrollbar { width: 6px; }
.bostwo-panel::-webkit-scrollbar-track { background: transparent; }
.bostwo-panel::-webkit-scrollbar-thumb {
  background: rgba(196,146,42,0.45);
  border-radius: 3px;
}
.bostwo-panel::-webkit-scrollbar-thumb:hover { background: rgba(196,146,42,0.7); }

.bostwo-overlay.bostwo-visible .bostwo-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Fade hinting there's more content below — hidden once scrolled to the end. */
.bostwo-panel::before {
  content: '';
  position: sticky;
  display: block;
  bottom: 0; left: 0;
  height: 40px;
  margin-top: -40px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
  z-index: 3;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.bostwo-panel.bostwo-panel-at-end::before { opacity: 0; }

.bostwo-panel-handle { display: none; }

.bostwo-close {
  position: absolute;
  top: 0.8rem; right: 0.8rem;
  z-index: 2;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(8,10,15,0.65);
  color: var(--gold);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.bostwo-close:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.06); }

.bostwo-portrait-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--dark);
}
.bostwo-portret {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  filter: brightness(0.88) saturate(0.95);
}

.bostwo-panel-body { padding: 1.4rem 1.8rem 1.8rem; text-align: center; }
.bostwo-imie {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem; color: var(--gold);
  margin: 0.2rem 0 0.15rem; letter-spacing: 0.04em;
}
.bostwo-epitet {
  font-family: 'Kaushan Script', cursive;
  color: var(--primary);
  font-size: 1.1rem;
  margin: 0 0 0.2rem;
}
.bostwo-opis {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text);
  text-align: left;
}

.bostwo-ciekawostka {
  margin-top: 1.4rem;
  padding: 1rem 1.2rem;
  border: 1px dashed rgba(196,146,42,0.4);
  border-radius: 10px;
  background: rgba(196,146,42,0.06);
  text-align: left;
}
.bostwo-ciekawostka:empty,
.bostwo-ciekawostka.bostwo-ciekawostka-hidden { display: none; }
.bostwo-ciekawostka-label {
  display: block;
  font-family: 'Kaushan Script', cursive;
  color: var(--gold-dim);
  font-size: 1rem;
  margin-bottom: 0.35rem;
}
.bostwo-ciekawostka-text { font-size: 0.98rem; color: var(--muted); margin: 0; }

/* Mobile: turn the modal into a bottom sheet */
@media (max-width: 640px) {
  .bostwo-overlay { align-items: flex-end; padding: 0; }
  .bostwo-panel {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }
  .bostwo-overlay.bostwo-visible .bostwo-panel { transform: translateY(0); }
  .bostwo-panel-handle {
    display: block;
    width: 40px; height: 4px;
    border-radius: 3px;
    background: rgba(196,146,42,0.4);
    margin: 0.7rem auto 0;
  }
  .bostwo-portrait-wrap { aspect-ratio: 16/9; }
  .bostwo-panel-body { padding: 1.1rem 1.3rem 2rem; }
  .bostwo-imie { font-size: 1.6rem; }
}

/* =============================================
   PREV / NEXT NAVIGATION
   ============================================= */
.swieto-nav {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 1.4rem 2rem;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
.swieto-nav .lang        { display: none; }
.swieto-nav .lang.active {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-prev,
.nav-next {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  flex: 0 0 auto;
  max-width: 38%;
}
.nav-next { margin-left: auto; }
.nav-prev:hover,
.nav-next:hover {
  border-color: var(--border);
  background: rgba(196,146,42,0.06);
  color: var(--gold);
}
.nav-arrow {
  font-size: 1.3rem;
  color: var(--primary);
  flex-shrink: 0;
}
.nav-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.nav-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.97rem;
  color: var(--gold-dim);
  line-height: 1.25;
}
.nav-next .nav-info { text-align: right; }
.nav-empty { flex: 0 0 auto; max-width: 38%; min-width: 0; }

.nav-kolo {
  font-size: 2.2rem !important;
  color: rgba(196,146,42,0.5);
  text-decoration: none;
  flex-shrink: 0;
  flex: 0 0 auto;
  transition: color 0.2s, transform 0.3s;
  line-height: 1;
  text-shadow: 0 0 14px rgba(196,146,42,0.35);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-kolo:hover {
  color: var(--primary);
  transform: translateX(-50%) scale(1.2);
  text-shadow: 0 0 20px rgba(196,146,42,0.6);
}

/* =============================================
   IMAGE PLACEHOLDER (no feast image)
   ============================================= */
.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  font-size: 2.5rem;
  color: rgba(196,146,42,0.25);
}

/* =============================================
   SEASON BADGE
   ============================================= */
.card-season {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  font-size: 0.72rem;
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  background: rgba(15,17,23,0.78);
  border: 1px solid currentColor;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* =============================================
   GOLDEN RUNE CURSOR TRAIL
   ============================================= */
.rune-trail {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  font-size: 1rem;
  color: var(--primary);
  transform: translate(-50%, -50%);
  opacity: 0.85;
  text-shadow: 0 0 8px rgba(196,146,42,0.9);
  animation: runeFade 0.9s ease forwards;
  user-select: none;
  line-height: 1;
}
@keyframes runeFade {
  0%   { opacity: 0.85; transform: translate(-50%,-50%)  translateY(0)    scale(1);   }
  60%  { opacity: 0.5;  transform: translate(-50%,-50%)  translateY(-14px) scale(1.1); }
  100% { opacity: 0;    transform: translate(-50%,-50%)  translateY(-28px) scale(0.7); }
}

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #f5e1a4, var(--primary));
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* =============================================
   RESPONSIVE — wheel & nav extra breakpoints
   ============================================= */
@media (max-width: 768px) {
  .kolo-wrap           { width: min(420px, 98%); }
  .nav-prev, .nav-next { max-width: 42%; padding: 0.4rem 0.5rem; }
  .nav-name            { font-size: 0.85rem; }
  .nav-hint            { display: none; }
  .duch-tag            { font-size: 0.82rem; }
  .node-label          { font-size: 13px; stroke-width: 2.5px; }
  .nav-kolo            { font-size: 1.9rem !important; }

  .kolo-panel-inner  { padding: 0.7rem 1rem; gap: 0.45rem; }
  .kolo-panel-name   { font-size: 1rem; }
  .kolo-panel-btn    { padding: 0.4rem 1rem; font-size: 0.82rem; }
}

@media (max-width: 400px) {
  .swieto-nav .lang.active {
    display: flex !important;
    flex-direction: row;
    gap: 0.4rem;
    align-items: center;
    justify-content: space-between;
  }
  .nav-prev, .nav-next, .nav-empty { max-width: 42%; }
  .nav-kolo { font-size: 1.8rem !important; }
}

/* =============================================
   SITE BACKGROUND (Wyraj / Nawia scene)
   Tylko na lista.html — statyczny obraz teraz,
   video z Kling wskoczy w to samo miejsce później.
   ============================================= */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.site-bg-img,
.site-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: brightness(0.78) saturate(0.9);
  transform: scale(1.02);
  animation: bgBreathe 42s ease-in-out infinite;
}

/* Winieta — wtapia krawędzie obrazu w --dark, żeby nie było
   twardej ramki i żeby środek (pod kartą) był maksymalnie spokojny */
.site-bg-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at center,
      rgba(15,17,23,0.75) 0%,
      rgba(15,17,23,0.35) 45%,
      transparent 70%),
    linear-gradient(to bottom,
      var(--dark) 0%,
      transparent 12%,
      transparent 88%,
      var(--dark) 100%);
}

@keyframes bgBreathe {
  0%, 100% { transform: scale(1.02); filter: brightness(0.78) saturate(0.9); }
  50%      { transform: scale(1.06); filter: brightness(0.85) saturate(0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .site-bg-img,
  .site-bg-video { animation: none; }
}