:root {
  --panel: #f6f3ff; --raised: #fff; --ink: #0b2540; --soft: #4d6280; --line: #d9d3ee;
  --lagoon: #007f91; --hibiscus: #d1125f; --sun: #ffc738; --sea: #2c67a8;
  --display: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
  --body: Figtree, 'Segoe UI', sans-serif;
  color-scheme: light;
}
[data-style=night] {
  --panel: #101d3d; --raised: #1a2a52; --ink: #eef1ff; --soft: #a9b7dc; --line: #2d3f70;
  --lagoon: #4fd8e4; --hibiscus: #ff6fa8; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sea); color: var(--ink); font: 400 15px/1.45 var(--body); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
#stage canvas { position: fixed; inset: 0; display: block; touch-action: none; }
#ground { position: fixed !important; inset: 0; pointer-events: none; background: var(--sea); }
#ground { overflow: hidden; }
#plane { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
#ground img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; transform-origin: 0 0; will-change: transform; }
[data-style=night] #ground { filter: brightness(.5) saturate(.75); }
#overlay { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
html:not([data-page]) :is(#top, #tools, #menu) { touch-action: pan-x pan-y; } /* szczypanie powiększa mapę, nie stronę */
#overlay > * { position: absolute; left: 0; top: 0; will-change: transform; }

.region { z-index: 2; padding: 4px 8px; border-radius: 7px; background: #ffffffd9; font: 800 15px/1 var(--display); color: #0b2540; white-space: nowrap; }
[data-style=night] .region { color: #fff; background: #0b1530d9; }

#panel { position: fixed; left: 0; top: 0; bottom: 0; width: 350px; background: var(--panel); display: flex; flex-direction: column; transition: transform .25s; z-index: 5; }
#panel.closed { transform: translateX(-100%); visibility: hidden; transition: transform .25s, visibility 0s .25s; }
.head { padding: 22px 20px 14px; }
h1 { margin: 0; font: 800 40px/.95 var(--display); letter-spacing: -.03em; }
.head p { margin: 6px 0 14px; color: var(--soft); font-size: 14px; }
#q { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--raised); }
#q::placeholder { color: var(--soft); opacity: 1; }
.progress { padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.progress div:first-child { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 4px; overflow: hidden; background: var(--line); display: block; margin: 6px 0 10px; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--hibiscus); }
progress::-moz-progress-bar { background: var(--hibiscus); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--lagoon); width: 17px; height: 17px; margin: 0; flex: none; }
.scroll { overflow-y: auto; flex: 1; padding: 10px 12px 24px; overscroll-behavior: contain; }
.bulk { display: flex; gap: 14px; padding: 4px 8px 6px; }
.text { padding: 4px 0; color: var(--lagoon); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
details > summary { display: flex; align-items: center; gap: 10px; padding: 10px 8px; cursor: pointer; font: 700 18px/1.2 var(--display); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; width: 8px; height: 8px; border: solid var(--soft); border-width: 0 2px 2px 0; transform: rotate(-45deg); margin-left: auto; }
details[open] > summary::after { transform: rotate(45deg); }
.kind { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.kind:hover, .result:hover { background: var(--raised); }
.dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; flex: none; }
.dot i { width: 18px; height: 18px; mask: center / contain no-repeat; -webkit-mask: center / contain no-repeat; }
.kind .label { flex: 1; min-width: 0; }
.kind .n { color: var(--soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.result { width: 100%; display: flex; gap: 10px; text-align: left; padding: 8px; border-radius: 8px; align-items: center; }
.result b { display: block; font-weight: 600; }
.result small, .empty { color: var(--soft); font-size: 13px; }
.empty { padding: 12px 8px; font-size: 15px; }

#card { position: fixed; right: 16px; top: 16px; width: 340px; max-height: calc(100dvh - 110px); overflow-y: auto; background: var(--panel); border-radius: 14px; padding: 18px; box-shadow: 0 8px 30px #0b254055; z-index: 6; }
#card h2 { margin: 10px 32px 2px 0; font: 700 24px/1.1 var(--display); overflow-wrap: anywhere; }
#card p { margin: 8px 0; }
#card .meta { color: var(--soft); margin: 0; font-size: 14px; }
#card .close { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; font-size: 22px; line-height: 1; }
.shot { display: block; width: 100%; padding: 0; margin-top: 12px; border-radius: 9px; overflow: hidden; background: var(--line); aspect-ratio: 16 / 9; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
#light { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #06142aee; color: #fff; }
#light::backdrop { background: none; }
#light[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 10px; padding: 60px 16px 24px; }
#light img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 8px; }
#light p { margin: 0; text-align: center; max-width: 70ch; }
#light button { position: absolute; right: 12px; top: 8px; width: 44px; height: 44px; font-size: 28px; color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { padding: 10px 14px; border-radius: 9px; font-weight: 600; background: var(--raised); border: 2px solid var(--line); }
.btn.main { background: var(--hibiscus); border-color: var(--hibiscus); color: #fff; }
[data-style=night] .btn.main { color: #240413; }
.btn.main[aria-pressed=true] { background: transparent; color: var(--hibiscus); }

#tools { position: fixed; right: 16px; bottom: 36px; display: flex; gap: 2px; background: var(--panel); border-radius: 12px; padding: 4px; box-shadow: 0 3px 14px #0b254055; z-index: 4; }
#tools button { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 9px; font-weight: 600; }
#tools button:hover { background: var(--raised); }
#menu { position: fixed; left: 16px; top: 16px; z-index: 4; box-shadow: 0 3px 14px #0b254055; }
#hide { position: absolute; right: 12px; top: 18px; width: 40px; height: 40px; font-size: 22px; }
#route { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: var(--panel); border-radius: 12px; padding: 8px 10px 8px 16px; box-shadow: 0 3px 14px #0b254055; z-index: 4; white-space: nowrap; max-width: calc(100vw - 24px); overflow-x: auto; }
#hubbody .bars + h2 { margin-top: 26px; }
#hubbody h3 { font: 700 18px/1.2 var(--display); margin: 22px 0 6px; }
.hint { color: var(--soft); margin: 4px 0 12px; max-width: 70ch; }
.barrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 9px; }
.barrow progress { margin: 4px 0 0; }
button.barrow:hover, .barrow[aria-pressed=true] { background: var(--raised); }
.barname { font-weight: 600; }
.grow { flex: 1; min-width: 0; }
#hub .n { color: var(--soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 12px; }
.item { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; }
.item:hover { background: var(--raised); }
.link { text-align: left; padding: 4px 0; }
.link b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.link small, .entry small { color: var(--soft); font-size: 13px; }
.star { width: 40px; height: 40px; font-size: 22px; color: var(--hibiscus); flex: none; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.field { padding: 10px 12px; border: 2px solid var(--line); border-radius: 9px; background: var(--raised); color: var(--ink); font: inherit; max-width: 100%; }
textarea.field { width: 100%; resize: vertical; }
#hubbody > .field { display: block; margin-bottom: 8px; }
#hubbody .check { padding: 6px 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-bottom: 8px; }
.lab { display: flex; gap: 12px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.lab span { min-width: 110px; }
.seg { display: inline-flex; background: var(--line); border-radius: 10px; padding: 3px; }
.seg button { padding: 8px 18px; border-radius: 8px; font-weight: 600; }
.seg button[aria-pressed=true] { background: var(--raised); }
.entry { padding: 10px 0; border-bottom: 1px solid var(--line); }
.entry p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.veil { filter: blur(9px); cursor: pointer; }
#credit { position: fixed; right: 16px; bottom: 8px; font-size: 12px; color: #fff; z-index: 3; text-shadow: 0 1px 3px #000a; }
#credit a { color: inherit; }
#credit button { color: inherit; padding: 0; text-decoration: underline; font-size: inherit; }
#licenses { border: 0; border-radius: 14px; padding: 22px; max-width: min(460px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
#licenses::backdrop { background: #06142a99; }
#licenses h2 { margin: 0 0 8px; font: 700 24px/1.1 var(--display); }
#licenses a { color: var(--lagoon); }
#tip { position: fixed; left: 0; top: 0; pointer-events: none; background: var(--ink); color: var(--panel); padding: 5px 10px; border-radius: 7px; font-weight: 600; font-size: 14px; max-width: 260px; z-index: 7; }
#toast { position: fixed; left: 50%; top: 20px; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 9px; z-index: 9; font-weight: 600; }
#load { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--sea); color: #fff; z-index: 20; text-align: center; padding: 24px; }
#load strong { font: 800 clamp(56px, 12vw, 130px)/.9 var(--display); letter-spacing: -.04em; }
#load .btn { color: #0b2540; background: var(--sun); border-color: var(--sun); }
@media (max-width: 760px) {
  #panel { width: 100%; top: auto; height: 72dvh; border-radius: 18px 18px 0 0; }
  #panel.closed { transform: translateY(100%); }
  h1 { font-size: 32px; }
  #route { left: 8px; right: 8px; bottom: 100px; transform: none; white-space: normal; flex-wrap: wrap; gap: 0 14px; }
  .head { padding: 16px 18px 10px; }
  #card { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 56dvh; }
  #tools { left: 8px; right: 8px; justify-content: space-between; }
  #tools button { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) { #panel { transition: none !important; } }

#pause { border: 0; border-radius: 16px; padding: 26px; width: min(320px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
#pause[open] { display: grid; gap: 10px; }
#pause::backdrop { background: #06142acc; }
#pause h2 { margin: 0 0 6px; font: 800 34px/1 var(--display); letter-spacing: -.02em; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
kbd { font: 600 14px var(--body); background: var(--raised); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; overflow-wrap: anywhere; }
.tools .field[type=number] { width: 205px; }


/* Kompendium */
.seg + h1 { margin-top: 16px !important; }
.tools.wide .field { flex: 1; }
.hqrow { align-items: flex-start; }
.hqrow > input { margin-top: 13px; }
details.hq { flex: 1; min-width: 0; }
details.hq > summary { padding: 8px 4px; font: inherit; }
details.hq > summary b { display: block; font-weight: 600; overflow-wrap: anywhere; }
details.set > summary { padding: 10px 4px; font: 700 17px/1.2 var(--display); border-bottom: 1px solid var(--line); }
#hub .item small { color: var(--soft); font-size: 13px; }
.detail { padding: 2px 4px 12px; max-width: 75ch; overflow-wrap: anywhere; }
.detail p { margin: 6px 0; }
.detail dl { display: grid; grid-template-columns: minmax(110px, 180px) 1fr; gap: 4px 14px; margin: 10px 0; }
.detail dt { color: var(--soft); }
.detail dd { margin: 0; }
.detail li { margin: 4px 0; }
.detail a { color: var(--lagoon); }
.src > summary { padding: 6px 0; font: 600 13px var(--body); color: var(--lagoon); justify-content: flex-start; }
.src > summary::after { margin-left: 4px; }
.block { display: block; }
.code { display: inline-block; margin: 5px 0; letter-spacing: .12em; font-size: 16px; }
.warn { border-left: 4px solid var(--hibiscus); padding: 8px 12px; background: var(--raised); border-radius: 0 9px 9px 0; max-width: 70ch; }
.item .field[type=number] { width: 120px; }
.need { min-width: 96px; }
@media (max-width: 760px) {
  .item .field[type=number] { width: 84px; }
  .need { min-width: 64px; }
  .detail dl { grid-template-columns: 1fr; gap: 0; }
  .detail dd { margin-bottom: 6px; }
}

/* Strona: nagłówek, podstrony, stopka */
:root { --top: 60px; }
#top { position: fixed; inset: 0 0 auto; height: var(--top); z-index: 8; display: flex; align-items: center; gap: 20px; padding: 0 20px; background: var(--raised); border-bottom: 1px solid var(--line); }
#brand { font: 800 26px/1 var(--display); letter-spacing: -.03em; color: var(--hibiscus); text-decoration: none; }
#hubnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
#hubnav a { padding: 10px 13px; border-radius: 9px; color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
#hubnav a:last-child { margin-left: auto; }
#hubnav a:hover { background: var(--panel); }
#hubnav a[aria-current] { background: var(--lagoon); color: var(--raised); }
#panel { top: var(--top); }
#card { top: calc(var(--top) + 16px); max-height: calc(100dvh - 110px - var(--top)); }
#menu { top: calc(var(--top) + 16px); }
#toast { top: calc(var(--top) + 14px); }
#light, #licenses, #pause { z-index: 9; }
[data-page], [data-page] body { height: auto; min-height: 100%; overflow: visible; background: var(--panel); }
[data-page] :is(#stage, #overlay) { visibility: hidden; }
[data-page] :is(#panel, #card, #menu, #tools, #route, #credit, #tip) { display: none !important; }
[data-page] #overlay * { visibility: hidden; }
#hub { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 100vh; padding-top: var(--top); background: var(--panel); }
#subnav { display: flex; gap: 22px; overflow-x: auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: 22px 24px 0; }
#subnav a { padding: 4px 0 8px; color: var(--soft); font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
#subnav a:hover { color: var(--ink); }
#subnav a[aria-current] { color: var(--ink); border-color: var(--hibiscus); }
#hubbody { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 24px 64px; }
#hubbody h1 { font: 800 44px/1 var(--display); letter-spacing: -.03em; margin: 0 0 16px; }
#hubbody h2 { font: 800 28px/1.05 var(--display); letter-spacing: -.02em; margin: 0 0 12px; }
#hubbody.home { max-width: none; padding: 0; }
.hero { background: var(--sea); color: #fff; padding: clamp(48px, 9vw, 120px) max(24px, calc((100vw - 1072px) / 2)) clamp(40px, 7vw, 84px); }
[data-style=night] .hero { background: #183a6b; }
#hubbody .hero h1 { font-size: clamp(76px, 15vw, 200px); line-height: .85; letter-spacing: -.05em; margin: 0; }
.hero p { font-size: 20px; max-width: 46ch; margin: 22px 0 26px; }
.herosearch { display: flex; gap: 8px; max-width: 620px; margin-bottom: 14px; }
.herosearch .field { flex: 1; min-width: 0; border-color: transparent; }
.mapgo { display: inline-block; background: var(--sun); border-color: var(--sun); color: #0b2540; text-decoration: none; }
.dir { max-width: 1120px; margin: 0 auto; padding: 52px 24px 72px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 44px 40px; }
.dir a { display: block; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.dir a b { display: block; font-weight: 700; }
.dir a span { color: var(--soft); font-size: 14px; }
.dir a:hover b { color: var(--hibiscus); text-decoration: underline; text-underline-offset: 3px; }
#hub footer { border-top: 1px solid var(--line); padding: 20px max(24px, calc((100vw - 1072px) / 2)); color: var(--soft); font-size: 13px; }
#hub footer p { margin: 3px 0; }
#hub footer a { color: inherit; }
@media (max-width: 760px) {
  #top { padding: 0 10px 0 14px; gap: 10px; }
  #brand { font-size: 22px; }
  #panel { top: auto; height: calc(100dvh - var(--top) - 60px); }
  #card { top: auto; max-height: 56dvh; }
  #subnav { padding: 16px 16px 0; }
  #hubbody { padding: 18px 16px 48px; }
  #hubbody h1 { font-size: 36px; }
}

/* Zdjęcia haseł */
.pic { flex: none; width: 72px; height: 72px; border-radius: 9px; overflow: hidden; background: var(--line); }
.pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pic.none { display: grid; place-items: center; color: var(--soft); font: 800 30px/1 var(--display); }
.hqrow > input { margin-top: 35px; }
.hqrow > .star { margin-top: 24px; }
details.hq > summary { gap: 14px; }
.bigpic { display: block; padding: 0; margin: 4px 0 12px; border-radius: 12px; overflow: hidden; background: var(--line); }
.bigpic img { display: block; max-width: 100%; max-height: 460px; }
.hqrow.card { background: var(--raised); border-radius: 14px; padding: 8px 12px; margin-bottom: 12px; }
.card .pic { width: 120px; height: 120px; border-radius: 10px; }
.card .pic.none { font-size: 48px; }
.card > .star { margin-top: 48px; }
.card details.hq > summary b { font: 700 20px/1.15 var(--display); }
.lead { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; max-width: 75ch; }
@media (max-width: 760px) {
  .card .pic { width: 84px; height: 84px; }
  .card > .star { margin-top: 30px; }
  .hqrow.card { padding: 6px; }
  details.hq > summary { gap: 10px; }
}
