/* Loch Pixel = Press Start 2P (OFL, fonts/OFL.txt) z poprawionymi ą/ę w podzbiorze latin-ext; nazwa własna, bo OFL zastrzega nazwę oryginału dla wersji zmodyfikowanych */
@font-face { font-family: 'Loch Pixel'; font-display: swap; src: url(../fonts/press-start-2p-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193; }
@font-face { font-family: 'Loch Pixel'; font-display: swap; src: url(../fonts/loch-pixel-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: 'VT323'; font-display: swap; src: url(../fonts/vt323-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193; }
@font-face { font-family: 'VT323'; font-display: swap; src: url(../fonts/vt323-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0; }

/* Gra osadzona w stronie serwisu: wszystko w obrębie .lochman, reguły elementów przez :where (zerowa specyficzność). */
.lochman {
  --void: #07070a; --panel: #101016; --line: #26262e; --edge: #62627a; --txt: #e8e8f0; --muted: #8a8aa0; /* --edge: ramki przycisków, ≥3:1 na każdym tle (WCAG 1.4.11) */
  --y: #ffe500; --m: #ff1493; --c: #26fedc; --r: #e0245e; --px: 'Loch Pixel', monospace; --vt: 'VT323', monospace;
  background: var(--void); color: var(--txt); font-family: var(--vt); font-size: 20px; line-height: normal;
  display: flex; flex-direction: column; align-items: center; padding: 12px;
}
:where(.lochman) * { box-sizing: border-box; margin: 0; padding: 0; }
html:has(.lochman) { overscroll-behavior-y: none; } /* bez pull-to-refresh i odbicia strony: przypadkowe przeciągnięcie w dół po pasku nie przeładowuje gry; zwykłe przewijanie (wyjście awaryjne) zostaje */
:where(.lochman) button { font: inherit; color: inherit; cursor: pointer; }
:where(.lochman) kbd { font-family: inherit; color: var(--txt); border: 1px solid #44445a; padding: 0 4px; }
.lochman .hidden { display: none !important; }

.studio { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 12px; width: min(100%, 1000px); align-items: start; }
.tv { position: relative; min-width: 0; background: #000; border: 3px solid var(--line); border-radius: 18px; padding: 12px;
  box-shadow: 0 0 0 6px #111116, 0 0 60px rgba(255, 20, 147, .15); }
.screen { position: relative; border-radius: 10px; overflow: hidden; background: #050507; touch-action: none; } /* gesty sterują, nie przewijają */
:where(.lochman) canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
#c { max-height: max(300px, calc(100vh - 210px)); max-height: max(300px, calc(100dvh - 210px)); object-fit: contain; }
.screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .55) 100%);
  animation: flick 4s infinite steps(1); }
@keyframes flick { 50% { opacity: .92; } 51% { opacity: 1; } }

.osd { position: absolute; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 7px 10px; font-family: var(--px); font-size: 10px; pointer-events: none; text-shadow: 2px 2px 0 #000; }
.osd.top > *, .osd.bot > * { white-space: nowrap; }
.osd.top { top: 0; background: linear-gradient(rgba(0, 0, 0, .75), transparent); }
.osd.bot { bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.live { background: var(--r); color: #fff; padding: 4px 6px; display: inline-flex; gap: 6px; align-items: center; text-shadow: none; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite steps(1); }
@keyframes blink { 50% { opacity: 0; } }
.viewers { color: var(--y); }
.floor { color: #fff; }
.timer { color: var(--c); font-size: 12px; }
.timer.hot { color: #ff5a3c; animation: blink .5s infinite steps(1); }
.hp { color: var(--m); display: inline-flex; align-items: center; gap: 2px; }
.hp canvas { width: 14px; height: 14px; image-rendering: pixelated; }
.hp canvas.lost { opacity: .35; filter: grayscale(1); }
.hp canvas + span { margin-left: 4px; }
.hp .hpmax { color: #c77a98; }
.gold { color: var(--y); }
.score { color: var(--c); }
.mana .bar { width: 70px; }
.bar { display: inline-block; height: 8px; background: #1a1a24; border: 1px solid var(--edge); position: relative; vertical-align: middle; } /* ramka ≥3:1: koniec paska widać także przy prawie pustym pasku */
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #ff4fd8; transition: width .2s; }
.bar.xp { width: 110px; }
.bar.xp i { background: var(--y); }

.banner { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); z-index: 8; pointer-events: none; opacity: 0;
  background: rgba(8, 8, 12, .88); border: 2px solid var(--y); padding: 8px 12px; font-family: var(--px); font-size: 10px;
  color: var(--y); text-align: center; width: max-content; max-width: 86%; line-height: 1.6; transition: opacity .2s; }
.banner.on { opacity: 1; }
/* dolne progi: na niskiej planszy baner nie wchodzi na popup (ten ma do 63 px wysokości) */
.p-high .banner { top: auto; bottom: max(28%, 96px); }
.p-low .banner { top: max(24%, 96px); }
.pop-top:not(.p-high) .banner { top: max(24%, 96px); } /* popup trzymany u góry: baner pod nim */
.pop-top .popup { bottom: auto; top: 28px; } /* położenie wybiera UI.hud: z dala od pola gracza */
.banner.bad { border-color: #ff4d6d; color: #ff9aaa; }

/* osiągnięcie: niski pasek tuż nad dolnym HUD-em, żeby nie zasłaniał planszy (pełny opis jest w czacie) */
.popup { position: absolute; left: 50%; bottom: 30px; transform: translate(-50%, 10px); opacity: 0; z-index: 6;
  background: rgba(12, 12, 16, .9); border: 2px solid var(--y); border-left-width: 6px; box-shadow: 3px 3px 0 var(--m);
  padding: 5px 10px; text-align: left; width: min(92%, 440px); transition: .18s; pointer-events: none; }
.popup.on { transform: translate(-50%, 0); opacity: 1; }
.popup b { display: block; font-family: var(--px); font-size: 9px; color: var(--y); margin-bottom: 3px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup p { font-size: 16px; line-height: 1; color: #c9c9d6;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

/* góra 32 px: pod paskiem OSD (jak .ovmute), żeby nadtytuł albo nagłówek wysokiej karty nie stał w wierszu zegara */
.overlay { --ovpb: 18px; position: absolute; inset: 0; z-index: 7; display: none; padding: 32px 18px var(--ovpb); overscroll-behavior: contain;
  background: rgba(4, 4, 8, .82); text-align: center; overflow-y: auto; }
.overlay.on { display: flex; }
.card { max-width: 480px; margin: auto; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.card .title { font-family: var(--px); text-transform: uppercase; font-size: clamp(20px, 4.4vw, 32px); color: var(--y); text-shadow: 4px 4px 0 var(--m); line-height: 1.2; }
.card h2 { font-family: var(--px); font-size: 14px; color: var(--y); line-height: 1.5; }
/* .kicker: nadtytuł nad h2.title (nie nagłówek); h3.sub: nagłówek sekcji karty (ranking) w tym samym stylu */
.card .sub, .card .kicker { font-family: var(--px); font-size: 10px; color: var(--c); letter-spacing: .05em; line-height: normal; }
.card p { font-size: 20px; line-height: 1.1; }
.card .muted { color: var(--muted); }
.card .mobs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.card .mob { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 16px; width: 86px; line-height: 1; }
.card .mob.boss { color: #ff9aaa; }
.card canvas.spr { width: 36px; height: 36px; image-rendering: pixelated; }
.btn { font-family: var(--px); font-size: 11px; background: var(--y); color: #0c0c10; border: 2px solid #0c0c10;
  box-shadow: 4px 4px 0 var(--m); padding: 11px 14px; text-transform: uppercase; letter-spacing: .05em; line-height: 1.5; transition: transform .08s, box-shadow .08s; }
@media (hover: hover) { .btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--m); } } /* tylko z kursorem: na dotyku :hover przykleja się po stuknięciu i przycisk wygląda na wciśnięty */
.btn:focus-visible, .iconbtn:focus-visible, .touch button:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.btn.ghost { background: transparent; color: var(--y); border-color: var(--y); box-shadow: none; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.scores { list-style: none; font-size: 18px; width: 100%; max-width: 360px; text-align: left; }
.scores li { display: flex; justify-content: space-between; border-bottom: 1px dashed #26262e; padding: 2px 0; }

.hudbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.lvl { display: flex; align-items: center; gap: 8px; font-family: var(--px); font-size: 10px; color: var(--y); }
#lvl { min-width: 11ch; } /* „POZ. 10 +12”: stała szerokość (czcionka o stałej szerokości znaku), żeby pasek nie zawijał się inaczej po awansie — pad by skakał pod kciukiem */
.slots, .equip { display: flex; gap: 5px; }
.slot { position: relative; width: 38px; height: 38px; border: 2px solid var(--edge); background: #0e0e14; display: grid; place-items: center; }
.slot canvas { width: 24px; height: 24px; image-rendering: pixelated; }
.slot .k { position: absolute; left: 2px; top: 1px; font-family: var(--px); font-size: 7px; color: var(--muted); }
.slot .n { position: absolute; right: 2px; bottom: 1px; font-family: var(--px); font-size: 8px; color: #fff; text-shadow: 1px 1px 0 #000; }
.equip .slot { width: 30px; height: 30px; border-color: #86702e; }
.equip .slot canvas { width: 20px; height: 20px; }
.iconbtn { margin-left: auto; width: 38px; height: 38px; border: 2px solid var(--edge); background: #0e0e14; color: var(--y); font-size: 16px; }
.iconbtn + .iconbtn { margin-left: 0; }
/* ♪, ❚❚ i ⛶ w jednej grupie: zawijają się razem i stoją przy prawej krawędzi paska (odstęp dziedziczony z paska) */
.hudbar .tools { display: flex; align-items: center; gap: inherit; margin-left: auto; flex: none; }
.iconbtn.off { color: #8a8aa0; text-decoration: line-through; }
.iconbtn.idle { opacity: .4; cursor: default; } /* ❚❚ poza grą i pauzą (tytuł, karta piętra, strefa, koniec): nic nie robi */
/* pełny ekran (komputer, telefon poziomo): przycisk ⛶ w pasku albo F; ikona zmienia się po wejściu */
#fullBtn svg { display: block; width: 18px; height: 18px; margin: auto; }
#fullBtn .exit, #fullBtn.on .enter { display: none; }
#fullBtn.on .exit { display: block; }
/* w pełnym ekranie bez paska serwisu i legendy; plansza i czat rosną do wysokości ekranu, a szerokość studia rośnie z wysokością ekranu
   jak w dużym oknie (ta sama formuła z rezerwą 150 px zamiast 210) — stałe 1500 px dawało po bokach planszy szerokie czarne pasy */
.lochman:fullscreen { overflow-y: auto; } /* pełny ekran obejmuje samą grę (bez nagłówka serwisu) */
.lochman:fullscreen .help { display: none; }
.lochman:fullscreen .studio { width: min(100%, max(1000px, min(1500px, calc((100vh - 150px) * 1.1 + 292px)))); width: min(100%, max(1000px, min(1500px, calc((100dvh - 150px) * 1.1 + 292px)))); }
.lochman:fullscreen #c { max-height: max(300px, calc(100vh - 150px)); max-height: max(300px, calc(100dvh - 150px)); }
/* duże okno na komputerze: studio rośnie tak, żeby plansza wypełniała dostępną wysokość (max-height #c niżej: 100dvh − 210 px;
   292 px = czat 250 + odstęp 12 + ramka i padding TV 2×15; 1,1 ≈ proporcje najszerszej planszy 23×21); pełny ekran: ta sama formuła z rezerwą 150 px (:fullscreen wygrywa);
   okno do 760 px wysokości: rezerwa 158 px, bez legendy (blok niżej) */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .studio { width: min(100%, max(1000px, min(1500px, calc((100vh - 210px) * 1.1 + 292px)))); width: min(100%, max(1000px, min(1500px, calc((100dvh - 210px) * 1.1 + 292px)))); }
  .help { max-width: max(1000px, min(1500px, calc((100vh - 210px) * 1.1 + 292px))); max-width: max(1000px, min(1500px, calc((100dvh - 210px) * 1.1 + 292px))); }
}
/* niskie okno komputera (≤760 px): legenda .help jest ukryta (max-height: 760px niżej), więc plansza dostaje jej 52 px (12 odstępu + 2 wiersze; 210 − 52 = 158);
   musi stać po #c z ogólną rezerwą 210 px (ta sama specyficzność) */
@media (min-width: 1024px) and (max-height: 760px) and (hover: hover) and (pointer: fine) {
  #c { max-height: max(300px, calc(100vh - 158px)); max-height: max(300px, calc(100dvh - 158px)); }
}
/* okno na pół ekranu (821–1023 px): węższy pasek XP i odstępy, żeby pasek pod planszą z 4 sztukami wyposażenia mieścił się w jednym wierszu */
@media (min-width: 821px) and (max-width: 1023px) {
  .hudbar { gap: 6px; }
  .bar.xp { width: 60px; }
}
/* ♪ nakładki (top 32 px, prawa krawędź) w wąskiej ramce planszy: długi tytuł karty („DANE UTAJNIONE”) łamie się zamiast wchodzić pod ♪
   (≈ szerokość nakładki 100vw − 326 px minus pas ♪ po obu stronach); tablety mają nakładkę na cały ekran z ♪ nad tytułem */
@media (min-width: 821px) and (max-width: 1023px) and (hover: hover) {
  .overlay .card .title { max-width: calc(100vw - 430px); }
}

.ticker { max-width: 100%; margin-top: 10px; background: var(--y); color: #0c0c10; overflow: hidden; white-space: nowrap;
  font-family: var(--px); font-size: 10px; padding: 7px 0; border-radius: 3px; }
.ticker span { display: inline-block; padding-left: 100%; animation: tick 60s linear infinite; }
@keyframes tick { to { transform: translateX(-100%); } }

/* czat ma zawsze wysokość ramki telewizora (align-self: stretch; #log nie wnosi wysokości treści do wiersza siatki); min-height to tylko dolny próg —
   wcześniejsza formuła z 100dvh na niskich oknach wystawała poza ramkę */
.chat { background: var(--panel); border: 3px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; height: auto; align-self: stretch; min-height: 320px; }
.chat h2 { font-family: var(--px); font-size: 10px; padding: 12px; border-bottom: 2px solid var(--line); color: var(--m); }
#log { flex: 1 1 0; height: 0; overflow: hidden; padding: 8px 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
/* najstarszy wiersz wypychany górą łagodnie gaśnie zamiast być uciętym w pół litery pod nagłówkiem */
#log { -webkit-mask-image: linear-gradient(transparent, #000 22px); mask-image: linear-gradient(transparent, #000 22px); }
#log:empty::before { content: 'Widzowie czekają na start transmisji…'; color: var(--muted); }
#log div { line-height: 1.05; animation: in .25s; overflow-wrap: anywhere; }
#log .n { font-weight: bold; }
#log .sys { color: var(--y); }
#log .act { color: var(--c); }
@keyframes in { from { opacity: 0; transform: translateX(10px); } }
.sponsor { border-top: 2px solid var(--line); padding: 10px 12px; font-size: 18px; color: #9a9ab0; }
.sponsor strong { color: var(--c); }

.help { margin-top: 12px; text-align: center; color: var(--muted); font-size: 18px; max-width: 1000px; text-wrap: balance; } /* szerokość jak studio (na dużym oknie rośnie); legenda nie mieści się w jednej linii: dwie równe linie zamiast samotnego ogona */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; pointer-events: none; opacity: 0;
  background: #0c0c10; border: 2px solid var(--c); color: var(--c); padding: 8px 14px; font-family: var(--px); font-size: 10px;
  line-height: 1.6; width: max-content; max-width: calc(100% - 32px); text-align: center; transition: opacity .2s; }
.toast.on { opacity: 1; }
.overlay .ovmute { position: absolute; top: 32px; right: 8px; margin: 0; } /* pod górnym paskiem OSD (32 px), żeby nie zasłaniać zegara w pauzie i na karcie piętra */
.card .btn.quit { margin-top: 18px; }
/* główny przycisk karty zawsze w zasięgu, gdy karta jest wyższa niż ekran (przykleja się do dołu nakładki) */
.overlay .row.sticky { position: sticky; bottom: calc(-1 * var(--ovpb)); z-index: 1; width: 100%; padding: 8px 0 var(--ovpb); background: rgba(4, 4, 8, .94);
  box-shadow: 0 -14px 12px -6px rgba(4, 4, 8, .94); } /* cień sygnalizuje, że nad paskiem jest jeszcze treść */
.card .share-text { font-size: 18px; user-select: all; background: #101016; border: 1px dashed #44445a; padding: 6px 8px; }

/* Bezpieczna strefa między piętrami */
/* paski przewijania w barwach gry (zamiast jasnoszarych systemowych) */
.overlay, .safe, .loot { scrollbar-color: #44445a #101016; scrollbar-width: thin; }
.safe { position: fixed; inset: 0; z-index: 40; overflow-y: auto; overscroll-behavior: contain; background: var(--void); padding: 40px 16px 0; scroll-padding-top: 36px; scroll-padding-bottom: 130px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.safe .wrap { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.safe header { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap;
  border-bottom: 4px solid var(--c); padding-bottom: 10px; }
.safe header .title { font-family: var(--px); font-size: clamp(16px, 3vw, 24px); color: var(--c); line-height: 1.3; }
.safe header p { color: var(--muted); }
/* ♪ zawsze w prawym górnym rogu nagłówka (jak .ovmute na kartach): blok tytułu bierze resztę pierwszego wiersza,
   linia „Złoto · Poziom” zawsze w osobnym wierszu pod podtytułem — bez skoków układu przy zawijaniu */
.safe header > div { flex: 1 1 0; min-width: 0; }
.safe header > p { flex: 1 1 100%; }
.safe header .iconbtn { margin-left: auto; align-self: start; }
/* tytuł strefy obok ♪ na wąskich ekranach: separator „·” jako podział wiersza („BEZPIECZNA STREFA ·” się nie mieścił i kropka
   zaczynała drugi wiersz); poniżej 350 px separator zostaje w wierszu (inaczej 4 wiersze), szerzej kropka mieści się na końcu wiersza */
@media (min-width: 350px) and (max-width: 440px) { .safe header .title .sep { display: block; font-size: 0; line-height: 0; } }
.box { min-width: 0; background: var(--panel); border: 2px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.box h2 { font-family: var(--px); font-size: 11px; color: var(--y); letter-spacing: .04em; line-height: 1.5; }
.box.full { grid-column: 1 / -1; }
.box h2:focus-visible, .loot:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.safe header .title:focus { outline: none; } /* cel fokusu ustawiany skryptem na starcie strefy (tabindex=-1, poza kolejnością Tab): czytnik zaczyna od tytułu; obrys nachodził na podtytuł */
.plus:focus-visible, .shop button:focus-visible, .hudbar .slots .slot:focus-visible, .inv .slot:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; } /* mniejszy odstęp: sloty paska mają gap 5 px, sklep i plecak 6 px */
.stats-table { width: 100%; border-collapse: collapse; font-size: 19px; }
.stats-table td { padding: 3px 4px; border-bottom: 1px dashed #26262e; }
.stats-table td:first-child { white-space: nowrap; text-align: left; }
.stats-table td.multi { white-space: pre-line; }
.stats-table td:last-child { text-align: right; overflow-wrap: anywhere; }
.perf { height: 12px; background: #1a1a24; border: 1px solid var(--edge); position: relative; }
.perf i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #c9793a, #ffd400, #e27bff); }
.roulette { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; min-height: 64px; }
.roulette .q { font-family: var(--px); font-size: 9px; padding: 8px 6px; border: 2px solid var(--edge); color: var(--muted); min-width: 70px; text-align: center; }
.roulette .q.hit { color: #000; border-color: #fff; transform: scale(1.12); }
.boxes { display: flex; flex-wrap: wrap; gap: 6px; }
.boxes .b { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; width: 92px; text-align: center; line-height: 1; overflow-wrap: anywhere; hyphens: auto; }
.boxes canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.loot { list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; overflow-x: hidden; font-size: 18px; }
.loot li { display: flex; gap: 8px; align-items: center; animation: in .3s; }
.loot canvas { width: 20px; height: 20px; image-rendering: pixelated; flex: none; }
.statrow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 19px; }
.statrow small { display: block; color: var(--muted); font-size: 15px; line-height: 1; }
.statrow b { font-family: var(--px); font-size: 12px; color: var(--y); min-width: 28px; text-align: right; }
.plus { font-family: var(--px); font-size: 12px; width: 32px; height: 32px; background: var(--c); color: #000; border: 2px solid #000; }
.plus:disabled { opacity: .3; cursor: default; }
.shop { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.shop button { display: flex; gap: 6px; align-items: center; text-align: left; background: #0e0e14; border: 2px solid var(--edge); padding: 6px; font-size: 16px; line-height: 1; }
.shop button:disabled { cursor: default; border-color: var(--line); }
/* „nie stać cię” sygnalizują ciemniejsza ramka, przyciemniona ikona i cena oraz szara nazwa; opis i „plecak pełny” zostają czytelne (opis widać tylko tu) */
.shop button:disabled > canvas, .shop button:disabled > .price { opacity: .4; }
.shop button:disabled > .nm { color: var(--muted); }
.shop canvas { width: 20px; height: 20px; image-rendering: pixelated; flex: none; }
.shop .price { margin-left: auto; color: var(--y); }
.shop .full { font-size: 13px; color: #ff9aaa; }
.shop .price, .shop .full { white-space: nowrap; }
.shop .desc { display: block; font-size: 14px; color: var(--muted); line-height: 1; margin-top: 3px; } /* opis pod nazwą (dymek title wymaga długiego najechania, na dotyku nie działa) */
.shop button, .shop .nm { min-width: 0; } /* długie słowa w opisach nie rozpychają kolumny sklepu */
.shop .nm { overflow-wrap: anywhere; }
.shopgold { color: var(--y); }
.safe .go { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 14px; flex-wrap: wrap;
  position: sticky; bottom: 0; z-index: 1; background: var(--void); padding: 10px 0 14px; border-top: 2px solid var(--line); }
.safe .go p { flex: 1 1 260px; text-align: right; color: #ff9aaa; }
.inv { display: flex; gap: 6px; flex-wrap: wrap; }
.inv .eq { border-color: #86702e; } /* wyposażenie w złotej ramce jak w pasku pod planszą — nie wygląda jak 5. i 6. miejsce w plecaku */
/* zajęte miejsce plecaka w strefie to przycisk sprzedaży (wygląda jak zwykłe miejsce); .arm: czeka na drugie kliknięcie */
@media (hover: hover) { .inv button.slot:hover { border-color: var(--y); } }
.inv button.slot.arm { border-color: #ff9aaa; background: #2a1018; } /* button w selektorze: wygrywa z :hover (kursor stoi nad uzbrojonym miejscem) */
.sellhint { font-size: 16px; line-height: 1.1; color: var(--muted); }
.sellhint.on { color: #ff9aaa; }
/* opisy przedmiotów spoza sklepu pod plecakiem (tylko dotyk, .touch-only): ikona wiąże opis ze slotem */
.invdesc p { font-size: 15px; line-height: 1.1; color: var(--muted); overflow-wrap: anywhere; }
.invdesc p + p { margin-top: 6px; }
.invdesc canvas { display: inline-block; width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -2px; margin-right: 6px; }
.invdesc b { font-weight: normal; color: var(--txt); }

.touch { display: none; touch-action: none; }
.touch-only { display: none; }
@media (max-width: 820px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .tv { padding: 6px; border-radius: 10px; }
  .osd { font-size: 8px; padding: 5px 6px; }
  .hp canvas { width: 11px; height: 11px; }
  .hp { gap: 1px; }
  .popup { bottom: 22px; padding: 4px 8px; }
  .popup b { font-size: 8px; }
  .popup p { font-size: 14px; -webkit-line-clamp: 1; line-clamp: 1; }
  /* popup ma tu ok. 41 px (≤400 px: do 53 px, progi niżej): baner tuż obok niego, możliwie daleko od gracza */
  .p-high .banner { bottom: max(28%, 68px); }
  .p-low .banner { top: max(24%, 72px); }
  .pop-top:not(.p-high) .banner { top: max(24%, 72px); }
  .iconbtn, .hudbar .tools { margin-left: 0; }
  .chat { height: 170px; min-height: 0; }
  .lochman { font-size: 18px; padding: 8px 0; }
  .safe .wrap { grid-template-columns: minmax(0, 1fr); }
  .shop { grid-template-columns: 1fr; }
  .help { display: none; }
  /* na telefonie nakładka zajmuje cały ekran, żeby przyciski karty nie chowały się w małej ramce planszy */
  .overlay { --ovpb: 24px; position: fixed; inset: 0; z-index: 45; padding: 78px 16px var(--ovpb); background: rgba(4, 4, 8, .94); }
  .overlay .ovmute { top: 34px; } /* w górnym marginesie nakładki, nad nagłówkiem karty */
}
@media (hover: none) and (pointer: coarse) {
  .touch { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 560px; margin: 10px auto 0; gap: 12px; }
  .touch .pad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 44px); gap: 4px; }
  .touch .pad [data-dir="0"] { grid-column: 2; grid-row: 1; }
  .touch .pad [data-dir="1"] { grid-column: 1; grid-row: 2; }
  .touch .pad [data-dir="3"] { grid-column: 3; grid-row: 2; }
  .touch .pad [data-dir="2"] { grid-column: 2; grid-row: 3; }
  .touch button { background: #15151d; border: 2px solid var(--edge); color: var(--y); font-family: var(--px); font-size: 9px; touch-action: manipulation; }
  .touch .pad button { font-size: 20px; line-height: 1; } /* strzałki ▲◀▶▼ są spoza czcionki pikselowej (rysuje je czcionka zastępcza): w 9 px były ledwo widoczne */
  .touch .acts { display: flex; flex-direction: column; gap: 6px; }
  .touch .acts button { padding: 10px 12px; min-height: 44px; }
  .touch button.on { background: #2a2a38; border-color: var(--y); }
  /* cele dotyku w strefie: chybione stuknięcie wydaje punkt albo złoto bez cofnięcia */
  .plus { width: 44px; height: 44px; }
  .overlay .ovmute, .safe header .iconbtn { width: 44px; height: 44px; } /* ♪ na kartach i w strefie: cel dotyku jak ♪/❚❚ paska */
  .shop button { min-height: 44px; }
  .inv .slot { width: 44px; height: 44px; } /* zajęte miejsca plecaka to przyciski sprzedaży; cały rząd w jednym rozmiarze */
  .keys-only, .help, #fullBtn { display: none; } /* także tablety szersze niż 820 px; pełny ekran na komputerze i na telefonie poziomo od 760 px (niżej) */
  /* karta na cały ekran także na tabletach (w ramce planszy chowałaby się pod przyklejonym przyciskiem) */
  .overlay { --ovpb: 24px; position: fixed; inset: 0; z-index: 45; padding: 78px 16px var(--ovpb); background: rgba(4, 4, 8, .94); }
  .overlay .ovmute { top: 34px; }
  .touch-only { display: block; }
  /* pod planszą jest jeszcze pad (~150 px), więc plansza oddaje mu miejsce */
  #c { max-height: max(160px, calc(100vh - 356px)); max-height: max(160px, calc(100dvh - 356px)); }
}
/* telefony w pionie do 440 px (wyposażenie ukryte): pasek pod planszą ma zawsze 2 wiersze (POZ. osobno, sloty 44/40 px = 64/56 px), więc plansza oddaje mniej niż przy ogólnej rezerwie;
   napisy OSD nad i pod planszą, jak w poziomie: pole ma tu 9–16 px, a OSD 26/21 px zakrywał górny i dolny korytarz
   (350 = pasek serwisu i padding 30+12, ramka TV 2×9, padding OSD 16+12, pasek 10+64, pasek wiadomości 10+24, pad 10+144) */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 440px) {
  .equip { display: none; } /* pasek pod planszą w 2 wierszach zamiast 3; wyposażenie widać w strefie między piętrami */
  .screen { padding: 16px 0 12px; }
  #c { max-height: max(160px, calc(100vh - 350px)); max-height: max(160px, calc(100dvh - 350px)); }
}
/* szersze telefony, składane i małe tablety w pionie (441–743 px): pole ma tu wciąż 13–26 px, więc napisy OSD też nad i pod planszą, jak ≤440;
   pasek pod planszą (z wyposażeniem) ma do 3 wierszy, więc rezerwa = ogólne 356 + padding OSD 16+12 = 384; blok musi stać po ogólnej rezerwie 356 px */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (min-width: 441px) and (max-width: 743px) {
  .screen { padding: 16px 0 12px; }
  #c { max-height: max(160px, calc(100vh - 384px)); max-height: max(160px, calc(100dvh - 384px)); }
}
/* tablety w pionie od 744 px (iPad mini): pasek pod planszą w jednym wierszu (POZ. 228 + plecak 191 + 4 sztuki wyposażenia 135 + ♪/❚❚ 98 + odstępy 30 = 682 px),
   więc rezerwa z paskiem 10+44 (302 = pasek serwisu i padding 30+12, ramka TV 2×9, pasek 10+44, pasek wiadomości 10+24, pad 10+144);
   od 821 px pasek serwisu 34 px i ramka 2×15 (318); bloki muszą stać po ogólnej rezerwie 356 px (ta sama specyficzność) */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (min-width: 744px) {
  #c { max-height: max(160px, calc(100vh - 302px)); max-height: max(160px, calc(100dvh - 302px)); }
}
@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (min-width: 821px) {
  #c { max-height: max(160px, calc(100vh - 318px)); max-height: max(160px, calc(100dvh - 318px)); }
}
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .hudbar .slots .slot, .hudbar .iconbtn { width: 44px; height: 44px; } /* plecak i przyciski; wyposażenie to tylko obrazki */
  /* stałe pudełko planszy: proporcje labiryntu zmieniają się między piętrami (19×21, 23×21, 23×23, 27×25), a z height: auto pasek, pasek wiadomości
     i krzyżak pod planszą przeskakiwałyby po każdym zejściu; object-fit: contain dorysowuje pasy, max-height nadal ogranicza wysokość */
  #c { aspect-ratio: 1; }
}
/* tablety w pionie szersze niż 820 px (iPad Pro 11", Surface): jedna kolumna jak na telefonie, czat pod telewizorem —
   inaczej plansza ma ok. 2/3 szerokości ekranu, a pod padem zostaje pusty pas */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 1100px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .chat { height: 170px; min-height: 0; }
}
/* wysoki tablet poziomo (powyżej 720 px wysokości; niższe ekrany mają pad po prawej stronie planszy): krzyżak w lewej, akcje w prawej kolumnie
   obok planszy — w zasięgu kciuków przy trzymaniu oburącz; pasek i pasek wiadomości pod planszą, czat pod telewizorem; plecak i ♪/❚❚ 44 px jak w pionie.
   Pad nie stoi pod planszą, więc plansza rośnie płynnie z wysokością okna (bez skoku na progu 720/721 px):
   164 = pasek serwisu i padding 34+12, ramka TV 2×15, pasek 10+44, pasek wiadomości 10+24 */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-height: 721px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .chat { height: 170px; min-height: 0; }
  .tv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
  .screen { grid-column: 2; grid-row: 1; }
  .hudbar { grid-column: 2; grid-row: 2; }
  .ticker { grid-column: 2; grid-row: 3; }
  .touch { display: contents; } /* krzyżak i akcje stają się kolumnami siatki TV */
  /* touch-action z .touch nie działa przy display: contents (brak pudełka): bez tego ślizg kciuka po krzyżaku przewijałby stronę */
  .touch .pad { grid-column: 1; grid-row: 1 / span 3; touch-action: none; }
  .touch .acts { grid-column: 3; grid-row: 1 / span 3; touch-action: none; }
  .hudbar .slots .slot, .hudbar .iconbtn { width: 44px; height: 44px; }
  #c { max-height: max(160px, calc(100vh - 164px)); max-height: max(160px, calc(100dvh - 164px)); }
}
/* najwęższe telefony: pasek pod planszą w jednym wierszu */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 340px) {
  .hudbar { gap: 6px; }
  .hudbar .slots .slot, .hudbar .iconbtn { width: 40px; height: 40px; }
  .equip { display: none; } /* brak miejsca; wyposażenie widać w strefie między piętrami */
}
/* telefon i mały tablet poziomo (do 720 px wysokości): pad obok planszy, pasek wiadomości schowany, czat pod spodem —
   przy padzie pod planszą zostawałoby jej na tabletach 7–10" tylko 190–320 px wysokości, a OSD zasłaniałoby jej skrajne rzędy */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 720px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .tv { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: start; }
  .screen, .hudbar { grid-column: 1; }
  .ticker { display: none; }
  .touch { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; justify-content: flex-start; width: auto; margin-top: 0; }
  .touch .pad { grid-template-rows: repeat(3, clamp(28px, calc((100vh - 80px) / 6), 44px)); grid-template-rows: repeat(3, clamp(28px, calc((100dvh - 80px) / 6), 44px)); }
  .touch .acts button { min-height: 0; height: clamp(28px, calc((100vh - 80px) / 6), 44px); height: clamp(28px, calc((100dvh - 80px) / 6), 44px); padding: 0 12px; }
  /* pasek pod planszą w jednym wierszu (❚❚ to jedyna pauza na dotyku) */
  .hudbar { flex-wrap: nowrap; gap: 6px; min-width: 0; overflow: hidden; } /* nigdy nie wchodzi pod pad */
  .hudbar > * { flex-shrink: 0; }
  /* przy braku miejsca (np. 641–656 px szerokości) kurczy się tylko pasek XP, nie znika ❚❚; POZ. ma stałą szerokość, więc sloty nie skaczą po awansie */
  .hudbar > .lvl { flex-shrink: 1; min-width: 0; }
  /* popup osiągnięcia węższy — nie zasłania połowy planszy */
  .popup { bottom: 24px; } /* nad dolnym paskiem HUD */
  .popup p { font-size: 14px; -webkit-line-clamp: 4; line-clamp: 4; } /* wąski pas obok planszy: opis w kilku wierszach */
  /* niski ekran: popup przy lewej krawędzi, baner przy prawej — nie nachodzą na siebie przy żadnym położeniu gracza */
  .popup { left: 8px; width: min(260px, max(120px, calc(50% - var(--boardw, 0px) / 2 - 16px))); transform: translateY(10px); } /* w pasie obok planszy; min. 120 px = najdłuższe słowo tytułu (12 znaków po 8 px) + ramka i padding — na 568×320 zachodzi na lewy brzeg planszy o 2,5 pola (19 kolumn), 3,8 (23) i 5,2 (27); na najniższych ekranach (≤640×520) popup ma więc sam tytuł */
  .popup.on { transform: none; }
  /* baner w pasie po prawej stronie planszy (szerokość planszy podaje UI.fitBanner) */
  .banner { left: auto; right: 8px; transform: none; max-width: max(116px, calc(50% - var(--boardw, 0px) / 2 - 16px));
    font-size: 8px; padding: 6px 8px; overflow-wrap: anywhere; } /* wąski pas: mniejsza czcionka; 116 px = 12 znaków po 8 px + padding 16 + ramka 4, więc słowa do 12 liter (BEZPIECZNE, SKOLOPENDRA, DOBROCZYŃCY, Uzdrawiający) nie łamią się w środku */
  .banner .sep { display: block; font-size: 0; line-height: 0; } /* separator „·” jako podział wiersza: w wąskim pasie wiersz nie zaczyna się od kropki */
  .popup b { white-space: normal; } /* wąski popup: nazwa osiągnięcia w dwóch wierszach zamiast wielokropka */
  .p-high .banner { bottom: 24%; } /* popup obok, nie pod banerem: bez dolnych progów */
  .p-low .banner, .pop-top:not(.p-high) .banner { top: 24%; }
  #lvl { white-space: nowrap; }
  .bar.xp { width: 60px; flex: 0 1 60px; min-width: 16px; }
  .equip { display: none; } /* brak miejsca; wyposażenie widać w strefie między piętrami */
  .iconbtn, .hudbar .tools { margin-left: 0; }
  /* karty nakładki na cały ekran, jak w pionie */
  .overlay { --ovpb: 16px; position: fixed; inset: 0; z-index: 45; padding: 36px 16px var(--ovpb); background: rgba(4, 4, 8, .94); }
  .overlay .ovmute { top: 32px; }
  /* napisy OSD nad i pod planszą, nie na jej skrajnych rzędach (wąska plansza, pełna szerokość paska) */
  .screen { padding: 22px 0 20px; }
  #c { max-height: max(150px, calc(100vh - 152px)); max-height: max(150px, calc(100dvh - 152px)); }
  /* w pełnym ekranie ten sam układ, tylko bez nagłówka serwisu — nie formuła z komputera (min. 300 px wypchnęłaby pasek z ❚❚ poza ekran) */
  .lochman:fullscreen #c { max-height: max(150px, calc(100vh - 136px)); max-height: max(150px, calc(100dvh - 136px)); }
}
/* szersze telefony i małe tablety poziomo: w wierszu paska jest miejsce (z „POZ. 20 +12” luz ≥ 27 px), więc plecak i ♪/❚❚ mają 44 px jak w pionie;
   6 px odzyskane z odstępu nad paskiem — plansza i dół ramki bez zmian */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 720px) and (min-width: 720px) {
  .hudbar { margin-top: 4px; }
  .hudbar .slots .slot, .hudbar .iconbtn { width: 44px; height: 44px; }
}
/* telefon poziomo od 760 px: ⛶ także na dotyku (Android odzyskuje pasek adresu, plansza rośnie o ok. 1/3; bez API przycisk chowa main.js klasą .hidden);
   w wierszu paska zostaje ok. 17 px luzu. Węższe ekrany: ⛶ ucinałby się w pasku; tablety (szersze niż 1000 px) w pełnym ekranie przekroczyłyby 720 px wysokości
   i zmieniły układ, a przycisk by zniknął */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 720px) and (min-width: 760px) and (max-width: 1000px) {
  #fullBtn { display: block; }
}
/* najwęższe telefony poziomo (np. 568×320): mniejszy pad i sloty, bez paska XP */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 520px) and (max-width: 640px) {
  .bar.xp { display: none; }
  #lvl { font-size: 8px; }
  .touch .pad { grid-template-columns: repeat(3, 46px); }
  /* bardzo niska plansza: popup z samym tytułem (ok. 36–48 px) zasłania mniej i mieści się nad albo pod graczem; opis ukryty tylko wizualnie
     (czytnik nadal go ogłasza), pełny jest w czacie (UI.sys w achievementPopup) */
  .popup p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .popup b { margin-bottom: 0; }
  .hudbar .slot { width: 34px; height: 34px; }
}
/* bardzo wąski ekran: z odznaki „NA ŻYWO” zostaje migająca kropka, żeby górny pasek zmieścił się w jednym wierszu */
@media (max-width: 400px) {
  .live { font-size: 0; gap: 0; padding: 4px; }
  .osd { gap: 4px; }
  .hp { gap: 0; }
  .hp canvas { width: 9px; height: 9px; }
  .mana .bar { width: 44px; }
  /* popup osiągnięcia: na 360 px najdłuższa nazwa (34 znaki po 8 px) mieści się w jednym wierszu, na węższych łamie się zamiast wielokropka */
  .popup { width: min(96%, 440px); }
  .popup b { white-space: normal; }
  /* popup z dwuwierszową nazwą ma do 53 px: baner o jeden wiersz (12 px) dalej, żeby na niskiej planszy nie wchodził na popup */
  .p-high .banner { bottom: max(28%, 80px); }
  .p-low .banner, .pop-top:not(.p-high) .banner { top: max(24%, 84px); }
}
@media (max-width: 360px) {
  .hp canvas { width: 8px; height: 8px; }
  .mana .bar { width: 36px; }
}
@media (max-height: 760px) {
  .help { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen::after, .ticker span, .live::before, .timer.hot { animation: none; }
  .ticker span { padding-left: 10px; } /* bez przewijania tekst stoi od lewej krawędzi */
  .popup, .banner, .toast { transition: none; }
  #log div, .loot li { animation: none; }
  .roulette .q.hit { transform: none; } /* wynik losowania wyróżniają kolor tła i biała ramka */
}
