/* TotemWake — strona gry (premium, grafiki Codexa 38).
   Kolory z obrazów: granat zmierzchu, złoto totemu, błękit kryształu, pergamin. Czcionki z gry: Metamorphous (nagłówki), Bree Serif. */

@font-face {
  font-family: "Metamorphous";
  src: url("../fonts/Metamorphous-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Bree Serif";
  src: url("../fonts/BreeSerif-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --dusk: #0d1426;
  --dusk-deep: #080d1b;
  --panel: #16203a;
  --panel-edge: #2b3858;
  --gold: #f0c46a;
  --gold-light: #ffe2a0;
  --gold-deep: #a8742a;
  --crystal: #6fdcff;
  --ember: #ff8a4c;
  --parchment: #f3e9d2;
  --muted: #b3b9c9;
  --display: "Metamorphous", "Bree Serif", Georgia, serif;
  --serif: "Bree Serif", Georgia, serif;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  color: var(--parchment);
  font: 18px/1.7 var(--serif);
  background-color: var(--dusk);
  background-image:
    linear-gradient(rgba(13, 20, 38, .82), rgba(13, 20, 38, .9)),
    url("../img/art/decor-forest-night-tile.webp");
  background-size: auto, 720px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-light); text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { font-weight: 400; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--crystal); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--gold); color: #2a1a05; padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---------- Przyciski: złoty, kuty — jak przyciski w grze ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: .55em 1.6em;
  border: 1px solid #ffe8b0;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, var(--gold-light), var(--gold) 50%, var(--gold-deep));
  box-shadow: inset 0 -3px 0 rgba(90, 52, 10, .45), 0 0 0 1px rgba(40, 22, 4, .6), 0 10px 30px rgba(240, 196, 106, .22);
  color: #2b1904;
  font: 1.12rem/1 var(--serif);
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 240, 200, .6);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { color: #2b1904; filter: brightness(1.06); transform: translateY(-1px); box-shadow: inset 0 -3px 0 rgba(90, 52, 10, .45), 0 0 0 1px rgba(40, 22, 4, .6), 0 14px 36px rgba(240, 196, 106, .38); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: rgba(13, 20, 38, .55);
  border-color: rgba(240, 196, 106, .7);
  box-shadow: none;
  color: var(--gold-light);
  text-shadow: none;
  backdrop-filter: blur(4px);
}
.btn-ghost:hover { color: #fff; background: rgba(240, 196, 106, .14); box-shadow: none; }
.btn-small { min-height: 42px; padding: .4em 1.1em; font-size: 1rem; }

/* Przycisk zablokowany do startu alfy: kuty, ciemny, ze złotą kłódką */
.btn-locked, .btn-locked:hover {
  cursor: not-allowed;
  border-color: rgba(240, 196, 106, .55);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 50%),
    repeating-linear-gradient(135deg, rgba(240, 196, 106, .07) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, #2a3350, #161d33);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .6), 0 8px 26px rgba(0, 0, 0, .35);
  color: var(--gold-light);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
  transform: none;
  filter: none;
  letter-spacing: .02em;
}
.btn .lock { width: 1.05em; height: 1.05em; fill: var(--gold); flex: none; filter: drop-shadow(0 0 6px rgba(240, 196, 106, .45)); }
.btn-large { min-height: 64px; padding: .6em 2.2em; font-size: 1.3rem; }

/* ---------- Nagłówek: przezroczysty nad obrazem, granatowy po przewinięciu ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.site-header.scrolled { background: rgba(8, 13, 27, .9); backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(240, 196, 106, .18); }
.nav { display: flex; align-items: center; justify-content: space-between; width: min(1180px, 100% - 32px); margin-inline: auto; height: var(--header-h); }
.brand img { height: 46px; width: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6)); transition: opacity .3s ease; }
/* Nad obrazem jest duże logo — małe w nagłówku dopiero po przewinięciu */
.js .site-header:not(.scrolled) .brand img { opacity: 0; }
.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) { color: var(--parchment); text-decoration: none; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.nav-links a:not(.btn):hover { color: var(--gold-light); }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 2px; margin: 6px 0; background: var(--parchment); transition: transform .2s, opacity .2s; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    display: none; flex-direction: column; gap: 4px; padding: 12px 16px 22px;
    background: rgba(8, 13, 27, .97); border-bottom: 1px solid rgba(240, 196, 106, .25);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; text-align: center; padding: 8px 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .site-header:has(.nav-links.open) { background: rgba(8, 13, 27, .97); }
}

/* ---------- Hero: warstwy paralaksy ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 640px; max-height: 1300px; overflow: hidden; isolation: isolate; }
.hero-stage { position: absolute; inset: 0; z-index: -1; background: var(--dusk-deep); }
.hero-layers { position: absolute; inset: -2.5%; }
.hero-layers img, .hero-flat img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 38%;
}
.hero-layers img {
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0) scale(var(--s, 1));
  will-change: transform;
}
.hero-flat { display: none; }

/* ---------- Świecący kryształ totemu ----------
   .art-box odtwarza object-fit: cover (+ object-position) obrazu, więc punkt kryształu w % obrazu trafia w kryształ
   przy każdym rozmiarze okna. Efekty rysowane „screen” — tylko rozjaśniają obraz. */
.crystal-fx { position: absolute; inset: 0; container-type: size; pointer-events: none; mix-blend-mode: screen;
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0) scale(var(--s, 1)); will-change: transform; }
.art-box { position: absolute; }
.art-wide {
  --bw: max(100cqw, 100cqh * 16 / 9);
  --bh: max(100cqh, 100cqw * 9 / 16);
  width: var(--bw); height: var(--bh);
  left: calc((100cqw - var(--bw)) * .5); top: calc((100cqh - var(--bh)) * .38);
}
.art-tall {
  --bw: max(100cqw, 100cqh * 9 / 16);
  --bh: max(100cqh, 100cqw * 16 / 9);
  width: var(--bw); height: var(--bh);
  left: calc((100cqw - var(--bw)) * .5); top: calc((100cqh - var(--bh)) * .3);
}
.crystal-fx-phone { display: none; }
.crystal {
  position: absolute; left: var(--cx); top: var(--cy); width: var(--cw); aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.crystal > span { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.cf-halo {
  width: 520%; height: 520%;
  background: radial-gradient(circle, rgba(111, 220, 255, .55) 0%, rgba(70, 170, 255, .22) 30%, rgba(40, 120, 255, .08) 52%, transparent 70%);
  animation: cf-breathe 3.6s ease-in-out infinite;
}
.cf-core {
  width: 150%; height: 190%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, .95) 0%, rgba(190, 245, 255, .8) 22%, rgba(111, 220, 255, .35) 48%, transparent 72%);
  animation: cf-pulse 1.8s ease-in-out infinite;
}
.cf-rays {
  width: 700%; height: 700%;
  background: repeating-conic-gradient(from 0deg, rgba(150, 235, 255, .32) 0deg 2.5deg, transparent 2.5deg 17deg);
  -webkit-mask: radial-gradient(circle, #000 6%, rgba(0, 0, 0, .55) 22%, transparent 50%);
  mask: radial-gradient(circle, #000 6%, rgba(0, 0, 0, .55) 22%, transparent 50%);
  animation: cf-spin 40s linear infinite, cf-flicker 5s ease-in-out infinite;
}
.cf-ring {
  width: 120%; height: 120%;
  border: 2px solid rgba(160, 240, 255, .9);
  box-shadow: 0 0 18px rgba(111, 220, 255, .9), inset 0 0 14px rgba(111, 220, 255, .6);
  opacity: 0;
  animation: cf-wave 4.2s cubic-bezier(.15, .6, .3, 1) infinite;
}
.cf-ring.late { animation-delay: 2.1s; }
.mote {
  width: 9%; height: 9%;
  background: #dff8ff; box-shadow: 0 0 8px 2px rgba(111, 220, 255, .95);
  opacity: 0;
  animation: cf-rise 4.2s ease-out infinite;
  animation-delay: var(--d);
}
@keyframes cf-breathe { 0%, 100% { opacity: .6; transform: translate(-50%, -50%) scale(.9); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes cf-pulse { 0%, 100% { opacity: .7; transform: translate(-50%, -50%) scale(.92); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } }
@keyframes cf-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes cf-flicker { 0%, 100% { opacity: .55; } 40% { opacity: .95; } 60% { opacity: .7; } }
@keyframes cf-wave {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  12% { opacity: .9; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(5.5); }
}
@keyframes cf-rise {
  0% { opacity: 0; transform: translate(-50%, -50%) translate(0, 0) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--mx), -620%) scale(1.1); }
}
.hero-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 42% at 50% 92%, rgba(8, 13, 27, .85), transparent 70%),
    linear-gradient(180deg, rgba(8, 13, 27, .55) 0%, transparent 16%, transparent 58%, var(--dusk) 100%);
}

/* Jedno zaplanowane wejście: warstwy osiadają od tła do przodu, potem logo */
.js .hero-layers > [data-depth] { opacity: 0; --s: 1.06; transition: opacity 1.1s ease, transform 1.6s cubic-bezier(.2, .7, .2, 1); }
.js .hero.is-ready .hero-layers > [data-depth] { opacity: 1; --s: 1; }
.js .hero.is-ready .hero-layers > [data-depth="1"] { transition-delay: .12s; }
.js .hero.is-ready .hero-layers > [data-depth="2"] { transition-delay: .24s; }
.js .hero.is-ready .hero-layers > [data-depth="3"] { transition-delay: .36s; }
.js .hero.is-ready .hero-layers > [data-depth="4"] { transition-delay: .48s; }
.js .hero.is-ready.settled .hero-layers > [data-depth] { transition: opacity .3s ease, transform .25s linear; transition-delay: 0s; }
.js .hero-copy > * { opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform .9s ease; }
.js .hero.is-ready .hero-copy > * { opacity: 1; transform: none; }
.js .hero.is-ready .hero-copy > :nth-child(1) { transition-delay: .7s; }
.js .hero.is-ready .hero-copy > :nth-child(2) { transition-delay: .85s; }
.js .hero.is-ready .hero-copy > :nth-child(3) { transition-delay: .95s; }
.js .hero.is-ready .hero-copy > :nth-child(4) { transition-delay: 1.05s; }

.hero-copy {
  position: absolute; left: 50%; bottom: clamp(28px, 6vh, 72px); transform: translateX(-50%);
  width: min(760px, 100% - 32px);
  text-align: center;
}
.hero-logo { width: clamp(220px, min(24vw, 36vh), 400px); margin: 0 auto 4px; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .7)); }
.hero h1 {
  font: clamp(1.45rem, 2.4vw, 2.1rem)/1.2 var(--serif);
  color: var(--gold-light);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .9);
}
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 22px; }
.hero-note { margin-top: 14px; font-size: .92rem; color: var(--muted); text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }

/* Telefon w pionie i „reduced motion”: jeden obraz, bez paralaksy */
@media (max-width: 700px) and (orientation: portrait) {
  .hero-layers { display: none; }
  .hero-flat { display: block; }
  .hero-flat img { object-position: 50% 30%; }
  .crystal-fx-phone { display: block; }
  .hero { max-height: none; }
  .hero-logo { width: min(64vw, 280px); }
  .hero .btn-ghost { display: none; }
  .cta-row { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-layers { display: none; }
  .hero-flat { display: block; }
  .js .hero-copy > * { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Sekcje ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-title {
  font: clamp(2rem, 4.4vw, 3.3rem)/1.12 var(--display);
  color: var(--parchment);
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}
.section-lead { max-width: 40em; margin: 18px auto 0; text-align: center; color: var(--muted); font-size: 1.08rem; }

.divider {
  height: clamp(48px, 7vw, 92px);
  background: url("../img/art/decor-section-divider.webp") center / min(1240px, 120vw) auto no-repeat;
  opacity: .95;
}

/* ---------- The run: oś 20 minut ---------- */
/* Zegar rundy: skala 0–24 min; --p = pozycja znacznika w % (ustawia main.js) */
.run-clock { position: relative; max-width: 1040px; margin: 64px auto 0; padding-top: 86px; }
.clock-track {
  position: relative; height: 64px; border-radius: 14px;
  box-shadow:
    0 0 0 2px #e9c27a, 0 0 0 5px #1a2238, 0 0 0 6px rgba(240, 196, 106, .45),
    0 14px 40px rgba(0, 0, 0, .55), 0 0 40px rgba(111, 220, 255, .08);
}
.run-clock:has(.clock-input:focus-visible) .clock-track { outline: 3px solid var(--crystal); outline-offset: 9px; }
.clock-sky { position: absolute; inset: 0; display: flex; border-radius: 14px; overflow: hidden; }
.sky { flex: var(--w) 0 0; position: relative; background: url("../img/clock/sky-strip.jpg") no-repeat; }
/* Malowany pasek z gry: dzień = 0–62% obrazu, noc = 62–100% (jak materiał paska w HUD) */
.sky.day { background-size: calc(100% / .62) 100%; background-position: 0 0; }
.sky.night { background-size: calc(100% / .38) 100%; background-position: 100% 0; }
.sky.boss {
  background: radial-gradient(circle at 50% 50%, #ff9a5c 0%, #c7402a 45%, #3b0e14 100%);
  box-shadow: inset 0 0 18px rgba(255, 200, 140, .6);
  animation: boss-glow 2.4s ease-in-out infinite;
}
.sky.next {
  background:
    linear-gradient(90deg, rgba(13, 20, 38, .55), rgba(13, 20, 38, 0) 40%),
    url("../img/art/feature-autumn-dusk.webp") center 55% / cover;
}
.sky + .sky { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .18); }
@keyframes boss-glow { 50% { filter: brightness(1.25) saturate(1.2); } }

.clock-icon, .clock-next, .clock-pin, .clock-marker { position: absolute; left: calc(var(--at) * 1%); transform: translate(-50%, -50%); top: 50%; pointer-events: none; }
.clock-icon { width: 40px; filter: drop-shadow(0 0 10px rgba(255, 230, 160, .8)); }
.clock-icon.boss-icon { width: 54px; top: 46%; filter: drop-shadow(0 0 12px rgba(255, 110, 60, .9)); }
.clock-next { font: 2rem/1 var(--serif); letter-spacing: -.05em; color: #ffe2a0; text-shadow: 0 0 12px rgba(255, 190, 90, .9), 0 2px 4px rgba(0, 0, 0, .8); animation: next-run 1.6s ease-in-out infinite; }
@keyframes next-run { 50% { transform: translate(-35%, -50%); opacity: .75; } }
.clock-pin { top: -1px; width: 12px; height: 12px; transform: translate(-50%, -50%) rotate(45deg); background: var(--gold-light); box-shadow: 0 0 0 2px #1a2238, 0 0 10px rgba(240, 196, 106, .9); }

/* Przyszłość rundy (za znacznikiem) przygaszona */
.clock-shade {
  position: absolute; top: 0; bottom: 0; right: 0; left: calc(var(--p) * 1%);
  border-radius: 0 14px 14px 0; background: rgba(8, 13, 27, .45); pointer-events: none;
}
.clock-marker { --at: var(--p); top: 50%; height: 104px; width: auto; filter: drop-shadow(0 0 8px rgba(255, 220, 140, .9)); z-index: 2; }
.clock-input {
  position: absolute; inset: -20px 0; width: 100%; height: calc(100% + 40px); margin: 0;
  opacity: 0; cursor: ew-resize; z-index: 3;
}

/* Dymek nad znacznikiem: czas i co się wtedy dzieje */
.clock-bubble {
  position: absolute; top: 0; left: var(--bubble-x, 0px); transform: translateX(-50%);
  min-width: 230px; max-width: 320px; padding: 10px 16px 12px; text-align: center;
  border-radius: 12px; border: 1px solid rgba(240, 196, 106, .6);
  background: linear-gradient(180deg, rgba(30, 40, 68, .97), rgba(16, 22, 40, .97));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 24px var(--bubble-glow, rgba(240, 196, 106, .25));
  transition: box-shadow .4s ease;
}
.clock-bubble::after {
  content: ""; position: absolute; left: var(--tail-x, 50%); bottom: -7px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg);
  background: #121a2f; border-right: 1px solid rgba(240, 196, 106, .6); border-bottom: 1px solid rgba(240, 196, 106, .6);
}
.clock-time { display: block; font: 1.5rem/1.1 var(--display); color: var(--gold-light); font-variant-numeric: tabular-nums; }
.clock-event { display: block; margin-top: 2px; font-size: .95rem; line-height: 1.35; color: var(--parchment); }
.run-clock.is-night .clock-time { color: var(--crystal); }
.run-clock.is-night { --bubble-glow: rgba(111, 220, 255, .35); }
.run-clock.is-boss { --bubble-glow: rgba(255, 110, 60, .5); }
.run-clock.is-boss .clock-time { color: var(--ember); }

.clock-ticks { position: relative; height: 28px; margin-top: 16px; font-size: .9rem; color: var(--muted); }
.clock-ticks span { position: absolute; left: calc(var(--at) * 1%); transform: translateX(-50%); white-space: nowrap; }
.clock-ticks span:first-child { transform: none; }
.clock-ticks .tick-boss { color: var(--ember); }
.clock-ticks .tick-next { transform: translateX(-100%); color: var(--gold-light); }
.clock-hint { margin-top: 6px; text-align: center; font-size: .9rem; color: var(--muted); }
.clock-replay { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--gold-light); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Po bossie: kolejny poziom */
.next-level {
  margin: 64px auto 0; max-width: 980px;
  display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 40px; align-items: center;
}
.next-level h3 { font: clamp(1.7rem, 3vw, 2.3rem)/1.15 var(--display); color: var(--gold); margin-bottom: 14px; }
.next-level p { color: var(--muted); }
.next-level p + p { margin-top: 10px; color: var(--parchment); }
@media (max-width: 720px) { .next-level { grid-template-columns: 1fr; text-align: center; } .next-level-art { max-width: 380px; margin-inline: auto; } }

/* Krok rundy pasujący do czasu na zegarze */
.step, .next-level { transition: opacity .35s ease, transform .35s ease; }
.run.has-clock .step:not(.is-current) { opacity: .5; }
.run.has-clock .step.is-current { transform: translateY(-4px); }
.run.has-clock .step.is-current img { filter: drop-shadow(0 0 22px rgba(240, 196, 106, .7)); }
.run.has-clock .next-level.is-current .next-level-art { box-shadow: 0 0 40px rgba(240, 196, 106, .35); }

.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 28px; }
.step { text-align: center; }
.step img { width: 104px; margin: 0 auto 10px; filter: drop-shadow(0 6px 18px rgba(240, 196, 106, .25)); }
.step-time { color: var(--crystal); font-size: .95rem; }
.step h3 { margin: 4px 0 8px; font: 1.4rem/1.25 var(--serif); color: var(--gold-light); }
.step p:last-child { color: var(--muted); font-size: 1rem; line-height: 1.65; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .clock-ticks span:nth-child(2), .clock-ticks span:nth-child(3), .clock-ticks span:nth-child(4) { display: none; }
  .clock-ticks .tick-boss { transform: translateX(-100%); }
  .clock-ticks .tick-next { top: 20px; }
  .clock-ticks { height: 44px; }
  .clock-track { height: 52px; }
  .clock-icon { width: 30px; }
  .clock-icon.boss-icon { width: 40px; }
  .clock-pin { display: none; }
  .clock-bubble { min-width: 0; width: min(300px, calc(100vw - 48px)); }
  .run-clock { padding-top: 92px; }
}

/* ---------- Złota ramka Codexa (9-slice, rogi 76 px na 256) ---------- */
.framed {
  display: block;
  border: 20px solid transparent;
  border-image: url("../img/art/decor-card-frame.webp") 76 stretch;
  background: var(--dusk-deep);
  margin: 0;
}
.framed img { width: 100%; }

/* ---------- Features ---------- */
.feature-grid { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 52px 34px; }
.feature h3 { margin: 18px 4px 6px; font: 1.35rem/1.25 var(--serif); color: var(--gold-light); }
.feature p { margin: 0 4px; color: var(--muted); font-size: 1rem; line-height: 1.65; }
@media (max-width: 980px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- Złoto i odblokowania ---------- */
.unlocks { background: radial-gradient(ellipse 60% 70% at 78% 50%, rgba(240, 196, 106, .12), transparent 70%); }
.unlocks-inner { display: grid; grid-template-columns: 1fr minmax(320px, 470px); gap: 64px; align-items: center; }
.unlocks .section-title, .unlocks .section-lead { text-align: left; margin-inline: 0; }
.loop { list-style: none; margin: 32px 0 0; padding: 0; counter-reset: loop; display: grid; gap: 22px; }
.loop li { counter-increment: loop; position: relative; padding-left: 60px; }
.loop li::before {
  content: counter(loop);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #e0a43c 60%, #8a5a18);
  box-shadow: 0 0 0 2px rgba(13, 20, 38, .9), 0 0 0 3px rgba(240, 196, 106, .6), 0 0 18px rgba(240, 196, 106, .45);
  color: #3a2406; font: 1.1rem var(--serif);
}
.loop li:not(:last-child)::after {
  content: ""; position: absolute; left: 20px; top: 48px; bottom: -18px; width: 2px;
  background: linear-gradient(rgba(240, 196, 106, .6), rgba(240, 196, 106, .1));
}
.loop h3 { font: 1.3rem/1.3 var(--serif); color: var(--gold-light); }
.loop p { color: var(--muted); margin-top: 4px; }
.alpha-note {
  margin-top: 30px; padding: 14px 18px;
  border-left: 3px solid var(--crystal); border-radius: 0 10px 10px 0;
  background: rgba(111, 220, 255, .08); color: var(--parchment);
}
.alpha-note strong { color: var(--crystal); font-weight: 400; }

.vault { padding: 26px 22px 24px; }
.vault-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; font-size: 1.15rem; color: var(--gold-light); }
.vault-head img { width: 40px; filter: drop-shadow(0 0 10px rgba(240, 196, 106, .6)); }
.vault-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: 12px; padding: 10%;
  background: radial-gradient(circle at 50% 40%, rgba(111, 220, 255, .22), rgba(13, 20, 38, .9) 70%);
  box-shadow: inset 0 0 0 1px rgba(240, 196, 106, .55), 0 0 16px rgba(111, 220, 255, .18);
}
.tile img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.tile.locked { background: rgba(8, 13, 27, .85); box-shadow: inset 0 0 0 1px rgba(150, 160, 190, .25); }
.tile.locked img { filter: grayscale(1) brightness(.38) contrast(1.1); }
.tile .lock {
  position: absolute; right: 8%; bottom: 8%; width: 30%; height: 30%;
  fill: var(--gold); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .9));
}
@media (max-width: 900px) {
  .unlocks-inner { grid-template-columns: 1fr; gap: 44px; }
  .vault { max-width: 470px; width: 100%; margin-inline: auto; }
}

/* ---------- Heroes: jak wybór postaci w grze ---------- */
.heroes { background: radial-gradient(ellipse 70% 60% at 30% 55%, rgba(240, 196, 106, .1), transparent 70%); }
.hero-select {
  margin-top: 56px;
  display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 28px 56px;
  grid-template-areas: "portrait info" "portrait picker";
  align-items: center;
}
.hero-portrait { grid-area: portrait; }
.hero-portrait img { aspect-ratio: 1; object-fit: cover; transition: opacity .25s ease; }
.hero-portrait img.swapping { opacity: 0; }
.hero-info { grid-area: info; align-self: end; }
.hero-info h3 { font: clamp(2.4rem, 5vw, 3.8rem)/1.05 var(--display); color: var(--gold); text-shadow: 0 3px 20px rgba(240, 196, 106, .25); }
.hero-weapon { margin-top: 10px; color: var(--crystal); font-size: 1.05rem; }
.hero-weapon::before { content: "Starting weapon: "; color: var(--muted); }
.hero-tagline { margin-top: 14px; font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.45; max-width: 22em; }
.hero-picker { grid-area: picker; align-self: start; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-picker button {
  width: 96px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: .95rem/1.2 var(--serif); text-align: center;
}
.hero-picker img {
  width: 96px; height: 96px; object-fit: cover; border-radius: 12px;
  border: 2px solid var(--panel-edge);
  filter: saturate(.55) brightness(.75);
  transition: filter .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hero-picker span { display: block; margin-top: 6px; }
.hero-picker button:hover img { filter: saturate(.9) brightness(.95); }
.hero-picker button[aria-pressed="true"] { color: var(--gold-light); }
.hero-picker button[aria-pressed="true"] img { filter: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 196, 106, .3), 0 0 24px rgba(240, 196, 106, .45); }
@media (max-width: 820px) {
  .hero-select { grid-template-columns: 1fr; grid-template-areas: "portrait" "info" "picker"; justify-items: center; text-align: center; }
  .hero-portrait { width: min(380px, 100%); }
  .hero-tagline { margin-inline: auto; }
  .hero-picker { justify-content: center; }
  .hero-picker { flex-wrap: nowrap; gap: 10px; width: 100%; max-width: 440px; }
  .hero-picker button { flex: 1 1 0; width: auto; min-width: 0; font-size: .8rem; }
  .hero-picker img { width: 100%; height: auto; aspect-ratio: 1; }
}

/* ---------- Download ---------- */
.framed-panel {
  border: 24px solid transparent;
  border-image: url("../img/art/decor-card-frame.webp") 76 stretch;
  background:
    radial-gradient(ellipse 60% 70% at 18% 20%, rgba(111, 220, 255, .12), transparent 70%),
    radial-gradient(ellipse 50% 60% at 90% 90%, rgba(240, 196, 106, .1), transparent 70%),
    linear-gradient(rgba(22, 32, 58, .94), rgba(13, 20, 38, .96)),
    url("../img/art/decor-forest-night-tile.webp") center / 560px;
  background-origin: border-box;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.download-panel { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; padding: clamp(24px, 4vw, 48px); }
.download .section-title { text-align: left; }
/* Pobieranie zablokowane do startu alfy (builds.json "open": false) */
.download.is-locked .open-only, .download:not(.is-locked) .locked-only { display: none !important; }
.download .locked-only.btn { margin-top: 30px; }
.download-lead { margin-top: 14px; color: var(--muted); max-width: 30em; }
.build-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 28px 0; }
.build-facts div { border-left: 2px solid rgba(240, 196, 106, .5); padding-left: 14px; }
.build-facts dt { color: var(--muted); font-size: .88rem; }
.build-facts dd { margin: 2px 0 0; font-size: 1.15rem; color: var(--parchment); }
.mirror { margin-top: 12px; color: var(--muted); font-size: .95rem; }
.install { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.install li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; align-items: baseline; color: var(--parchment); font-size: 1rem; }
.install li::before {
  content: counter(step);
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--gold); color: var(--gold-light); font-size: .85rem;
}
.download-notes h3 { font: 1.45rem/1.3 var(--serif); color: var(--gold-light); }
.notes { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.notes li { position: relative; padding-left: 28px; line-height: 1.55; }
.notes li::before {
  content: ""; position: absolute; left: 4px; top: .55em; width: 9px; height: 9px;
  background: var(--crystal); transform: rotate(45deg); box-shadow: 0 0 10px rgba(111, 220, 255, .8);
}
.notes .empty { padding-left: 0; color: var(--muted); }
.notes .empty::before { display: none; }
.history { margin-top: 26px; border-top: 1px solid rgba(240, 196, 106, .2); padding-top: 16px; }
.history summary { cursor: pointer; color: var(--gold-light); }
.history h4 { margin: 18px 0 8px; font: 1.05rem var(--serif); color: var(--parchment); }
.history h4 small { color: var(--muted); font-size: .85rem; margin-left: 8px; }
.history .notes { margin-top: 0; gap: 8px; font-size: .96rem; color: var(--muted); }
.history .notes li::before { background: var(--gold-deep); box-shadow: none; }
.feedback { margin-top: 30px; color: var(--muted); font-size: .96rem; }
@media (max-width: 900px) {
  .download-panel { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 480px) {
  .build-facts { grid-template-columns: 1fr 1fr; gap: 12px; }
  .btn-large { width: 100%; padding-inline: 1em; font-size: 1.15rem; white-space: nowrap; }
  .download-panel { padding: 8px 4px; }
}

/* ---------- Stopka ---------- */
.site-footer { padding: 48px 0 56px; border-top: 1px solid rgba(240, 196, 106, .14); background: rgba(8, 13, 27, .7); color: var(--muted); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: center; }
.footer-inner img { grid-row: span 2; width: 72px; }
.footer-brand { font: 1.5rem var(--display); color: var(--gold-light); }
.credits { grid-column: 2; font-size: .82rem; opacity: .8; }
