/* Wygląd serwisu. Paleta: noc, zmierzch, lawenda, krem, róż, zachód słońca. */
:root, [data-style=night] {
  --panel: #0d0c1a; --raised: #1f1f38; --line: #38365d; --ink: #fdfbff; --soft: #ccc2f5;
  --lagoon: #ffb2c6; --hibiscus: #ffb2c6; --sun: #ffd4a8; --cream: #fff9cb; --plum: #4d2b4e;
  --sunset: linear-gradient(100deg, #e9639b, #fec497);
  --display: 'League Gothic', 'Arial Narrow', Impact, sans-serif;
  --body: Urbanist, 'Segoe UI', sans-serif;
  --top: 72px; --wide: 1320px; --gut: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}
html, body { font: 500 16px/1.5 var(--body); }
::selection { background: #e9639b; color: #fff; }
:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
h1, h2, #hubbody h1, #hubbody h2 { font: 400 48px/.95 var(--display); letter-spacing: .01em; text-transform: uppercase; color: var(--cream); margin: 0; text-wrap: balance; }
#hubbody h1 { font-size: clamp(60px, 9vw, 132px); line-height: .88; margin: 0 0 24px; }
#hubbody h2 { font-size: clamp(36px, 4vw, 56px); margin: 0 0 14px; }
#hubbody h3 { font: 700 20px/1.2 var(--body); margin: 32px 0 10px; color: var(--ink); }

/* Formanty */
.btn { display: inline-block; padding: 12px 22px; border: 0; border-radius: 999px; background: var(--line); color: var(--ink); font-weight: 700; line-height: 1.2; text-decoration: none; transition: background-color .2s, color .2s; }
.btn:hover { background: #4d4a7d; }
.btn.main, [data-style=night] .btn.main { background: var(--lagoon); color: var(--plum); }
.btn.main:hover { background: var(--cream); }
.btn.main[aria-pressed=true] { background: transparent; color: var(--lagoon); box-shadow: inset 0 0 0 2px var(--lagoon); }
.round { width: 48px; height: 48px; border-radius: 50%; background: var(--line); font-size: 26px; line-height: 1; }
.round:hover { background: var(--lagoon); color: var(--plum); }
.field, #q { border: 0; border-radius: 999px; padding: 12px 20px; background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
textarea.field { border-radius: 20px; }
.field::placeholder, #q::placeholder { color: #a99fd6; opacity: 1; }
select.field { appearance: none; padding-right: 42px; background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23ffb2c6' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 18px center; }
.field:focus-visible, #q:focus-visible { outline: 2px solid var(--lagoon); outline-offset: 0; }
progress { height: 6px; }
progress::-webkit-progress-value { background: var(--sunset); }
progress::-moz-progress-bar { background: var(--sunset); }
input[type=checkbox] { appearance: none; width: 22px; height: 22px; border-radius: 7px; background: var(--raised); box-shadow: inset 0 0 0 2px #6a66a0; cursor: pointer; }
input[type=checkbox]:checked { background: var(--lagoon) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22' fill='none' stroke='%234d2b4e' stroke-width='3'%3E%3Cpath d='M5 11.5l4 4 8-9'/%3E%3C/svg%3E") center / contain; box-shadow: none; }
input[type=checkbox]:indeterminate { background: linear-gradient(var(--lagoon) 0 0) center / 10px 3px no-repeat var(--raised); }
.seg { background: var(--raised); border-radius: 999px; padding: 4px; }
.seg button { border-radius: 999px; color: var(--soft); }
.seg button[aria-pressed=true] { background: var(--line); color: var(--ink); }
.text { color: var(--lagoon); }
kbd { background: var(--raised); border-color: var(--line); }
.star { color: var(--lagoon); }

/* Nagłówek */
#top { background: linear-gradient(#0d0c1a, #0d0c1a00); border: 0; padding: 0 var(--gut); gap: 28px; pointer-events: none; }
#top > * { pointer-events: auto; }
#top::before { content: ''; position: absolute; inset: 0; background: #0d0c1af0; z-index: -1; opacity: 0; transition: opacity .25s; }
html:not([data-page]) #top::before, html[data-down] #top::before { opacity: 1; }
#brand { font: 400 36px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; color: var(--cream); }
#hubnav { gap: 4px; justify-content: flex-end; }
#hubnav a, #hubnav a:last-child { margin: 0; padding: 9px 14px; border-radius: 999px; color: var(--ink); font-weight: 600; }
#hubnav a:hover { background: #38365db0; }
#hubnav a[aria-current] { background: var(--lagoon); color: var(--plum); }
#burger { flex: none; width: 48px; height: 48px; border-radius: 50%; position: relative; }
#burger::before, #burger::after { content: ''; position: absolute; left: 11px; right: 11px; height: 5px; background: var(--ink); transition: transform .2s, background-color .2s; }
#burger::before { top: 16px; }
#burger::after { bottom: 16px; }
#burger:hover::before { transform: translateX(-4px); background: var(--lagoon); }
#burger:hover::after { transform: translateX(4px); background: var(--lagoon); }

/* Spis na pełnym ekranie */
#index { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: var(--panel); color: var(--ink); overflow-y: auto; }
#index::backdrop { background: none; }
#index[open] { animation: wipe .45s cubic-bezier(.7, 0, .2, 1); }
@keyframes wipe { from { clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 0); } to { clip-path: polygon(-30% 0, 100% 0, 100% 100%, 0 100%); } }
.indexart { position: fixed; inset: 0 0 0 45%; opacity: .7; background: center / cover; transition: background-image .35s; -webkit-mask: linear-gradient(90deg, #0000, #000a 70%); mask: linear-gradient(90deg, #0000, #000a 70%); }
.indexnav { position: relative; padding: 110px var(--gut) 64px; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 44px 32px; max-width: 1160px; }
.indexnav h2 { font-size: clamp(42px, 5vw, 64px); margin-bottom: 8px; }
.indexnav a { display: block; padding: 4px 0; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 600; text-shadow: 0 1px 12px #0d0c1a; }
.indexnav h2 a { font: inherit; color: var(--cream); padding: 0; }
.indexnav a:hover { color: var(--lagoon); }
#indexclose { position: fixed; z-index: 2; top: 12px; right: var(--gut); }

/* Podstrony */
[data-page], [data-page] body { overflow-x: clip; }
#hub { isolation: isolate; background: linear-gradient(#0d0c1a 0, #14132a 900px, #0d0c1a 2200px); }
#hub::before { content: ''; position: absolute; z-index: -1; inset: 0 0 auto; height: min(64vw, 620px); background: var(--art, none) 50% 28% / cover; opacity: .9; -webkit-mask: linear-gradient(#000, #0000 92%); mask: linear-gradient(#000, #0000 92%); }
#hub::after { content: ''; position: absolute; z-index: -1; inset: 0 0 auto; height: min(64vw, 620px); background: linear-gradient(90deg, #0d0c1ae0 10%, #0d0c1a1a 80%); }
[data-page=home] #hub::before, [data-page=home] #hub::after, [data-page=entry] #hub::before, [data-page=entry] #hub::after { display: none; }
#subnav { max-width: var(--wide); padding: 34px var(--gut) 0; gap: 26px; scrollbar-width: none; }
#subnav a { color: var(--ink); font-size: 17px; text-shadow: 0 1px 10px #0d0c1a; }
#subnav a[aria-current] { color: var(--cream); border-color: var(--lagoon); }
#hubbody { max-width: var(--wide); padding: 24px var(--gut) 100px; }
.hint { color: var(--soft); }
#hubbody > .hint, #hubbody > div > .hint { text-shadow: 0 1px 8px #0d0c1a; }
.seg + h1 { margin-top: 26px !important; }
.item, .barrow { border-radius: 14px; }
.item:hover, button.barrow:hover, .barrow[aria-pressed=true] { background: #1f1f38b0; }
details.set { background: #1f1f3880; border-radius: 18px; padding: 4px 18px; margin-bottom: 8px; }
details.set > summary { border: 0; font: 700 19px/1.2 var(--body); }
details.hq > summary b { font-weight: 700; font-size: 17px; }
details.hq > summary:hover b { color: var(--lagoon); }
.pic { width: 112px; height: 70px; border-radius: 12px; background: var(--raised); }
.pic.none { font-size: 34px; color: #6a66a0; }
.entry { border-color: var(--line); }
.warn { border: 0; border-radius: 18px; background: #4d2b4e; padding: 14px 20px; }
.detail { font-size: 16px; }
.detail dl { gap: 0 20px; border-radius: 18px; background: #1f1f3880; padding: 8px 20px; margin: 20px 0; }
.detail dt, .detail dd { padding: 8px 0; }
.dpad { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 6px; }
.dpad i { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); color: var(--cream); font: 700 17px/1 var(--body); }
#hub footer { border: 0; padding: 28px var(--gut) 40px; font-size: 14px; }

/* Kafle encyklopedii */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(var(--gut) * -1) 20px; padding: 4px var(--gut); scrollbar-width: none; }
.chips a { flex: none; padding: 10px 18px; border-radius: 999px; background: #1f1f38e6; color: var(--ink); font-weight: 600; text-decoration: none; }
.chips a:hover { background: var(--line); }
.chips a[aria-current] { background: var(--lagoon); color: var(--plum); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px 18px; }
.grid > .hint, .grid > .btn { grid-column: 1 / -1; justify-self: start; }
.grid > .hint { margin: 0; }
.tile { position: relative; min-width: 0; }
.tile > a { display: block; color: var(--ink); text-decoration: none; }
.tile .pic { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 20px; }
.tile .pic.none { display: grid; font-size: 84px; background: linear-gradient(189deg, #38365d, #18182d); }
.tile .pic img { transition: scale .5s cubic-bezier(.2, .7, .2, 1); }
.tile a:hover .pic img { scale: 1.06; }
.tile b { display: block; margin-top: 12px; font: 400 30px/.98 var(--display); letter-spacing: .01em; text-transform: uppercase; color: var(--cream); overflow-wrap: anywhere; }
.tile small { color: var(--soft); font-size: 15px; }
.tile .star { margin: 0; position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; background: #0d0c1aa6; }
.grid.tall .pic { aspect-ratio: 3 / 4; }
.grid.tall .tile > a { position: relative; }
.grid.tall .tile .lab2 { position: absolute; inset: auto 0 0; padding: 70px 18px 16px; border-radius: 0 0 20px 20px; background: linear-gradient(#0d0c1a00, #0d0c1ae6); }
.grid.tall .tile b { font-size: 38px; margin: 0; }

/* Strona hasła */
.sheet { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); align-items: start; padding-top: 16px; }
.sheet.bare { grid-template-columns: minmax(0, 860px); }
.sheetpic { position: sticky; top: calc(var(--top) + 16px); }
.sheetpic .bigpic { width: 100%; margin: 0; border-radius: 28px; view-transition-name: hero; }
.sheetpic .bigpic img { width: 100%; max-height: calc(100dvh - var(--top) - 60px); object-fit: cover; }
#hubbody .sheet h1 { font-size: clamp(56px, 7vw, 108px); margin-bottom: 8px; }
.sheet .role { font-size: 20px; color: var(--lagoon); margin: 0 0 20px; }
.back { display: inline-block; margin-bottom: 18px; color: var(--soft); font-weight: 600; text-underline-offset: 4px; }
.sheet .detail { font-size: 17px; padding: 0; }
.sheet .detail p { margin: 0 0 14px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 72px; }
.pager a { color: var(--cream); text-decoration: none; font: 400 clamp(28px, 4vw, 52px)/1 var(--display); text-transform: uppercase; max-width: 46%; }
.pager a:last-child { text-align: right; margin-left: auto; }
.pager a:hover { color: var(--lagoon); }
.pager small { display: block; font: 600 15px/1.4 var(--body); text-transform: none; color: var(--soft); }
::view-transition-group(hero) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

/* Strona główna: kadry */
[data-page=home] #hub { padding-top: 0; }
#hubbody.home { max-width: none; padding: 0; }
.hero { min-height: 100svh; display: flex; flex-direction: column; padding: var(--top) var(--gut) 28px; background: linear-gradient(189deg, #0d0c1a 20%, #1f1f38 70%, #38365d); }
.panels { flex: 1; display: flex; gap: 10px; min-height: 380px; margin: 0 clamp(20px, 3vw, 48px); }
.panel { --skew: -6deg; position: relative; flex: 1 1 0; min-width: 0; transform: skewX(var(--skew)); overflow: hidden; border-radius: 6px; background: linear-gradient(#b06fa8, #f3a683); color: #fff; text-decoration: none; transition: flex-grow .55s cubic-bezier(.2, .8, .2, 1); }
.panel:is(:hover, :focus-visible) { flex-grow: 2.6; }
.frame { position: absolute; inset: 0 -70px; transform: skewX(6deg); }
.frame img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.panel::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(#0d0c1a00, #0d0c1acc); }
.panel b { position: absolute; z-index: 1; left: 28px; bottom: 16px; transform: skewX(6deg); font: 400 clamp(24px, 2.6vw, 50px)/1 var(--display); text-transform: uppercase; color: var(--cream); white-space: nowrap; }
.play .panel { animation: drop .7s cubic-bezier(.2, .8, .2, 1) calc(var(--i) * 70ms) backwards; }
@keyframes drop { from { clip-path: inset(0 0 100% 0); translate: 0 -40px; } to { clip-path: inset(0); translate: 0; } }
.herofoot { display: flex; align-items: flex-end; gap: 16px 20px; padding-top: 24px; }
.herofoot > div { margin-right: auto; }
#hubbody .hero h1 { font-size: clamp(84px, 11vw, 176px); line-height: .78; letter-spacing: .005em; margin: 0 0 12px; background: linear-gradient(100deg, #fff9cb 15%, #fec497 45%, #e9639b 95%); background-clip: text; -webkit-background-clip: text; color: transparent; }
.hero p { margin: 0; font-size: 18px; max-width: none; color: var(--soft); }
.herosearch { flex: 0 1 440px; margin: 0; }
.herosearch .field { border: 0; min-width: 0; }

/* Krainy: kolejna zasłania poprzednią */
.places { position: relative; }
.place { position: sticky; top: 0; height: 100svh; overflow: hidden; background: linear-gradient(#38365d, #18182d); view-timeline: --place block; }
.place img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.place::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #0d0c1ab8, #0d0c1a00 60%), linear-gradient(#0d0c1a00 45%, #0d0c1acc); }
.placetext { position: absolute; z-index: 1; left: var(--gut); right: var(--gut); bottom: clamp(40px, 9vh, 110px); }
#hubbody .placetext h2 { font-size: clamp(76px, 15vw, 250px); line-height: .8; margin: 0 0 20px; }
.placetext p { margin: 0 0 22px; font-size: 21px; max-width: 40ch; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .place img { animation: settle linear both; animation-timeline: --place; animation-range: entry; }
    @keyframes settle { from { scale: 1.35; } to { scale: 1; } }
  }
}
.cast { position: relative; padding: 96px 0 60px; background: linear-gradient(#0d0c1a, #1f1f38); }
.casthead { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 0 var(--gut) 26px; }
#hubbody .casthead h2 { font-size: clamp(52px, 8vw, 120px); margin: 0; }
.casthead > div { display: flex; gap: 8px; }
.rail { display: flex; gap: 16px; overflow-x: auto; padding: 4px var(--gut) 24px; scroll-snap-type: x proximity; scroll-padding: var(--gut); scrollbar-width: none; }
.portrait { position: relative; flex: none; width: min(330px, 74vw); aspect-ratio: 3 / 4; overflow: hidden; border-radius: 26px; scroll-snap-align: start; background: linear-gradient(189deg, #4d3a62, #18182d); }
.portrait img { width: 100%; height: 100%; object-fit: cover; transition: scale .5s cubic-bezier(.2, .7, .2, 1); }
.portrait:hover img { scale: 1.05; }
.portrait b { position: absolute; inset: auto 0 0; padding: 90px 22px 18px; background: linear-gradient(#0d0c1a00, #0d0c1ae6); font: 400 44px/.95 var(--display); text-transform: uppercase; color: var(--cream); }
.dir { position: relative; display: block; max-width: none; padding: 60px var(--gut) 110px; background: #1f1f38; }
.dirrow { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 12px 32px; max-width: var(--wide); margin: 0 auto; padding: 24px 0; }
#hubbody .dirrow h2 { font-size: clamp(44px, 5vw, 76px); }
.dirrow > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 24px; align-content: start; }
.dir a { border: 0; }
.dir a span { font-size: 15px; }
.dir a:hover b { color: var(--lagoon); text-decoration: none; }

/* Mapa */
#panel { background: #0d0c1af5; }
#panel h1 { font-size: 56px; }
.progress { border-color: var(--raised); }
details > summary { font-family: var(--body); }
#card { background: #14132af5; border-radius: 24px; box-shadow: 0 16px 50px #0d0c1a80; }
#card h2 { font: 400 38px/.95 var(--display); }
.shot { border-radius: 16px; }
#tools, #route { background: #0d0c1af0; border-radius: 999px; padding: 6px; }
#route { padding-left: 20px; padding-right: 16px; }
#tools button { border-radius: 999px; }
#tools button:hover { background: var(--line); }
#tools #compass { position: absolute; right: calc(100% + 12px); bottom: 0; width: 76px; height: 76px; min-width: 0; padding: 0; border-radius: 50%; background: #0d0c1af0; }
#tools #compass:hover { background: #1f1f38; }
#rose { position: absolute; inset: 2px; transform: rotate(var(--a, 0deg)); }
#rose svg { position: absolute; inset: 0; }
#rose .nn { fill: #e9639b; }
#rose .ss { fill: var(--soft); }
#rose .ticks { stroke: #6a66a0; stroke-width: 2; stroke-linecap: round; }
#rose :is(b, i) { position: absolute; left: 50%; top: 50%; width: 20px; margin: -9px -10px; font: 700 13px/18px var(--body); text-align: center; color: var(--soft); transform: translate(var(--x, 0), var(--y, 0)) rotate(calc(var(--a, 0deg) * -1)); }
#rose b { --y: -27px; color: var(--cream); font-size: 16px; font-weight: 800; }
#rose :nth-child(3) { --x: 27px; }
#rose :nth-child(4) { --y: 27px; }
#rose :nth-child(5) { --x: -27px; }
@media (max-width: 940px) { #tools #compass { position: fixed; right: 12px; bottom: auto; top: calc(var(--top) + 12px); } }
.region, [data-style=night] .region { background: #0d0c1ad9; color: var(--cream); font: 400 21px/1 var(--display); text-transform: uppercase; border-radius: 6px; }
#tip, #toast { background: var(--cream); color: var(--plum); }
#toast { border-radius: 999px; padding: 12px 22px; }
#pause, #licenses { background: #14132a; border-radius: 28px; }
#pause h2, #licenses h2 { font: 400 60px/.9 var(--display); }
#pause .btn { text-align: center; }
#load { background: linear-gradient(180deg, #38365d, #e9639b 62%, #fec497); }
#load strong { font: 400 clamp(52px, 14vw, 240px)/.8 var(--display); text-transform: uppercase; letter-spacing: .01em; color: var(--cream); }
#load .btn { background: var(--cream); color: var(--plum); }

@media (max-width: 1100px) {
  #hubnav { display: none; }
  #burger { margin-left: auto; }
}
@media (max-width: 760px) {
  :root, [data-style=night] { --top: 60px; }
  .panels { flex-direction: column; gap: 6px; margin: 0; min-height: 0; }
  .panel { transform: none; min-height: 62px; border-radius: 12px; }
  .panel:is(:hover, :focus-visible) { flex-grow: 1.5; }
  .frame { inset: 0; transform: none; }
  .frame img { object-position: 50% 14% !important; }
  .panel::after { inset: 0; background: linear-gradient(90deg, #0d0c1acc, #0d0c1a00 75%); }
  .panel b { transform: none; left: 18px; bottom: 12px; font-size: 34px; }
  .herofoot { flex-wrap: wrap; align-items: stretch; padding-top: 20px; }
  .herofoot > div, .herosearch { flex: 1 1 100%; }
  .herofoot > .btn { flex: 1; text-align: center; }
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .sheetpic { position: static; }
  .dirrow { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 12px; }
  .tile b { font-size: 25px; }
  .grid.tall .tile b { font-size: 28px; }
  .grid.tall .tile .lab2 { padding: 50px 12px 12px; }
  .pic { width: 84px; height: 56px; }
  .indexart { inset: 0; opacity: .45; }
  .indexnav { grid-template-columns: 1fr 1fr; gap: 30px 16px; padding-top: 84px; }
  .indexnav a { font-size: 16px; }
  #tools { left: 8px; right: 8px; bottom: 54px; }
  #credit { left: 14px; right: 14px; }
  #tools button { min-width: 38px; }
  #panel { border-radius: 24px 24px 0 0; }
}
@media (max-width: 760px) and (max-height: 720px) { .hero { min-height: 720px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
