:root {
  --bg: #0f1a12;
  --panel: rgba(18, 28, 20, 0.86);
  --panel-solid: #16231a;
  --line: rgba(220, 230, 200, 0.14);
  --text: #eef0e4;
  --muted: #b5bda6;
  --accent: #d8a64a;
  --accent-2: #f0c46a;
  --good: #8fcf6a;
  --bad: #ff6b55;
  --warn: #f0b04a;
  --radius: 14px;
  /* закритий вид колекції (COL-8, ADR-098): той самий знімок — приглушений і злегка зелений; розмиття — за розміром картки */
  --locked: saturate(0.35) sepia(0.2) hue-rotate(35deg) brightness(0.88);
  /* схема меню «⋯» на воротах (MOB-9): міні-екран вбудованого браузера — світлі меню застосунків на темній сторінці */
  --hw-chrome: #0b130d; --hw-page: #1a2a1f; --hw-sheet: #f1f1f5; --hw-card: #fff; --hw-ink: #1b1b1f; --hw-mute: #cdcdd5;
  --hw-hit: rgba(240,196,106,0.45); --hw-bad: #e5484d; --hw-t: 5s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; margin: 0; }
kbd {
  font: 11px/1 ui-monospace, Menlo, monospace; padding: 3px 5px; border-radius: 4px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); margin-left: 6px;
}

/* Екрани */
/* до рішення js/boot/bootstrap.js (ворота чи меню, MIG-M3a.1) меню не видно — у вбудованому браузері з воротами не блимає;
   ранній вхід так і не виконався (обрив мережі на його модулях) — меню з'являється саме за 10 с, як було до MIG-M3a.1 */
body.boot #menu { visibility: hidden; animation: boot-menu 0s 10s forwards; }
@keyframes boot-menu { to { visibility: visible; } }
.screen {
  /* поле екрана; з viewport-fit=cover — не менше безпечних зон: виріз, Dynamic Island, заокруглені кути (REV-6c) */
  --pad: 16px;
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: max(var(--pad), env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right))
    max(var(--pad), env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
  z-index: 20;
  background: radial-gradient(ellipse at 50% 30%, rgba(40,60,40,0.55), rgba(5,10,6,0.85));
  backdrop-filter: blur(3px);
  overflow-y: auto;
}
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); padding: 24px; max-width: 100%;
}
.account { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.account .who { color: var(--text); font-weight: 600; }
.account a { color: var(--accent-2); }
section { margin-top: 14px; }
section h3 { font-size: 15px; color: var(--muted); font-family: inherit; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.chip {
  cursor: pointer; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; color: var(--text);
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
}
.chip.active { border-color: var(--accent); background: rgba(216,166,74,0.18); }
.menu-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
/* оголошення адміна в меню (SRV-5.4): текст як є, переноси рядків — з тексту */
.announce { margin: 0; padding: 9px 12px; border: 1px solid var(--accent); border-radius: 10px; background: rgba(16,24,16,0.88); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.announce::before { content: '📣 '; }
/* стан сервера над «Вирушити» (SRV-4.3) */
.menu-net { margin: 0; text-align: center; color: var(--warn); font-size: 13.5px; }
#menu .menu-net:not(.hidden) { display: flex; align-items: center; justify-content: center; gap: 8px; } /* «Перезавантажити» — у рядку з текстом */
.menu-net .btn { margin-left: 10px; padding: 6px 12px; font-size: 13.5px; }
#menu .menu-net .btn { margin-left: 0; flex: none; }
/* текст адміна (обслуговування, SRV-5.4) — з переносами рядків, як в адмінці й на сайті; довге слово (адреса) не виходить за край */
#menu-net-text, #error-text { white-space: pre-line; overflow-wrap: anywhere; }
/* текст адміна про обслуговування — до 500 знаків: у меню до чотирьох рядків з прокруткою, не геть «Вирушити» */
#menu-net-text { display: block; line-height: 1.25; max-height: 5em; overflow-y: auto; }
/* замок (SRV-5.3, П-45): закритий ліс і рівень видно, вибрати не можна; підказка — на картці, у title чипа й над «Вирушити» */
.chip.locked { opacity: 0.55; cursor: not-allowed; }
.menu-lock { margin: 0; text-align: center; color: var(--warn); font-size: 13.5px; }
.menu-version { margin: 0; color: var(--muted); opacity: .6; font-size: 11px; user-select: text; }

/* ---------- Меню «Поріг лісу» (MENU-2, ADR-112; MENU.md §6; макет v2) ----------
   Одна розмітка, чотири розкладки медіазапитами (не body.touch — він лише збільшує цілі): комп'ютер і планшет у ландшафті
   (за замовчуванням), планшет у портреті (min-width 700), телефон у портреті, телефон у ландшафті (висота ≤ 500). Гнучка
   лише горталка: оголошення, рядок стану й дворядкові назви стискають її, а не виштовхують «Вирушити». Розміри карток —
   CSS-змінні горталки (--cw-k, --ch-k, --off-k, --sc; читає ui/carousel.js). Колір лісу — --fc (look.menu.color файлу
   лісу — стиль #menu і картки, ui/menu.js; MIG-B6.1); анімуються лише transform і opacity; reduced motion — .rm на #menu (ui/gate.js followStill) */
#menu {
  --pad: 16px; --fc: #a9c45a; --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --u: 1px; /* одиниця розмірів комп'ютерної розкладки: 1px — макет 1280 × 720; більше вікно — більше (медіазапит нижче) */
  display: block; backdrop-filter: none; isolation: isolate; overscroll-behavior: none;
  background: linear-gradient(180deg, #13241a 0%, #0b140e 100%);
}
/* тло — розмита й притемнена мініатюра вибраної прогулянки (статичний filter, анімується лише opacity) */
.mbg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.mbg i { position: absolute; inset: -60px; background: center / cover no-repeat; filter: blur(34px) brightness(0.26) saturate(1.15); opacity: 0; transition: opacity 0.55s; }
.mbg i.on { opacity: 1; }
.mbg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(4,8,5,0.15) 25%, rgba(4,8,5,0.75) 100%); }
.mn {
  /* висота — екран (без прокрутки): горталка (1fr) бере те, що лишилось, і колонка колекції її не розпирає; телефон у
     портреті — min-height (рядок «сесія скінчилась» під «Вирушити» може піти під прокрутку) */
  position: relative; display: grid; height: 100%; min-height: 0; max-width: calc(1480 * var(--u)); margin: 0 auto; column-gap: calc(26 * var(--u)); row-gap: calc(12 * var(--u));
  grid-template-columns: minmax(0, 1fr) clamp(240px, 24vw, calc(320 * var(--u)));
  grid-template-rows: auto auto minmax(170px, 1fr) auto auto auto;
  grid-template-areas: "top top" "ann ann" "car col" "dots col" "rows go" "foot foot";
}
/* шапка */
.mtop { grid-area: top; display: flex; align-items: center; gap: 12px; min-width: 0; min-height: calc(40 * var(--u)); }
.mbrand { display: flex; align-items: center; gap: 10px; margin-right: auto; flex: none; }
.mbrand svg { width: calc(28 * var(--u)); height: calc(28 * var(--u)); flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.mbrand h1 { font-size: calc(21 * var(--u)); line-height: 1; color: var(--accent-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtop .macct { margin: 0; font-size: calc(13 * var(--u)); text-align: right; flex: 0 1 auto; min-width: 0; }
#menu .macct { line-height: calc(16 * var(--u)); } /* посилання з зоною 14 + 16 + 14 = 44 під body.touch */
#menu .macct[hidden] { display: none !important; } /* сервер недоступний — без порожнього рядка (правила розкладок ставлять display) */
:where(#menu button, #menu a):focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; } /* :where — точкові правила (.mstart, .mseg, .mtile) сильніші */
.mlang { display: flex; gap: 4px; flex: none; }
.mlang .chip { padding: 4px 10px; font-size: calc(12.5 * var(--u)); }
.mib { width: calc(38 * var(--u)); height: calc(38 * var(--u)); flex: none; border-radius: 50%; border: 1px solid var(--line); background: rgba(10,18,12,0.55); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.mib svg { width: calc(19 * var(--u)); height: calc(19 * var(--u)); }
.mib[aria-expanded="true"] { border-color: var(--accent); }
.mcol-chip { display: none; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer; font: inherit; font-size: 13.5px; white-space: nowrap; min-height: 38px; flex: none; }
.mchip-ring svg, .mring-svg svg { display: block; }
.mchip-ring svg { width: 26px; height: 26px; }
.mchip-n b { font-variant-numeric: tabular-nums; }
#menu .rb { fill: none; stroke: rgba(255,255,255,0.14); stroke-width: 4.5; }
#menu .rf { fill: none; stroke: var(--accent); stroke-width: 4.5; stroke-linecap: round; }
.mnew { display: inline-block; font-size: calc(12.5 * var(--u)); padding: 2px 9px; border-radius: 999px; background: rgba(216,166,74,0.22); color: var(--accent-2); font-weight: 600; font-variant-numeric: tabular-nums; }
#menu-announce { grid-area: ann; line-height: 1.25; max-height: 6.25em; overflow-y: auto; } /* довге оголошення (до 500 знаків) — прокрутка в собі, не геть «Вирушити» */
/* горталка */
.mcar { grid-area: car; position: relative; min-height: 0; overflow: hidden; overflow: clip; /* clip — не прокручується скриптом; hidden — Safari < 16 */ border-radius: 16px; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none;
  --cw-k: 0.78; --ch-k: 0.5625; --off-k: 0.636; --sc: 0.8; }
.mtrack { position: absolute; inset: 0; }
.mcard {
  --on: 0; /* наскільки картка в центрі (0…1): пише ui/carousel.js place() щокадру, і під час перетягування */
  --mr: 16px; /* радіус картки: і border-radius, і обрізка .mclip (той самий 16 — у .lhero.from переходу в гру) */
  position: absolute; left: 50%; top: 50%; border-radius: var(--mr); overflow: hidden; cursor: pointer; outline: none;
  background: #142016; background: linear-gradient(160deg, color-mix(in srgb, var(--fc) 45%, #10180f), #0f1a12 80%);
  transition: transform 0.32s var(--ease), box-shadow 0.32s; will-change: transform;
}
/* обводка кольором лісу — за положенням картки, не за класом .act (той перемикається в мить рішення — обводка спалахувала
   біля самої зупинки): з'являється, поки картка виїжджає в центр, і гасне, поки вона йде — тим самим переходом, що й рух */
.mcard::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--fc); opacity: var(--on); transition: opacity 0.32s var(--ease); will-change: opacity; } /* окремий шар: перетягування не перемальовує картку */
.mtrack.still .mcard, .mcar.dragging .mcard, .mtrack.still .mcard::after, .mcar.dragging .mcard::after { transition: none; }
/* обгортка вмісту: заокруглення обрізає сама (clip-path), не лише overflow картки — шари відеокарти всередині (Ken Burns,
   туман, полотно) інакше на кадр виходили кутами за обводку в мить зупинки */
.mclip { position: absolute; inset: 0; border-radius: inherit; clip-path: inset(0 round var(--mr)); background: inherit; } /* тло картки — і в групі змішування (знебарвлення сусідів) */
/* шар Ken Burns — заздалегідь у кожної видимої картки: не народжується в мить, коли картка стає центральною (кадр без обрізки) */
.mcard:not(.far) .mkb { will-change: transform; }
.mcard.act { cursor: grab; box-shadow: 0 22px 50px rgba(0,0,0,0.55); }
.mcar.dragging .mcard.act { cursor: grabbing; }
.mcard.far { visibility: hidden; }
.mcard:focus-visible::after { outline: 2px solid var(--accent-2); outline-offset: -5px; opacity: 1; } /* рамка фокуса — на обводці (над .mclip), всередині неї */
.mart, .mwx, .mwx i, .mdim { position: absolute; inset: 0; pointer-events: none; }
.mart img.mlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.45s; }
.mart img.mlay.on { opacity: 1; }
/* статична погода (живі шари — MENU-3): приглушення хмар (часткова насиченість — шар saturation), туман градієнтом,
   дощ — затемнення й риски */
.mwx i { opacity: 0; transition: opacity 0.5s; }
.mwx i::after { content: ''; position: absolute; inset: 0; }
#menu[data-weather="cloudy"] .mwx [data-w="cloudy"], #menu[data-weather="fog"] .mwx [data-w="fog"],
#menu[data-weather="drizzle"] .mwx [data-w="drizzle"], #menu[data-weather="storm"] .mwx [data-w="storm"] { opacity: 1; }
.mwx [data-w="cloudy"] { background: rgba(110,120,118,0.26); }
.mwx [data-w="cloudy"]::after, .mwx [data-w="storm"]::after { background: rgba(128,128,128,0.45); mix-blend-mode: saturation; }
.mwx [data-w="fog"] { background: linear-gradient(to top, rgba(200,206,200,0.06), rgba(205,210,205,0.42) 55%, rgba(200,205,200,0.58)); }
/* живий туман за маскою глибини (MENU-3) — у центральній картці статичний градієнт легший: інакше небо вигорає */
#menu:not(.fxoff) .mcard.act:has(.mfog.ready) .mwx [data-w="fog"] { background: linear-gradient(to top, rgba(200,206,200,0.03), rgba(205,210,205,0.18) 55%, rgba(200,205,200,0.26)); }
.mwx [data-w="drizzle"] { background: repeating-linear-gradient(105deg, transparent 0 9px, rgba(200,215,230,0.16) 9px 10px), rgba(20,32,40,0.22); }
.mwx [data-w="storm"] { background: repeating-linear-gradient(110deg, transparent 0 5px, rgba(200,215,230,0.2) 5px 6px), rgba(8,12,26,0.42); }
/* сусіди — темніші й знебарвлені (фокус на центральній): прозорість — у псевдоелементів, не в .mdim — інакше .mdim посеред
   переходу стає ізольованою групою, і шар насиченості змішується лише з її темним тлом (знебарвлення — стрибком у кінці) */
.mdim::before, .mdim::after { content: ''; position: absolute; inset: 0; opacity: calc(1 - var(--on)); transition: opacity 0.32s var(--ease); } /* за положенням, як обводка */
.mdim::before { background: rgba(4,8,5,0.7); }
.mdim::after { background: rgba(128,128,128,0.5); mix-blend-mode: saturation; }
.mtrack.still .mdim::before, .mtrack.still .mdim::after, .mcar.dragging .mdim::before, .mcar.dragging .mdim::after { transition: none; }
.mcap { position: absolute; left: 0; right: 0; bottom: 0; padding: calc(22 * var(--u)) calc(20 * var(--u)) calc(16 * var(--u)); background: linear-gradient(to top, rgba(6,12,7,0.88), rgba(6,12,7,0.55) 60%, transparent); }
.mcap h2 { font-size: calc(32 * var(--u)); line-height: 1.05; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.mmood { margin: 6px 0 0; font-size: calc(14 * var(--u)); color: #dfe4d2; text-shadow: 0 1px 6px rgba(0,0,0,0.7); }
.mmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 10px; font-size: calc(13 * var(--u)); color: #cfd5c2; }
.mmeta:not(:has(> :not([hidden]))) { display: none; }
.mprog { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; white-space: nowrap; } /* «Знайдено тут 3 з 71» — без переносу; тісно — стискається смужка */
.mprog[hidden], .mrec[hidden] { display: none; }
.mbar { position: relative; display: block; flex: 0 1 auto; min-width: 32px; width: calc(92 * var(--u)); height: 5px; border-radius: 3px; background: rgba(255,255,255,0.16); overflow: hidden; }
.mbar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--fc); }
.mrec { color: var(--text); font-variant-numeric: tabular-nums; }
.mlk { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,0.6); color: var(--warn); font-size: 12.5px; max-width: calc(100% - 24px); }
.mlk .lock { position: static; width: 14px; height: 14px; display: inline-flex; flex: none; aspect-ratio: auto; transform: none; background: none; border-radius: 0; color: inherit; }
.mlk .lock svg { width: 100%; height: 100%; opacity: 1; margin: 0; }
.marw { position: absolute; top: 50%; z-index: 5; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.28); background: rgba(8,14,9,0.62); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.marw svg { width: 18px; height: 18px; }
.marw.prev { left: calc(50% - var(--cw, 600px) / 2 - 20px); }
.marw.next { left: calc(50% + var(--cw, 600px) / 2 - 20px); }
.marw[disabled] { opacity: 0.25; cursor: default; }
.mcar.one .marw, .mcar.one ~ .mdots { visibility: hidden; }
.mdots { grid-area: dots; position: relative; z-index: 6; display: flex; justify-content: center; align-items: center; gap: 18px; min-height: 14px; }
.mdots button { position: relative; width: 10px; height: 6px; border-radius: 3px; border: 0; padding: 0; background: rgba(255,255,255,0.3); cursor: pointer; transition: width 0.32s var(--ease), background 0.32s; }
.mdots button.on { width: 30px; background: var(--fc); }
.mdots button::after { content: ''; position: absolute; inset: -12px -8px; }
.mhint { position: absolute; left: 50%; top: 14px; z-index: 6; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,0.6); font-size: 13px; pointer-events: none; white-space: nowrap; }
/* ряди часу й погоди */
.mrows { grid-area: rows; display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(10 * var(--u)); align-content: start; min-width: 0; }
.mrow { display: grid; grid-template-columns: calc(112 * var(--u)) minmax(0, 1fr); align-items: center; min-width: 0; }
.mrl { display: flex; flex-direction: column; gap: 3px; font-size: calc(11.5 * var(--u)); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.mrl em { font: calc(14 * var(--u))/1.2 Georgia, "Times New Roman", serif; letter-spacing: 0; text-transform: none; color: var(--text); overflow-wrap: anywhere; }
.mtiles { display: flex; gap: calc(8 * var(--u)); align-items: center; padding: calc(6 * var(--u)) 4px; min-width: 0; }
.mtile {
  position: relative; flex: 0 1 auto; min-width: 0; width: calc(104 * var(--u)); height: calc(60 * var(--u)); border-radius: 10px; overflow: hidden; padding: 0; cursor: pointer; /* стискаються, коли поруч кубик (планшет, вузьке вікно); телефон — прокрутка ряду */
  border: 1px solid rgba(255,255,255,0.14); color: #eef0e4; font: inherit;
  background: #142016; background: linear-gradient(180deg, var(--t1, color-mix(in srgb, var(--fc) 45%, #10180f)), var(--t2, #142016));
  transition: transform 0.18s var(--ease), box-shadow 0.18s;
}
.mtile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% 60%; }
.mtile .mx { position: absolute; inset: 0; pointer-events: none; }
.mx[data-w="clear"] { background: radial-gradient(circle at 78% 18%, rgba(255,240,190,0.5), transparent 35%); }
.mx[data-w="cloudy"] { background: rgba(120,130,125,0.4); }
.mx[data-w="fog"] { background: linear-gradient(to top, rgba(210,215,210,0.15), rgba(215,220,215,0.75) 60%); }
.mx[data-w="drizzle"] { background: repeating-linear-gradient(105deg, transparent 0 7px, rgba(200,215,230,0.35) 7px 8px), rgba(20,30,40,0.22); }
.mx[data-w="storm"] { background: repeating-linear-gradient(110deg, transparent 0 4px, rgba(200,215,230,0.45) 4px 5px), rgba(10,15,30,0.45); }
.mx[data-w="storm"]::after { content: ''; position: absolute; left: 55%; top: 6%; width: 16px; height: 26px; background: #fff7c8; opacity: 0.9;
  clip-path: polygon(40% 0, 100% 0, 60% 40%, 95% 40%, 15% 100%, 40% 52%, 5% 52%); }
.mtl { position: absolute; left: 0; right: 0; bottom: 0; padding: calc(12 * var(--u)) 4px calc(4 * var(--u)); font-size: calc(11.5 * var(--u)); line-height: 1.15; text-align: center; background: linear-gradient(to top, rgba(0,0,0,0.78), transparent); overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.mtile.on { transform: scale(1.1); box-shadow: 0 0 0 2px var(--fc), 0 8px 18px rgba(0,0,0,0.5); z-index: 1; }
.mtile:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
/* старт: тривалість (3…5 сегментів порівну) і «Вирушити в ліс» */
.mgo { grid-area: go; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); min-width: 0; padding-top: 4px; container-type: inline-size; }
.mdur { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(10,18,12,0.62); border: 1px solid var(--line); min-width: 0; }
.mseg { flex: 1 1 0; min-width: 0; min-height: calc(34 * var(--u)); border: 0; background: none; border-radius: 999px; padding: 7px 4px; font: inherit; font-size: calc(13.5 * var(--u)); white-space: nowrap; color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.mseg.on { background: rgba(216,166,74,0.24); color: var(--text); }
.mseg:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.mdur.n5 .mseg { font-size: calc(12 * var(--u)); padding-inline: 2px; }
/* без color-mix (Chrome < 111, Safari < 16.2): декларація з var() дійсна при розборі — запасний рядок перед нею не діє */
@supports not (color: color-mix(in srgb, red, red)) {
  .mcard { background: linear-gradient(160deg, #1d2e1d, #0f1a12 80%); }
  .mtile { background: linear-gradient(180deg, var(--t1, #1d2e1d), var(--t2, #142016)); }
  .mstart { box-shadow: 0 10px 28px rgba(216,166,74,0.3), inset 0 1px 0 rgba(255,255,255,0.5); }
}
.mstart {
  display: flex; flex-direction: column; justify-content: center; min-height: calc(64 * var(--u)); border: 0; border-radius: 14px; padding: calc(14 * var(--u)) 18px; cursor: pointer;
  text-align: center; text-decoration: none; color: #1b1406; font: inherit;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 28px rgba(216,166,74,0.3), inset 0 1px 0 rgba(255,255,255,0.5);
  box-shadow: 0 10px 28px rgba(216,166,74,0.3), inset 0 1px 0 rgba(255,255,255,0.5), 0 0 0 2px color-mix(in srgb, var(--fc) 45%, transparent);
  transition: transform 0.12s, opacity 0.2s;
}
.mstart:active { transform: scale(0.98); }
.mstart b { display: flex; align-items: center; justify-content: center; gap: 10px; font: 600 25px/1.1 Georgia, "Times New Roman", serif; font-size: clamp(18px, 8cqi, calc(25 * var(--u))); text-wrap: balance; } /* cqi — окремо: без підтримки лишається 25px */
.mstart b svg { width: calc(22 * var(--u)); height: calc(22 * var(--u)); flex: none; transition: transform 0.2s var(--ease); }
.mstart:hover b svg { transform: translateX(3px); }
.mstart small { display: block; margin-top: 4px; font-size: calc(12.5 * var(--u)); color: #4a3812; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mstart:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.4); }
.mstart:focus-visible { outline: 2px solid #fff3cf; outline-offset: 3px; }
/* колекція: блок (комп'ютер і планшет) */
.mcol { grid-area: col; display: flex; flex-direction: column; gap: calc(10 * var(--u)); padding: calc(16 * var(--u)); border-radius: 16px; background: var(--panel); border: 1px solid var(--line); min-height: 0; overflow: hidden;
  container: mcol / size; } /* висота — від горталки поруч: низький блок ховає знімки й підпис, не «Відкрити колекцію» */
@container mcol (max-height: 340px) { #menu-col #menu-col-sub, #menu-col #menu-col-thumbs { display: none; } }
@container mcol (max-height: 300px) { #menu-col > .mct:first-child { display: none; } #menu-col .mring-svg svg { width: 48px; height: 48px; } }
@container mcol (max-height: 230px) { #menu-col #menu-col-rank { display: none; } } /* місце — і на екрані колекції («Колекціонери») */
.mct { font-size: calc(11.5 * var(--u)); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mct[hidden] { display: none; }
.mring { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mring-svg svg { width: calc(64 * var(--u)); height: calc(64 * var(--u)); flex: none; }
.mring-t { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.mring-n { font: 600 calc(26 * var(--u))/1 Georgia, "Times New Roman", serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mring-n small { font: 400 calc(14 * var(--u))/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--muted); }
.mring-n.mring-empty { font-size: 19px; }
.mring-sub { font-size: calc(13 * var(--u)); color: var(--muted); line-height: 1.35; }
.mrank { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mrank:hover { border-color: var(--line); }
.mrank.quiet { cursor: default; background: none; border: 1px dashed rgba(255,255,255,0.16); }
.mrank svg { width: calc(22 * var(--u)); height: calc(22 * var(--u)); flex: none; color: var(--accent-2); }
.mrank-t { flex: 1; min-width: 0; font-size: calc(12 * var(--u)); line-height: 1.25; color: var(--muted); -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
.mrank-up { flex: 1 0 100%; padding-left: calc(22 * var(--u) + 10px); font-size: calc(12 * var(--u)); line-height: 1.25; color: var(--accent-2); }
.mrank-n { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 2px 4px; max-width: 46%; text-align: right; font: 600 calc(22 * var(--u))/1 Georgia, "Times New Roman", serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mrank-n small { font: 400 calc(12 * var(--u))/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--muted); }
.mrank-go { font-size: 20px; color: var(--muted); }
.mcol > * { flex: none; min-width: 0; }
.mthumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(6 * var(--u)); align-items: start; }
#menu-col .mthumbs { flex: 0 1 auto; min-height: 0; overflow: hidden; } /* поступається першою — не «Відкрити колекцію» */
.mthumbs.quiet { display: block; font-size: 13px; line-height: 1.4; color: var(--muted); padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(255,255,255,0.16); }
.mthumb { position: relative; aspect-ratio: 1; border-radius: 10px; background: #1a2a1f; border: 1px solid rgba(255,255,255,0.1); overflow: hidden; }
.mthumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mthumb img:not([src]) { visibility: hidden; }
.mthumb.nw::after { content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 2px rgba(10,18,12,0.8); }
.mthumb.more { display: grid; place-items: center; font: 600 15px Georgia, "Times New Roman", serif; color: var(--accent-2); background: rgba(216,166,74,0.1); border-color: rgba(216,166,74,0.35); }
.mopen { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: calc(46 * var(--u)); margin-top: auto; padding: 8px 12px; border-radius: 12px; cursor: pointer; border: 1px solid rgba(240,196,106,0.6); background: rgba(216,166,74,0.14); color: var(--accent-2); font: inherit; font-weight: 600; font-size: calc(15 * var(--u)); transition: background 0.15s; }
.mopen:hover { background: rgba(216,166,74,0.24); }
.mopen svg { width: calc(18 * var(--u)); height: calc(18 * var(--u)); flex: none; }
#menu-col[data-state="off"] .mrank-box, #menu-col[data-state="wait"] .mrank-box, #menu-col[data-state="nonet"] .mrank-box, #menu-col[data-state="anon"] .mrank-box { display: none; }
/* тихий рядок: на комп'ютері — лише версія; акаунт і мова — у шапці */
.mq { grid-area: foot; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 12px; min-width: 0; }
.mq .macct, .mq .mlang { display: none; }
.mq .macct { margin: 0; }
/* ⚙: панель під кнопкою (телефон — знизу на всю ширину) */
.mset {
  position: absolute; z-index: 30; top: calc(max(var(--pad), env(safe-area-inset-top)) + 8px + 40 * var(--u)); right: max(var(--pad), env(safe-area-inset-right));
  width: min(360px, calc(100vw - 2 * var(--pad))); max-height: calc(100% - 80px); overflow-y: auto; padding: 14px 16px 16px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,0.55);
}
.mset-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mset-head h2 { font-size: 18px; color: var(--accent-2); }
.mset h3 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-family: inherit; margin: 10px 0 6px; }
.mset .settings { margin-top: 10px; }
.mset .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mset .menu-lock { margin-top: 8px; text-align: left; }
.mset-acct { display: none; margin: 12px 0 14px; }
.mset-lang { display: none; } /* телефон — мова тут, не в шапці (медіазапити нижче) */
.mset-lang .mlang .chip { padding: 7px 14px; font-size: 14px; } /* як чипи якості поруч */
.mset-ver { margin-top: 10px; text-align: right; }
/* зменшений рух: без руху, кросфейд нової центральної картки ≤ 150 мс */
#menu.rm .mcard, #menu.rm .mcard::after, #menu.rm .mtile, #menu.rm .mdots button, #menu.rm .mdim::before, #menu.rm .mdim::after { transition-duration: 0.01s !important; }
#menu.rm .mart img.mlay, #menu.rm .mbg i, #menu.rm .mwx i { transition-duration: 0.15s; }
#menu .mcard.fadein { animation: mfade 0.15s ease-out; }
@keyframes mfade { from { opacity: 0.35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #menu .mcard, #menu .mtile { transition-duration: 0.01s !important; } }
/* живий шар погоди (MENU-3, js/ui/menuFx.js; змінні --mfog, --mfogc, --mrays, --mra, --mcloud ставить fxSync на #menu):
   лише центральна картка рухається; туман — за маскою глибини (mask-image — з JS), дрейф двох шарів transform;
   промені — screen-градієнт з «диханням»; тінь хмари; спалах грози — у межах картки. Зменшений рух (.rm) і рівень без
   руху (.fxoff, QUALITY.menuFx = 0) — без анімацій і спалаху */
.mkb { position: absolute; inset: 0; pointer-events: none; transform-origin: 50% 60%; }
.mcard.act .mkb { animation: mkb 19s ease-in-out infinite alternate; }
@keyframes mkb { from { transform: scale(1); } to { transform: scale(1.04); } }
.mfog { position: absolute; inset: 0; overflow: hidden; opacity: var(--mfog, 0); transition: opacity 0.5s;
  background: rgba(var(--mfogc, 226,230,224), 0.3);
  -webkit-mask-size: cover; mask-size: cover; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.mfog.nomask { -webkit-mask-image: linear-gradient(to top, transparent 25%, #000 80%); mask-image: linear-gradient(to top, transparent 25%, #000 80%); }
.mfog i { position: absolute; top: -10%; bottom: 0; left: 0; width: 200%; background: var(--mfogtex) repeat-x 0 50% / 50% 100%; opacity: 0.85; }
.mfog i.f2 { top: 20%; bottom: -15%; opacity: 0.6; }
.mcard.act .mfog i.f1 { animation: mdrift 46s linear infinite; }
.mcard.act .mfog i.f2 { animation: mdrift 31s linear infinite reverse; }
@keyframes mdrift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
#menu { --mrc: 255,232,186; }
#menu[data-time="dawn"] { --mrc: 255,200,176; }
#menu[data-time="evening"] { --mrc: 255,178,100; }
.mrays { position: absolute; inset: 0; mix-blend-mode: screen; opacity: var(--mrays, 0); transition: opacity 0.5s; }
.mrays::before { content: ''; position: absolute; inset: 0;
  background: linear-gradient(var(--mra, 238deg), transparent 18%, rgba(var(--mrc), 0.34) 40%, transparent 47%, rgba(var(--mrc), 0.26) 57%, transparent 66%); }
.mcard.act .mrays::before { animation: mbreath 9s ease-in-out infinite alternate; }
@keyframes mbreath { from { opacity: 0.6; } to { opacity: 1; } }
.mcloud { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: var(--mcloud, 0); transition: opacity 0.5s; }
.mcloud i { position: absolute; top: -30%; left: 0; width: 70%; height: 160%; background: radial-gradient(ellipse at 50% 50%, rgba(8,14,12,0.34), transparent 65%); transform: translateX(-110%); }
.mcard.act .mcloud i { animation: mcloud 17s linear infinite; }
@keyframes mcloud { 0% { transform: translateX(-110%); } 70%, 100% { transform: translateX(160%); } }
.mcard canvas.mfx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mflash { position: absolute; inset: 0; pointer-events: none; background: rgba(225,232,255,0.9); opacity: 0; }
.mflash.go { animation: mflash 0.45s ease-out; }
@keyframes mflash { from { opacity: 0.55; } to { opacity: 0; } }
#menu.rm .mkb, #menu.rm .mfog i, #menu.rm .mrays::before, #menu.rm .mcloud i,
#menu.fxoff .mkb, #menu.fxoff .mfog i, #menu.fxoff .mrays::before, #menu.fxoff .mcloud i { animation: none !important; }
#menu.rm .mflash, #menu.fxoff .mflash, #menu.rm canvas.mfx, #menu.fxoff canvas.mfx { display: none; }
/* туман за маскою — лише в центральній картці й лише з маскою (до неї — нічого, не туман на всю картку); m0 — статичний градієнт MENU-2 */
.mcard:not(.act) .mfog, .mfog:not(.ready), #menu.fxoff .mfog { opacity: 0; } /* opacity — з переходом 0,5 с, не стрибком */
/* закритий ліс (SRV-5.3): сірий разом з туманом і променями, без часток і руху */
.mcard.locked .mkb { filter: grayscale(1) brightness(0.7); animation: none !important; }
.mcard.locked :is(.mfog i, .mcloud i), .mcard.locked .mrays::before { animation: none !important; }
.mcard.locked canvas.mfx, .mcard.locked .mflash { display: none; }
/* живий дощ на полотні — у центральній картці статичних рисок немає (лише затемнення); сусіди, rm і рівень без руху — риски */
#menu:not(.rm):not(.fxoff) .mcard.act .mwx [data-w="drizzle"] { background: rgba(20,32,40,0.22); }
#menu:not(.rm):not(.fxoff) .mcard.act .mwx [data-w="storm"] { background: rgba(8,12,26,0.42); }
/* «Навмання» (MENU-3): комп'ютер і планшет — квадрат у кінці ряду погоди, телефон — у підписі ряду; «перебирання» —
   спалахи плиток і оберт кубика */
.mrow-w { grid-template-columns: calc(112 * var(--u)) minmax(0, max-content) auto; justify-content: start; } /* кубик — одразу за плитками, не на краю широкого вікна */
.mdice { position: relative; flex: none; display: grid; place-items: center; padding: 0; cursor: pointer; border-radius: 10px; border: 1px dashed rgba(255,255,255,0.34); background: rgba(10,18,12,0.55); color: var(--text); font: inherit; }
.mdice:hover { border-color: var(--accent); }
.mdice svg { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
.mdice.spin svg { animation: mspin 0.6s var(--ease); }
@keyframes mspin { from { transform: rotate(0); } to { transform: rotate(540deg); } }
.mdice-d { width: calc(46 * var(--u)); height: calc(46 * var(--u)); margin-left: 8px; }
.mdice-m { display: none; }
#menu.norandom .mdice { display: none !important; } /* «Навмання» вимкнено в налаштуваннях гри (ops.menu.random) */
#menu.rm .mdice svg { animation: none; }
.mtile.shuf { box-shadow: 0 0 0 2px var(--accent-2), 0 6px 14px rgba(0,0,0,0.45); z-index: 2; }
/* 🔊 звук меню: увімкнено — контур акценту */
.msnd .spk-on, .msnd.on .spk-off { display: none; }
.msnd.on .spk-on { display: block; }
.msnd.on { border-color: var(--accent); }
/* перехід у гру (MENU-3): меню гасне під тлом завантаження, що розростається з картки (#loading.art) */
#menu.hidden.leaving { display: block !important; opacity: 0; transition: opacity 0.35s ease-out 0.3s; pointer-events: none; } /* гасне, коли під ним уже тло завантаження (.lbg) — не кадр минулої прогулянки */
/* комп'ютер і планшет у ландшафті ширші за 1000: розкладка росте з вікном, як макет 1280 × 720, що масштабується
   (основа 1200 × 680 — на 1280 × 720 трохи більше за макет; межа 1,5 — 1920 × 1080 і більше). Горталка гнучка й без того;
   --u — колонка колекції, плитки часу й погоди, старт, шапка й підписи (на телефонах і планшеті в портреті — 1px) */
@media (orientation: landscape) and (min-height: 501px) and (min-width: 1001px) {
  #menu { --u: clamp(1px, min(100vw / 1200, 100vh / 680), 1.5px); }
}
/* вужче вікно комп'ютера (до 1000): підпис ряду над плитками, плитки стискаються */
@media (max-width: 1000px) and (min-height: 501px) and (orientation: landscape) {
  .mrow { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .mrl { flex-direction: row; align-items: baseline; gap: 8px; }
  .mtile { flex: 1 1 0; width: auto; min-width: 0; max-width: 104px; height: 56px; }
  .mrow-w { grid-template-columns: minmax(0, 1fr); }
  .mdice-d { display: none; }
  .mdice-m { display: flex; }
}
/* кубик у підписі ряду (телефони, вужче вікно): кнопка з підписом, зона ≥ 44 */
.mdice-m { z-index: 2; align-items: center; gap: 6px; height: 32px; margin-left: auto; padding: 0 10px; align-self: center; border-radius: 999px; font-size: 12.5px; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.mdice-m svg { width: 17px; height: 17px; }
body.touch #menu .mdice-m::after { content: ''; position: absolute; inset: -11px -2px; } /* від краю рамки: 24 − 2 + 22 = 44 під дотиком (над сусідніми рядами — z-index) */
/* планшет у портреті: горталка на всю ширину, ряди під нею, старт і колекція — поруч */
@media (orientation: portrait) and (min-width: 700px) {
  .mn {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(240px, 1fr) auto auto auto auto;
    grid-template-areas: "top top" "ann ann" "car car" "dots dots" "rows rows" "go col" "foot foot";
  }
  .mcar { --cw-k: 0.8; --off-k: 0.62; }
  .mcol { container-type: normal; }
}
/* телефон у портреті: чип колекції в шапці, сусіди горталки краєм, ряди — горталки за край екрана; акаунт, мова й версія —
   у ⚙ (як у макеті); під «Вирушити» — лише «Сесія входу скінчилась» (на 320 × 568 прокручується лише він) */
@media (orientation: portrait) and (max-width: 699.98px) {
  #menu { --pad: 14px; } /* макет: поля 14 */
  .mn {
    height: auto; min-height: 100%; column-gap: 0; row-gap: 10px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(150px, 1fr) auto auto auto auto;
    grid-template-areas: "top" "car" "dots" "rows" "go" "foot";
  }
  .mbrand h1, .mtop .macct, .mtop .mlang, .mcol { display: none; }
  .mcol-chip { display: flex; }
  #menu-announce { grid-area: car; align-self: start; z-index: 7; margin: 8px 8px 0; font-size: 13px; padding: 6px 10px; }
  /* макет: горталка з полями й закругленням (не на весь екран), картка 306 з 362 і портретна (306 × 340: на нижчому екрані —
     вужча, сусіди видно більше), сусіди — краєм (зсув 292 = 0,954 ширини картки) */
  .mcar { --cw-k: 0.845; --ch-k: 0; --ar: 0.9; --cw-min-k: 0.68; --off-k: 0.954; --sc: 0.86; } /* не вужча за 0,68: назва лісу ≤ 2 рядки */
  .marw { display: none; }
  .mcap { padding: 18px 16px 14px; }
  .mcap h2 { font-size: 26px; }
  .mmood { font-size: 13px; }
  .mrows { gap: 8px; }
  .mrow { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  /* підпис ряду — однакова висота (24) в обох рядах, «Навмання» — 24: від підпису до плиток однаково, і в «Час доби», і в
     «Погода» */
  .mrl { flex-direction: row; align-items: center; gap: 8px; min-height: 24px; }
  .mrow-w { grid-template-columns: minmax(0, 1fr); }
  .mdice-d { display: none; }
  .mdice-m { display: flex; }
  .mdice-m { height: 24px; }
  .mtiles { gap: 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
    margin-inline: calc(-1 * var(--pad)); padding: 6px var(--pad); scroll-padding-inline: var(--pad); }
  .mtiles::-webkit-scrollbar { display: none; }
  .mtile { flex-shrink: 0; width: 104px; height: 74px; scroll-snap-align: center; }
  .mtile .mtl { font-size: 12.5px; }
  .mtile.on { transform: scale(1.06); }
  .mgo { padding-top: 0; grid-template-rows: auto; }
  .mstart { min-height: 0; padding: 15px 18px; } /* макет: 72 */
  .mstart b { font-size: 21px; }
  /* як у макеті: під «Вирушити» нічого — акаунт, мова й версія — у ⚙; картка бере звільнену висоту, старт — унизу екрана */
  .mq { display: none; }
  .mset-acct, .mset-lang { display: block; }
  /* сесія входу скінчилась (ADR-085, SRV-4.3): гравець має це бачити до старту — інакше піде в ліс новим гостем */
  .mq:has(> .macct[data-state="expired"]:not([hidden])) { display: flex; flex-direction: column; justify-content: center; padding: 8px 0 8px; text-align: center; } /* зверху 8 — зона «Увійти» (±14) не впирається в «Вирушити» */
  .mq:has(> .macct[data-state="expired"]:not([hidden])) > :not(.macct) { display: none; }
  .mq .macct[data-state="expired"] { display: block; font-size: 12.5px; }
  .mq .macct .mguest { display: none; } /* нік гостя — у ⚙: тут один рядок і на 320 px */
}
/* нижчий екран (Safari з панелями: 390 × 664, 430 × 739) — стискаються плитки, старт і проміжки, а не фото лісу: картка
   лишається більшою за половину вільної висоти, як у макеті */
@media (orientation: portrait) and (max-width: 699.98px) and (max-height: 780px) {
  .mn { row-gap: 8px; }
  .mtile { width: 92px; height: 64px; }
  .mstart { padding: 12px 16px; }
}
@media (orientation: portrait) and (max-width: 699.98px) and (max-height: 700px) {
  /* рядок стану чи замка над «Вирушити» — замість підпису вибору в кнопці (той самий вибір видно на плитках) */
  .mgo:has(> .menu-net:not(.hidden), > .menu-lock:not(.hidden)) .mstart small { display: none; }
  .mn { row-gap: 6px; }
  .mrows { gap: 4px; }
  .mtiles { padding-block: 4px; }
  .mtile { width: 74px; height: 52px; } /* 52 − зона кубика (≈ 6) ≥ 44 */
  .mtile .mtl { font-size: 11.5px; padding-top: 10px; }
  .mstart { padding: 9px 14px; }
  .mstart b { font-size: 19px; }
  .mstart small { margin-top: 2px; }
  .mcap { padding: 14px 14px 12px; }
  .mcap h2 { font-size: 23px; }
}
@media (orientation: portrait) and (max-width: 699.98px) and (max-height: 600px) {
  .mq:has(> .macct[data-state="expired"]:not([hidden])) { padding: 6px 0 0; } /* «Сесія входу скінчилась» — і з рядком замка у вікні */
  .mn:has(> .mq .macct[data-state="expired"]:not([hidden])) .mstart small { display: none; } /* місце для нього (вибір видно на плитках) */
  .mn { grid-template-rows: auto minmax(120px, 1fr) auto auto auto auto; row-gap: 6px; }
  #menu-net-text, #menu .mgo > .menu-lock { line-height: 1.25; max-height: 2.5em; overflow-y: auto; font-size: 12.5px; }
  .mgo:has(> .menu-net:not(.hidden)) > .menu-lock { display: none; } /* обидва не вміщуються: спершу зв'язок (кнопка й так вимкнена) */
  .mmood { display: none; }
  .mcap h2 { font-size: 22px; }
  .mtile { width: 74px; height: 52px; } /* 52 − зона кубика (≈ 6) ≥ 44 */
}
/* телефон у ландшафті (вирізи — поле .screen з safe-area): горталка ліворуч, праворуч — шапка-чип, ряди, тривалість,
   «Вирушити»; акаунт, мова й версія — у ⚙ (сесія входу скінчилась — позначка на ⚙) */
@media (orientation: landscape) and (max-height: 500px) {
  #menu { --pad: 12px; } /* макет: поля 12, праве — 18 у шапки й старту (ряди — до краю, прокруткою) */
  .mn {
    height: 100%; column-gap: 14px; row-gap: 4px;
    grid-template-columns: minmax(0, 1fr) clamp(230px, 42%, 380px);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "car top" "car rows" "car go" "dots go";
  }
  .mbrand, .mtop .macct, .mcol, .mq { display: none; }
  .mcol-chip { display: flex; }
  .mtop { min-height: 38px; gap: 8px; justify-content: flex-end; padding-right: 6px; }
  .mtop .mlang { display: none; } /* мова — у ⚙ (як у макеті): чипу колекції — місце для чисел */
  #btn-menu-set { position: relative; }
  #menu:has(.mset-acct[data-state="expired"]:not([hidden])) #btn-menu-set::after {
    content: ''; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px rgba(10,18,12,0.9);
  }
  .mib { width: 38px; height: 38px; }
  .mcol-chip { min-height: 38px; }
  .mset-acct, .mset-lang { display: block; }
  #menu-announce { grid-area: car; align-self: start; z-index: 7; margin: 8px 8px 0; font-size: 12.5px; padding: 6px 10px; }
  .mcar { --cw-k: 0.93; --ch-k: 0; --off-k: 0.9; --sc: 0.84; }
  .marw { width: 36px; height: 36px; margin-top: -18px; }
  .marw.prev { left: calc(50% - var(--cw, 400px) / 2 + 8px); }
  .marw.next { left: calc(50% + var(--cw, 400px) / 2 - 44px); }
  .mcap { padding: 14px 14px 12px; }
  .mcap h2 { font-size: 22px; }
  .mmood { display: none; }
  .mmeta { margin-top: 6px; font-size: 12px; }
  .mdots { min-height: 10px; }
  .mrows { gap: 0; align-content: start; }
  .mrow { grid-template-columns: minmax(0, 1fr); }
  /* підпис ряду — однакова висота (24) в обох рядах (як у портреті) */
  .mrl { flex-direction: row; align-items: center; gap: 8px; font-size: 11.5px; min-height: 24px; }
  .mrow-w { grid-template-columns: minmax(0, 1fr); }
  .mdice-d { display: none; }
  .mdice-m { display: flex; height: 24px; }
  .mrl em { font-size: 14px; }
  .mtiles { gap: 8px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
    padding: 5px var(--pad) 5px 6px; margin-left: -6px; margin-right: calc(-1 * var(--pad)); scroll-padding-inline: 6px var(--pad); } /* поле 6: вибрана плитка (×1,06) з обводкою 2 px не обрізається рядом з прокруткою — і перша */
  .mtiles::-webkit-scrollbar { display: none; }
  .mtile { flex-shrink: 0; width: 86px; height: 56px; scroll-snap-align: center; }
  .mtile.on { transform: scale(1.06); }
  .mgo { gap: 5px; padding-top: 0; grid-template-rows: auto; align-content: end; }
  /* рядок стану й замка — до двох рядків з прокруткою, щоб ряди не налазили на старт */
  #menu-net-text, #menu .mgo > .menu-lock { line-height: 1.25; max-height: 2.5em; overflow-y: auto; }
  /* обидва рядки не вміщуються: зв'язку немає — спершу він (кнопка й так вимкнена; замок — коли сервер оживе) */
  .mgo:has(> .menu-net:not(.hidden)) > .menu-lock { display: none; }
  .mtile:focus-visible { outline-offset: -2px; } /* ряд з прокруткою обрізає кільце назовні — всередину плитки */
  .mstart { min-height: 0; padding: 10px 14px; } /* макет: 59 */
  .mstart b { font-size: 19px; }
  .mstart small { margin-top: 2px; }
  .mset { top: max(var(--pad), env(safe-area-inset-top)); max-height: calc(100% - 16px); }
  /* дотик (тривалість 44 px) і рядок стану чи замка над «Вирушити»: плитки нижчі — інакше ряд погоди налазить на тривалість
     (iPhone 844 × 390, до 12 px). Виняток із «body.touch лише збільшує цілі»: компенсує саме збільшену під дотиком тривалість */
  body.touch .mn:has(> .mgo > .menu-net:not(.hidden), > .mgo > .menu-lock:not(.hidden)) .mtile { height: 50px; } /* 50 − зона кубика (≈ 6) ≥ 44 */
  /* рядок стану чи замка над «Вирушити» — замість підпису вибору в кнопці (вибір видно на плитках; як у портреті ≤ 700) */
  .mgo:has(> .menu-net:not(.hidden), > .menu-lock:not(.hidden)) .mstart small { display: none; }
}
/* ландшафт телефона ширший за 700: у шапці колонки, як у макеті, — знак гри (без назви), чип колекції з числами, 🔊, ⚙ */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 700.02px) { /* не 701: дробова ширина між межами */
  .mgo { padding-right: 6px; } /* макет: праве поле старту 18 (на ≤ 700 — ні: п'ять сегментів тривалості в ≈ 230 px — кожен ≥ 44) */
  .mbrand { display: flex; }
  .mbrand h1 { display: none; }
  .mbrand svg { width: 26px; height: 26px; }
}
/* вузький ландшафт (568 × 320, 667 × 375): у шапці колонки ≈ 230 px — чип колекції лише кільцем (числа — у aria-label) */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  .mcol-chip { padding: 4px; }
  .mcol-chip > :not(.mchip-ring) { display: none; }
  /* «Навмання» — лише значком (назва — в aria-label): «WEATHER Thunderstorm Random» у колонці ≈ 230 px — у два рядки */
  .mdice-m > span { display: none; }
  .mdice-m { padding: 0 8px; }
  body.touch #menu .mdice-m::after { inset: -11px -6px; } /* 33 + 12 ≥ 44 */
}
/* «Перезавантажити» — значком ↻ (назва лишається текстом кнопки для читача): у вузькому ландшафті інакше стискає пояснення
   до слова, у низькому (≤ 400: iPhone 812 × 375) — рядок стану у два рядки налазить на ряд погоди */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px), (orientation: landscape) and (max-height: 400px) {
  #menu .menu-net .btn { font-size: 0; padding: 6px 10px; }
  #menu .menu-net .btn::before { content: '↻'; content: '↻' / ''; font-size: 18px; line-height: 1; }
}
/* низький ландшафт (Safari з панеллю: 844 × 340, 812 × 330; 568 × 320): підписи рядів лишаються (як у макеті) — стискаються
   плитки й проміжки */
@media (orientation: landscape) and (max-height: 360px) {
  #menu { --pad: 8px; }
  .mtop { min-height: 36px; }
  .mrl em { font-size: 13px; }
  .mtile { width: 82px; height: 52px; } /* 52 − зона кубика (≈ 7) ≥ 44 */
  .mtiles { padding-block: 4px; } /* вибрана: 52 × 0,03 + обводка 2 ≈ 3,6 */
  /* рядок стану чи замка над «Вирушити» (рідко): підписів рядів немає, кубик — у кінці ряду погоди (як до ADR-117) */
  .mn:has(> .mgo > .menu-net:not(.hidden), > .mgo > .menu-lock:not(.hidden)) .mrl { display: none; }
  .mn:has(> .mgo > .menu-net:not(.hidden), > .mgo > .menu-lock:not(.hidden)) .mrow-w { grid-template-columns: minmax(0, 1fr) auto; }
  .mn:has(> .mgo > .menu-net:not(.hidden), > .mgo > .menu-lock:not(.hidden)) .mdice-d { display: grid; width: 44px; height: 46px; margin-left: 6px; }
  .mn:has(> .mgo > .menu-net:not(.hidden), > .mgo > .menu-lock:not(.hidden)) .mrow-w .mtiles { margin-right: 0; padding-right: 5px; } /* ряд — до кубика, не під ним; 5 — обводка вибраної останньої плитки (×1,06 + 2 px) */
  .mstart { padding: 7px 12px; }
  .mstart b { font-size: 17px; gap: 8px; } /* «Head into the forest» — в один рядок у колонці ≈ 230 px */
  .mstart b svg { width: 18px; height: 18px; }
  .menu-net, .menu-lock { font-size: 12px; line-height: 1.25; }
}
@media (orientation: landscape) and (max-height: 330px) {
  .mstart small { display: none; } /* 568 × 320: вибір видно на плитках */
}
/* пароль доступу змінено (SRV-4.3): над усіма екранами й грою */
.net-denied {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60;
  width: 460px; max-width: calc(100vw - 24px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 12px 14px; background: var(--panel-solid); border: 1px solid var(--warn); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.net-denied span { flex: 1 1 100%; color: var(--muted); font-size: 13.5px; }
.net-denied .btn { margin-left: auto; padding: 7px 14px; font-size: 14px; }
/* «Зв'язок втрачено» (SRV-4.5): напис над оглядом, паузою, довідником; режим netlost — панель */
.net-lost {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 55;
  max-width: calc(100vw - 24px); padding: 9px 16px; background: var(--panel-solid); border: 1px solid var(--warn);
  border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); pointer-events: none;
}
.netlost-panel { width: 460px; text-align: center; }
.netlost-panel p { color: var(--muted); margin: 12px 0 0; }
.netlost-panel .menu-actions { justify-content: center; }
.device-info { color: var(--muted); font-size: 12px; margin-top: 6px; }
.device-info:empty { display: none; }
.btn {
  cursor: pointer; font: inherit; font-weight: 600; font-size: 15px; color: var(--text);
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.07);
  transition: 0.15s;
}
.btn:hover { background: rgba(255,255,255,0.14); }
.btn.primary { background: linear-gradient(180deg, #e0b058, #b98232); color: #1a1208; border-color: #e8c078; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
/* вимкнена кнопка (SRV-4.3: «Вирушити в ліс», поки сервер недоступний чи старт триває) */
.btn:disabled, .btn:disabled:hover { cursor: not-allowed; opacity: 0.5; filter: grayscale(0.5); }
.btn.big { font-size: 18px; padding: 14px 28px; }
/* фокус з клавіатури (Tab поза грою, REV-6a); клік мишею рамки не дає */
.btn:focus-visible, .chip:focus-visible, .tc-btn:focus-visible, input[type=range]:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}

/* Завантаження */
.loading-box { text-align: center; color: var(--muted); }
/* з меню (MENU-3, js/ui/menuArt.js loadingArt): тло — ілюстрація прогулянки; герой розростається з прямокутника картки
   (clip-path і transform картинки, 700 мс), під ним — розмита мініатюра; блок стану — знизу на підкладці, смужка замість
   спінера. .rm — кросфейд без руху */
.lart, .lbar, .lsum { display: none; }
#loading.art { background: transparent; backdrop-filter: none; }
#loading.art .lart { display: block; position: absolute; inset: 0; overflow: hidden; }
.lbg { position: absolute; inset: -60px; background: #0b140e center / cover no-repeat; filter: blur(34px) brightness(0.42) saturate(1.2); }
#loading.art .lbg { animation: lfade 0.3s both; } /* під меню, що гасне з 0,3 с, і героєм, що розростається */
#loading.art.cross { background: #0b140e; } /* кросфейд («Ще раз», rm): тло одразу, не кадр минулої прогулянки */
#loading.art.cross .lbg { animation-delay: 0s; }
.lhero { position: absolute; inset: 0; clip-path: inset(0 round 0); transition: clip-path 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.lhero.from { clip-path: inset(var(--lt) var(--lr) var(--lb) var(--ll) round 16px); transition: none; }
.lhero img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transform-origin: 0 0; opacity: 0; transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s; }
.lhero img.on { opacity: 1; }
.lhero.from img { transform: translate(var(--lx), var(--ly)) scale(var(--ls)); transition: none; }
#loading.rm .lhero img { transition: opacity 0.15s; }
#loading.art .loading-box { position: absolute; left: 50%; bottom: max(10%, calc(env(safe-area-inset-bottom) + 16px)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  min-width: min(280px, calc(100% - 32px)); padding: 14px 22px; border-radius: 14px; background: rgba(6,12,7,0.62); color: var(--text); animation: lfade 0.5s 0.45s both; }
#loading.art .spinner { display: none; }
#loading.art .lbar { display: block; width: 220px; max-width: 100%; height: 3px; margin: 0 auto 10px; border-radius: 2px; background: rgba(255,255,255,0.15); overflow: hidden; }
.lbar i { display: block; width: 40%; height: 100%; background: var(--accent); animation: lbar 1.4s ease-in-out infinite; }
#loading.rm .lbar i { animation: none; width: 100%; opacity: 0.5; }
#loading.art .lsum { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
#loading.rm .lbg, #loading.rm .loading-box { animation-duration: 0.15s; animation-delay: 0s; }
@keyframes lfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
/* Помилка (REV-1) */
.error-panel { width: 520px; text-align: center; }
.error-panel p { color: var(--muted); margin: 12px 0 0; }
.error-panel .menu-actions { justify-content: center; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ready-panel { width: 580px; text-align: center; }
.ready-panel p { color: var(--muted); margin: 8px 0 0; }
.rules { text-align: left; color: var(--text); line-height: 1.5; padding-left: 20px; margin: 12px 0 14px; }
.rules li { margin: 5px 0; }
/* підготовка пристрою: яскравість і звук — дві поради з анімацією (у вузькому — одна під одною) */
.ready-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; text-align: left; }
.setup-tip {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); font-size: 14px; line-height: 1.35; color: var(--text);
}
.bright-anim, .sound-anim { position: relative; flex: none; width: 64px; height: 64px; display: grid; place-items: center; }
/* повзунок яскравості: за замовчуванням — горизонтальний (Android, комп'ютер), body.ios — вертикальний (iPhone, iPad) */
.b-bar {
  position: relative; display: block; overflow: hidden; width: 60px; height: 22px; border-radius: 11px;
  background: rgba(255,255,255,0.16);
}
.b-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: #f4f1e8; transform-origin: left; animation: bFillX 3s ease-in-out infinite; }
.b-sun { position: absolute; left: 4px; top: 3px; width: 16px; height: 16px; fill: #7a7468; stroke: #7a7468; stroke-width: 2; stroke-linecap: round; }
.b-finger {
  position: absolute; left: 2px; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: rgba(255,255,255,0.45); border: 2px solid rgba(255,255,255,0.8); box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  animation: bFingerX 3s ease-in-out infinite;
}
@keyframes bFillX { 0%, 15% { transform: scaleX(0.3); } 55%, 85% { transform: scaleX(1); } 100% { transform: scaleX(0.3); } }
@keyframes bFingerX {
  0% { transform: translateX(18px); opacity: 0; } 10%, 15% { transform: translateX(18px); opacity: 1; }
  55%, 70% { transform: translateX(60px); opacity: 1; } 80%, 100% { transform: translateX(60px); opacity: 0; }
}
body.ios .b-bar { width: 30px; height: 60px; border-radius: 9px; }
body.ios .b-fill { inset: auto 0 0 0; width: auto; height: 100%; transform-origin: bottom; animation-name: bFillY; }
body.ios .b-sun { left: 7px; top: auto; bottom: 5px; }
body.ios .b-finger { left: 50%; top: 2px; animation-name: bFingerY; }
@keyframes bFillY { 0%, 15% { transform: scaleY(0.3); } 55%, 85% { transform: scaleY(1); } 100% { transform: scaleY(0.3); } }
@keyframes bFingerY {
  0% { transform: translateY(42px); opacity: 0; } 10%, 15% { transform: translateY(42px); opacity: 1; }
  55%, 70% { transform: translateY(0); opacity: 1; } 80%, 100% { transform: translateY(0); opacity: 0; }
}
/* звук: хрестик «вимкнено» зникає, хвилі з'являються по черзі */
.sound-anim svg { width: 44px; height: 44px; fill: none; stroke: var(--accent-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sound-anim .s-spk { fill: var(--accent-2); }
.sound-anim .s-mute { stroke: #e07a5f; animation: sMute 3s infinite; }
.sound-anim .s-w1 { animation: sWave1 3s infinite; }
.sound-anim .s-w2 { animation: sWave2 3s infinite; }
.sound-anim .s-w3 { animation: sWave3 3s infinite; }
@keyframes sMute { 0%, 25% { opacity: 1; } 32%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes sWave1 { 0%, 30% { opacity: 0; } 38%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sWave2 { 0%, 40% { opacity: 0; } 48%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sWave3 { 0%, 50% { opacity: 0; } 58%, 90% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .b-fill, .b-finger, .sound-anim path { animation: none !important; }
  .b-finger, .sound-anim .s-mute { opacity: 0; }
}

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#stats { position: absolute; top: 16px; left: 16px; display: flex; gap: 10px; }
.stat {
  background: rgba(10,16,12,0.7); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  display: flex; flex-direction: column; min-width: 78px;
  /* без backdrop-filter над живим полотном: браузер щокадру розмивав би кадр гри під табличками (4–12 мс кадру) */
}
.stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.stat span:last-child { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
#score.neg { color: var(--bad); }
#timer.warn { color: var(--warn); }
#compass {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 360px; max-width: 60vw; height: 30px;
  overflow: hidden; border-radius: 8px; background: rgba(10,16,12,0.45); border: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
#compass-strip { position: absolute; top: 0; left: 0; height: 100%; white-space: nowrap; font-size: 13px; font-weight: 600; }
#compass-strip span { position: absolute; top: 6px; transform: translateX(-50%); color: var(--muted); }
#compass-strip span.major { color: var(--accent-2); }
#compass-mark { position: absolute; left: 50%; top: 0; width: 2px; height: 8px; background: var(--accent); transform: translateX(-50%); }
#crosshair { position: absolute; } /* вигляд — спільний з прицілом онбордингу (#coach-cross) */
#hint {
  position: absolute; left: 50%; top: calc(50% + 28px); transform: translateX(-50%); font-size: 14px;
  text-shadow: 0 1px 3px #000; color: #fff; white-space: nowrap;
}
#help { position: absolute; transition: opacity 1.5s; } /* вигляд — спільний зі смужкою онбордингу (#coach-help) */
#help.fade { opacity: 0; }
#click-to-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  background: rgba(10,16,12,0.7); padding: 16px 26px; border-radius: 12px; border: 1px solid var(--line); font-size: 18px;
}
#click-to-play small { color: var(--muted); font-size: 13px; }
/* Мапа лісництва (js/map.js): мінімапа праворуч унизу, повна — по центру; гра не зупиняється */
#minimap { position: absolute; right: 16px; bottom: 16px; width: 150px; height: 150px; border-radius: 50%; opacity: 0.86; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45)); }
#map-full { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.map-sheet {
  background: #e9dfc2; color: #4a3a26; border-radius: 6px; padding: 10px 12px 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.55);
  border: 1px solid #a8966c; opacity: 0.97;
  /* ширина — мапи: легенда переноситься під нею, а не розширює лист (KI-192; низький екран у ландшафті — легенда праворуч, нижче) */
  width: min-content;
}
.map-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-family: Georgia, serif; font-size: 15px; margin-bottom: 6px; }
#map-cover { font-size: 13px; font-style: italic; color: #6d5a3e; }
#map-canvas { display: block; width: min(80vh, 80vw, 820px); height: min(80vh, 80vw, 820px); border: 1px solid #8f7c56; }
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; margin-top: 6px; color: #5a4630; }
.map-legend i { display: inline-block; vertical-align: middle; margin-right: 5px; font-style: normal; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; background: #9a2a1c; }
.lg-x { font-weight: 700; color: #1f1b16; }
.lg-ring { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #3f7a3a; box-sizing: border-box; }
.lg-line { width: 16px; height: 2px; background: rgba(154,42,28,0.8); }
.lg-fog { width: 14px; height: 10px; background: repeating-linear-gradient(-45deg, #e3d9bc 0 3px, #a89a78 3px 4px); border: 1px solid #b8a883; }
#toasts { position: absolute; top: 80px; right: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: rgba(12,20,14,0.9); border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 10px;
  padding: 10px 14px; min-width: 240px; max-width: 360px; animation: toastIn 0.3s ease-out; /* без backdrop-filter — як .stat */
}
.toast.bad { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--accent); }
.toast .tt { font-weight: 700; display: flex; justify-content: space-between; gap: 12px; }
.toast .tt .pts { font-variant-numeric: tabular-nums; }
.toast.good .pts { color: var(--good); }
.toast.bad .pts { color: var(--bad); }
.toast .td { font-size: 13px; color: var(--muted); margin-top: 3px; }
.toast.out { opacity: 0; transform: translateX(20px); transition: 0.5s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }

/* Огляд */
#inspect {
  position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 45%, rgba(40,52,38,0.55), rgba(4,8,5,0.9));
  backdrop-filter: blur(6px);
}
.inspect-frame {
  position: relative; width: min(1000px, 100%); height: min(760px, 100%); border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 40%, var(--insp-a, #3a4a36), var(--insp-b, #121a12) 75%);
}
#inspect-canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#inspect-canvas:active { cursor: grabbing; }
.inspect-tip {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--muted);
  background: rgba(0,0,0,0.35); padding: 6px 12px; border-radius: 8px; text-align: center; max-width: 92%;
}
.inspect-bar {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; background: linear-gradient(0deg, rgba(0,0,0,0.6), transparent);
}
.inspect-q { font-family: Georgia, serif; font-size: 20px; }
/* огляд без 3D (REV-1): ознаки виду текстом */
.inspect-nogl {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, 90%);
  background: rgba(0,0,0,0.45); border-radius: 12px; padding: 14px 18px;
  max-height: calc(100% - 150px); overflow-y: auto; /* довгий перелік на телефоні горизонтально — не під панеллю кнопок */
}
.inspect-nogl p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.inspect-nogl ul { margin: 0; padding-left: 20px; }
.inspect-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-left: auto; } /* три рішення (COL-3): на вузькому екрані — у два ряди; і перенесені під питання — праворуч */

/* Колекція (COL-1b; на місці довідника — класи guide-*) */
.guide-panel {
  width: 1100px; max-height: calc(100vh - 32px);
  /* висота видимої області (телефон: без панелей браузера) мінус поля екрана (REV-6c) */
  max-height: calc(100dvh - max(var(--pad), env(safe-area-inset-top)) - max(var(--pad), env(safe-area-inset-bottom)));
  display: flex; flex-direction: column; margin: auto;
  height: calc(100dvh - max(var(--pad), env(safe-area-inset-top)) - max(var(--pad), env(safe-area-inset-bottom))); /* фільтр із кількома плитками — та сама висота: шапка не стрибає (COL-10) */
}
/* шапка (COL-10, ADR-098): рядок 1 — назва / вкладки, прогрес, «Закрити»; рядок 2 — стан, «Фільтри», пошук і праворуч дії
   (.col-acts); на десктопі .guide-head — display: contents у сітці .guide-top, на телефоні — липкий блок (нижче) */
.guide-top { position: relative; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; }
.guide-head { display: contents; }
.guide-row1 { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px 16px; min-width: 0; }
.guide-row1 h2 { margin: 0; white-space: nowrap; }
.col-tabs { display: flex; gap: 6px; flex: none; }
.col-prog { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-prog .cnt-s { display: none; }
/* смужка — сталої висоти (KI-197: у flex-стовпці стискалась): збережене і нове цієї прогулянки світлішим */
.col-bar { flex: 0 1 160px; display: flex; min-width: 72px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.col-bar i { display: block; flex: none; height: 100%; transition: width 0.4s; }
.col-bar i.saved { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.col-bar i.walk { background: repeating-linear-gradient(-45deg, rgba(240,196,106,0.95) 0 3px, rgba(240,196,106,0.55) 3px 6px); }
#btn-guide-close { flex: none; margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; }
#btn-guide-close .x { display: none; }
#btn-guide-close .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.guide-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
/* ергономіка екрана колекції (ADR-098 п.5): цілі ≥ 44 px — лише в #guide (глобальний .chip меню — без змін) */
#guide .chip { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.col-seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,0.03); }
.col-seg .chip { border-color: transparent; background: none; padding: 0 16px; }
.col-seg .chip.active { border-color: var(--accent); background: rgba(216,166,74,0.2); }
.guide-tools .ico { width: 18px; height: 18px; flex: none; }
.col-fbtn { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 15px; }
.col-fbtn .fn { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #1a1408; font-size: 12.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.col-sbtn { display: none; }
.col-search { position: relative; display: flex; align-items: center; flex: 1 1 180px; min-width: 160px; max-width: 300px; }
.col-search .ico { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
#col-search { width: 100%; min-height: 44px; padding: 0 44px 0 40px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,0.05); color: var(--text); font: inherit; font-size: 15px; }
#col-search::placeholder { color: var(--muted); opacity: 1; }
#col-search:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
#col-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.col-sclear { position: absolute; right: 0; top: 0; width: 44px; height: 44px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 16px; cursor: pointer; }
.col-sclear:hover { color: var(--text); }
.col-acts { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.col-result { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 0; }
.col-shown { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-result .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
.col-acts .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
/* панелі «Фільтри» і «Як працює колекція»: десктоп — випадна під рядком 2 поверх сітки, телефон — аркуш знизу (нижче) */
.col-pop { position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; width: min(640px, 100%); max-height: min(70vh, 600px); overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 16px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 44px rgba(0,0,0,0.6); }
.col-pop.col-rules { left: auto; right: 0; width: min(580px, 100%); }
.col-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col-pop-head h3 { margin: 0; font-size: 18px; }
.col-pop-x { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.col-pop h4 { margin: 12px 0 8px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.guide-filter { display: flex; gap: 8px; flex-wrap: wrap; }
#guide .chip.off { opacity: 0.45; cursor: not-allowed; }
.col-hint { margin: 8px 0 0; color: var(--accent-2); font-size: 14px; }
.col-seen { min-height: 44px; padding: 0 14px; font-size: 14px; }
/* «Останні знахідки» (COL-13): рядок плиток на всю ширину сітки над альбомом; не влізли — прокрутка вбік */
.col-recent { grid-column: 1 / -1; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.col-recent-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.col-recent-head h3 { margin: 0; font-size: 15px; }
.col-recent-head .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
.col-recent-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(9rem, calc((100% - 5 * 12px) / 6)); gap: 12px; overflow-x: auto; padding: 2px; }
.col-pop-foot { position: sticky; bottom: -16px; display: flex; justify-content: flex-end; gap: 10px; margin: 16px 0 -16px; padding: 10px 0 16px; background: var(--panel-solid); } /* дії — завжди видно під прокруткою панелі */
.col-pop-foot .btn { min-height: 48px; padding: 0 20px; }
.col-rules ul { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.5; color: #dfe3d2; }
.col-rules li { margin: 4px 0; }
.col-scrim { display: none; }
/* порожня вибірка: напис і «Скинути фільтри» на всю ширину сітки */
.col-empty { grid-column: 1 / -1; padding: 40px 16px; text-align: center; color: var(--muted); }
.col-empty p { margin: 0 0 14px; font-size: 16px; }
.col-empty .btn { min-height: 48px; padding: 0 20px; }
.col-body { display: flex; gap: 16px; flex: 1; min-height: 0; margin-top: 12px; }
/* альбом (COL-9, ADR-098): плитки сталої висоти — ширина в rem (збільшений текст — менше колонок); рядок — max-content:
   у сітці сталої висоти з прокруткою auto-рядки стискаються нижче вмісту */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); grid-auto-rows: max-content; align-items: start; align-content: start; gap: 12px; overflow-y: auto; padding: 2px 4px 2px 2px; flex: 1; min-width: 0; min-height: 0; }
.gtile {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 0; text-align: left; transform-origin: 0 0; /* FLIP перебудови — від лівого верхнього кута */ cursor: pointer; font: inherit; color: var(--text);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.gtile:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 0; } /* поле сітки — 2 px: кільце не обрізане й не під знімком */
.gtile .img { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: radial-gradient(ellipse at 50% 60%, #3c4a38, #18221a); }
.gtile .img img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* незнайдений в альбомі — фон і знімок темніші (замок — без змін) */
.gtile.q .img, .gcard.gdetail.q .img { background: radial-gradient(ellipse at 50% 60%, #222a20, #0e140f); }
.gtile.q .img img { filter: var(--locked) blur(7px) brightness(0.8); }
.gtile .num { position: absolute; right: 6px; top: 6px; font-size: 12px; line-height: 1.4; color: var(--muted); background: rgba(15,26,18,0.6); padding: 0 6px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.gtile .nw { position: absolute; left: 6px; top: 6px; font-size: 12px; font-weight: 800; line-height: 1.4; background: var(--accent); color: #1a1408; padding: 1px 8px; border-radius: 999px; }
/* назва — до 2 рядків сталої висоти (повна — title / aria-label), тож висота плитки не залежить від сусідів */
.gtile .nm { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; height: 2.5em; line-height: 1.25; margin: 8px 10px 3px; font-weight: 700; font-size: 14px; }
.gtile .st { display: block; margin: 0 10px; font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtile .st.yes { color: var(--good); }
.gtile .st.yes::before { content: '✓ '; }
.gtile .st.no { color: var(--muted); }
.gtile .st.fresh { color: var(--accent-2); }
.gtile .st.fresh::before { content: '★ '; }
.gtile .fq { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.4; white-space: nowrap; color: var(--muted); margin: 6px 10px 9px; padding-top: 6px; border-top: 1px solid var(--line); }
/* шкала рідкості (COL-9): заповнені крапки — рідше (дуже часто — 1 … дуже рідко — 5); слово поруч */
.gtile .fq .dots { display: inline-flex; gap: 3px; flex: none; }
.gtile .fq .dots i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid rgba(220,230,200,0.35); }
.gtile .fq .dots i.on { background: var(--accent-2); border-color: var(--accent-2); }
.gtile .fq .w { overflow: hidden; text-overflow: ellipsis; }
/* знімок трохи затемнений, при наведенні — світлішає (лише де є наведення: на дотику плитки не темніють) */
@media (hover: hover) {
  .gtile:hover { background: rgba(255,255,255,0.08); }
  .gtile .img { filter: brightness(0.9); transition: filter 0.15s; }
  .gtile:hover .img, .gtile:focus-visible .img, .gtile.sel .img { filter: brightness(1.06); }
}
.gtile .st .lock { position: static; display: inline-block; width: 1.05em; height: 1.05em; aspect-ratio: auto; transform: none; background: none; border-radius: 0; vertical-align: -0.15em; margin-right: 3px; color: inherit; }
.gtile .st .lock svg { display: block; width: 100%; height: 100%; opacity: 1; margin: 0; }
.gtile.sel { border-color: var(--accent-2); background: rgba(216,166,74,0.12); }
/* деталі виду (COL-9): вміст — картка довідника .gcard.gdetail; широкий екран — бічна панель, вузький — шар */
.col-detail { flex: none; width: 380px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.03); }
.col-detail-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--panel-solid); border-bottom: 1px solid var(--line); }
.col-detail-no { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
#btn-col-back { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; font-size: 16px; }
#btn-col-back .back { display: none; }
#btn-col-back .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* ім'я «✕» для читачів екрана */
/* бічна панель (широкий екран): номер і маленький «✕» — поверх фону знімка, прокручуються з карткою */
@media (min-width: 1000px) and (min-height: 521px) {
  .col-detail { position: relative; }
  .col-detail-top { position: absolute; left: 0; right: 0; top: 0; padding: 8px; background: none; border: 0; pointer-events: none; }
  .col-detail-top > * { pointer-events: auto; }
  #btn-col-back { position: relative; min-width: 0; min-height: 0; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(15,26,18,0.6); color: var(--muted); font-size: 14px; }
  #btn-col-back:hover { color: var(--text); background: rgba(15,26,18,0.85); }
  #btn-col-back::after { content: ''; position: absolute; inset: -7px; } /* зона натискання — 44 px */
  .col-detail-no { font-size: 12px; line-height: 1.4; padding: 0 6px; border-radius: 999px; background: rgba(15,26,18,0.6); }
}
.gcard.gdetail { border: 0; border-radius: 0; background: none; }
.gcard.gdetail .img { height: auto; aspect-ratio: 1; max-height: 210px; }
.gcard.gdetail.q .img img { filter: var(--locked) blur(14px) brightness(0.8); }
.gcard.gdetail .body { padding: 12px 16px 18px; font-size: 16px; line-height: 1.45; }
.gcard.gdetail .nm { font-size: 22px; font-family: Georgia, "Times New Roman", serif; font-weight: 600; align-items: baseline; }
.gcard.gdetail .nm .pts { font-family: inherit; font-size: 18px; }
.gcard.gdetail .lt { font-size: 15px; }
.gcard.gdetail :is(.st, .freq, .hint, .mine, ul, .twins) { font-size: 15px; }
.gcard.gdetail .fleg { font-size: 13px; }
.gcard.gdetail .badge { font-size: 13px; }
/* без бічної панелі (вузький екран, планшет у портреті): деталі — на всю панель замість шапки й сітки */
@media not all and (min-width: 1000px) and (min-height: 521px) {
  /* :not(.top) — на вкладці «Колекціонери» (деталі там сховано) шапка з вкладками й «Закрити» лишається (ревю: глухий кут) */
  #guide.detail:not(.top) :is(.guide-top, #col-scrim, #col-note, #col-result, #col-intro, #guide-grid) { display: none !important; }
  #guide.detail:not(.top) .guide-panel { height: 100%; } /* панель тієї самої висоти, що й з альбомом (вміст деталей буває коротким) */
  .col-detail { width: auto; flex: 1; border: 0; border-radius: 0; background: none; }
  #btn-col-back .back { display: inline; }
  #btn-col-back .x { display: none; }
  .gcard.gdetail .img { max-height: min(340px, 50vh); }
}
.gcard { background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.gcard .img { position: relative; overflow: hidden; height: 170px; background: radial-gradient(ellipse at 50% 60%, #3c4a38, #18221a); display: flex; align-items: center; justify-content: center; }
.gcard .img img { width: 100%; height: 100%; object-fit: contain; }
.gcard .img img:not([src]), .gtile .img img:not([src]) { visibility: hidden; } /* знімок ще в черзі — без значка «битого» зображення й alt */
.gcard .body { padding: 10px 12px 12px; }
.gcard .nm { font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; gap: 8px; }
.gcard .lt { font-style: italic; color: var(--muted); font-size: 12.5px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; margin: 6px 0; }
.badge.edible { background: rgba(143,207,106,0.18); color: var(--good); }
.badge.inedible { background: rgba(240,176,74,0.18); color: var(--warn); }
.badge.poison { background: rgba(255,107,85,0.18); color: var(--bad); }
.badge.deadly { background: rgba(255,60,40,0.3); color: #ff8a78; }
.badge.conditional { background: rgba(190,210,110,0.16); color: #cfdc86; }
.badge.red { background: rgba(200,40,60,0.28); color: #ffb0b8; }
.gcard .freq { font-size: 12.5px; color: #dfe3d2; margin: 2px 0 5px; }
.gcard .fbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,0.06); }
.gcard .fbar i { display: block; flex-basis: 0; }
.gcard .fbar i, .gcard .fleg span::before { background: var(--fc); } /* колір лісу — BIOMES[*].color (js/ui/collection.js) */
.gcard .fleg { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); margin: 4px 0 2px; }
.gcard .fleg span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; }
.gcard ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.4; color: #dfe3d2; }
.gcard .pts { font-variant-numeric: tabular-nums; }
.guide-filter .chip small { margin-left: 0.35em; }
.guide-filter .chip small { color: var(--muted); font-size: 0.85em; font-variant-numeric: tabular-nums; }
.col-note { color: var(--warn); font-size: 14px; margin: 10px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.col-note .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
.col-intro { margin: 12px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(216,166,74,0.08); }
.col-intro h3 { font-size: 18px; }
.col-intro p { margin: 6px 0 0; line-height: 1.5; }
.col-intro p.first { color: var(--accent-2); }
/* незнайдений вид (COL-8, ADR-098): назва, латина, закритий знімок (--locked, замок); без категорії, балів і ознак */
.gcard .st { font-size: 12.5px; margin: 1px 0 4px; } /* стан текстом (COL-8, ADR-098): не лише кольором */
.gcard .st.yes { color: var(--good); }
.gcard .st.yes::before { content: '✓ '; }
.gcard .st.no { color: var(--muted); }
.gcard.q .img { background: radial-gradient(ellipse at 50% 60%, #2c3529, #141b15); }
.gcard.q .img img { filter: var(--locked) blur(8px); }
/* замок закритого виду (COL-8, ADR-098; ui/dom.js LOCK_SVG): по центру знімка, 40 % висоти, тьмяний, без обідка */
.lock { position: absolute; left: 50%; top: 50%; height: 40%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(15,26,18,0.5); color: var(--muted); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.lock svg { width: 57.5%; height: 57.5%; opacity: 0.8; margin-top: -4%; }
.gcard .hint { font-size: 13px; color: #dfe3d2; margin: 3px 0; }
.gcard.q .freq { margin-top: 6px; }
.gcard .mine { font-size: 12.5px; color: #dfe3d2; background: rgba(216,166,74,0.1); border-radius: 8px; padding: 6px 8px; margin: 2px 0 6px; line-height: 1.45; }
.gcard .mine.fresh { color: var(--accent-2); }
/* Вкладка «Колекціонери» (COL-5, js/ui/collectors.js): клас top на #guide ховає картки й фільтри колекції */
#col-top { display: none; }
#guide.top #col-top { display: block; flex: 1; min-height: 0; overflow-y: auto; margin-top: 12px; }
#guide.top :is(#guide-tools, #col-acts, .col-pop, #col-scrim, #col-note, #col-result, #col-intro, .col-body) { display: none !important; }
.col-top-count { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.col-top-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.col-top-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.col-top-table td { padding: 7px 10px; border-bottom: 1px solid rgba(220,230,200,0.06); }
.col-top-table .pl, .col-top-table .n { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
.col-top-table .nk { overflow-wrap: anywhere; }
.col-top-table tr.mine td { background: rgba(216,166,74,0.14); color: var(--accent-2); font-weight: 600; }
.col-top-me { margin: 12px 0 4px; font-weight: 600; }
.col-top-hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.col-top-hint a { color: var(--accent-2); }

/* Пауза, підсумки */
.pause-panel { width: 760px; }
.pause-msg { color: var(--bad); margin: 8px 0 0; }
.pause-grid { display: grid; grid-template-columns: 260px 1fr; gap: 22px; margin-top: 14px; }
.pause-col { display: flex; flex-direction: column; gap: 10px; }
.settings { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 14px; }
.settings label { display: flex; flex-direction: column; gap: 4px; }
.settings input { accent-color: var(--accent); }
.settings label.check { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
/* перемикач (AN-5, «Анонімна статистика»): сам input — зона 48×44 (і на телефоні, задача 18), доріжка й повзунок — псевдоелементи */
.settings input.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 48px; height: 44px; margin: -10px 0; cursor: pointer; background: none; }
.settings input.switch::before { content: ''; position: absolute; left: 4px; top: 11px; width: 40px; height: 22px; border-radius: 11px; background: rgba(255,255,255,0.18); transition: background 0.15s; }
.settings input.switch::after { content: ''; position: absolute; left: 7px; top: 14px; width: 16px; height: 16px; border-radius: 50%; background: #e9e4d6; transition: transform 0.15s; }
.settings input.switch:checked::before { background: var(--accent); }
.settings input.switch:checked::after { transform: translateX(18px); }
.settings input.switch:focus-visible::before { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (forced-colors: active) { /* високий контраст: фон псевдоелементів скидається — рамка й колір системи */
  .settings input.switch::before { border: 1px solid CanvasText; }
  .settings input.switch::after { background: CanvasText; }
  .settings input.switch:checked::after { background: Highlight; }
}
.settings .set-note { margin: -4px 0 0; font-size: 12.5px; line-height: 1.4; }
.settings .set-note a { color: var(--accent-2); }
.basket-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.basket-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,0.04); }
.basket-item .pts.pos { color: var(--good); }
.basket-item .pts.neg { color: var(--bad); }
.basket-empty { color: var(--muted); font-style: italic; }
/* картка колекції для поширення (COL-6): кнопка екрана колекції (кнопка підсумку — у розділі вікна підсумку) */
.col-share { display: inline-flex; }
#btn-col-share:disabled { opacity: 0.75; cursor: progress; }
.pause-coltext { color: var(--accent-2); margin: 8px 0 0; }
/* «Як не сплутати» на картці знайденого виду (COL-4): двійник з назвою чи «???» */
.gcard .twins { margin-top: 8px; font-size: 12.5px; line-height: 1.4; color: #dfe3d2; }
.gcard .tw-title { font-weight: 700; color: var(--accent-2); margin-bottom: 3px; }
.gcard .twin { border-left: 2px solid var(--line); padding: 2px 0 2px 8px; margin: 4px 0; }
.gcard .twin.q { border-left-color: var(--bad); }
.gcard .tw-h { font-weight: 700; }
.gcard .twin.q .tw-h { color: var(--warn); }
.toast .tn { font-size: 12.5px; font-weight: 700; color: var(--accent-2); margin-top: 4px; }
/* свято рідкісного (COL-2): тост першої знахідки рідкісного виду — золотавий; «дуже рідко» (gold2) — тепліший, довше світиться */
.toast.gold { border-color: rgba(240,196,106,0.55); border-left-color: var(--accent-2); background: linear-gradient(100deg, rgba(64,48,16,0.94), rgba(14,20,14,0.92) 70%); box-shadow: 0 0 18px rgba(240,196,106,0.28); }
.toast.gold .tt > span:first-child { color: var(--accent-2); }
.toast.gold2 { border-left-color: #ffb45a; background: linear-gradient(100deg, rgba(92,56,14,0.95), rgba(20,20,12,0.92) 75%); animation: toastIn 0.3s ease-out, goldGlow 1.6s ease-in-out 0.3s 3; }
@keyframes goldGlow { 50% { box-shadow: 0 0 30px rgba(255,190,96,0.55); } }
@media (prefers-reduced-motion: reduce) {
  .toast.gold2 { animation: toastIn 0.3s ease-out; }
}

/* ---------- Вікно «Прогулянку завершено» (SUM-2, ADR-106; макет v4 — docs/SUMMARY_TASKS.md) ----------
   Заголовок, тіло (прокручується лише воно: стенд ліворуч + основна колонка), рядок кнопок; «Подробиці» — шар на всю панель.
   Без .anim розмітка — кінцева: стилі «до відкриття» — лише під .anim (ui/summary.js play). Розміри — кінцеві значення
   каскаду макета: комп'ютер; низьке вікно (max-height 700); телефон (max-height 520, між вирізами — поле .screen); вузьке
   (max-width 960); портрет (max-width 560 — одна колонка) */
#summary { --dim: #8a937c; --line-2: rgba(220, 230, 200, 0.26); }
#summary .sum-panel { width: 920px; display: flex; flex-direction: column; gap: 14px; padding: 20px 36px 16px; border-radius: 20px; text-align: left;
  background: rgba(18, 28, 20, 0.9); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  max-height: calc(100dvh - max(var(--pad), env(safe-area-inset-top)) - max(var(--pad), env(safe-area-inset-bottom))); }
#summary .sum-panel.anim.in { animation: sumIn 0.3s cubic-bezier(.05, .7, .1, 1) both; }
@keyframes sumIn { from { opacity: 0; transform: translateY(12px); } }
#summary .sum-panel.instant, #summary .sum-panel.instant * { transition: none !important; animation: none !important; }
#summary .sum-top { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
#summary .sum-ttl { font: 600 15px/1 Georgia, "Times New Roman", serif; color: var(--muted); margin: 0; white-space: nowrap; }
#summary .sum-ctx { flex: 1; min-width: 0; font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#summary .sum-note { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
#summary .sum-note[data-state="checking"], #summary .sum-note[data-state="unconfirmed"], #summary .sum-note[data-state="unsaved"] { color: var(--warn); }
#summary .sum-note[data-state="pending"]::before { content: "…"; display: inline-block; margin-right: 4px; animation: sumBreath 1.6s ease-in-out infinite; }
@keyframes sumBreath { 50% { opacity: 0.35; } }
#summary .sum-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#summary .sum-cols { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: stretch; }
#summary .main { display: flex; flex-direction: column; min-width: 0; }
#summary .main.mid { justify-content: center; }
#summary .main > :first-child { margin-top: 0; }
#summary .side4 { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#summary .side4 .stand { flex: 1; }
#summary .side4 .quiet { margin-top: 0; }
#summary .pk { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
#summary .sm { display: none; }
#summary img:not([src]) { visibility: hidden; } /* знімок ще в черзі — без значка «битого» */
/* знімка ще немає (черга) чи не вийшло — «?»; знімок проявиться, щойно буде */
#summary :where(.img, .clip, .box):has(> img:not([src]))::after { content: "?"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 600 26px/1 Georgia, serif; color: rgba(220, 230, 200, 0.42); }
#summary .stand .img::after { font-size: 64px; }
#summary .th .box::after { font-size: 16px; }
#summary .anim .stand.locked .img::after { content: none; } /* закрита знахідка — лише замок */
/* стенд: знахідка → найцінніше в кошику → бали → порожній кошик */
#summary .stand { position: relative; min-height: 300px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; transition: opacity 0.4s;
  background: radial-gradient(ellipse 85% 60% at 50% 40%, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015) 70%); }
#summary .anim .stand:not(.in) { opacity: 0; }
#summary .stand .lbl { font-size: 11px; font-weight: 600; line-height: 1.2; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); min-height: 14px; transition: color 0.4s; }
#summary .stand .img { position: relative; width: 210px; height: 210px; margin: 4px 0 2px; }
#summary .stand .img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: filter 0.9s ease-out, transform 0.9s cubic-bezier(.05, .7, .1, 1); }
#summary .stand .nm { font: 600 22px/1.15 Georgia, "Times New Roman", serif; }
#summary .stand .lat { font: italic 13px/1.3 Georgia, "Times New Roman", serif; color: var(--muted); }
#summary .stand .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
#summary .chip4 { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--muted); white-space: nowrap; }
#summary .chip4.rar { background: transparent; color: var(--accent-2); border: 1px solid rgba(240, 196, 106, 0.55); }
#summary .stand .note { font-size: 12.5px; color: var(--dim); margin-top: 2px; }
#summary .stand.st-find { border-color: rgba(240, 196, 106, 0.28); background: radial-gradient(ellipse 85% 60% at 50% 40%, rgba(240, 196, 106, 0.13), rgba(255, 255, 255, 0.015) 72%); }
#summary .stand.st-find .lbl { color: var(--accent); }
#summary .stand.st-find :is(.nm, .lat, .chips, .note) { transition: opacity 0.45s 0.25s; }
#summary .stand .lockbig { height: 34px; transition: opacity 0.3s; }
#summary .stand:not(.locked) .lockbig { opacity: 0; }
/* знахідка спершу закрита, як незнайдений вид; відкриття — пік 2 */
#summary .anim .stand.locked .img img { filter: var(--locked) blur(7px); transform: scale(0.94); }
#summary .anim .stand.locked :is(.nm, .lat, .chips, .note) { opacity: 0; }
#summary .anim .stand.locked .lbl { color: var(--dim); }
/* «дуже рідко»: тихий промінь за грибом (як rareFx у лісі), один раз */
#summary .stand .ray { position: absolute; left: 50%; top: -30%; width: 120px; height: 120%; transform: translateX(-50%) rotate(8deg); filter: blur(10px); opacity: 0; pointer-events: none;
  background: linear-gradient(rgba(255, 236, 190, 0), rgba(255, 236, 190, 0.22) 45%, rgba(255, 236, 190, 0)); }
#summary .stand.vr.lit .ray { animation: sumRay 2.6s ease-out both; }
@keyframes sumRay { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0.35; } }
#summary .stand.st-catch .lbl { color: var(--muted); }
#summary .stand.st-score { align-items: flex-start; text-align: left; gap: 10px; padding-inline: 28px; background: radial-gradient(ellipse 90% 70% at 30% 40%, rgba(240, 196, 106, 0.07), rgba(255, 255, 255, 0.015) 72%); }
#summary .stand.st-score .score { flex-wrap: wrap; row-gap: 2px; } /* «балів» — під числом, якщо поруч не вміщається */
#summary .stand.st-score .score .num { font-size: 84px; }
#summary .stand.st-score .score .num.long { font-size: 56px; } /* довге число (4–5 знаків з мінусом): «8 888 балів» — одним рядком */
#summary .stand.st-score .score .num.xlong { font-size: 44px; } /* 6+ знаків: «−12 345» */
#summary .stand.st-score .rank { font-size: 21px; }
#summary .stand.st-empty { gap: 10px; }
#summary .stand.st-empty .bask { width: 96px; height: 96px; color: var(--dim); opacity: 0.8; }
#summary .stand.st-empty .et { font: 600 20px/1.2 Georgia, "Times New Roman", serif; }
#summary .stand.st-empty p { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 220px; }
#summary kbd { margin: 0 1px; } /* клавіша в підказці — без глобального відступу зліва («(V)», не «( V)») */
/* бали, звання, рекорд (рядок зарезервовано: пізня відповідь сервера нічого не зсуває) */
#summary .score { display: flex; align-items: baseline; gap: 12px; line-height: 1; }
#summary .score .num { font-size: 68px; font-weight: 800; line-height: 0.88; color: var(--accent-2); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; transition: color 0.3s; }
#summary .score .num.neg { color: #e3b4a3; }
#summary .score .num.zero { color: var(--muted); font-size: 60px; }
#summary .score small { font-size: 19px; color: var(--muted); }
#summary .sub { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#summary .rank { font: 600 21px/1.25 Georgia, "Times New Roman", serif; min-height: 26px; transform-origin: left center; display: grid; }
/* звання під час відліку (.cur) і кінцеве (.fin, невидиме) — в одній клітинці: висота — за кінцевим, нічого не стрибає */
#summary .rank > span { grid-area: 1 / 1; min-width: 0; }
#summary .rank > .fin { visibility: hidden; }
#summary .rank.up { animation: sumPop 0.45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes sumPop { 40% { transform: scale(1.06); } }
#summary .rec { display: inline-flex; align-items: center; gap: 6px; min-height: 20px; font-size: 14px; font-weight: 600; color: var(--text); transition: opacity 0.35s, transform 0.35s cubic-bezier(.34, 1.56, .64, 1); }
#summary .rec svg { width: 16px; height: 16px; color: var(--accent-2); flex: none; }
#summary .rec.rq { font-weight: 400; color: var(--dim); font-size: 13px; }
#summary .rec.rq svg { color: var(--dim); }
#summary .anim .rec:not(.in) { opacity: 0; transform: translateY(4px); }
#summary .late { animation: sumLate 0.4s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes sumLate { from { opacity: 0; transform: translateY(4px); } }
/* герой основної колонки: бали й місце на одній базовій лінії, пояснення під ними */
#summary .hero4 { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(42%); column-gap: 24px; row-gap: 4px; align-items: baseline; }
#summary .hero4 .score { flex-wrap: wrap; row-gap: 2px; } /* «балів» — під число, а не за межі клітинки */
#summary .hero4 .pk2 { grid-column: 2; grid-row: 1; justify-self: end; }
#summary .hero4 .score { grid-column: 1; grid-row: 2; }
#summary .hero4 .score .num { font-size: 60px; }
#summary .hero4.zero .score .num { font-size: 44px; }
#summary .hero4 .sub { grid-column: 1; grid-row: 3; }
#summary .hero4 .rank { font-size: 18px; }
#summary .hero4 .pv { grid-column: 2; grid-row: 2; justify-self: end; }
#summary .hero4 .ps { grid-column: 2; grid-row: 3; justify-self: end; text-align: right; align-self: start; overflow-wrap: break-word; min-width: 0; }
/* місце серед колекціонерів: велике — нове місце, дрібно — приріст і старе */
#summary .pv { font-size: 44px; font-weight: 800; line-height: 1; color: var(--good); font-variant-numeric: tabular-nums; white-space: nowrap; transition: text-shadow 0.6s; }
#summary .pv.glow { text-shadow: 0 0 22px rgba(143, 207, 106, 0.45); }
#summary .ps { font-size: 13px; color: var(--muted); }
#summary .ps b { color: var(--good); font-weight: 700; }
#summary .ps .hid { white-space: nowrap; }
#summary .hero4.pl { grid-template-columns: minmax(0, 1fr) min(42%, 230px); } /* стала колонка місця: пізня відповідь не перекомпоновує бали й звання */
#summary .place { transition: opacity 0.4s; }
#summary .place.wait { visibility: hidden; }
#summary .anim .place:not(.in) { opacity: 0; }
#summary .placerow { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: baseline; }
#summary .placerow .pk2 { grid-column: 1 / -1; }
#summary .placerow .pv { grid-column: 1; grid-row: 2; }
#summary .placerow .ps { grid-column: 2; grid-row: 2; }
#summary .placerow .ps .sm { display: none !important; }
/* «+N» нових видів з картками; смужка колекції */
#summary .col { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; transition: opacity 0.35s; }
#summary .anim .col:not(.in) { opacity: 0; }
#summary .ch { display: flex; align-items: baseline; gap: 12px; }
#summary .ch .plus { font-size: 44px; font-weight: 800; line-height: 1; color: var(--accent-2); font-variant-numeric: tabular-nums; transform-origin: left center; }
#summary .ch .plus.pop { animation: sumPop 0.35s cubic-bezier(.34, 1.56, .64, 1); }
#summary .ch .of { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
#summary .ch .of b { color: var(--text); }
#summary .cards { display: flex; gap: 14px; padding-top: 8px; } /* ярлик рідкості — над рамкою картки */
#summary .cd { width: 96px; flex: none; display: flex; flex-direction: column; gap: 5px; }
#summary .cd .fr { position: relative; width: 72px; height: 72px; border-radius: 13px; border: 1px solid var(--line-2); background: radial-gradient(ellipse at 50% 60%, #2c3529, #141b15); transition: border-color 0.5s, box-shadow 1.2s; }
#summary .cd .clip { position: absolute; inset: 0; border-radius: 13px; overflow: hidden; }
#summary .cd .clip img { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); object-fit: contain; transition: filter 0.8s ease-out; }
#summary .cd .lock { height: 18px; left: auto; top: auto; right: 6px; bottom: 6px; transform: none; opacity: 0; transition: opacity 0.3s; }
#summary .cd.k-cut.flash .fr { border-color: rgba(240, 196, 106, 0.8); box-shadow: 0 0 18px rgba(240, 196, 106, 0.25); }
#summary .cd.k-spare .fr { border: 1.5px solid rgba(143, 207, 106, 0.75); background: radial-gradient(ellipse at 50% 70%, #233823, #121a13); }
#summary .cd.k-spare.breath .fr { box-shadow: 0 0 14px rgba(143, 207, 106, 0.35); }
#summary .cd.k-bad .fr { border: 1.5px solid rgba(217, 154, 134, 0.75); }
#summary .cd.k-bad .clip img { filter: saturate(0.6) brightness(0.9); }
#summary .cd .bdg { position: absolute; left: -6px; bottom: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #101a12; border: 1px solid var(--line-2); transition: opacity 0.3s 0.2s; z-index: 1; }
#summary .cd .bdg svg { width: 13px; height: 13px; }
#summary .cd.k-spare .bdg { color: #a9d483; border-color: rgba(143, 207, 106, 0.6); }
#summary .cd.k-trample .bdg { color: var(--muted); }
#summary .cd.k-bad .bdg { color: #e3a28d; border-color: rgba(217, 154, 134, 0.6); }
#summary .cd .rar { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); font-size: 10px; font-weight: 600; line-height: 1; padding: 3px 5px; border-radius: 5px; color: var(--accent-2); border: 1px solid rgba(240, 196, 106, 0.55); background: rgba(10, 15, 11, 0.7); white-space: nowrap; transition: opacity 0.3s 0.25s; z-index: 1; }
#summary .cd.k-spare .rar { color: #a9d483; border-color: rgba(143, 207, 106, 0.55); }
#summary .cd .nm { font-size: 12.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: opacity 0.4s 0.25s; }
#summary .cd .cdhow { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.4s 0.35s; }
#summary .cd.k-spare .cdhow { color: #a9d483; }
#summary .cd.k-bad .cdhow { color: #e3a28d; }
#summary .cd.more { width: auto; transition: opacity 0.3s; } /* «+K» — завширшки з рамку: ряд вміщає ще одну картку */
#summary .cd.more .fr { display: grid; place-items: center; font-size: 18px; font-weight: 600; color: var(--muted); background: rgba(255, 255, 255, 0.03); border-color: var(--line); }
/* до відкриття картки — закрита, як незнайдений вид; вид дії (рамка, значок) — лише після відкриття */
#summary .anim .cd:not(.on) .fr { border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 60%, #2c3529, #141b15); box-shadow: none; }
#summary .anim .cd:not(.on) .clip img { filter: var(--locked) blur(5px); }
#summary .anim .cd:not(.on) .lock { opacity: 1; }
#summary .anim .cd:not(.on) :is(.nm, .cdhow, .bdg, .rar) { opacity: 0; }
#summary .anim .cd.more:not(.on) { opacity: 0; }
#summary .cbar { display: flex; gap: 2px; height: 6px; }
#summary .cbar i { flex: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.08); }
#summary .cbar i.have { background: #6f8f58; }
#summary .cbar i.nw { background: var(--accent-2); box-shadow: 0 0 6px rgba(240, 196, 106, 0.7); transition: background 0.3s, box-shadow 0.3s; }
#summary .cbar i.nw.q { background: #b9a98a; box-shadow: none; }
#summary .anim .cbar i.nw:not(.lit) { background: rgba(255, 255, 255, 0.08); box-shadow: none; }
/* колекція тихим рядком (розкладки B, C) */
#summary .colmini { display: flex; align-items: center; gap: 16px; margin-top: 22px; transition: opacity 0.35s; }
#summary .anim .colmini:not(.in) { opacity: 0; }
#summary .colmini .cbar { flex: 1; }
#summary .colmini .of { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
#summary .colmini .of b { color: var(--text); font-weight: 600; }
/* тихий шар: кошик знімками, рішення, «Як не сплутати» */
#summary .quiet { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
#summary .bk { display: flex; flex-direction: column; gap: 8px; }
#summary .bk .bh { display: flex; justify-content: space-between; align-items: baseline; }
#summary .bk .bh b { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
#summary .strip { display: flex; gap: 10px; overflow: hidden; }
#summary .th { position: relative; width: 46px; flex: none; transition: opacity 0.25s, transform 0.3s cubic-bezier(.34, 1.56, .64, 1); }
#summary .anim .th:not(.in) { opacity: 0; transform: translateY(6px) scale(0.92); }
#summary .th .box { position: relative; width: 46px; height: 46px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); overflow: hidden; }
#summary .th .box img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
#summary .th .n { position: absolute; right: 2px; bottom: 2px; font-size: 11px; font-weight: 700; line-height: 1; padding: 2px 4px; border-radius: 5px; background: rgba(8, 12, 9, 0.85); }
#summary .th .p { display: none; text-align: center; font-size: 11px; margin-top: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
#summary .th .p.neg { color: #e3a28d; }
#summary .th.more .box { display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--muted); }
#summary .bk.big { margin-top: 22px; gap: 12px; }
#summary .bk.big .th, #summary .bk.big .th .box { width: 72px; }
#summary .bk.big .th .box { height: 72px; border-radius: 12px; background: radial-gradient(ellipse at 50% 60%, #34412f, #161f17); }
#summary .bk.big .th .p { display: block; font-size: 12.5px; }
#summary .bk.big .strip { gap: 12px; }
#summary .bk.big .bn { font-size: 30px; font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
#summary .bk.big .bn small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
#summary .line { font-size: 13.5px; line-height: 1.45; color: var(--muted); transition: opacity 0.4s; }
#summary .anim .line:not(.in) { opacity: 0; }
#summary .line b { color: var(--text); font-weight: 600; }
#summary .learn { display: flex; gap: 12px; align-items: center; }
#summary .learn img { width: 36px; height: 36px; object-fit: contain; flex: none; }
#summary .learn .more { color: var(--dim); }
/* спори «дуже рідко» */
#summary .spore { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #ffe6a6; box-shadow: 0 0 8px 2px rgba(255, 214, 120, 0.6); opacity: 0; pointer-events: none; z-index: 2; }
#summary .spore.go { animation: sumSpore 2.2s ease-out both; }
@keyframes sumSpore { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 15% { opacity: 0.75; } 100% { opacity: 0; transform: translate(var(--dx), -76px) scale(1); } }
/* рядок кнопок: «Подробиці», «Поділитися» (значок), «Зареєструватися» (гість, контур), «До меню», «Ще раз цей ліс» — головна */
#summary .sum-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-top: 1px solid var(--line); padding-top: 12px; }
#summary .sum-foot > * { flex-shrink: 0; } /* кнопки не стискаються (текст не виходить за рамку) — ряд переноситься */
#summary .sum-foot .sp { flex: 1 1 0; }
#summary .sum-foot #btn-again { margin-left: auto; } /* ряд перенісся — головна лишається праворуч */
#summary .sum-foot .btn { white-space: nowrap; border-radius: 11px; padding: 12px 20px; min-height: 44px; }
#summary .sum-foot .sum-link { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 6px; font-weight: 500; }
#summary .sum-foot .sum-icon { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; background: transparent; }
#summary .sum-icon svg, #summary .reg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#summary .sum-icon .lbl { font-size: 13px; max-width: 16em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* поступ картки (найдовший — «Не вдалося — спробувати ще») */
#summary .sum-icon .lbl:empty { display: none; }
#btn-sum-share:disabled { opacity: 0.75; cursor: progress; }
#summary .sum-foot .reg { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent-2); padding: 10px 14px; border-color: rgba(240, 196, 106, 0.55); background: rgba(240, 196, 106, 0.08); text-decoration: none; }
#summary .reg svg { width: 16px; height: 16px; }
#summary .sum-regnote { font-size: 12.5px; color: var(--muted); max-width: 190px; line-height: 1.3; }
#summary .sum-foot:has(#sum-share-lbl:not(:empty)) .sum-regnote { display: none; } /* поступ картки на «Поділитися» — підпис гостя ховаємо: ряд кнопок не переноситься */
/* «Подробиці» — шар на всю площу вікна */
#summary .sum-det { position: absolute; inset: 0; z-index: 4; border-radius: inherit; background: #111b13; padding: 24px 36px 20px; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }
#summary .sum-det-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#summary .sum-det-top h3 { margin: 0; font-size: 18px; }
#summary .sum-det-top h3:focus { outline: none; }
#summary .sum-det-list { overflow: hidden auto; min-height: 88px; flex: 1; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; align-content: start; } /* сітка, не columns: з обмеженою висотою колонки йшли б праворуч, за край */
#summary .sum-panel.det-open { min-height: min(360px, calc(100dvh - max(var(--pad), env(safe-area-inset-top)) - max(var(--pad), env(safe-area-inset-bottom)))); } /* низьке вікно (порожній кошик) — «Подробицям» є де вміститися */
#summary .sum-det .row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
#summary .sum-det .row .nw { font-style: normal; color: var(--accent-2); margin-left: 6px; white-space: nowrap; }
#summary .sum-det .row b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
#summary .sum-det .row b.neg { color: #e3a28d; }
#summary .sum-det-learn { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(201, 114, 90, 0.07); color: var(--muted); max-height: 34%; overflow: auto; }
#summary .sum-det-learn p { margin: 0; }
#summary .sum-det-learn b { color: var(--text); }
#summary .sum-det-tot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 28px; }
@media (prefers-reduced-motion: reduce) {
  #summary .sum-note[data-state="pending"]::before, #summary .late, #summary .spore { animation: none !important; }
}
@media (max-width: 960px) {
  #summary .sum-cols { grid-template-columns: 220px 1fr; gap: 24px; }
  #summary .stand .img { width: 170px; height: 170px; }
  #summary .stand.st-score .score .num { font-size: 64px; }
  #summary .stand.st-score .score .num.long { font-size: 44px; }
  #summary .stand.st-score .score .num.xlong { font-size: 36px; }
  #summary .sum-regnote { display: none; }
  #summary .cards { gap: 10px; }
  #summary .cd { width: 84px; }
  #summary .cd .fr { width: 64px; height: 64px; }
}
/* комп'ютер з низьким вікном (1366 × 650 і нижче) */
@media (max-height: 700px) {
  #summary .sum-panel { gap: 12px; padding-block: 16px 14px; }
  #summary .stand { min-height: 0; }
  #summary .stand .img { width: 150px; height: 150px; }
  #summary .score .num { font-size: 64px; }
  #summary .hero4 .score .num { font-size: 52px; }
  #summary .rank { font-size: 18px; min-height: 22px; }
  #summary .ch .plus { font-size: 38px; }
  #summary .col { margin-top: 12px; gap: 8px; }
  #summary .quiet { margin-top: 10px; }
  #summary .cd { width: 84px; }
  #summary .cd .fr { width: 54px; height: 54px; }
  #summary .th, #summary .th .box { width: 38px; }
  #summary .th .box { height: 38px; }
  #summary .bk.big .th, #summary .bk.big .th .box { width: 60px; }
  #summary .bk.big .th .box { height: 60px; }
}
/* телефон у ландшафті: 844 × 390 мінус вирізи — 750 px (поле .screen) */
@media (max-height: 520px) {
  #summary .sum-panel { width: 750px; gap: 10px; padding: 10px 22px 8px; border-radius: 16px; }
  #summary .sum-ttl { font-size: 13px; }
  #summary .sum-ctx, #summary .sum-note { font-size: 11.5px; }
  #summary .sum-cols { grid-template-columns: 210px 1fr; gap: 22px; }
  #summary .stand { min-height: 0; padding: 10px; gap: 3px; border-radius: 13px; }
  #summary .stand .lbl { font-size: 11px; }
  #summary .stand .img { width: 100px; height: 100px; margin: 2px 0 0; }
  #summary .stand .nm { font-size: 16px; }
  #summary .stand :is(.lat, .note, .chip4.pts), #summary .stand.st-find .chip4.act { display: none; }
  #summary .stand .chips { margin-top: 3px; gap: 4px; }
  #summary .chip4 { font-size: 11px; padding: 3px 7px; }
  #summary .stand.st-score { padding-inline: 18px; }
  #summary .stand.st-score .score .num { font-size: 56px; }
  #summary .stand.st-score .score .num.long { font-size: 42px; }
  #summary .stand.st-score .score .num.xlong { font-size: 34px; }
  #summary .stand.st-score .rank { font-size: 16px; }
  #summary .stand.st-empty .bask { width: 56px; height: 56px; }
  #summary .stand.st-empty .et { font-size: 15px; }
  #summary .stand.st-empty p { font-size: 12px; }
  #summary .hero4 { row-gap: 2px; column-gap: 14px; }
  #summary .hero4.pl { grid-template-columns: minmax(0, 1fr) min(42%, 150px); } /* місце — стала колонка: пізня відповідь не перекомпоновує бали й звання */
  #summary .hero4 .pk2 { display: none; }
  #summary .hero4 .score .num { font-size: 42px; }
  #summary .hero4 .score .num.long { font-size: 36px; }
  #summary .hero4 .score .num.xlong { font-size: 30px; }
  #summary .hero4 .score small { font-size: 14px; }
  #summary .hero4 .rank { font-size: 15px; min-height: 18px; }
  #summary .hero4 .rank > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #summary .hero4 .pv, #summary .placerow .pv { font-size: 30px; }
  #summary .hero4 .ps, #summary .placerow .ps { font-size: 12px; }
  #summary .pk { font-size: 11px; }
  #summary .lg { display: none; }
  #summary .sm { display: inline; }
  #summary :is(.col, .colmini, .quiet, .bk.big) { margin-top: 8px; }
  #summary .col > .pk { display: none; }
  #summary .col { gap: 6px; }
  #summary .ch .plus { font-size: 24px; }
  #summary .ch .of { font-size: 12.5px; }
  #summary .cards { gap: 10px; padding-top: 4px; }
  #summary .cd { width: 48px; gap: 0; }
  #summary .cd .fr { width: 48px; height: 48px; border-radius: 10px; }
  #summary .cd .clip { border-radius: 10px; }
  #summary .cd :is(.nm, .cdhow, .rar) { display: none; } /* назва — у підказці; рідкість — на стенді й у «Подробицях» */
  #summary .cd .bdg { width: 18px; height: 18px; left: -5px; bottom: -5px; }
  #summary .cd .lock { height: 13px; right: 3px; bottom: 3px; }
  #summary .cbar { gap: 0; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
  #summary .cbar i { border-radius: 0; background: transparent; }
  #summary .cbar i.have { background: #6f8f58; }
  #summary .anim .cbar i.nw:not(.lit) { background: transparent; }
  #summary .quiet { gap: 10px; }
  #summary .bk { gap: 6px; }
  #summary .th, #summary .th .box { width: 32px; }
  #summary .th .box { height: 32px; }
  #summary .strip { gap: 6px; }
  #summary .bk:not(.big) { flex-direction: row; align-items: center; gap: 12px; }
  #summary .bk:not(.big) .bh { flex-direction: column; align-items: flex-start; gap: 2px; flex: none; }
  #summary .bk:not(.big) .bh b { font-size: 12px; }
  #summary .bk.big { flex-direction: row; align-items: center; gap: 12px; }
  #summary .bk.big .bh { display: none; }
  #summary .bk.big .bn { flex: none; display: flex; flex-direction: column; gap: 2px; font-size: 24px; }
  #summary .bk.big .bn small { margin-left: 0; font-size: 12px; }
  #summary .bk.big .th, #summary .bk.big .th .box { width: 50px; }
  #summary .bk.big .th .box { height: 50px; }
  #summary .bk.big .th .p { display: none; }
  #summary .line { font-size: 12px; }
  #summary .main:not(.lay-C) .line.acts { display: none; } /* у C — це весь вміст колонки, лишається */
  #summary .learn img { display: none; }
  #summary .learn .sm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } /* два рядки: «Як не сплутати — у подробицях» не зрізається */
  #summary .side4 .learn .more { display: none; }
  #summary .rec { min-height: 18px; } /* рядок зарезервовано і на телефоні: пізній рекорд не зсуває героя */
  #summary .rec.rq { visibility: hidden; } /* тихий «Рекорд: N» на телефоні — не показуємо, місце лишається */
  #summary .sum-foot { padding-top: 8px; }
  #summary .sum-foot .btn { font-size: 14px; padding: 9px 16px; }
  #summary .sum-foot .sum-icon { padding: 8px 10px; }
  #summary .sum-foot .reg { font-size: 13px; padding: 8px 12px; }
  #summary .sum-foot:has(#sum-share-lbl:not(:empty)) .reg > span { display: none; } /* поступ картки — «Зареєструватися» значком (aria-label): ряд не переноситься */
  #summary .sum-regnote { display: none; }
  #summary .sum-det { padding: 12px 22px 10px; font-size: 12px; }
  #summary .sum-det-tot { grid-template-columns: repeat(2, 1fr); }
  /* телефон: прокручується весь шар (без вкладених прокруток), шапка — липка */
  #summary .sum-det { overflow-y: auto; }
  #summary .sum-det-top { position: sticky; top: -12px; z-index: 1; background: #111b13; padding-block: 2px; }
  #summary .sum-det-list { flex: none; overflow: visible; min-height: 0; }
  #summary .sum-det-learn { max-height: none; overflow: visible; flex: none; }
}
/* дуже низький ландшафт (667 × 375, 568 × 320): ще щільніше */
@media (max-height: 380px) {
  #summary .sum-panel { gap: 6px; padding: 8px 16px 6px; }
  #summary .sum-cols { grid-template-columns: 170px 1fr; gap: 14px; }
  #summary .stand { padding: 6px 8px; }
  #summary .stand.st-score { padding-inline: 12px; }
  #summary .stand .img { width: 64px; height: 64px; }
  #summary .stand .nm { font-size: 14px; }
  #summary .stand.st-score .score .num { font-size: 42px; }
  #summary .stand.st-score .score .num.long { font-size: 32px; }
  #summary .stand.st-score .score .num.xlong { font-size: 26px; }
  #summary .stand.st-empty .bask { width: 40px; height: 40px; }
  #summary .hero4 .score .num { font-size: 32px; }
  #summary .hero4 .score .num.long, #summary .hero4 .score .num.xlong { font-size: 26px; }
  #summary .hero4 .pv, #summary .placerow .pv { font-size: 24px; }
  #summary :is(.col, .colmini, .quiet, .bk.big) { margin-top: 4px; }
  #summary .ch .plus { font-size: 20px; }
  #summary .cd { width: 40px; }
  #summary .cd .fr { width: 40px; height: 40px; }
  #summary .th, #summary .th .box { width: 28px; }
  #summary .th .box { height: 28px; }
  #summary .bk.big .th, #summary .bk.big .th .box { width: 40px; }
  #summary .bk.big .th .box { height: 40px; }
  #summary .bk.big .bn { font-size: 20px; }
  #summary .colmini .pk { display: none; }
  #summary .sum-foot { padding-top: 6px; gap: 6px 8px; }
  #summary .sum-foot .btn { padding: 6px 12px; }
}
/* 568 × 320: звання й «Як не сплутати» — один рядок, рядок рекорду без резерву (KI-214) */
@media (max-height: 340px) {
  #summary .hero4 .rank > span, #summary .learn .sm { -webkit-line-clamp: 1; }
  #summary .rec { min-height: 0; }
  #summary .rec.rq { display: none; }
}
/* вузький ландшафт: «Зареєструватися» — значком (назва — aria-label) */
@media (max-width: 700px) and (orientation: landscape) {
  #summary .sum-foot .reg > span { display: none; }
}
body.touch #summary .cd .rar { font-size: 11px; } /* планшет: шрифт ≥ 11 px */
/* портрет (телефон повернули на підсумку — MODES.summary.rotate: ні): одна колонка */
@media (max-width: 560px) {
  #summary .sum-panel { padding: 14px 16px 12px; gap: 10px; border-radius: 16px; }
  #summary .sum-top { flex-wrap: wrap; row-gap: 2px; }
  #summary .sum-ctx { order: 3; flex-basis: 100%; }
  #summary .sum-cols { grid-template-columns: 1fr; gap: 14px; }
  #summary .stand { min-height: 0; padding: 12px; }
  #summary .stand .img { width: 120px; height: 120px; }
  #summary .stand :is(.lat, .note) { display: none; }
  #summary .hero4 { column-gap: 14px; }
  #summary .hero4 .pk2 { display: none; }
  #summary .hero4 .score .num { font-size: 48px; }
  #summary .hero4 .pv, #summary .placerow .pv { font-size: 32px; }
  #summary .hero4 .ps { font-size: 12px; }
  #summary .lg { display: none; }
  #summary .sm { display: inline; }
  #summary .learn .sm { display: block; }
  #summary .cd .rar { font-size: 11px; }
  #summary .sum-foot { gap: 8px; }
  #summary .sum-foot .sp, #summary .sum-regnote { display: none; }
  #summary #btn-again { order: -1; flex: 1 1 100%; } /* головна — першим рядком на всю ширину */
  #summary .sum-det { padding: 14px 16px 12px; }
  #summary .sum-det-list { grid-template-columns: 1fr; }
  #summary .sum-det-tot { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .pause-grid { grid-template-columns: 1fr; }
  #help, #coach-help, label:has(> #set-help-hide) { display: none; }
}

/* Монітор продуктивності (F3, js/perf.js) */
#perf {
  position: fixed; top: 84px; left: 16px; z-index: 16; width: 340px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px); overflow-y: auto; pointer-events: none;
  background: rgba(10,16,12,0.88); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px;
  font-size: 12.5px; line-height: 1.35; color: var(--text); /* без backdrop-filter: розмиття саме навантажує відеокарту */
}
#perf.compact { width: 240px; }
#perf.compact .pf-full, #perf.compact .pf-legend { display: none; }
#perf .pf-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
#perf .pf-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
#perf .pf-key { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
#perf .pf-verdict { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
#perf .pf-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; }
#perf .pf-vt { font-size: 20px; font-weight: 700; line-height: 1.1; }
#perf .pf-vd { color: var(--muted); font-variant-numeric: tabular-nums; }
#perf canvas { display: block; width: 100%; }
#perf .pf-graph { height: 70px; background: rgba(255,255,255,0.03); border-radius: 6px; }
#perf .pf-long { height: 26px; margin-top: 6px; background: rgba(255,255,255,0.03); border-radius: 6px; }
#perf .pf-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin-top: 3px; }
#perf .pf-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-left: 4px; }
#perf .pf-legend i.ln { height: 2px; width: 12px; }
#perf .pf-legend-r { margin-left: auto; }
#perf .pf-sec { margin: 10px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); font-weight: 600; }
#perf .pf-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
#perf .pf-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
#perf .pf-l { width: 74px; flex: none; }
#perf .pf-v { width: 70px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
#perf .pf-na { color: var(--muted); font-style: italic; }
#perf .pf-bar { position: relative; flex: 1; height: 12px; border-radius: 3px; background: rgba(255,255,255,0.07); display: flex; overflow: hidden; }
#perf .pf-bar.thin { height: 8px; }
#perf .pf-bar b { display: block; height: 100%; }
#perf .pf-bar u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: 0.8; }
#perf .pf-bar em { position: absolute; right: 2px; top: -2px; font-style: normal; color: #fff; font-size: 11px; }
#perf .pf-sub { color: var(--muted); font-size: 11px; margin: -1px 0 2px 82px; }
#perf .pf-sub i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin: 0 3px 0 6px; }
#perf .pf-sub i:first-child { margin-left: 0; }
#perf .pf-bn { font-weight: 600; margin-top: 3px; }
#perf .pf-qs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#perf .pf-q { background: rgba(255,255,255,0.05); border-radius: 6px; padding: 4px 6px; font-variant-numeric: tabular-nums; }
#perf .pf-q span { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.2; min-height: 2.4em; }
#perf .pf-q b { font-size: 16px; }
#perf .pf-row2 { margin-top: 4px; color: var(--muted); }
#perf .pf-row2 b { font-size: 14px; }
#perf .pf-ev { display: grid; grid-template-columns: 58px 44px 1fr; gap: 4px; font-size: 11.5px; margin: 2px 0; font-variant-numeric: tabular-nums; }
#perf .pf-ev span:first-child { color: var(--muted); }
#perf .pf-adv { padding: 5px 8px; border-radius: 6px; margin: 4px 0; border-left: 3px solid; background: rgba(255,255,255,0.04); }
#perf .pf-adv.good { border-color: var(--good); }
#perf .pf-adv.warn { border-color: var(--warn); }
#perf .pf-adv.bad { border-color: var(--bad); }

/* Тест продуктивності (js/bench.js) */
#bench-progress {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 50; width: 420px; max-width: calc(100vw - 32px);
  background: rgba(10,16,12,0.85); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-align: center;
}
#bench-progress .bp-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); margin-top: 8px; overflow: hidden; }
#bench-progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.bench-panel { width: 720px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); overflow-y: auto; }
.bench-panel h2 { margin-bottom: 10px; }
.keys-panel { width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); overflow-y: auto; }
.keys-panel h3 { margin: 14px 0 8px; color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.keys-list { display: grid; grid-template-columns: minmax(0, 14em) 1fr; gap: 7px 18px; margin: 0; align-items: baseline; }
.keys-list dt { text-align: right; white-space: nowrap; color: var(--muted); }
.keys-list dd { margin: 0; }
.keys-list kbd { margin-left: 0; }
/* гібрид: торкнулися екрана, поки панель відкрита (body.touch ховає kbd) — клавіші лишаються */
body.touch #keys kbd { display: inline-block !important; }
@media (max-width: 520px) { .keys-list { grid-template-columns: 1fr; gap: 2px; } .keys-list dt { text-align: left; } .keys-list dd { margin-bottom: 6px; } }
.keys-panel .menu-actions { margin-top: 18px; }
.bn-top { margin-bottom: 12px; }
.bn-big { font-size: 30px; font-weight: 700; font-family: Georgia, serif; }
.bn-sub { color: var(--muted); }
.bn-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bn-tile { background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.bn-tile span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; }
.bn-tile b { font-size: 26px; font-variant-numeric: tabular-nums; }
.bn-tile small { color: var(--muted); font-size: 12px; }
.bn-cmp { margin: 12px 0 4px; }
.bn-cmp span { color: var(--muted); font-size: 13px; }
.bn-sec { margin: 16px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.bn-sec span { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12px; }
.bn-row { display: grid; grid-template-columns: 190px 1fr 64px 92px; gap: 10px; align-items: center; margin: 4px 0; font-size: 14px; }
.bn-l small { color: var(--muted); }
.bn-bar { position: relative; height: 14px; border-radius: 4px; background: rgba(255,255,255,0.07); overflow: hidden; }
.bn-bar b { position: absolute; left: 0; top: 0; bottom: 0; opacity: 0.85; }
.bn-bar s { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,0.35); }
.bn-bar i { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #6fb6ff; }
.bn-bar u { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
.bn-v { text-align: right; font-variant-numeric: tabular-nums; }
.bn-v.small { color: var(--muted); font-size: 12px; }
.bn-note { margin: 4px 0; }
.bn-note.small { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.bn-note.warn { border-left: 3px solid var(--warn); padding-left: 8px; }
@media (max-width: 640px) {
  .bn-tiles { grid-template-columns: 1fr; }
  .bn-row { grid-template-columns: 1fr 60px; }
  .bn-row .bn-bar { grid-column: 1 / -1; grid-row: 2; }
  .bn-v.small { display: none; }
}

/* ---------- Телефон і планшет (js/touch.js; body.touch — сенсорний режим) ---------- */
.t-only { display: none; }
body.touch .t-only { display: revert; }
body.touch .k-only, body.touch kbd, body.touch #help { display: none !important; }
body.touch .btn, body.touch .chip, body.touch .gtile, body.touch #menu button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.screen > .panel { margin: auto; }

#touch { position: fixed; inset: 0; z-index: 12; touch-action: none; }
#tc-zone { position: absolute; inset: 0; touch-action: none; }
/* джойстик: у спокої — підказка внизу ліворуч, під пальцем — там, де торкнулись */
#tc-stick {
  --r: 58px;
  position: absolute; left: 0; top: 0; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border-radius: 50%; border: 2px solid rgba(255,255,255,0.28); background: rgba(10,16,12,0.22); pointer-events: none;
  transform: translate(calc(var(--r) + 34px + env(safe-area-inset-left)), calc(100vh - var(--r) - 30px - env(safe-area-inset-bottom)));
  transform: translate(calc(var(--r) + 34px + env(safe-area-inset-left)), calc(100dvh - var(--r) - 30px - env(safe-area-inset-bottom)));
  opacity: 0.55; transition: opacity 0.2s;
}
#tc-stick.held { opacity: 1; transition: none; }
#tc-knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(238,240,228,0.55); box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
#tc-stick.run { border-color: var(--accent); }
#tc-stick.run #tc-knob { background: rgba(240,196,106,0.85); }
.tc-btn {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font: inherit; font-size: 22px; line-height: 1; color: var(--text); border-radius: 50%;
  background: rgba(10,16,12,0.5); border: 1px solid rgba(255,255,255,0.22); touch-action: none; -webkit-tap-highlight-color: transparent;
}
.tc-btn small { font-size: 10px; color: var(--muted); }
.tc-btn:active, .tc-btn.active { background: rgba(216,166,74,0.35); border-color: var(--accent); }
.tc-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); display: flex; gap: 10px; }
.tc-top .tc-btn { position: static; width: 46px; height: 46px; font-size: 20px; }
#tc-crouch { width: 64px; height: 64px; right: calc(26px + env(safe-area-inset-right)); bottom: calc(118px + env(safe-area-inset-bottom)); }
#tc-inspect {
  width: 92px; height: 92px; right: calc(98px + env(safe-area-inset-right)); bottom: calc(28px + env(safe-area-inset-bottom)); font-size: 30px;
  background: rgba(216,166,74,0.4); border-color: var(--accent-2); animation: tcPulse 1.2s ease-in-out infinite;
}
#tc-inspect small { color: var(--text); }
@keyframes tcPulse { 50% { box-shadow: 0 0 0 8px rgba(240,196,106,0.18); } }
/* «Око грибника» (MOB-6, js/eye.js): кнопка над «Присісти» (сенсорний шар) і чип над мапою (комп'ютер): кільце
   відновлення заряду (--eye-p: 0…1, повне — заряди повні), число зарядів, без заряду — притьмарено */
.eye-btn { --eye-p: 1; }
.eye-btn::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--accent-2) calc(var(--eye-p) * 360deg), rgba(255,255,255,0.12) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
}
.eye-btn > b {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; color: #1a1408; background: var(--accent-2);
}
.eye-btn.empty { opacity: 0.7; }
.eye-btn.empty > b { background: rgba(238,240,228,0.5); }
.eye-btn.nope { animation: eyeNope 0.35s; }
/* +1 заряд: «+1» вилітає з бейджа вгору й гасне, бейдж спалахує */
.eye-plus {
  position: absolute; top: -20px; right: -14px; font-style: normal; font-size: 16px; font-weight: 800; color: #fff;
  text-shadow: 0 0 6px rgba(240,196,106,0.95), 0 1px 3px rgba(0,0,0,0.9); pointer-events: none; opacity: 0;
}
.eye-btn.gain .eye-plus { animation: eyePlus 1.3s ease-out; }
.eye-btn.gain > b { animation: eyeBadge 0.9s ease-out; }
@keyframes eyePlus { 0% { opacity: 0; transform: translateY(4px) scale(0.8); } 15% { opacity: 1; transform: translateY(-4px) scale(1.15); } 100% { opacity: 0; transform: translateY(-30px) scale(1); } }
@keyframes eyeBadge { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(240,196,106,0.9); } 30% { transform: scale(1.35); } 100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(240,196,106,0); } }
@keyframes eyeNope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
#tc-eye { width: 56px; height: 56px; right: calc(30px + env(safe-area-inset-right)); bottom: calc(196px + env(safe-area-inset-bottom)); }
/* низький ландшафт (ревю 2026-10-12, R1): над «Присісти» верх Ока = висота − 252 − нижній відступ і заходить на ряд паузи
   (до 58 px) уже нижче ~339 px (iPhone з Face ID, нижній відступ 21) — тоді Око ліворуч від «Присісти», над «Роздивитись» */
@media (max-height: 339px) { #tc-eye { right: calc(100px + env(safe-area-inset-right)); bottom: calc(132px + env(safe-area-inset-bottom)); } }
#eye-chip {
  position: absolute; right: 64px; bottom: 184px; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1;
  background: rgba(10,16,12,0.5); border: 1px solid rgba(255,255,255,0.22);
}
body.touch #eye-chip { display: none; }
#eye-note {
  position: absolute; left: 50%; top: 58px; transform: translateX(-50%); padding: 6px 14px; border-radius: 10px;
  background: rgba(10,16,12,0.6); border: 1px solid rgba(240,196,106,0.5); color: var(--text); font-size: 15px;
  white-space: nowrap; opacity: 0; transition: opacity 0.6s;
}
#eye-note.on { opacity: 1; transition: opacity 0.25s; }
body.touch #eye-note { top: calc(50px + env(safe-area-inset-top)); }
@media (orientation: portrait) { body.touch #eye-note { top: calc(104px + env(safe-area-inset-top)); } } /* планшет: табло й компас вгорі */
#eye-veil {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 45%, rgba(4,8,4,0.55) 100%);
}
#eye-veil.on { animation: eyeVeil 1.1s ease-out; }
@keyframes eyeVeil { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #eye-veil.on { animation-duration: 0.4s; } .eye-btn.nope { animation: none; } .eye-btn.gain .eye-plus { animation: eyePlusFade 1.6s; } .eye-btn.gain > b { animation: none; } }
@keyframes eyePlusFade { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
#tc-stick.ghost { opacity: 1; }

/* Онбординг сенсорного керування (js/ui/coach.js): оверлей над шаром #touch пропускає дотики, картка — ні */
#coach { position: fixed; inset: 0; z-index: 13; pointer-events: none; }
#coach-ring {
  position: fixed; border: 2px solid var(--accent-2); box-shadow: 0 0 0 100vmax rgba(4,8,5,0.58), 0 0 18px rgba(240,196,106,0.45);
  transition: left 0.35s, top 0.35s, width 0.35s, height 0.35s, border-radius 0.35s;
}
#coach-hand {
  position: fixed; left: 0; top: 0; width: 64px; height: 84px; margin: -2px 0 0 -26px; transform-origin: 26px 2px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); will-change: transform, opacity;
}
#coach-ripple, #coach-tap {
  position: fixed; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  border: 3px solid var(--accent-2); opacity: 0; transform: scale(0.4);
}
#coach-ripple.on, #coach-tap.on { animation: coachRipple 0.6s ease-out; }
@keyframes coachRipple { 0% { opacity: 0.9; transform: scale(0.4); } 100% { opacity: 0; transform: scale(1.5); } }
#coach-tags span {
  position: fixed; transform: translateX(-50%); padding: 1px 4px; border-radius: 8px; white-space: nowrap;
  font-size: 10px; color: var(--text); background: rgba(10,16,12,0.72);
}
#coach-card {
  position: fixed; pointer-events: auto; width: min(360px, calc(100vw - 32px)); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
#coach-card.at-left { left: calc(16px + env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); width: min(360px, 42vw); }
#coach-card.at-left.up { top: calc(14px + env(safe-area-inset-top)); transform: none; } /* «Знайдіть гриб»: місце джойстика вільне */
#coach-card.at-right { right: calc(16px + env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); width: min(360px, 42vw); }
#coach-card.at-top { left: 16px; right: 16px; margin: 0 auto; top: calc(16px + env(safe-area-inset-top)); }
#coach-card.at-bottom { left: 16px; right: 16px; margin: 0 auto; bottom: calc(16px + env(safe-area-inset-bottom)); }
:is(#coach-card, #icoach-card) h3 { font-size: 20px; }
:is(#coach-card, #icoach-card) p { margin: 0; line-height: 1.4; color: var(--muted); }
.coach-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
:is(#coach-dots, .coach-dots) { display: flex; gap: 6px; }
:is(#coach-dots, .coach-dots) i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.22); }
:is(#coach-dots, .coach-dots) i.past { background: var(--accent); }
:is(#coach-dots, .coach-dots) i.now { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(240,196,106,0.25); }
:is(#coach-ok, .coach-ok) { color: var(--good) !important; font-weight: 600; }
:is(#coach-ok, .coach-ok):empty { display: none; }
:is(#coach-ok, .coach-ok).hint { color: var(--accent-2) !important; }
.coach-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.coach-btns .btn { touch-action: manipulation; }
@media (max-height: 420px) { #coach-card { padding: 12px 14px; gap: 6px; } #coach-card h3 { font-size: 17px; } #coach-card p { font-size: 14px; } }
/* клавіатура й миша (ADR-105, #coach.keys): місце картки й колонки — coach.js layoutKeys (інлайн); сенсорного шару тут немає */
#coach:not(.keys) :is(#coach-cross, #coach-help, #coach-kbd, #coach-lock, #coach-note) { display: none; }
#coach.keys #coach-hand, #coach.keys #coach-tags { display: none; }
#coach-cross { position: fixed; }
:is(#crosshair, #coach-cross) {
  left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: rgba(255,255,255,0.75); box-shadow: 0 0 3px rgba(0,0,0,0.8); transition: all 0.12s;
}
:is(#crosshair, #coach-cross).active { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: transparent; border: 1.5px solid rgba(240,196,106,0.85); box-shadow: 0 0 6px rgba(0,0,0,0.6); }
#coach-help { position: fixed; z-index: 1; }
:is(#help, #coach-help) {
  bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--muted);
  background: rgba(10,16,12,0.5); padding: 7px 14px; border-radius: 8px;
  /* в один рядок, а вужче за нього — переноситься в межах екрана (REV-6c) */
  width: max-content; max-width: calc(100% - 32px); text-align: center;
}
/* підказка кроку в центрі (місце — coach.js layoutKeys): клавіші з підписами дій, малюнок за data-art, підпис збоку */
#coach-kbd {
  position: fixed; left: 50%; top: 60%; display: flex; align-items: center; gap: 18px; padding: 14px 18px;
  border-radius: 16px; background: rgba(10,16,12,0.6);
}
#coach-keys { display: grid; grid-auto-columns: minmax(44px, auto); gap: 6px 8px; justify-items: center; align-items: start; }
#coach-keys .ck { display: flex; flex-direction: column; align-items: center; gap: 5px; }
#coach-keys .ck b {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; box-sizing: border-box; border-radius: 8px;
  font: 600 16px/1 ui-monospace, Menlo, monospace; color: var(--text);
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); border-bottom-width: 3px;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
#coach-keys .ck b.arr { font: 22px/1 system-ui, sans-serif; }
#coach-keys .ck.plus b { min-width: 0; padding: 0; background: none; border: 0; color: var(--muted); }
#coach-keys .ck i { font-style: normal; font-size: 13px; color: var(--text); white-space: nowrap; text-shadow: 0 1px 3px #000; }
#coach-keys .ck.demo b { background: rgba(240,196,106,0.32); border-color: var(--accent-2); transform: translateY(2px); }
#coach-keys .ck.on b { background: rgba(143,207,106,0.4); border-color: var(--good); transform: translateY(2px); }
#coach-side { font-size: 15px; color: var(--text); white-space: nowrap; text-shadow: 0 1px 3px #000; }
#coach-kbd > svg, #coach-mouse { display: none; }
#coach-kbd:is([data-art="look"], [data-art="click"]) #coach-mouse, #coach-kbd[data-art="torch"] #coach-torch, #coach-kbd[data-art="eye"] #coach-eyeart { display: block; }
#coach-kbd[data-art="look"] #coach-mouse { margin: 14px 18px; } /* стрілки довкола */
#coach-torch { width: 180px; height: 81px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
#coach-torch .beam { opacity: 0; transition: opacity 0.25s; }
#coach-torch.on .beam { opacity: 0.55; }
#coach-torch.on .sw { fill: var(--accent-2); }
#coach-eyeart { width: 72px; height: 40px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6)); }
#coach-eyeart .ln { stroke: #e9e4d6; transition: stroke 0.25s; }
#coach-eyeart .fl { fill: #e9e4d6; transition: fill 0.25s; }
#coach-eyeart.on .ln { stroke: var(--accent-2); }
#coach-eyeart.on .fl { fill: var(--accent-2); }
#coach-note {
  position: fixed; left: 0; right: 0; text-align: center; font-size: 16px; color: var(--accent-2); text-shadow: 0 1px 4px #000;
}
#coach-ring.spot { border: 0; box-shadow: 0 0 0 100vmax rgba(4,8,5,0.5); transition: none; } /* світла пляма в центрі кадру, без обводки */
#coach.keys #coach-card h3 { font-size: 18px; }
#coach.keys #coach-card p { font-size: 14px; }
@media (max-height: 420px) { #coach.keys #coach-card h3 { font-size: 16px; } #coach.keys #coach-card p { font-size: 13px; } }
#coach-card .coach-btns kbd { opacity: 0.8; }
#coach-mouse { position: relative; width: 52px; height: 76px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); will-change: transform; }
#coach-mouse svg { display: block; width: 100%; height: 100%; }
#coach-mouse.click .lmb { fill: var(--accent-2); }
#coach-mouse .ar { position: absolute; font: 13px/1 sans-serif; font-style: normal; color: var(--accent-2); display: none; }
#coach-kbd[data-art="look"] #coach-mouse .ar { display: block; }
#coach-mouse .ar.l { left: -18px; top: calc(50% - 6px); } #coach-mouse .ar.r { right: -18px; top: calc(50% - 6px); }
#coach-mouse .ar.u { left: calc(50% - 6px); top: -17px; } #coach-mouse .ar.d { left: calc(50% - 6px); bottom: -17px; }
#coach-ring.aim { border-color: var(--good); box-shadow: 0 0 0 100vmax rgba(4,8,5,0.58), 0 0 18px rgba(143,207,106,0.55); }
#coach.keys #coach-card { overflow-y: auto; } /* низьке вікно: maxHeight — до клавіш (layoutKeys), текст прокручується (ревю) */
#coach-lock { color: var(--accent-2) !important; }

/* Онбординг огляду гриба (js/ui/inspectCoach.js, ADR-103): шар на всю рамку огляду (затемнення кільця — у межах рамки,
   overflow: hidden), жести проходять на полотно, картка — ні. Усе — absolute: #inspect з backdrop-filter — контейнер і для fixed */
#btn-icoach {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  font-size: 17px; font-weight: 700; background: rgba(0,0,0,0.35);
}
#inspect.coaching #btn-icoach, #inspect.coaching .inspect-tip { visibility: hidden; }
.inspect-tip { max-width: calc(100% - 128px); } /* «?» праворуч угорі — підказка по центру його не накриває (ревю) */
#icoach { position: absolute; inset: 0; pointer-events: none; }
#icoach-ring {
  position: absolute; border: 2px solid var(--accent-2); border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(4,8,5,0.5), 0 0 18px rgba(240,196,106,0.45);
  transition: left 0.35s, top 0.35s, width 0.35s, height 0.35s, border-radius 0.35s;
}
#icoach-finger, #icoach-mouse { position: absolute; left: 0; top: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); will-change: transform, opacity; }
#icoach-finger { width: 64px; height: 84px; margin: -2px 0 0 -26px; transform-origin: 26px 2px; }
#icoach-mouse { width: 34px; height: 46px; margin: -2px 0 0 -2px; transform-origin: 2px 2px; }
#icoach-ripple {
  position: absolute; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  border: 3px solid var(--accent-2); opacity: 0; transform: scale(0.4);
}
#icoach-ripple.on { animation: coachRipple 0.6s ease-out; }
#icoach-card {
  position: absolute; left: 12px; top: 12px; pointer-events: auto; width: min(340px, calc(100% - 24px)); padding: 14px 16px; /* місце й ширина — inspectCoach.js layout */
  display: flex; flex-direction: column; gap: 7px; max-height: calc(100% - 24px); overflow-y: auto; /* картка — у крайньому разі */
}
#icoach-card > * { flex: none; }
/* низька картка (над панеллю кнопок, layout) — прокручується лише текст, «Далі» видно завжди */
#icoach-card > #icoach-text { flex: 0 1 auto; min-height: 2.7em; overflow-y: auto; }
#icoach-card > #icoach-ok { flex: 0 1 auto; min-height: 1.35em; overflow-y: auto; }
#icoach-card p { font-size: 15px; }
#icoach-card .coach-btns { flex-wrap: nowrap; }
#icoach-card .coach-btns .btn { padding: 10px 16px; flex: none; white-space: nowrap; } /* один ряд: картка не вужча за ряд кнопок (layout) */
@media (max-height: 340px) { #icoach-card .coach-head { display: none; } } /* 640×300: місце тексту, «Далі» — у картці */
@media (max-height: 420px) { #icoach-card { padding: 10px 12px; gap: 5px; } #icoach-card h3 { font-size: 16px; } #icoach-card p { font-size: 13px; line-height: 1.35; } }

/* HUD на телефоні: із запасом від вирізу екрана, кнопки не перекривають сповіщення */
body.touch #stats { top: calc(12px + env(safe-area-inset-top)); left: calc(12px + env(safe-area-inset-left)); }
body.touch #compass { top: calc(12px + env(safe-area-inset-top)); max-width: 34vw; }
body.touch #minimap { right: auto; bottom: auto; left: calc(12px + env(safe-area-inset-left)); top: calc(78px + env(safe-area-inset-top)); width: 120px; height: 120px; }
body.touch #map-canvas { width: min(74vh, 74vw); height: min(74vh, 74vw); }
body.touch #toasts { top: calc(68px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); }
body.touch #inspect { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
body.touch .inspect-btns .btn { padding: 14px 22px; font-size: 17px; }
body.touch .settings input[type=range] { height: 44px; margin: 0; }
/* Цілі натискання ≥ 44 CSS px на телефоні й планшеті поза колекцією (задача 18; ADR-098 п.5 — орієнтир; #guide — свої
   правила COL-10, глобальні тут його не чіпають). Кнопки, чипи й варіанти меню — не нижчі за 44 px (на 2–11 px вищі, ніж
   з мишею; <button> центрує вміст сам); мова й посилання акаунта — невидима зона (вигляд шапки той самий: ::after з
   полями min(0px, 50% − 22px) розширює зону до 44 і не зменшує більшу). Десктоп без дотику — без змін. Перевірка —
   D.touchScreens() / D.touchTargets() (TESTING «Цілі натискання») */
body.touch :is(.btn, .chip):not(#guide *) { min-width: 44px; min-height: 44px; }
body.touch #menu .mlang .chip { position: relative; min-height: 0; }
body.touch #menu .mset-lang .mlang .chip { min-height: 44px; } /* у ⚙ — справжні 44, як чипи якості */
body.touch #menu .mlang .chip::after {
  content: ''; position: absolute; top: min(0px, calc(50% - 22px)); bottom: min(0px, calc(50% - 22px));
  left: min(0px, calc(50% - 22px)); right: min(0px, calc(50% - 22px));
}
body.touch .account a { display: inline-block; padding: 14px 4px; margin: -14px -4px; }
/* меню (MENU-2): стрілки, рисочки (зони ::after не перекриваються), ⚙, чип, сегменти тривалості — ≥ 44 */
body.touch #menu .marw { width: 44px; height: 44px; margin-top: -22px; }
body.touch #menu .mdots { gap: 34px; }
body.touch #menu .mdots button::after { inset: -19px -17px; }
@media (orientation: landscape) and (max-height: 500px) {
  body.touch #menu .mdots button::after { inset: -30px -17px -8px; } /* рисочки біля нижнього краю екрана — зона вгору */
}
body.touch #menu .mib, body.touch #menu .mcol-chip { min-width: 44px; min-height: 44px; }
body.touch #menu .mib { width: max(44px, calc(38 * var(--u))); height: max(44px, calc(38 * var(--u))); } /* великий сенсорний екран — у масштабі розкладки */
body.touch #menu .mseg { min-height: max(44px, calc(34 * var(--u))); }
body.touch #menu .mstart { min-height: 44px; }
body.touch #menu .mtop { min-height: 44px; }
body.touch #menu .mdur.n5 { gap: 1px; padding-inline: 2px; } /* п'ять сегментів у колонці ≈ 230 px — кожен ≥ 44 */
/* телефон (портрет і ландшафт): вигляд — як у макеті (🔊, ⚙, чип — 38, сегменти тривалості — 34, шапка — 40), зона дотику
   44 — невидимим ::before (::after ⚙ зайнятий позначкою «сесія скінчилась») */
@media (orientation: portrait) and (max-width: 699.98px), (orientation: landscape) and (max-height: 500px) {
  body.touch #menu .mn .mtop { min-height: 40px; }
  body.touch #menu .mn .mtop .mib { width: 38px; height: 38px; min-width: 0; min-height: 0; position: relative; }
  body.touch #menu .mn .mtop .mcol-chip { min-width: 0; min-height: 38px; position: relative; }
  body.touch #menu .mn .mdur .mseg { min-height: 34px; position: relative; }
  body.touch #menu .mn .mtop .mib::before, body.touch #menu .mn .mtop .mcol-chip::before { content: ''; position: absolute; inset: -4px; } /* від краю рамки (1 px): 38 − 2 + 8 = 44 */
  body.touch #menu .mn .mdur .mseg::before { content: ''; position: absolute; inset: -5px 0; }
}
@media (orientation: landscape) and (max-height: 360px) {
  body.touch #menu .mn .mtop { min-height: 38px; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  body.touch #menu .mn .mtop .mcol-chip { min-width: 38px; justify-content: center; } /* лише кільце — коло 38: зона 38 − 2 + 8 = 44 */
}

/* Низький екран (телефон горизонтально) */
@media (max-height: 520px) {
  .screen { --pad: 8px; }
  .panel { padding: 14px 16px; }
  section { margin-top: 8px; }
  section h3 { font-size: 12px; margin-bottom: 5px; }
  .menu-actions { margin-top: 12px; }
  .stat { padding: 4px 10px; min-width: 64px; }
  .stat span:last-child { font-size: 17px; }
  .stat .label { font-size: 9.5px; }
  #compass { height: 26px; }
  #compass-strip span { top: 4px; }
  body.touch #minimap { top: calc(56px + env(safe-area-inset-top)); width: 92px; height: 92px; } /* MOB-1: менша частка кадру */
  .toast { min-width: 0; max-width: 300px; padding: 7px 11px; }
  .toast .td { font-size: 12px; }
  .inspect-bar { padding: 8px 12px; }
  .inspect-q { font-size: 16px; }
  .inspect-tip { top: 8px; font-size: 12px; }
  .rules { margin: 6px 0 8px; line-height: 1.4; font-size: 14px; }
  .rules li { margin: 3px 0; }
  .ready-panel h2 { font-size: 20px; }
  .ready-setup { margin-bottom: 8px; }
  .setup-tip { padding: 6px 10px; font-size: 13px; }
  #btn-go { padding: 11px 24px; font-size: 16px; }
  .pause-grid { grid-template-columns: 220px 1fr; gap: 14px; margin-top: 8px; }
  .pause-col { gap: 7px; }
  .pause-col .btn { padding: 9px 14px; }
  .basket-list { max-height: 220px; }
}
@media (max-width: 760px), (max-height: 520px) {
  /* колекція на телефоні (COL-10): панель на весь екран без подвійних полів (безпечні відступи — поле екрана), прокручується
     вся панель; липка шапка — рядки 1 і 2 (портрет) чи лише рядок 1 (ландшафт, нижче); дії — під шапкою, прокручуються;
     --gx — бічне поле */
  #guide { --pad: 0px; }
  .guide-panel { --gx: 16px; width: 100%; display: block; overflow-y: auto; padding: 0 var(--gx) 16px; border: 0; border-radius: 0; overscroll-behavior: contain; }
  .guide-top { display: contents; }
  .guide-head { position: sticky; top: 0; z-index: 3; display: block; margin: 0 calc(-1 * var(--gx)); padding: 8px var(--gx); background: var(--panel-solid); border-bottom: 1px solid var(--line); }
  .guide-row1 { gap: 8px; }
  .guide-row1 h2 { font-size: 20px; }
  /* вкладки на місці назви (назва — для читачів екрана) */
  .guide-row1:has(#col-tabs:not(.hidden)) h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .col-tabs .chip { padding: 0 12px; }
  .col-prog { flex: 1; justify-content: flex-end; gap: 8px; }
  .col-prog .cnt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* повний — для читачів екрана */
  .col-prog .cnt-s { display: inline; color: var(--text); font-weight: 600; }
  /* смужка — на всю ширину по нижньому краю липкої шапки (портрет — .guide-head, ландшафт — рядок 1: обидва sticky, тож
     блок для absolute) */
  .col-bar { position: absolute; left: 0; right: 0; bottom: -1px; width: auto; min-width: 0; border-radius: 0; background: rgba(255,255,255,0.06); }
  .col-prog { white-space: nowrap; }
  #btn-guide-close { padding: 0 12px; }
  #btn-guide-close kbd { display: none; }
  .guide-tools { margin-top: 8px; flex-wrap: nowrap; gap: 8px; }
  #guide.searching .guide-tools { flex-wrap: wrap; }
  .col-seg { flex: 1 1 auto; min-width: 0; }
  .col-seg .chip { flex: 1 1 auto; padding: 0 8px; }
  .col-fbtn { flex: none; position: relative; min-width: 44px; padding: 0 10px; justify-content: center; }
  .col-fbtn .lb { display: none; }
  .col-fbtn .fn { position: absolute; top: -4px; right: -4px; }
  .col-sbtn { flex: none; display: inline-flex; width: 44px; min-height: 44px; padding: 0; align-items: center; justify-content: center; }
  .col-search { display: none; }
  #guide.searching .col-search { display: flex; flex: 1 1 100%; min-width: 0; max-width: none; }
  .col-acts { justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
  .col-body { display: block; }
  .col-pop, .col-pop.col-rules { position: fixed; z-index: 22; inset: auto 0 0 0; width: auto; max-height: 78dvh; border-radius: 16px 16px 0 0; border-width: 1px 0 0;
    padding: 10px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .col-scrim { display: block; position: fixed; z-index: 21; inset: 0; background: rgba(0,0,0,0.55); touch-action: none; } /* свайп по тлу не прокручує альбом */
  .col-pop-foot { --sb: max(16px, env(safe-area-inset-bottom)); bottom: calc(-1 * var(--sb)); margin-bottom: calc(-1 * var(--sb)); padding-bottom: var(--sb); } /* нижнє поле аркуша — безпечна зона */
  .guide-grid { overflow: visible; padding-right: 0; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); } /* 375 px — дві колонки */
  .col-recent-row { gap: 10px; grid-auto-columns: 8.5rem; }
  .col-detail { overflow: visible; }
  .col-detail-top { margin: 0 calc(-1 * var(--gx)); padding: 8px var(--gx); }
  #guide.top #col-top { overflow: visible; }
  .col-top-table td, .col-top-table th { padding: 6px 6px; }
}
/* вузький телефон у портреті: «Закрити» — значком ✕ (ім'я — для читачів екрана) */
@media (max-width: 420px) {
  #btn-guide-close { width: 44px; padding: 0; }
  #btn-guide-close .lb { display: none; }
  #btn-guide-close .x { display: inline; }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* колекція: липкий лише рядок 1 (назва / вкладки, прогрес, «Закрити»), стан і пошук — з альбомом */
  .guide-head { display: contents; }
  .guide-row1 { position: sticky; top: 0; z-index: 3; margin: 0 calc(-1 * var(--gx)); padding: 6px var(--gx); background: var(--panel-solid); border-bottom: 1px solid var(--line); }
  .col-prog .cnt { display: inline; }
  .col-prog .cnt-s { display: none; }
  .guide-tools { margin-top: 10px; flex-wrap: wrap; }
  .col-seg, .col-seg .chip { flex: none; }
  .col-pop, .col-pop.col-rules { max-height: calc(100dvh - 24px); } /* аркуш — майже на весь низький екран */
  .col-seg .chip { padding: 0 14px; }
  .col-fbtn { padding: 0 14px; }
  .col-fbtn .lb { display: inline; }
  .col-fbtn .fn { position: static; }
  .col-sbtn { display: none; }
  .col-search, #guide.searching .col-search { display: flex; flex: 1 1 200px; }
  /* мапа: легенда стовпцем праворуч (під мапою в кілька рядків лист вищий за екран; у портреті ширини на стовпець
     немає — там лист з легендою під мапою; KI-192) */
  .map-sheet { width: auto; display: grid; grid-template-columns: auto auto; column-gap: 14px; }
  .map-head { grid-column: 1 / -1; }
  .map-legend { flex-direction: column; flex-wrap: nowrap; justify-content: flex-end; margin-top: 0; }
}
@media (max-width: 760px) and (orientation: landscape) {
  .pause-grid { grid-template-columns: 1fr 1fr; }
}
/* Телефон вертикально: табло зверху на всю ширину, під ним компас ліворуч і кнопки праворуч */
@media (orientation: portrait) {
  body.touch #compass { top: calc(66px + env(safe-area-inset-top)); left: calc(12px + env(safe-area-inset-left)); transform: none; width: 44vw; max-width: 44vw; }
  body.touch .tc-top { top: calc(62px + env(safe-area-inset-top)); }
  body.touch #minimap { top: calc(110px + env(safe-area-inset-top)); }
  body.touch #toasts { top: calc(118px + env(safe-area-inset-top)); left: 12px; align-items: stretch; }
}

/* «Поверніть телефон» (MOB-1, ADR-090): гра на телефоні в портреті (MODES.rotate → body.rotate-on, body.phone — main.js) —
   поверх усього, дотики ковтає (і ті 0,5 с, поки ще прозорий); гра під ним стоїть (режим portrait, loop.js). З'являється із
   затримкою: Android за цей час сам повертає екран («Вирушити» — повний екран і orientation.lock). «Вийти в меню» — крім дії
   (body.rotate-wait). Значок — телефон набік */
#rotate { display: none; }
@media (orientation: portrait) {
  body.phone.touch.rotate-on #rotate {
    position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    background: var(--panel-solid); color: var(--text); text-align: center; touch-action: none;
    animation: rotate-in 0.2s ease-out 0.5s both;
  }
}
#rotate h2 { font-size: 24px; margin: 6px 0 0; }
#rotate p { font-size: 16px; line-height: 1.45; max-width: 300px; margin: 0; color: var(--muted); }
#btn-rotate-menu { margin-top: 14px; touch-action: manipulation; }
body.rotate-wait #btn-rotate-menu { visibility: hidden; }
.rotate-icon { width: 120px; height: 120px; }
.rotate-phone { fill: none; stroke: var(--accent); stroke-width: 4; transform-origin: 48px 41px; animation: rotate-phone 2.4s ease-in-out infinite; }
.rotate-arrow { fill: none; stroke: var(--accent-2); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
@keyframes rotate-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rotate-phone { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .rotate-phone { animation: none; transform: rotate(-90deg); } }
/* Поворот застряг (MOB-7, ADR-107; MOB-10; body.rotate-stuck — js/ui/stuck.js rotWatch): другий вигляд — «Екран не
   повертається?» і дії виходу в браузер; на низькому екрані — менший значок і прокрутка (safe center: верх не зрізано) */
.rs-stuck { display: none; }
body.rotate-stuck #rotate .rs-normal { display: none; }
body.rotate-stuck #rotate h2.rs-stuck, body.rotate-stuck #rotate p.rs-stuck, body.rotate-stuck #rotate div.rs-stuck { display: block; }
/* центр без обрізання верху (safe center Safari до 17.6 не виконує): від початку, поля auto першого й останнього */
@media (orientation: portrait) {
  body.phone.touch.rotate-on.rotate-stuck #rotate { justify-content: flex-start; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
  body.phone.touch.rotate-on.rotate-stuck #rotate > :first-child { margin-top: auto; }
  body.phone.touch.rotate-on.rotate-stuck #rotate > :last-child { margin-bottom: auto; }
}
body.rotate-stuck .rotate-icon { width: 84px; height: 84px; flex: none; }
#rotate-escape { width: 100%; max-width: 340px; }
/* копія в оверлеї звичайного браузера (вбудований — компонент воріт нижче, MOB-10): «Копіювати посилання», адреса — поле,
   якщо буфер обміну недоступний */
.esc-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.esc-row .btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.esc-url { display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.06); color: var(--text); font: inherit; font-size: 13px;
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; } /* body.touch вимикає виділення — тут адресу копіюють довгим натисканням */
/* Ворота вбудованого браузера (MOB-9, ADR-108; js/ui/gate.js; селектори кнопок — сильніші за body.touch :is(.btn…)): один екран без прокрутки від 320×568 — знак гри, одне
   речення, головна кнопка виходу (≥ 56 px), «або», схема меню «⋯» з одним рядком підпису, «Копіювати посилання»
   (текстом, ≥ 44 px). Кнопки виходу немає (.no-go) — схема головна (вища, підпис більшим), копія — кнопка з рамкою.
   Схема (.hw-wrap > .hw) — міні-екран вбудованого браузера: смуга застосунку (✕, адреса, «⋯»), сторінка, шар меню
   (.hw-menu, вигляд — .hw-<menu>), шар браузера (.hw-done); цілі кроків — .hw-t1 (⋯ / «Копіювати»), .hw-t2 (пункт меню /
   значок Safari), .hw-t3 («Вставити»). Стани — s1 · s2 · s3 (статичні кадри), .anim — ті самі стани в циклі --hw-t;
   #gate.rm (prefers-reduced-motion — gate.js) — три пронумеровані кадри поруч замість анімації */
#gate {
  background:
    radial-gradient(ellipse at 50% 110%, rgba(216,166,74,0.16), transparent 60%),
    linear-gradient(180deg, #13241a 0%, #0b140e 100%);
}
#gate .gate-box { width: 100%; max-width: 420px; margin: auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
.gate-brand { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); letter-spacing: 0.3px; }
.gate-logo { font-size: 17px; line-height: 1; }
#gate .gate-title { margin: 0 0 4px; font-size: 23px; line-height: 1.22; color: var(--text); text-wrap: balance; overflow-wrap: anywhere; }
:is(#gate, #rotate) a.btn.gate-go { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 12px 18px; border-radius: 14px; font-size: 18px; text-decoration: none; }
.gate-or { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gate-how { margin: 4px 0 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gate-cap { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text); }
.no-go .gate-cap { font-size: clamp(15px, 4.6vw, 18px); } /* один рядок і на 320 px */
.gate-copy:not(.btn) { align-self: center; min-height: 44px; min-width: 44px; padding: 8px 14px; border: 0; background: none; color: var(--accent-2); font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:is(#gate, #rotate) button.btn.gate-copy { width: 100%; min-height: 50px; font-size: 16px; }
:is(#gate, #rotate) .gate-copy ~ .esc-url { margin-top: 0; }
/* схована для очей область екранного читача (role=status «Скопійовано ✓», ui/escape.js copyAction): поза потоком flex */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:is(#gate, #rotate) .gate-steps { display: none; }
:is(#gate, #rotate).rm .gate-steps { display: flex; justify-content: center; gap: 10px; width: 100%; padding-top: 8px; }
:is(#gate, #rotate).rm .gate-how > .hw-wrap { display: none; }

.hw-wrap { position: relative; width: min(100%, 300px); }
.no-go .hw-wrap { width: min(100%, 330px); }
.hw { --hw-h: clamp(150px, 33vh, 300px); position: relative; height: var(--hw-h); border-radius: 16px; overflow: hidden; background: var(--hw-page);
  border: 2px solid rgba(255,255,255,0.16); box-shadow: 0 10px 30px rgba(0,0,0,0.45); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-align: left; }
.no-go .hw { --hw-h: clamp(180px, 42vh, 380px); }
.gate-steps .hw-wrap { width: 31%; }
.gate-steps .hw { --hw-h: clamp(120px, 27vh, 230px); border-radius: 10px; }
.no-go .gate-steps .hw { --hw-h: clamp(140px, 34vh, 280px); }
.hw-bar { position: absolute; left: 0; right: 0; top: 0; height: 17%; display: flex; align-items: center; gap: 5%; padding: 0 5%; background: var(--hw-chrome); }
.hw-x { position: relative; flex: none; width: 9%; aspect-ratio: 1; }
.hw-x::before, .hw-x::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px; background: rgba(255,255,255,0.75); transform: rotate(45deg); }
.hw-x::after { transform: rotate(-45deg); }
.hw-url { flex: 1; height: 40%; border-radius: 999px; background: rgba(255,255,255,0.14); }
.hw-dots { position: relative; flex: none; display: flex; align-items: center; justify-content: center; gap: 12%; width: 13%; aspect-ratio: 1; border-radius: 50%; }
.hw-is-popover .hw-dots { background: rgba(255,255,255,0.18); }
.os-android .hw-dots { flex-direction: column; }
.hw-dots > b:not(.hw-tap) { flex: none; width: 3px; height: 3px; border-radius: 50%; background: #fff; }
.hw-page { position: absolute; left: 0; right: 0; top: 17%; bottom: 0; display: flex; flex-direction: column; gap: 9%; padding: 9% 8%; }
.hw-page > i { display: block; height: 6%; border-radius: 4px; background: rgba(255,255,255,0.09); }
.hw-page > i:nth-child(1) { width: 55%; height: 9%; background: rgba(216,166,74,0.28); }
.hw-page > i:nth-child(3) { width: 75%; }
.hw-pill { position: relative; align-self: center; margin-top: auto; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #1a1408; font-size: 11px; font-weight: 700; white-space: nowrap; }

.hw-menu, .hw-done { position: absolute; opacity: 0; visibility: hidden; }
.hw-menu { display: flex; flex-direction: column; color: var(--hw-ink); }
.hw-popover { top: 15%; right: 3%; width: 76%; bottom: 8%; padding: 2% 0; border-radius: 12px; background: var(--hw-sheet); box-shadow: 0 8px 24px rgba(0,0,0,0.5); transform-origin: 92% 0; --hw-from: scale(0.5); }
.hw-generic { top: 3%; right: 3%; width: 74%; height: 70%; padding: 2% 0; border-radius: 4px; background: var(--hw-card); box-shadow: 0 6px 20px rgba(0,0,0,0.55); transform-origin: 95% 0; --hw-from: scale(0.5); }
.hw-sheetFb, .hw-sheetList { left: 0; right: 0; bottom: 0; height: 76%; gap: 3%; padding: 2% 4% 3%; border-radius: 14px 14px 0 0; background: var(--hw-sheet); --hw-from: translateY(100%); }
.hw-sheetList { height: 84%; gap: 0; padding-bottom: 2%; }
.hw-copy { inset: 0; align-items: center; justify-content: center; background: linear-gradient(160deg, #36507a, #1b2840); --hw-from: scale(1.15); }
.hw-row { position: relative; flex: 1 1 0; min-height: 0; display: flex; align-items: center; gap: 6%; padding: 0 6%; border-radius: 8px; }
.hw-ic { flex: none; width: 11px; height: 11px; border-radius: 3px; background: var(--hw-mute); }
.hw-ln { flex: none; width: 50%; height: 5px; border-radius: 3px; background: var(--hw-mute); }
.hw-row:nth-child(2n) .hw-ln { width: 36%; }
.hw-bad .hw-ic, .hw-bad .hw-ln { background: var(--hw-bad); opacity: 0.7; }
.hw-popover .hw-bad { border-top: 1px solid rgba(0,0,0,0.12); border-radius: 0; }
.hw-sheetList .hw-row + .hw-row { border-top: 1px solid rgba(0,0,0,0.07); }
.hw-hit { --hw-base: transparent; flex-grow: 1.7; gap: 5%; }
.hw-sv { flex: none; width: 15px; height: 15px; color: var(--hw-ink); }
.hw-lbl { min-width: 0; font-size: 11.5px; line-height: 1.15; font-weight: 600; }
.hw-note { display: block; margin-top: 1px; font-size: 9px; font-weight: 400; color: #6b6b73; }
.hw-handle { flex: none; align-self: center; width: 14%; height: 4px; margin-bottom: 2%; border-radius: 2px; background: rgba(0,0,0,0.2); }
.hw-circles { flex: 0 0 17%; display: flex; justify-content: space-around; align-items: center; }
.hw-circles i { height: 82%; aspect-ratio: 1; border-radius: 50%; background: #e1e1e8; }
.hw-card { --hw-base: var(--hw-card); display: flex; flex-direction: column; flex: 1 1 0; padding: 1% 0; border-radius: 8px; background: var(--hw-card); }
.hw-card.hw-hit { --hw-base: var(--hw-card); flex: 0 0 16%; flex-direction: row; padding: 0 5%; }
.hw-card.hw-sm { flex: 0 0 11%; }
.hw-title { flex: none; margin: 0; padding: 1% 0 3%; text-align: center; font-size: 10px; font-weight: 700; }
.hw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14%; width: 62%; }
.hw-grid > i, .hw-app { aspect-ratio: 1; border-radius: 24%; background: rgba(255,255,255,0.2); }
.hw-app { --hw-base: var(--hw-card); position: relative; display: flex; align-items: center; justify-content: center; background: var(--hw-card); }
.hw-app .hw-sv { width: 82%; height: 82%; }
.hw-done { inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,12,9,0.86); }
.hw-big { width: 34%; max-width: 92px; height: auto; aspect-ratio: 1; color: #8ab4f8; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
.hw-paste { flex-direction: column; justify-content: flex-end; gap: 8px; padding: 0 6% 7%; background: var(--hw-sheet); }
.hw-addr { display: flex; align-items: center; width: 100%; height: 14%; padding: 0 6%; border-radius: 12px; background: var(--hw-card); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.hw-addr i { width: 40%; height: 5px; border-radius: 3px; background: var(--hw-mute); }
.hw-bubble { --hw-base: #2c2c2e; position: relative; padding: 5px 12px; border-radius: 8px; background: #2c2c2e; color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.hw-bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #2c2c2e; }
.hw-tap { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgba(240,196,106,0.55);
  border: 2px solid var(--accent-2); opacity: 0; pointer-events: none; }
.hw-row > .hw-tap { left: 74%; }
.hw-arrow { position: absolute; right: -12px; top: -24px; width: 26px; height: 26px; color: var(--accent-2); opacity: 0; }
.hw-n { position: absolute; left: -6px; top: -9px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #1a1408; font-size: 12px; font-weight: 800; z-index: 1; }
/* три кадри поруч — вужчі: меню ширше, пункт меню без значка й примітки, назва — до трьох рядків */
.gate-steps .hw-popover, .gate-steps .hw-generic { right: 3%; width: 94%; }
.gate-steps .hw-hit { flex-grow: 2.6; padding: 0 4%; }
.gate-steps .hw-hit > .hw-sv, .gate-steps .hw-note { display: none; }
.gate-steps .hw-lbl { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 7px; line-height: 1.1; }
.gate-steps .hw-card.hw-hit { flex: 0 0 24%; } /* без росту .gate-steps .hw-hit: інакше сірі картки стискаються */
.gate-steps .hw-sv { width: 10px; height: 10px; }
.gate-steps .hw-ic { width: 7px; height: 7px; }
.gate-steps .hw-ln { height: 3px; }
.gate-steps .hw-tap { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.gate-steps .hw-pill, .gate-steps .hw-bubble, .gate-steps .hw-title { font-size: 7.5px; padding: 3px 6px; }
.gate-steps .hw-pill { max-width: 92%; white-space: normal; text-align: center; line-height: 1.15; }
.gate-steps .hw-dots > b:not(.hw-tap) { width: 2px; height: 2px; }
.gate-steps .hw-arrow { width: 18px; height: 18px; right: -8px; top: -18px; }
/* стани кроків: s1 — ціль 1 (кільце, дотик, стрілка до справжньої кнопки), s2 — шар меню й ціль 2, s3 — шар браузера */
.hw-wrap.s1 .hw-t1 { box-shadow: 0 0 0 3px var(--accent-2); }
.hw-wrap.s1 .hw-t1 > .hw-tap, .hw-wrap.s2 .hw-t2 > .hw-tap, .hw-wrap.s1 .hw-arrow { opacity: 1; }
.hw-wrap.s2 .hw-menu, .hw-wrap.s3 .hw-done { opacity: 1; visibility: visible; }
.hw-wrap.s2 .hw-t2, .hw-wrap.s3 .hw-t3 { background: var(--hw-hit); box-shadow: inset 0 0 0 2px var(--accent); }
.hw-wrap.anim .hw-t1 { animation: hwRing var(--hw-t) infinite; }
.hw-wrap.anim .hw-t1 > .hw-tap { animation: hwTap1 var(--hw-t) infinite; }
.hw-wrap.anim .hw-arrow { animation: hwArrow var(--hw-t) infinite; }
.hw-wrap.anim .hw-menu { animation: hwMenu var(--hw-t) infinite; }
.hw-wrap.anim .hw-t2 { animation: hwHit var(--hw-t) infinite; }
.hw-wrap.anim .hw-t2 > .hw-tap { animation: hwTap2 var(--hw-t) infinite; }
.hw-wrap.anim .hw-done { animation: hwDone var(--hw-t) infinite; }
.hw-wrap.anim .hw-t3 { animation: hwHit3 var(--hw-t) infinite; }
/* «Вставити» — біла назва на темній бульбашці: підсвітка лише кільцем (світле тло з'їло б текст і відірвало хвостик) */
.hw-wrap.s3 .hw-bubble.hw-t3 { background: #2c2c2e; box-shadow: 0 0 0 2px var(--accent-2); }
.hw-wrap.anim .hw-bubble.hw-t3 { animation-name: hwRing3; }
@keyframes hwRing { 0% { box-shadow: 0 0 0 0 rgba(240,196,106,0.9); } 12% { box-shadow: 0 0 0 8px rgba(240,196,106,0); } 13% { box-shadow: 0 0 0 0 rgba(240,196,106,0.9); }
  25% { box-shadow: 0 0 0 8px rgba(240,196,106,0); } 26%, 100% { box-shadow: 0 0 0 0 rgba(240,196,106,0); } }
@keyframes hwTap1 { 0%, 14% { opacity: 0; transform: scale(1.6); } 19% { opacity: 1; transform: scale(1); } 23% { opacity: 1; transform: scale(0.8); } 28%, 100% { opacity: 0; transform: scale(0.8); } }
@keyframes hwArrow { 0%, 26% { opacity: 1; transform: none; } 13% { opacity: 1; transform: translate(3px, -3px); } 31%, 100% { opacity: 0; transform: none; } }
@keyframes hwMenu { 0%, 27% { opacity: 0; visibility: hidden; transform: var(--hw-from); } 33%, 76% { opacity: 1; visibility: visible; transform: none; }
  81%, 100% { opacity: 0; visibility: hidden; transform: none; } }
@keyframes hwHit { 0%, 40% { background-color: var(--hw-base, transparent); box-shadow: none; } 45%, 76% { background-color: var(--hw-hit); box-shadow: inset 0 0 0 2px var(--accent); }
  80%, 100% { background-color: var(--hw-base, transparent); box-shadow: none; } }
@keyframes hwTap2 { 0%, 50% { opacity: 0; transform: scale(1.6); } 55% { opacity: 1; transform: scale(1); } 59% { opacity: 1; transform: scale(0.8); } 64%, 100% { opacity: 0; transform: scale(0.8); } }
@keyframes hwDone { 0%, 76% { opacity: 0; visibility: hidden; } 81%, 95% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@keyframes hwRing3 { 0%, 83% { box-shadow: 0 0 0 0 rgba(240,196,106,0); } 87%, 95% { box-shadow: 0 0 0 2px var(--accent-2); } 100% { box-shadow: 0 0 0 0 rgba(240,196,106,0); } }
@keyframes hwHit3 { 0%, 83% { background-color: var(--hw-base, transparent); box-shadow: none; } 87%, 95% { background-color: var(--hw-hit); box-shadow: inset 0 0 0 2px var(--accent); }
  100% { background-color: var(--hw-base, transparent); box-shadow: none; } }
/* низький екран (менше ~600 px: 320×568, вбудований браузер з панелями застосунку) — щільніше */
@media (max-height: 620px) {
  #gate .gate-box { gap: 8px; }
  #gate .gate-title { font-size: 21px; margin-bottom: 2px; }
  #gate a.btn.gate-go { min-height: 56px; padding: 10px 16px; }
  .gate-how { gap: 8px; margin-top: 0; }
}
/* низький ландшафт (вбудований браузер, що все ж повернувся: ~844×390…568×320) — два стовпці: ліворуч знак, речення й
   кнопки, праворуч схема з підписом; рядки сітки — під пункти лівого стовпця (порожні — нульові, без проміжків) */
@media (orientation: landscape) and (max-height: 430px) {
  #gate .gate-box { max-width: 760px; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); grid-template-rows: repeat(6, auto);
    align-content: center; align-items: center; gap: 0 22px; }
  #gate .gate-box > * { grid-column: 1; margin-bottom: 8px; }
  #gate .gate-box > .sr-only { margin: -1px; }
  #gate .gate-box > .gate-how { grid-column: 2; grid-row: 1 / 7; margin: 0; gap: 8px; }
  #gate .gate-title { font-size: 20px; }
  .hw, .no-go .hw { --hw-h: clamp(130px, 66vh, 260px); }
  .gate-steps .hw, .no-go .gate-steps .hw { --hw-h: clamp(110px, 44vh, 200px); }
  #gate.rm .gate-steps { padding-top: 6px; }
  .gate-cap, .no-go .gate-cap { font-size: 14px; }
}
/* Вихід в оверлеї «Поверніть телефон» (MOB-10, ADR-108; js/ui/stuck.js fillStuck): вбудований браузер без воріт, екран не
   повернувся за таймером чи датчиком — компонент виходу воріт (exitParts) у компактному вигляді: менший значок, свій
   заголовок і рядок (статичні .rs-stuck сховано), кнопка-здогадка, «або», менша схема, копія; «Вийти в меню» лишається.
   Один екран без прокрутки від 320×568 (низький — ще щільніше) */
body.rotate-stuck #rotate.esc-app > .rs-stuck:not(#rotate-escape) { display: none; }
body.rotate-stuck #rotate.esc-app #rotate-escape { display: flex; flex-direction: column; align-items: stretch; gap: 8px; max-width: 360px; }
body.rotate-stuck #rotate.esc-app .rotate-icon { width: 56px; height: 56px; }
#rotate .esc-title { margin: 0; font-size: 22px; line-height: 1.22; }
#rotate .esc-text { max-width: none; margin: 0 0 2px; font-size: 15px; line-height: 1.35; }
#rotate .gate-or { max-width: none; font-size: 13px; color: var(--muted); }
#rotate .gate-how { margin: 0; gap: 8px; }
#rotate .hw-arrow { display: none; } /* стрілка на «⋯» застосунку — місця над схемою немає (лягала на «або») */
#rotate .hw-wrap { width: min(100%, 250px); }
#rotate .hw { --hw-h: clamp(120px, 24vh, 220px); }
#rotate .no-go .hw-wrap { width: min(100%, 280px); }
#rotate .no-go .hw { --hw-h: clamp(140px, 30vh, 260px); }
#rotate .gate-steps .hw-wrap { width: 31%; }
#rotate .gate-steps .hw { --hw-h: clamp(100px, 20vh, 180px); }
#rotate .gate-cap { font-size: 14.5px; }
#rotate.esc-app #btn-rotate-menu { margin-top: 4px; }
@media (max-height: 620px) {
  body.phone.touch.rotate-on.rotate-stuck #rotate.esc-app { gap: 6px; padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  body.rotate-stuck #rotate.esc-app .rotate-icon { width: 40px; height: 40px; }
  body.rotate-stuck #rotate.esc-app #rotate-escape { gap: 6px; }
  #rotate .esc-title { font-size: 20px; }
  #rotate .esc-text { font-size: 14px; }
  #rotate .hw { --hw-h: clamp(104px, 21vh, 180px); }
  #rotate .gate-steps .hw { --hw-h: clamp(90px, 18vh, 150px); }
  #rotate.esc-app #btn-rotate-menu { margin-top: 0; }
}
/* діагностика виходу ?esc=test (MOB-7, тимчасово; js/ui/escTest.js): поверх меню, прокрутка */
.esct { position: fixed; inset: 0; z-index: 200; overflow-y: auto; padding: max(14px, env(safe-area-inset-top)) 14px 40px; background: var(--panel-solid); color: var(--text); font-size: 14px; }
.esct h2 { margin: 0 0 8px; font-size: 19px; }
.esct h3 { margin: 16px 0 6px; font-size: 15px; }
.esct .esct-btn { display: flex; align-items: center; width: 100%; margin: 6px 0; text-decoration: none; text-align: left; }
.esct-info { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; margin: 6px 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.esct-note { margin: 6px 0; color: var(--muted); overflow-wrap: anywhere; }
.esct-arr { margin: 6px 0; padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.esct-arr.ok { background: rgba(80,180,90,0.25); }
.esct-arr.bad { background: rgba(220,80,60,0.25); }
.esct-paste { min-height: 64px; resize: vertical; }
@media (prefers-reduced-motion: reduce) { .col-bar i { transition: none; } }

/* «Ліс чекає» на телефоні — після загальних правил max-height: 520px (ті самі селектори) */
/* телефон у портреті: поради одна під одною, усе дрібніше — попап влазить без прокрутки (і на iPhone SE з панелями) */
@media (max-width: 520px) {
  #ready { --pad: 10px; }
  .ready-panel { padding: 14px 14px 16px; }
  .ready-panel h2 { font-size: 19px; }
  .ready-panel p { font-size: 13.5px; margin-top: 4px; }
  .ready-panel .rules { margin: 8px 0 10px; padding-left: 18px; line-height: 1.38; font-size: 14px; }
  .ready-panel .rules li { margin: 3px 0; }
  .ready-setup { grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
  .setup-tip { padding: 4px 10px; font-size: 13px; gap: 10px; }
  .bright-anim, .sound-anim { margin: -6px; transform: scale(0.8); }
  #btn-go { padding: 11px 22px; font-size: 16px; }
}
/* низький ландшафт (iPhone SE з панелями Safari, ~320 px): анімації менші, відступи щільніші */
@media (max-height: 380px) {
  .ready-panel { padding: 10px 14px 12px; }
  .ready-panel h2 { font-size: 18px; }
  .ready-panel p { margin-top: 2px; font-size: 13.5px; }
  .ready-panel .rules { margin: 6px 0 8px; font-size: 13.5px; line-height: 1.32; }
  .ready-panel .rules li { margin: 2px 0; }
  .ready-setup { margin-bottom: 10px; }
  .setup-tip { padding: 2px 10px; }
  .bright-anim, .sound-anim { margin: -6px; transform: scale(0.8); }
  #btn-go { padding: 9px 22px; }
}
/* дуже малі екрани (ландшафт iPhone SE першого покоління з панелями ~568×248, портрет вужчих за 340 px; ревю
   2026-10-12, L1): ще щільніше й дрібніше — кнопка «Вирушити» без прокрутки */
@media (max-height: 270px), (max-width: 340px) {
  #ready { --pad: 6px; }
  .ready-panel { padding: 8px 12px 10px; }
  .ready-panel h2 { font-size: 16.5px; }
  .ready-panel p { margin-top: 1px; font-size: 12.5px; }
  .ready-panel .rules { margin: 4px 0 6px; padding-left: 16px; font-size: 12.5px; line-height: 1.28; }
  .ready-panel .rules li { margin: 1px 0; }
  .ready-setup { gap: 6px; margin-bottom: 8px; }
  .setup-tip { padding: 0 8px; font-size: 12px; gap: 8px; }
  .bright-anim, .sound-anim { margin: -12px -10px; transform: scale(0.6); }
  #btn-go { padding: 8px 20px; font-size: 15px; }
}
