/* Gallery player, videos page filters, the online-play HUD note, the "Built with OneDroid" blocks, OneDroid text links
   and the Polish-glyph heading fallback. Loaded after site.css on every page. */

/* ---------- Headings: one font per heading ---------- */
/* The pixel font has no ą ć ę ł ń ó ś ź ż; such a heading is drawn wholly in the companion font (site-extras.js). */
.glyph-fallback, .game h2.glyph-fallback, .game h3.glyph-fallback, .chapter h2.glyph-fallback, .drawer-head h2.glyph-fallback {
  font-family: var(--font-body) !important; font-weight: 800 !important; letter-spacing: .01em;
}

/* ---------- Video cards ---------- */
.vid-filter { margin: 4px 0 6px; }
.vid-group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.vid-group-head h2 { margin: 0; }
.vid-n { font: 600 .85rem var(--font-body); color: var(--ui-muted); }
.vid-group > .muted { max-width: 760px; margin: 6px 0 14px; font-size: .95rem; }
.vid-group .vid-grid { margin-top: 14px; }
.vid-card { transition: border-color .15s, transform .15s; box-shadow: 0 2px 0 var(--ink); }
.vid-card:hover, .vid-card:focus-visible { transform: translateY(-2px); }
.vid-card:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.vid-poster img { transition: transform .25s; }
.vid-card:hover .vid-poster img { transform: scale(1.03); }
.vid-poster { overflow: hidden; }
.vid-ch { position: absolute; left: 8px; bottom: 8px; z-index: 1; background: var(--amber); color: var(--navy); font: 700 .74rem var(--font-body); padding: 2px 7px; border-radius: 4px; }
.vid-body .vid-sec { display: block; -webkit-line-clamp: unset; font: 700 .72rem var(--font-od); text-transform: uppercase; letter-spacing: .1em; color: var(--amber); margin-bottom: 4px; }
.vid-body .vid-cap { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .88rem; color: #cfc9e0; }
.vid-group .vid-body .vid-sec { display: none; }

/* ---------- The player dialog ---------- */
dialog.vid-player { display: none; flex-direction: column; overflow: hidden; width: min(1180px, 96vw); max-height: 94vh; max-height: 94dvh; }
dialog.vid-player[open] { display: flex; }
.vp-head { flex-shrink: 0; }
.vp-count { font: 700 .82rem var(--font-body); color: var(--navy); background: var(--amber); border-radius: 4px; padding: 2px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vp-head h2 { overflow-wrap: anywhere; }
dialog.vid-player .vp-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; overscroll-behavior: contain; }
.vp-main { min-width: 0; }
.vp-stage { position: relative; }
.vp-stage video { width: 100%; display: block; background: #000; border-radius: 6px; aspect-ratio: 16 / 9; max-height: calc(94vh - 330px); max-height: calc(94dvh - 330px); min-height: 180px; }
.vp-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border-radius: 8px; cursor: pointer;
  background: rgba(14,10,27,.7); color: var(--cream); border: 1px solid #3a3163; font-size: 1.3rem; opacity: 0; transition: opacity .15s, border-color .15s;
}
.vp-prev { left: 8px; } .vp-next { right: 8px; }
.vp-stage:hover .vp-arrow:not(:disabled) { opacity: 1; }
.vp-arrow:hover { border-color: var(--amber); }
.vp-arrow:disabled { display: none; }
@media (hover: none) { .vp-arrow { display: none; } }
.vp-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.vp-pos { font: 700 .95rem var(--font-body); color: var(--cream); font-variant-numeric: tabular-nums; }
.vp-bar .btn:disabled { opacity: .45; cursor: default; }
.vp-caption { margin: 10px 0 8px; }
.vp-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: .9rem; }
.vp-auto { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.vp-auto input { width: 18px; height: 18px; accent-color: var(--amber); margin: 0; }
.vp-scope { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.vp-scope .chip { padding: 4px 10px; font-size: .8rem; }
.vp-hint { font-size: .8rem; }
@media (hover: none) { .vp-hint { display: none; } }
.vp-strip-wrap { flex-shrink: 0; border-top: 1px solid #2f2756; background: var(--ink); padding: 10px 14px 12px; }
.vp-strip { list-style: none; margin: 0; padding: 2px 2px 6px; display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.vp-strip li { flex: 0 0 auto; scroll-snap-align: center; }
.vp-strip button { position: relative; display: block; width: 136px; padding: 0; border: 2px solid #2f2756; border-radius: 6px; overflow: hidden; background: var(--navy-raised); cursor: pointer; opacity: .7; transition: opacity .15s, border-color .15s; }
.vp-strip button:hover, .vp-strip button:focus-visible { opacity: 1; border-color: var(--amber-light); }
.vp-strip button[aria-current="true"] { opacity: 1; border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.vp-strip img, .vp-noimg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ink); }
.vp-sn, .vp-sd { position: absolute; bottom: 4px; font: 700 .7rem var(--font-body); padding: 1px 5px; border-radius: 3px; background: rgba(14,10,27,.85); color: var(--cream); }
.vp-sn { left: 4px; } .vp-sd { right: 4px; }
.vp-strip button[aria-current="true"] .vp-sn { background: var(--amber); color: var(--navy); }
.vp-strip::-webkit-scrollbar { height: 8px; }
.vp-strip::-webkit-scrollbar-thumb { background: #3a3163; border-radius: 8px; }
@media (max-width: 600px) {
  dialog.vid-player { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border-left: 0; border-right: 0; }
  .vp-head { padding: 8px 10px; }
  .vp-head h2 { font-size: 1rem; }
  dialog.vid-player .vp-body { padding: 10px; }
  .vp-strip button { width: 104px; }
  .vp-strip-wrap { padding: 8px 10px 10px; }
  .vp-lbl { display: none; }
  .vp-bar .btn { min-width: 52px; min-height: 40px; }
}

/* ---------- Online play: a HUD panel ---------- */
.hud-note {
  position: relative; margin-top: 24px; max-width: 860px; text-align: left;
  background: linear-gradient(180deg, rgba(29,23,54,.96), rgba(19,15,36,.96)); color: var(--cream);
  border: 1px solid #3a3163; border-top: 3px solid var(--amber); border-radius: var(--radius); box-shadow: 0 2px 0 var(--ink);
  padding: 14px 18px 16px;
}
.hud-note-center { margin-left: auto; margin-right: auto; }
.hud-note-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hud-note-head h3 { margin: 0; font-size: 1.1rem; color: var(--cream); }
.hud-tag { font: 800 .7rem var(--font-od); text-transform: uppercase; letter-spacing: .14em; color: var(--navy); background: var(--amber); border-radius: 4px; padding: 3px 8px; }
.hud-note-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; }
.hud-stat { background: var(--ink); border: 1px solid #2f2756; border-radius: 8px; padding: 10px 12px; text-align: center; }
.hud-stat .num { display: block; font: 400 2.4rem/1 var(--font-game); color: var(--amber); }
.hud-stat .lbl { display: block; font-size: .78rem; color: var(--ui-muted); margin-top: 6px; line-height: 1.3; }
.hud-note-text p { margin: 0 0 8px; font-size: .95rem; color: #d8d3e6; }
.hud-note-text p:last-child { margin-bottom: 0; }
.hud-note code { background: var(--ink); color: var(--amber-light); padding: 1px 5px; border-radius: 4px; font-size: .85em; overflow-wrap: anywhere; }
.hud-note-compact { margin-top: 14px; }
@media (max-width: 560px) {
  .hud-note-body { grid-template-columns: 1fr; }
  .hud-stat { display: flex; align-items: center; gap: 12px; text-align: left; }
  .hud-stat .lbl { margin-top: 0; }
}

/* ---------- OneDroid: secondary credits ---------- */
.od-link { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: var(--amber); text-underline-offset: 3px; }
.od-link:hover { color: var(--amber-light); text-decoration-style: solid; }
.game a.od-link, .chapter a.od-link { color: inherit; }
.game a.od-link:hover { color: var(--amber-light); }
.site-footer .footer-od { grid-column: 1 / -1; border-top: 1px solid var(--ui-line); padding-top: 18px; display: grid; gap: 6px 22px; grid-template-columns: minmax(0, 16em) minmax(0, 1fr); align-items: start; }
.footer-od h2 { margin: 0; font-size: .85rem; color: var(--ui-muted); }
.footer-od p { margin: 0; font-size: .85rem; grid-column: 1; }
.footer-od .od-links { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; }
.footer-od .od-social { grid-row: 3; }
.footer-od a { color: #cfc9e0; }
.footer-od a:hover { color: var(--amber); }
@media (max-width: 760px) {
  .site-footer .footer-od { grid-template-columns: 1fr; }
  .footer-od .od-links, .footer-od .od-social, .footer-od p { grid-column: 1; grid-row: auto; }
}
.od-tools { max-width: 760px; margin: 28px auto 0; text-align: left; }
.od-tools h3 { text-align: center; font-size: 1.1rem; }
.od-tool { display: block; text-decoration: none; color: var(--cream); transition: border-color .15s; }
.game a.od-tool { color: var(--cream); }
.od-tool:hover, .od-tool:focus-visible { border-color: var(--amber); color: var(--cream); }
.od-tool strong { display: block; color: var(--amber); margin-bottom: 4px; }
.od-tool span { font-size: .92rem; color: #cfc9e0; }
.od-more { margin-top: 14px; font-size: .9rem; color: var(--ui-muted); text-align: center; }

/* Footer column titles: one font in both languages ("GRA" / "JAK POWSTAŁA" would otherwise mix the two). */
.site-footer h2 { font-family: var(--font-body); font-weight: 800; letter-spacing: .08em; font-size: .85rem; }

/* ---------- Phones and touch: tap targets, notches, landscape ---------- */
@media (pointer: coarse) {
  .brand { min-height: 44px; min-width: 44px; }
  .lang-toggle button { min-height: 44px; min-width: 44px; }
  .menu-btn, .header-actions .btn-sm { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .chip { min-height: 44px; display: inline-flex; align-items: center; }
  .vp-scope .chip { min-height: 40px; }
  .site-footer li a, .footer-od a { display: inline-block; padding: 9px 0; }
  .footer-od .od-links { gap: 0 16px; }
  .vp-auto { min-height: 44px; }
  .vp-auto input { width: 22px; height: 22px; }
  .btn-sm { min-height: 44px; }
}
/* Notches and rounded corners (viewport-fit=cover). */
.site-header .wrap, .site-footer .wrap, main .wrap {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.site-footer { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
@media (max-width: 600px) {
  dialog.vid-player .vp-head { padding-top: max(8px, env(safe-area-inset-top)); }
  .vp-strip-wrap { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
/* Phone in landscape: the picture first, the rest scrolls under it. */
@media (max-height: 500px) and (orientation: landscape) {
  dialog.vid-player { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .vp-head { padding: 4px 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .vp-head h2 { font-size: .95rem; }
  dialog.vid-player .vp-body { padding: 8px max(12px, env(safe-area-inset-left)); }
  .vp-stage video { max-height: calc(100dvh - 120px); min-height: 0; }
  .vp-strip-wrap { padding: 6px 12px; }
  .vp-strip button { width: 96px; }
  .vp-hint { display: none; }
}
/* 3D viewers: a vertical swipe scrolls the page (set on the canvas too by voxel.js). */
.viewer canvas, .hero-stage canvas { touch-action: pan-y; }
/* Long pages: let the browser skip layout and paint of far-away sections. */
.vid-group { content-visibility: auto; contain-intrinsic-size: auto 900px; }
#timeline .timeline > li { content-visibility: auto; contain-intrinsic-size: auto 160px; }
/* Save-Data / slow connection (common.js sets html.save-data): no smooth-scroll, lighter motion. */
html.save-data .vid-card:hover .vid-poster img { transform: none; }

/* The Menu button only below the nav breakpoint (site.css's `.btn` display rule came later and won). */
.site-header .menu-btn { display: none; }
@media (max-width: 1180px) { .site-header .menu-btn { display: inline-flex; } }

/* Stable heights while a phone's URL bar shows and hides (svh/dvh where supported). */
@supports (height: 1svh) {
  .hero-inner { min-height: min(78svh, 720px); }
  .toc { max-height: calc(100svh - var(--header-h) - 24px); }
  dialog.lightbox { max-height: 94dvh; }
  dialog.lightbox img { max-height: 80svh; }
}
@media (max-width: 960px) { .hero-inner { min-height: 0; } }
.vp-chapters { max-height: 62vh; max-height: 62dvh; }

/* ---------- Downloads: Windows + macOS; the Mac note ---------- */
.dl-all { margin: 10px 0 0; font-size: .88rem; }
.dl-all a { color: var(--ui-muted); }
.hud-mac { margin-top: 18px; }
.hud-mac .hud-note-text p { margin: 0 0 8px; }
.mac-steps { margin: 0 0 10px; padding-left: 1.3em; display: grid; gap: 4px; font-size: .95rem; color: #d8d3e6; }
.mac-steps li::marker { color: var(--amber); font-weight: 700; }

/* ---------- Install page ---------- */
.inst { padding-bottom: 60px; max-width: 980px; }
.inst-ea { margin: 6px 0 26px; max-width: none; }
.inst-ea .hud-note-head h2 { margin: 0; font-size: 1.15rem; color: var(--cream); }
.inst-cmds { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin: 8px 0 10px; font-size: .88rem; color: var(--ui-muted); }
.inst pre { margin: 4px 0 0; padding: 8px 10px; background: var(--ink); border: 1px solid #2f2756; border-radius: 6px; overflow-x: auto; }
.inst pre code { background: none; padding: 0; color: var(--amber-light); font-size: .85rem; white-space: pre; }
.inst code { overflow-wrap: anywhere; }
.inst-files { font-size: .88rem; }
.inst-tabs { display: flex; gap: 6px; border-bottom: 2px solid #2f2756; margin: 0 0 18px; position: sticky; top: var(--header-h); z-index: 20; background: var(--navy); padding-top: 6px; }
.inst-tabs [role="tab"] { font: 800 1rem var(--font-od); padding: 10px 22px; min-height: 44px; border: 1px solid #2f2756; border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--navy-raised); color: var(--cream); cursor: pointer; margin-bottom: -2px; }
.inst-tabs [role="tab"][aria-selected="true"] { background: var(--navy); border-color: var(--amber); border-bottom: 2px solid var(--navy); color: var(--amber); }
.inst-toc-wrap { margin-bottom: 12px; }
.inst-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.inst-toc a { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; border: 1px solid #3a3163; border-radius: 99px; text-decoration: none; font: 700 .86rem var(--font-od); color: var(--cream); background: var(--navy-raised); }
.inst-toc a:hover, .inst-toc a:focus-visible { border-color: var(--amber); }
.inst-req { font-size: .92rem; }
.inst-sec { margin: 22px 0 8px; scroll-margin-top: calc(var(--header-h) + 64px); }
.inst-sec h3, .inst-sec h2 { font-size: 1.15rem; }
.inst-steps { counter-reset: st; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.inst-steps > li { counter-increment: st; position: relative; padding: 12px 14px 12px 50px; background: var(--navy-raised); border: 1px solid #2f2756; border-radius: var(--radius); color: #d8d3e6; font-size: .97rem; }
.inst-steps > li::before { content: counter(st); position: absolute; left: 12px; top: 11px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); color: var(--navy); font: 800 .85rem var(--font-body); }
.inst-steps strong { color: var(--cream); }
.ui-label { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--ink); border: 1px solid #4a4170; color: var(--amber-light); font-weight: 700; font-size: .92em; white-space: normal; }
.inst-aside { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--amber); background: rgba(29,23,54,.6); border-radius: 0 6px 6px 0; font-size: .95rem; }
.inst-both { margin-top: 34px; }
.inst-faq-item { border: 1px solid #2f2756; border-radius: var(--radius); background: var(--navy-raised); margin: 8px 0; }
.inst-faq-item summary { cursor: pointer; padding: 12px 14px; font-weight: 700; min-height: 44px; }
.inst-faq-item p { margin: 0; padding: 0 14px 12px; color: #d8d3e6; font-size: .95rem; }
.dl-guide { margin: 8px 0 0; font-size: .92rem; font-weight: 700; }
.dl-guide a::before { content: "→ "; }
.hero-guide { margin-top: 4px; }
.inst-from-mac { font-weight: 700; }
@media (max-width: 600px) { .inst-tabs [role="tab"] { flex: 1; padding: 10px 8px; } .inst-steps > li { padding-left: 44px; } }

/* Safari (before 18) needs the prefixed backdrop filter for the translucent header and the player backdrop. */
.site-header { -webkit-backdrop-filter: blur(8px); }

/* ---------- Manual on phones: nothing wide, nothing over the text ---------- */
/* long tokens (paths, file names) wrap instead of widening the page; code blocks and tables scroll inside themselves */
.manual-content, .chapter { min-width: 0; overflow-wrap: anywhere; }
.chapter pre { max-width: 100%; overflow-x: auto; }
.chapter code { overflow-wrap: anywhere; word-break: break-word; }
.chapter img { max-width: 100%; height: auto; }
/* the Contents button is a full-width, opaque sticky bar of its own (like the header): text scrolls under it, never
   beside or around it, and links land below it (scroll-padding covers its height) */
@media (max-width: 960px) {
  .toc-toggle {
    position: sticky; top: var(--header-h); z-index: 40;
    display: flex; width: 100%; justify-content: flex-start; gap: 8px;
    margin: 0 0 14px; border-radius: 0 0 var(--radius) var(--radius);
    background: var(--navy-raised); box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .6), 0 -12px 0 var(--navy);
  }
}

/* ---------- Privacy page ---------- */
.priv-list { padding-left: 1.2em; display: grid; gap: 6px; color: #d8d3e6; }
.priv-sec h2 { font-size: 1.2rem; }
