/* Обереги онлайн: облик оболочки — тот же, что у игры (css/ui.css): тёмный дуб и кожа, старая бронза, плашки НРИ из ui/.
   Размеры в rem: у игры 1rem = высота окна / 56 (не меньше 12px), поэтому всё растёт и сжимается вместе со столом.
   Телефон — горизонтально и (с 08.11) вертикально: body.ol-port — одна колонка; кнопки не ниже 44px. Видимая высота (без панелей браузера) — классы body.ol-low (≤460px) и
   body.ol-tiny (≤340px) из visualViewport (shell.js fitViewport), --ol-vh — эта высота в пикселях. Горизонтальной прокрутки нет нигде. */
:root { --ol-soul: #9fd8ff; --ol-gold: #f0c96a; --r-common: #cfc6b4; --r-rare: #6fb6ff; --r-epic: #c58cff; --r-legend: #ffb347; --ol-vh: 100dvh; }

/* режим «По сети» самой игры — для Foundry; здесь сеть через лобби и сервер */
#setup-mode button[data-mode="net"] { display: none !important; }
body.ol-online { overflow-x: hidden; }
/* значок громкости игры (K.UI.volumeButton) — поверх окна входа и экранов оболочки */
body.ol-online #vol-btn { z-index: 72; }
body.ol-online #vol-pop { z-index: 73; }

/* ── валюты: кристальд (золото) и души — картинки ui/currency/ (помощник по виду), заглушки по тем же путям */
.ol-gold, .ol-souls, .ol-xp { white-space: nowrap; }
.ol-gold { color: var(--ol-gold); }
.ol-souls { color: var(--ol-soul); }
.ol-xp { color: #b8e08a; }
.ol-gold::before, .ol-souls::before { content: ''; display: inline-block; width: 1.15em; height: 1.15em; margin-right: 0.25em; vertical-align: -0.22em;
  background: center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
.ol-gold::before { background-image: url("../ui/currency/gold.png"); }
.ol-souls::before { background-image: url("../ui/currency/soul.png"); }
.ol-gold.big::before { background-image: url("../ui/currency/gold_big.png"); width: 1.6em; height: 1.6em; vertical-align: -0.4em; }
.ol-souls.big::before { background-image: url("../ui/currency/soul_big.png"); width: 1.6em; height: 1.6em; vertical-align: -0.4em; }
.btn .ol-gold, .btn .ol-souls { color: inherit; }

/* ── вход */
.ol-auth { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(circle at 50% 35%, rgba(40, 28, 16, 0.55), rgba(5, 4, 3, 0.94) 70%), var(--sk-tex) 0 0 / 16rem 16rem repeat, #0b0806; }
.ol-auth.on { display: flex; }
.ol-auth-box { width: min(27rem, 94vw); max-height: none; overflow: visible; text-align: center; margin: auto; }
.ol-auth-box .logo { font-size: 3.2rem; line-height: 0.95; }
.ol-auth-box .sub { font-size: 1.05rem; margin: 0.3rem 0 0.8rem; }
.ol-auth-tabs { margin: 0 auto 0.6rem; }
.ol-field { display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 0.2rem; margin: 0.45rem 0; color: var(--muted); font-size: 0.95rem; }
.ol-field input, .ol-inv-row input, .ol-pw input, .ol-souls-search {
  font-family: var(--font); font-size: 1.15rem; color: var(--gold-hi); background: rgba(8, 6, 4, 0.78); border: 1px solid rgba(184, 137, 74, 0.55);
  box-shadow: inset 0 2px 0.375rem rgba(0, 0, 0, 0.7); border-radius: 0.35rem; padding: 0.55rem 0.7rem; min-height: 44px; outline: none; user-select: text; max-width: 100%; }
.ol-field input:focus, .ol-inv-row input:focus, .ol-pw input:focus, .ol-souls-search:focus { border-color: var(--ol-gold); box-shadow: inset 0 2px 0.375rem rgba(0, 0, 0, 0.7), 0 0 0.5rem rgba(240, 200, 110, 0.35); }
.ol-remember { justify-content: flex-start; margin: 0.2rem 0 0; color: var(--ink); }
#ol-auth-go { width: 100%; margin-top: 0.4rem; min-height: 48px; }
.ol-err { min-height: 1.3em; color: #ff9a7a; font-size: 1rem; margin-top: 0.3rem; }
.ol-note { color: var(--muted); font-size: 0.9rem; line-height: 1.4; margin: 0.4rem 0; font-style: italic; }
.ol-wait { color: var(--gold-hi); font-size: 1.3rem; margin: 1rem 0; }
.ol-wait:empty { display: none; }

/* ── скачать лаунчер: обычная кнопка, мелко версия и размер, подсказка про SmartScreen — по «?» (и по наведению) */
.ol-dl { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.2rem 0.5rem; margin-top: 0.4rem; position: relative; }
.ol-dl:empty { display: none; }
.ol-dl-btn { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 1rem !important; margin: 0 !important; text-decoration: none; min-height: 40px; }
.ol-dl-meta { color: var(--muted); font-size: 0.8rem; }
.ol-dl-q { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); color: var(--gold); cursor: pointer; font: inherit; font-size: 0.85rem; line-height: 1; padding: 0; }
.ol-dl-hint { display: none; flex-basis: 100%; color: var(--muted); font-size: 0.8rem; line-height: 1.35; text-align: left; padding: 0.3rem 0.4rem; border-left: 2px solid var(--line); }
.ol-dl.open .ol-dl-hint, .ol-dl-q:hover + .ol-dl-hint { display: block; }
.ol-dl-phone { color: var(--muted); font-size: 0.88rem; font-style: italic; }
#ol-dl-lobby { justify-content: flex-start; }

/* ── лобби: главное меню игры. Слева — ты и кнопки, справа — в сети, друзья, задания; середина свободна: стол живой */
#menu.ol { padding: 0; justify-content: stretch; align-items: stretch;
  background: linear-gradient(90deg, rgba(5, 6, 10, 0.9) 0%, rgba(5, 6, 10, 0.5) 30%, rgba(5, 6, 10, 0) 48%, rgba(5, 6, 10, 0) 58%, rgba(5, 6, 10, 0.55) 74%, rgba(5, 6, 10, 0.85) 100%); }
.ol-lobby { flex: 1; display: flex; justify-content: space-between; align-items: stretch; gap: 1rem; min-height: 0; min-width: 0; max-width: 100%; pointer-events: none;
  padding: max(0.8rem, env(safe-area-inset-top)) max(1.6rem, env(safe-area-inset-right)) max(0.8rem, env(safe-area-inset-bottom)) max(1.6rem, env(safe-area-inset-left)); }
.ol-left, .ol-right { pointer-events: auto; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ol-left { width: 23rem; justify-content: center; gap: 0.35rem; padding-top: 2.6rem; overflow-x: hidden; overflow-y: auto; }
.ol-left .logo { font-size: 3.3rem; line-height: 0.95; margin-bottom: 0.4rem; }
.ol-right { width: 25rem; justify-content: center; }
.ol-side { max-height: 100%; display: flex; flex-direction: column; padding: 0.6rem 0.8rem; overflow: hidden; }
.ol-sidetabs { flex: none; display: flex; margin-bottom: 0.4rem; }
.ol-sidetabs button { flex: 1; min-height: 40px; padding: 2px 0.4rem; font-size: 1rem; white-space: nowrap; }
.ol-sidetabs i { font-style: normal; color: var(--muted); font-size: 0.85em; }
.ol-pane { display: none; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ol-pane.on { display: block; }
.ol-h { color: var(--gold-hi); font-size: 1.1rem; margin: 0.5rem 0 0.3rem; padding-bottom: 0.4rem; text-shadow: 0 1px 0.1875rem #000;
  background: var(--sk-div-mid) left 1.5rem bottom -2px / auto 0.75rem no-repeat, var(--sk-div-rod) left bottom -2px / 100% 0.75rem no-repeat; }
.ol-h:first-child { margin-top: 0.2rem; }

.ol-plate { display: flex; align-items: center; gap: 0.8rem; text-align: left; cursor: pointer; color: var(--ink); font-family: var(--font); width: 100%; min-width: 0;
  border: 0.8125rem solid transparent; border-image: var(--sk-card) 32 / 0.8125rem / 0 stretch; background: rgba(10, 8, 6, 0.55); background-clip: padding-box; padding: 0.2rem 0.4rem; }
.ol-plate:hover { filter: brightness(1.12); }
.ol-plate-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ol-plate-body > b { font-size: 1.35rem; color: var(--gold-hi); font-weight: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-lv { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.ol-lv i, .ol-q i { display: block; height: 0.45rem; border-radius: 1rem; background: linear-gradient(90deg, #f0c96a var(--p), rgba(255, 255, 255, 0.1) var(--p)); box-shadow: inset 0 1px 2px #000; }
.ol-lv small { font-size: 0.75rem; }
.ol-money { display: flex; gap: 0.9rem; margin-top: 0.15rem; font-size: 1.1rem; }

.ol-face { width: 2.6rem; height: 2.6rem; flex: none; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: #1d1710;
  box-shadow: 0 0 0 0.15rem #6e5230, 0 0 0 0.25rem #c9a160, 0 0.15rem 0.5rem rgba(0, 0, 0, 0.6); color: var(--gold-hi); font-size: 1.2rem; }
.ol-face img { width: 100%; height: 100%; object-fit: cover; }
.ol-face.big { width: 4.2rem; height: 4.2rem; font-size: 2rem; }
.ol-face.huge { width: 6.5rem; height: 6.5rem; font-size: 3rem; }

.ol-find { min-height: 3.6rem; margin-top: 0.4rem !important; font-size: 1.6rem !important; }
.ol-find small { display: block; font-size: 0.85rem; color: var(--muted); }
.ol-find.waiting { animation: ol-pulse 1.6s ease-in-out infinite; }
@keyframes ol-pulse { 50% { box-shadow: 0 0 1.6rem rgba(240, 200, 110, 0.75), 0 0.375rem 1rem rgba(0, 0, 0, 0.5); } }
.ol-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.4rem; }
.ol-grid .btn, .ol-row2 .btn { margin: 0.2rem 0 !important; font-size: 1.1rem !important; min-height: 44px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ol-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.4rem; }
.ol-row2 .btn { font-size: 0.95rem !important; min-height: 40px; }
.ol-badge { display: inline-block; min-width: 1.3em; margin-left: 0.4em; padding: 0 0.3em; border-radius: 1em; background: #b0331f; color: #fff; font-size: 0.8em; font-weight: normal; }
.ol-badge:empty { display: none; }
.ol-elsewhere { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; color: #ffd2a0; font-size: 0.95rem; }
.ol-elsewhere:empty { display: none; }

.ol-inv-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.3rem; min-width: 0; }
.ol-inv-row input { flex: 1; min-width: 0; font-size: 1rem; padding: 0.4rem 0.6rem; }
.ol-inv-row .btn { margin: 0; font-size: 1rem; flex: none; }
.ol-list { display: flex; flex-direction: column; gap: 0.15rem; }
.ol-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.2rem; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); min-height: 44px; min-width: 0; }
.ol-row.me { opacity: 0.75; }
.ol-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ol-row-body b { font-weight: normal; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-row-body b i { color: var(--muted); font-size: 0.85em; }
.ol-row-body b em, .ol-tag { font-style: normal; font-size: 0.72em; color: #b8e08a; border: 1px solid rgba(184, 224, 138, 0.5); border-radius: 1em; padding: 0 0.4em; vertical-align: 0.1em; }
.ol-row-body small { color: var(--muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ol-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #5a5248; margin-right: 0.35rem; vertical-align: 0.05rem; }
.ol-dot.on { background: #7fd36a; box-shadow: 0 0 0.4rem #7fd36a; }
.btn.mini-btn { margin: 0; font-size: 0.95rem; padding: 0 0.5rem; min-height: 40px; flex: none; }
.btn.ol-add { min-width: 40px; font-size: 1.2rem; }
.ol-empty { color: var(--muted); font-style: italic; font-size: 0.9rem; padding: 0.4rem 0.2rem; line-height: 1.4; }
.ol-quests { display: flex; flex-direction: column; gap: 0.45rem; }
.ol-q { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.6rem; font-size: 0.92rem; }
.ol-q i { grid-column: 1 / -1; grid-row: 2; }
.ol-q small { grid-column: 2; grid-row: 1; color: var(--muted); white-space: nowrap; }
.ol-q.done span { color: #b8e08a; text-decoration: line-through; text-decoration-color: rgba(184, 224, 138, 0.5); }
.ol-q-note { color: var(--muted); font-size: 0.78rem; font-style: italic; }
.ol-packtag { font-weight: normal; color: #e6c8ff; }
.ol-frmenu { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
.ol-frmenu .btn { margin: 0; }
.ol-frmenu small { color: var(--muted); }

/* ── плашки поверх всего */
.ol-banner { position: fixed; left: 50%; top: max(0.6rem, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 65; display: none; max-width: 92vw; text-align: center;
  padding: 0.35rem 1rem; color: #ffe0c8; font-size: 1rem; border: 0.625rem solid transparent; border-image: var(--sk-plaque) 22 fill / 0.625rem / 0 stretch; text-shadow: 0 1px 2px #000; pointer-events: none; }
.ol-banner.on { display: block; }
.ol-away { top: 4.2rem; color: #ffd8a0; }
.ol-chip { position: fixed; right: max(0.8rem, env(safe-area-inset-right)); bottom: max(0.8rem, env(safe-area-inset-bottom)); z-index: 64; display: none; align-items: center; gap: 0.6rem; padding: 0.2rem 0.4rem 0.2rem 0.9rem;
  border: 0.625rem solid transparent; border-image: var(--sk-tile-on) 26 fill / 0.625rem / 0 stretch; color: #ffe7a8; font-size: 1rem; box-shadow: 0 0 1rem rgba(240, 200, 110, 0.35); max-width: 92vw; }
.ol-chip.on { display: flex; }
.ol-chip button { background: none; border: 0; color: #ffd2c4; font-size: 1.3rem; cursor: pointer; min-width: 44px; min-height: 40px; }
.ol-toast { position: fixed; left: 50%; bottom: max(12vh, env(safe-area-inset-bottom)); transform: translate(-50%, 1rem); z-index: 75; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 90vw; padding: 0.4rem 1.1rem; color: var(--ink); font-size: 1.05rem; text-align: center; border: 0.625rem solid transparent; border-image: var(--sk-plaque) 22 fill / 0.625rem / 0 stretch; text-shadow: 0 1px 2px #000;
  display: flex; align-items: center; gap: 0.8rem; }
.ol-toast.on { opacity: 1; transform: translate(-50%, 0); }
.ol-toast.on.act { pointer-events: auto; }
.ol-toast.bad { color: #ffc4b4; }
.ol-toast.ok { color: #e8f4c8; }
.ol-toast-act { font: inherit; color: #1a1208; background: linear-gradient(180deg, #f6d995, #c9963f); border: 0; border-radius: 0.4rem; padding: 0.25rem 0.8rem; cursor: pointer; min-height: 36px; white-space: nowrap; }
.ol-rotate { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; text-align: center; padding: 2rem; color: var(--ink);
  background: radial-gradient(circle at 50% 40%, #241a10, #050403 75%); font-size: 18px; }
.ol-rotate b { display: block; color: var(--gold-hi); font-size: 26px; margin-bottom: 8px; font-weight: normal; }
.ol-rotate div::before { content: '⟳'; display: block; font-size: 64px; color: var(--gold); margin-bottom: 12px; }
/* (08.11) оболочка работает вертикально — своей просьбы «поверни телефон» нет; игровая (#rotate) — только за 3D-столом */
body.ol-online:not(.hud-on) #rotate { display: none !important; }
/* «во весь экран» (Android): правый верхний угол */
.ol-fs { position: fixed; z-index: 72; top: max(0.5rem, env(safe-area-inset-top)); right: max(0.5rem, env(safe-area-inset-right)); width: 2.75rem; height: 2.75rem; min-width: 44px; min-height: 44px;
  display: none; align-items: center; justify-content: center; color: #f0c96a; cursor: pointer;
  background: none; border: 0.5rem solid transparent; border-image: var(--sk-button) 26 fill / 0.5rem / 0 stretch; }
.ol-fs.on { display: flex; }
body.hud-on .ol-fs { display: none; }
.ol-pwa .ol-inv-text { display: block; text-align: left; }

.ol-inv-text { display: flex; align-items: center; gap: 1rem; text-align: left; font-size: 1.1rem; line-height: 1.4; margin: 0.4rem 0 0.8rem; }
.ol-inv-text small { color: var(--muted); }
.ol-watch-close { margin-top: 1rem; }

/* ── против бота: колода бота — свёрнутым списком, чтобы не путать с моими */
#setup-enemy.ol-botdecks:not(.open) .deck-tile:not(:first-child):not(.sel) { display: none; }
.ol-bot-more { align-self: center; margin: 0 !important; font-size: 0.95rem !important; min-height: 40px; }

/* ── награда в окне итога */
.ol-reward { margin: 0.2rem 0 0.6rem; padding: 0.5rem 0.4rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.ol-rw-main { font-size: 1.4rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.ol-rw-up { color: var(--gold-hi); margin-top: 0.3rem; }
.ol-rw-q { color: var(--muted); font-size: 0.92rem; margin-top: 0.2rem; }
.ol-rw-q.done { color: #b8e08a; }
.ol-rw-note { color: var(--muted); font-style: italic; font-size: 0.88rem; margin-top: 0.3rem; }
.ol-rw-friend { margin: 0.5rem 0 0 !important; font-size: 1rem !important; }

/* ── экраны оболочки: лавка, наборы, профиль */
.ol-scr .panel { max-height: calc(var(--ol-vh) - 1.2rem); }
.ol-shop, .ol-prof, .ol-packscr { display: flex; flex-direction: column; height: min(calc(var(--ol-vh) - 1.6rem), 52rem); min-width: 0; overflow: hidden; }
.ol-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; flex: none; min-width: 0; }
.ol-top h2 { margin: 0; }
.ol-top .btn { margin: 0; }
.ol-tabs { flex-wrap: wrap; }
.ol-tabs button { min-height: 44px; }
.ol-to-packs b { font-size: 0.8em; }
.ol-purse { margin-left: auto; display: flex; gap: 1rem; font-size: 1.25rem; }
.ol-shop-body, .ol-prof-body { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; margin-top: 0.6rem; padding-right: 0.3rem; -webkit-overflow-scrolling: touch; }
.ol-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: 0.8rem; }
.ol-pack { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; border: 0.8125rem solid transparent; border-image: var(--sk-card) 32 / 0.8125rem / 0 stretch; background: rgba(10, 8, 6, 0.6); background-clip: padding-box; padding: 0.3rem 0.5rem; }
.ol-pack-art { height: 6.5rem; border-radius: 0.4rem; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; flex: none;
  background: radial-gradient(circle at 50% 120%, var(--pc, #6a4a20), transparent 70%), linear-gradient(160deg, #2a1d10, #120c07); box-shadow: inset 0 0 1.5rem rgba(0, 0, 0, 0.8); }
.ol-pack-art::before { content: ''; position: absolute; width: 4.4rem; height: 5.8rem; border-radius: 0.4rem; transform: rotate(-8deg) translateX(-1.2rem);
  background: linear-gradient(160deg, #3a2a16, #1a120a); border: 2px solid var(--pc, #b8894a); box-shadow: 0 0.3rem 0.8rem #000; }
.ol-pack-art::after { content: ''; position: absolute; width: 4.4rem; height: 5.8rem; border-radius: 0.4rem; transform: rotate(7deg) translateX(1.2rem);
  background: radial-gradient(circle at 50% 45%, var(--pc, #b8894a) 0 0.9rem, transparent 1rem), linear-gradient(160deg, #3a2a16, #1a120a); border: 2px solid var(--pc, #b8894a); box-shadow: 0 0.3rem 0.8rem #000; }
.ol-pack-art span { position: absolute; z-index: 2; right: 0.6rem; bottom: 0.35rem; font-size: 1.15rem; color: #fff3d0; text-shadow: 0 0 0.5rem #000, 0 0 1rem var(--pc); }
.ol-pk-small { --pc: #a08060; }
.ol-pk-house { --pc: #6fb6ff; }
.ol-pk-wanderer { --pc: #c58cff; }
.ol-pk-treasury { --pc: #ffb347; }
.ol-pack-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.ol-pack-body b { color: var(--gold-hi); font-weight: normal; font-size: 1.3rem; }
.ol-pack-body small { color: #cfc6b4; font-size: 0.92rem; line-height: 1.35; }
.ol-pack-house select { font-family: var(--font); font-size: 1rem; background: #0c0a08; color: var(--gold-hi); border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.3rem; min-height: 40px; max-width: 100%; }
.ol-odds { font-size: 0.85rem; color: var(--muted); }
.ol-odds summary { cursor: pointer; color: var(--gold); min-height: 32px; display: flex; align-items: center; }
.ol-odds div { margin: 0.2rem 0; line-height: 1.5; }
.ol-r { display: inline-block; margin-right: 0.5rem; white-space: nowrap; }
.ol-r.common { color: var(--r-common); } .ol-r.rare { color: var(--r-rare); } .ol-r.epic { color: var(--r-epic); } .ol-r.legend { color: var(--r-legend); }
.ol-pack-buy { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; }
.ol-pack-buy .ol-gold { font-size: 1.4rem; margin-right: auto; }
.ol-pack-buy .btn { margin: 0; font-size: 1.1rem !important; min-height: 44px; }
.ol-buydeck { display: flex; flex-direction: column; min-width: 0; }
.ol-buydeck .deck-tile { flex: 1; cursor: default; min-width: 0; }
.ol-deck-buy { display: flex; align-items: center; gap: 0.6rem; padding: 0.2rem 0.4rem; }
.ol-deck-buy .ol-gold { font-size: 1.2rem; margin-right: auto; }
.ol-deck-buy .btn { margin: 0; min-height: 44px; }
.ol-scr .deck-grid { grid-template-columns: repeat(auto-fill, minmax(min(18.75rem, 100%), 1fr)); }
.ol-souls-top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ol-souls-top .ol-note { flex: 1 1 20rem; font-style: normal; min-width: 0; }
.ol-souls-search { width: 100%; margin: 0.5rem 0; }
.ol-craft { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(12.5rem, 100%), 1fr)); gap: 0.7rem; }
.ol-craft-card { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.4rem; border-radius: 0.5rem; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.06); min-width: 0; }
.ol-craft-card img { width: 100%; border-radius: 0.5rem; }
.ol-craft-card b { font-weight: normal; color: var(--ink); font-size: 0.95rem; }
.ol-craft-card small { display: block; color: var(--muted); font-size: 0.8rem; }
.ol-craft-card.rare small { color: var(--r-rare); } .ol-craft-card.epic small { color: var(--r-epic); } .ol-craft-card.legend small { color: var(--r-legend); }
.ol-craft-btns { display: flex; flex-direction: column; gap: 0.15rem; }
.ol-craft-btns .btn { margin: 0; font-size: 0.9rem; min-height: 40px; padding: 0 0.4rem; }

/* ── «Открыть наборы»: слева стопки по видам, справа сцена (сюда встаёт 3D-открытие KKI.PackOpen) */
.ol-packs-main { flex: 1; min-height: 0; display: flex; gap: 1rem; margin-top: 0.6rem; min-width: 0; }
.ol-stacks { width: 17rem; flex: none; display: flex; flex-direction: column; gap: 0.5rem; overflow-x: hidden; overflow-y: auto; padding-right: 0.3rem; }
.ol-stack { display: flex; align-items: center; gap: 0.6rem; text-align: left; cursor: pointer; color: var(--ink); font-family: var(--font); min-height: 44px;
  border: 0.6rem solid transparent; border-image: var(--sk-card) 32 / 0.6rem / 0 stretch; background: rgba(10, 8, 6, 0.6); background-clip: padding-box; padding: 0.2rem; }
.ol-stack.sel { border-image-source: var(--sk-card-on); box-shadow: 0 0 1rem rgba(255, 196, 92, 0.35); }
.ol-stack .ol-pack-art { width: 5.2rem; height: 4rem; }
.ol-stack .ol-pack-art::before, .ol-stack .ol-pack-art::after { width: 2.4rem; height: 3.2rem; }
.ol-stack .ol-pack-art span { font-size: 1.1rem; right: 0.3rem; bottom: 0.1rem; }
.ol-stack b { display: block; font-weight: normal; color: var(--gold-hi); font-size: 1.05rem; }
.ol-stack small { color: var(--muted); }
.ol-stage { flex: 1; min-width: 0; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow-x: hidden; overflow-y: auto;
  border-radius: 0.6rem; background: radial-gradient(circle at 50% 45%, rgba(60, 40, 18, 0.55), rgba(4, 3, 2, 0.6) 70%); box-shadow: inset 0 0 2.5rem rgba(0, 0, 0, 0.8); }
.ol-stage-pack { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; }
.ol-stage-pack .ol-pack-art { width: 15rem; height: 13rem; animation: ol-float 3.2s ease-in-out infinite; }
.ol-stage-pack .ol-pack-art::before, .ol-stage-pack .ol-pack-art::after { width: 7.5rem; height: 10rem; }
@keyframes ol-float { 50% { transform: translateY(-0.4rem); } }
.ol-stage-name { color: var(--gold-hi); font-size: 1.5rem; }
.ol-stage-pack small { color: var(--muted); }
.ol-open-go { min-width: 12rem; }
.ol-stage-empty { text-align: center; color: var(--muted); padding: 1rem; }
.ol-open-box { width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 0.6rem; padding: 0.6rem; overflow-x: hidden; overflow-y: auto; }
.ol-open-title { text-align: center; color: var(--gold-hi); font-size: 1.8rem; text-shadow: 0 0 1rem rgba(240, 200, 110, 0.5); }
.ol-open-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; perspective: 80rem; }
.ol-oc { width: min(11.5rem, 28vw); aspect-ratio: 63 / 88; background: none; border: 0; padding: 0; cursor: pointer; animation: ol-deal .5s ease-out both; animation-delay: calc(var(--i) * 0.09s); }
@keyframes ol-deal { from { opacity: 0; transform: translateY(-3rem) rotate(-6deg) scale(0.8); } }
.ol-oc-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.2, .8, .3, 1.2); transform-style: preserve-3d; }
.ol-oc.open .ol-oc-in { transform: rotateY(180deg); }
.ol-oc-back, .ol-oc-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 0.6rem; }
.ol-oc-back { background: radial-gradient(circle at 50% 45%, #c9a160 0 1.2rem, transparent 1.3rem), repeating-linear-gradient(45deg, rgba(255, 220, 150, 0.06) 0 0.4rem, transparent 0.4rem 0.8rem), linear-gradient(160deg, #3a2a16, #140d07);
  border: 0.2rem solid #8a6a3a; box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.7); }
.ol-oc.rare .ol-oc-back { box-shadow: 0 0 1rem rgba(111, 182, 255, 0.55), 0 0.5rem 1.2rem rgba(0, 0, 0, 0.7); }
.ol-oc.epic .ol-oc-back { box-shadow: 0 0 1.3rem rgba(197, 140, 255, 0.7), 0 0.5rem 1.2rem rgba(0, 0, 0, 0.7); }
.ol-oc.legend .ol-oc-back, .ol-oc.sp .ol-oc-back { box-shadow: 0 0 1.8rem rgba(255, 179, 71, 0.9), 0 0.5rem 1.2rem rgba(0, 0, 0, 0.7); animation: ol-glow 1.4s ease-in-out infinite; }
@keyframes ol-glow { 50% { filter: brightness(1.35); } }
.ol-oc-face { transform: rotateY(180deg); overflow: visible; }
.ol-oc-face img { width: 100%; height: 100%; object-fit: contain; border-radius: 0.6rem; }
.ol-oc.open.legend .ol-oc-face img { box-shadow: 0 0 2.2rem rgba(255, 179, 71, 0.85); }
.ol-oc.open.epic .ol-oc-face img { box-shadow: 0 0 1.6rem rgba(197, 140, 255, 0.75); }
.ol-oc.open.rare .ol-oc-face img { box-shadow: 0 0 1.1rem rgba(111, 182, 255, 0.6); }
.ol-oc-face em { position: absolute; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.8rem; padding: 0.05rem 0.5rem; border-radius: 1rem; white-space: nowrap; box-shadow: 0 0.2rem 0.5rem #000; }
.ol-new { top: -0.6rem; background: #2f7a2a; color: #eaffd8; }
.ol-sp { bottom: 2.2rem; color: #10131f; background: linear-gradient(90deg, #ff9ae6, #a9b8ff, #8ff0ff, #fff3a0); }
.ol-sl { bottom: -0.6rem; background: #1a3c66; color: #d8f0ff; }
.ol-open-foot { text-align: center; color: var(--muted); font-size: 1rem; min-height: 1.3em; }

/* ── профиль */
.ol-prof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem; }
.ol-prof-head { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.ol-prof-head b { display: block; font-size: 1.6rem; color: var(--gold-hi); font-weight: normal; }
.ol-prof-head small { display: block; color: var(--muted); }
.ol-heroes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem; }
.ol-hero { background: none; border: 0; padding: 0.2rem; cursor: pointer; border-radius: 50%; min-height: 44px; display: flex; justify-content: center; }
.ol-hero .ol-face { width: 3.6rem; height: 3.6rem; }
.ol-hero.sel .ol-face { box-shadow: 0 0 0 0.15rem #f0c96a, 0 0 1rem rgba(255, 210, 120, 0.7); }
.ol-check { display: flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; min-height: 44px; cursor: pointer; }
.ol-check input { width: 1.3rem; height: 1.3rem; accent-color: #c9a160; }
.ol-pw { display: flex; flex-direction: column; gap: 0.4rem; }
.ol-pw small { color: var(--muted); font-size: 0.85rem; }
.ol-pw .btn { margin: 0; align-self: flex-start; min-height: 44px; }
.ol-sessions { display: flex; flex-direction: column; gap: 0.2rem; }
.ol-sess { padding: 0.3rem 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); }
.ol-sess b { font-weight: normal; display: block; }
.ol-sess small { color: var(--muted); font-size: 0.85rem; }
.ol-sess.cur b { color: var(--gold-hi); }
.ol-prof-out { margin-top: 1rem; flex-wrap: wrap; }
.btn.danger { color: #ffb4a0; }

/* ── узко (телефон, маленький планшет): лобби на всю ширину, колонки уже */
@media (max-width: 900px) {
  #menu.ol { background: linear-gradient(90deg, rgba(5, 6, 10, 0.88), rgba(5, 6, 10, 0.7)); }
  .ol-lobby { justify-content: center; }
  .ol-left { width: auto; flex: 1 1 18rem; max-width: 26rem; }
  .ol-right { width: auto; flex: 1 1 18rem; max-width: 26rem; }
  .ol-prof-grid { grid-template-columns: minmax(0, 1fr); }
  .ol-stacks { width: 13rem; }
}
/* очень узко: колонки друг под другом, лобби листается */
@media (max-width: 600px) {
  .ol-lobby { flex-direction: column; overflow-y: auto; justify-content: flex-start; }
  .ol-left, .ol-right { max-width: none; flex: none; }
  .ol-side { max-height: none; }
  .ol-packs-main { flex-direction: column; }
  .ol-stacks { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; flex: none; }
  .ol-stack { flex: none; }
}

/* ── низкая видимая высота (телефон горизонтально, панели браузера): ужать всё, главные кнопки — без прокрутки */
body.ol-low .ol-lobby { padding-top: max(0.4rem, env(safe-area-inset-top)); padding-bottom: max(0.4rem, env(safe-area-inset-bottom)); gap: 0.6rem; }
body.ol-low .ol-left { width: 27rem; max-width: 30rem; justify-content: flex-start; gap: 0.15rem; padding-top: 0.2rem; padding-left: 3.1rem; }
body.ol-low .ol-left .logo { display: none; }
body.ol-low .ol-right { width: 22rem; justify-content: flex-start; }
body.ol-low .ol-side { padding: 0.35rem 0.5rem; max-height: calc(var(--ol-vh) - 0.8rem); }
body.ol-low .ol-plate { border-width: 0.55rem; padding: 0; gap: 0.5rem; }
body.ol-low .ol-face.big { width: 2.9rem; height: 2.9rem; font-size: 1.4rem; }
body.ol-low .ol-plate-body > b { font-size: 1.15rem; }
body.ol-low .ol-find { min-height: 44px; font-size: 1.3rem !important; margin-top: 0.15rem !important; padding: 0 0.6rem; }
body.ol-low .ol-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 0.3rem; }
body.ol-low .ol-grid .btn { font-size: 0.98rem !important; min-height: 42px; padding: 0 0.3rem; margin: 0.12rem 0 !important; }
body.ol-low .ol-row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.ol-low .ol-row2 .btn { min-height: 40px; font-size: 0.88rem !important; margin: 0.1rem 0 !important; }
body.ol-low .ol-sidetabs button { min-height: 40px; font-size: 0.92rem; }
body.ol-low .ol-row { min-height: 40px; padding: 0.15rem; }
body.ol-low .ol-face { width: 2.2rem; height: 2.2rem; }
body.ol-low .ol-auth { align-items: flex-start; }
body.ol-low .ol-auth-box .logo { font-size: 2.2rem; }
body.ol-low .ol-auth-box .sub { display: none; }
body.ol-low .ol-field { margin: 0.2rem 0; }
body.ol-low .ol-oc { width: min(9rem, 24vw); }
body.ol-low .panel.wide.ol-shop, body.ol-low .panel.wide.ol-prof, body.ol-low .panel.wide.ol-packscr { padding: 0.4rem 0.6rem; }
body.ol-low .ol-shop, body.ol-low .ol-prof, body.ol-low .ol-packscr { height: calc(var(--ol-vh) - 0.6rem); }
body.ol-low .ol-scr.panel-screen { align-items: flex-start; padding-top: max(0.3rem, env(safe-area-inset-top)); padding-bottom: 0.3rem; }
body.ol-low .ol-top h2 { font-size: 1.3rem; padding-bottom: 0.3rem; }
body.ol-low .ol-pack-art { height: 4.6rem; }
body.ol-low .ol-stage-pack .ol-pack-art { width: 11rem; height: 8.5rem; }
body.ol-low .ol-stage-pack .ol-pack-art::before, body.ol-low .ol-stage-pack .ol-pack-art::after { width: 5rem; height: 6.8rem; }
body.ol-low .ol-dl { display: none; }
/* совсем низко (≤340px): плашка игрока в строку, «Найти соперника» ниже */
body.ol-tiny .ol-plate .ol-lv small, body.ol-tiny .ol-plate .ol-lv i { display: none; }
body.ol-tiny .ol-face.big { width: 2.4rem; height: 2.4rem; }
body.ol-tiny .ol-find { min-height: 42px; font-size: 1.2rem !important; }
body.ol-tiny .ol-grid .btn { min-height: 40px; }
body.ol-tiny .ol-row2 .btn { min-height: 40px; }
/* низкий экран: подсказка «на весь экран» целиком с кнопкой, всплывающие строки — сверху (не на кнопках), шапка экранов — в одну строку */
body.ol-low #ol-pwa .panel { padding: 0.5rem 0.9rem; max-height: calc(var(--ol-vh) - 0.6rem); }
body.ol-low #ol-pwa h2 { font-size: 1.15rem; margin: 0 0 0.3rem; padding-bottom: 0.3rem; }
body.ol-low #ol-pwa .ol-inv-text { font-size: 0.95rem; line-height: 1.35; margin: 0.2rem 0 0.4rem; }
body.ol-low #ol-pwa .btn { min-height: 40px; margin: 0; }
body.ol-low .ol-toast { bottom: auto; top: max(0.4rem, env(safe-area-inset-top)); transform: translate(-50%, -1rem); font-size: 0.95rem; padding: 0.2rem 0.8rem; }
body.ol-low .ol-toast.on { transform: translate(-50%, 0); }
body.ol-low .ol-top { flex-wrap: nowrap; gap: 0.35rem; }
body.ol-low .ol-top h2 { display: none; }
body.ol-low .ol-top .btn, body.ol-low .ol-tabs button { min-height: 40px; font-size: 0.95rem; padding: 0 0.5rem; white-space: nowrap; }
body.ol-low .ol-tabs { flex-wrap: nowrap; }
body.ol-low .ol-purse { font-size: 1rem; gap: 0.5rem; }
body.ol-low .ol-packscr .ol-top::before { content: 'Открыть наборы'; color: var(--gold-hi); font-size: 1.15rem; margin-right: auto; }

/* ── окна оболочки: ширина по содержимому, но не шире экрана; кнопки переносятся, ничего не вылезает (автор: «Принять» за краем) */
body.ol-online .modal .panel { max-width: calc(100vw - 1.2rem); overflow-x: hidden; box-sizing: border-box; }
#ol-inv-in .panel, #ol-ask .panel, #ol-pwa .panel { width: min(30rem, calc(100vw - 1.2rem)); }
#ol-inv-in .setup-row, #ol-ask .setup-row, #ol-deck .setup-row { flex-wrap: wrap; gap: 0.5rem; }
#ol-inv-in .setup-row .spacer, #ol-ask .setup-row .spacer { display: none; }
#ol-inv-in .setup-row .btn, #ol-ask .setup-row .btn { flex: 1 1 9rem; margin: 0; min-width: 0; white-space: normal; }
.ol-inv-text, .ol-inv-text > div { min-width: 0; overflow-wrap: anywhere; }
#gameover .panel { overflow-x: hidden; max-width: calc(100vw - 1.2rem); }
#ol-reward .btn { white-space: normal; max-width: 100%; }
.ol-rw-purse { margin-top: 0.4rem; font-size: 1.1rem; color: var(--muted); }
.ol-rw-purse .ol-gold { font-size: 1.35rem; }

/* ── лавка: витрина */
.ol-pack .ol-pack-art { height: 9rem; }
.ol-pack-art.img { background: radial-gradient(circle at 50% 70%, var(--pc, #6a4a20), transparent 70%), #120c07; }
.ol-pack-art.img::before, .ol-pack-art.img::after { display: none; }
.ol-pack-art.img img { height: 100%; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 0.4rem 0.8rem #000); }
.ol-in-h { color: var(--gold); font-size: 0.85rem; margin-top: 0.35rem; letter-spacing: 0.03em; }
.ol-in { margin: 0.1rem 0 0; padding-left: 1.1rem; color: #cfc6b4; font-size: 0.88rem; line-height: 1.4; }
.ol-oddsbar { display: flex; height: 0.55rem; border-radius: 1rem; overflow: hidden; margin: 0.25rem 0; box-shadow: inset 0 1px 2px #000; background: #1a140e; }
.ol-oddsbar i { display: block; min-width: 3px; }
.ol-oddsbar i.common { background: #8f877a; } .ol-oddsbar i.rare { background: #4f93e0; } .ol-oddsbar i.epic { background: #a874e6; } .ol-oddsbar i.legend { background: #ffb347; }
.ol-oddslegend { display: flex; flex-wrap: wrap; gap: 0 0.7rem; font-size: 0.8rem; }
.ol-pack-buy .ol-gold.big { font-size: 1.5rem; }
.ol-buyask { display: flex; align-items: center; gap: 0.9rem; text-align: left; min-width: 0; }
.ol-buyask .ol-pack-art { width: 6.5rem; height: 6.5rem; flex: none; }
.ol-buyask .ol-pack-art::before, .ol-buyask .ol-pack-art::after { width: 2.6rem; height: 3.6rem; }
.ol-buyask small { color: var(--muted); }
/* готовые колоды: плитка, цена, «Состав» и «Купить» */
.ol-decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18.75rem, 100%), 1fr)); gap: 0.75rem; }
.ol-deck-buy { flex-wrap: wrap; }
.ol-deck-buy .btn { flex: none; }
.ol-deck-panel { width: min(40rem, calc(100vw - 1.2rem)); max-height: calc(var(--ol-vh) - 1.2rem); display: flex; flex-direction: column; }
.ol-deck-panel h2 { margin: 0 0 0.4rem; }
.ol-deck-body { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.ol-deck-sum { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.ol-deck-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: 0.15rem 1rem; }
.ol-dl-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.3rem; border-bottom: 1px dashed rgba(255, 255, 255, 0.07); font-size: 0.95rem; min-width: 0; }
.ol-dl-row b { width: 1.5rem; height: 1.5rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #1d3f6e; color: #dff0ff; font-weight: normal; font-size: 0.85rem; }
.ol-dl-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-dl-row i { font-style: normal; color: var(--muted); }
.ol-dl-row em { font-style: normal; font-size: 0.72rem; color: #b8e08a; border: 1px solid rgba(184, 224, 138, 0.5); border-radius: 1em; padding: 0 0.35em; }
.ol-dl-row.rare span { color: var(--r-rare); } .ol-dl-row.epic span { color: var(--r-epic); } .ol-dl-row.legend span { color: var(--r-legend); }
#ol-deck-buy { display: flex; align-items: center; gap: 0.6rem; }
#ol-deck-buy .btn { margin: 0; }

/* ── монеты и полёты (2D; 3D-монеты — KKI.CoinFx помощника по виду) */
.ol-fx { position: fixed; inset: 0; z-index: 85; pointer-events: none; overflow: hidden; }
.ol-coin { position: absolute; left: 0; top: 0; will-change: transform; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)); }
.ol-fly { position: fixed; margin: 0; transition: transform .6s cubic-bezier(.5, -0.2, .7, 1), opacity .6s; transform-origin: center; z-index: 86; }
@keyframes ol-pop { 40% { transform: scale(1.25); filter: brightness(1.5); } }
.ol-pop { animation: ol-pop .28s ease-out; display: inline-block; }

/* ── статичный фон лобби, пока стол после партии не сбрасывается сам (K.V.board.resetIdle) */
body.ol-static-bg #menu.ol { background: radial-gradient(circle at 50% 40%, rgba(40, 28, 16, 0.55), rgba(5, 4, 3, 0.92) 75%), var(--sk-tex) 0 0 / 16rem 16rem repeat, #0b0806; }
body.ol-static-bg .ol-scr { background: radial-gradient(circle at 50% 40%, rgba(40, 28, 16, 0.6), rgba(5, 4, 3, 0.95) 75%), #0b0806; }

/* ── лавка на низком экране */
body.ol-low .ol-pack .ol-pack-art { height: 6rem; }
body.ol-low .ol-in { font-size: 0.82rem; }
body.ol-low .ol-buyask .ol-pack-art { width: 4.5rem; height: 4.5rem; }
body.ol-low .ol-deck-panel { padding: 0.5rem 0.7rem; }

/* ── 07.11, проверка удобства: ссылки-кнопки, «Забыли пароль?», окно отмены, блок любого игрока */
.ol-linkbtn { background: none; border: 0; padding: 0.3rem 0.2rem; min-height: 32px; font: inherit; font-size: 0.95rem; color: var(--gold-hi); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.ol-linkbtn:hover { color: #fff3c8; }
.ol-linkbtn.danger { color: #ff9a7a; }
.ol-auth-act { display: flex; flex-direction: column; align-items: stretch; }
.ol-forgot { display: block; margin: 0.4rem auto 0; }
.ol-note a { color: var(--gold-hi); }
.ol-err .ol-linkbtn { font-size: 1rem; }
#ol-inv-in .ol-linkbtn { display: block; margin: 0.5rem auto 0; font-size: 0.88rem; }
#ol-cancel .panel { width: min(28rem, calc(100vw - 1.2rem)); }
#ol-cancel .ol-inv-text { display: block; text-align: center; }
#ol-cancel p { margin: 0 0 0.4rem; font-size: 1.15rem; color: var(--ink); overflow-wrap: anywhere; }
#ol-cancel small { color: var(--muted); }
#ol-cancel .setup-row { justify-content: center; }
#ol-cancel .btn { min-width: 10rem; margin: 0; }
.ol-rw-opp { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-top: 0.5rem; }
.ol-rw-opp .btn { margin: 0 !important; font-size: 1rem !important; }
.ol-row .ol-more { min-width: 2.2rem; padding: 0 0.4rem; }
.ol-frmenu { display: flex; flex-direction: column; gap: 0.4rem; }
.ol-frmenu .btn { margin: 0; }
/* «Карты и колоды» в лобби обрезалось («Карты и коло…»): подпись переносится на две строки */
.ol-grid .btn, .ol-row2 .btn { white-space: normal; text-overflow: clip; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
/* лавка: почему кнопка неактивна — видимой строкой (на телефоне подсказки по наведению нет) */
.ol-short { display: block; font-size: 0.8rem; color: #ff9a7a; margin-top: 0.15rem; text-align: center; }

/* вход на низком телефоне (≤460px): лого и вкладки слева, поля справа — «Создать и войти» и правило пароля в экране без прокрутки */
body.ol-low .ol-auth { align-items: center; padding-top: max(0.3rem, env(safe-area-inset-top)); padding-bottom: max(0.3rem, env(safe-area-inset-bottom)); }
body.ol-low .ol-auth-box { width: min(48rem, 96vw); display: grid; grid-template-columns: minmax(10rem, 0.8fr) minmax(0, 1.25fr); grid-auto-rows: auto; column-gap: 1rem;
  align-items: start; text-align: left; padding: 0.45rem 0.8rem; }
body.ol-low .ol-auth-box > .logo { grid-column: 1; grid-row: 1; text-align: center; font-size: 2rem; }
body.ol-low .ol-auth-tabs { grid-column: 1; grid-row: 2; margin: 0.35rem auto; }
body.ol-low .ol-auth-box > .ol-note { grid-column: 1; grid-row: 3; font-size: 0.85rem; line-height: 1.3; margin: 0.2rem 0 0; }
body.ol-low #ol-auth-form { grid-column: 2; grid-row: 1 / span 4; }
body.ol-low #ol-auth-wait { grid-column: 1 / -1; text-align: center; }
body.ol-low .ol-field { flex-direction: row; align-items: center; gap: 0.5rem; margin: 0.18rem 0; }
body.ol-low .ol-field > span { flex: 0 0 4.6rem; font-size: 0.85rem; line-height: 1.05; }
body.ol-low .ol-field input { flex: 1; min-width: 0; min-height: 40px; padding: 0.3rem 0.6rem; font-size: 1.05rem; }
body.ol-low .ol-err { margin: 0; min-height: 0; font-size: 0.9rem; }
body.ol-low .ol-auth-act { flex-direction: row; align-items: center; gap: 0.6rem; margin-top: 0.25rem; }
body.ol-low .ol-auth-act .ol-remember { flex: none; margin: 0; font-size: 0.9rem; }
body.ol-low #ol-auth-go { flex: 1; margin: 0; min-height: 44px; font-size: 1.15rem; }
body.ol-low .ol-forgot { margin: 0.1rem 0 0 auto; font-size: 0.85rem; min-height: 28px; padding: 0.15rem 0.2rem; }
/* «Открыть все»: общая раскладка всех наборов — карты сразу лицом, мельче, одинаковые — «×N» */
.ol-open-many .ol-open-title small { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.ol-open-sum { text-align: center; color: var(--ink); font-size: 0.95rem; line-height: 1.5; }
.ol-open-sum .ol-r { margin: 0 0.15rem; }
.ol-open-cards.ol-many { gap: 0.55rem; }
.ol-many .ol-oc { width: min(7.6rem, 21vw); cursor: default; animation-delay: calc(var(--i) * 0.03s); }
.ol-many .ol-oc .ol-oc-in { transition: none; }
.ol-cnt { bottom: -0.55rem; background: #3a2a16; color: var(--gold-hi); border: 1px solid rgba(240, 200, 110, 0.5); }
.ol-many .ol-sl { bottom: auto; top: 1.1rem; }
.ol-open-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.ol-open-btns .btn { margin: 0; }
.ol-open-every { min-width: 12rem; }
body.ol-low .ol-open-btns .btn { min-width: 0; padding: 0 1rem; }
body.ol-low .ol-many .ol-oc { width: min(5.6rem, 16vw); }
/* окно 3D-открытия на весь экран (телефон): название набора не прячется под кнопкой громкости в левом верхнем углу */
body.ol-online .po-layer:not(.embed) .po-top { padding-left: calc(3.4rem + env(safe-area-inset-left)); }

/* «Песочница» конструктора — третьей кнопкой в нижнем ряду лобби */
.ol-row2.ol-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.ol-low .ol-row2.ol-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ol-row2.ol-three .btn { white-space: nowrap; overflow-wrap: normal; text-overflow: ellipsis; font-size: 0.86rem !important; padding: 0 0.25rem; letter-spacing: -0.01em; }
body.ol-low .ol-row2.ol-three .btn { font-size: 0.8rem !important; }

/* ── «Выбери стиль»: стартовая коллекция по замыслу (поверх лобби, пока не выбран) */
.ol-style { position: fixed; inset: 0; z-index: 72; display: none; align-items: center; justify-content: center; overflow-x: hidden; overflow-y: auto;
  padding: max(0.6rem, env(safe-area-inset-top)) max(0.6rem, env(safe-area-inset-right)) max(0.6rem, env(safe-area-inset-bottom)) max(0.6rem, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 35%, rgba(40, 28, 16, 0.55), rgba(5, 4, 3, 0.94) 70%), var(--sk-tex) 0 0 / 16rem 16rem repeat, #0b0806; }
.ol-style.on { display: flex; }
.ol-style-box { width: min(64rem, 100%); max-height: none; margin: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.ol-style-top { display: flex; align-items: center; gap: 1rem; }
.ol-style-head { flex: 1; min-width: 0; }
.ol-style-head h2 { margin: 0; padding-bottom: 0.2rem; }
.ol-style-head small { color: var(--muted); font-size: 0.95rem; }
#ol-style-go { flex: none; margin: 0; min-width: 11rem; }
.ol-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: 0.6rem; }
.ol-style-tile { display: flex; align-items: stretch; gap: 0.7rem; text-align: left; padding: 0.45rem; min-height: 6.5rem; cursor: pointer; font: inherit; color: var(--ink);
  background: rgba(8, 6, 4, 0.7); border: 1px solid rgba(184, 137, 74, 0.45); border-radius: 0.5rem; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.ol-style-tile:hover { border-color: var(--ol-gold); transform: translateY(-1px); }
.ol-style-tile.sel { border-color: var(--gold-hi); box-shadow: 0 0 0 2px rgba(240, 200, 110, 0.55), 0 0 1.2rem rgba(240, 200, 110, 0.3); }
.ol-style-art { flex: none; width: 5.6rem; border-radius: 0.35rem; background: #1a120b center 30% / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255, 220, 150, 0.25); }
.ol-style-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ol-style-body b { color: var(--gold-hi); font-size: 1.15rem; font-weight: normal; }
.ol-style-body small { font-size: 0.92rem; line-height: 1.3; }
.ol-style-body i { color: var(--muted); font-size: 0.8rem; margin-top: auto; }
body.ol-low .ol-style { align-items: flex-start; }
body.ol-low .ol-style-box { padding: 0.4rem 0.7rem; gap: 0.35rem; }
body.ol-low .ol-style-head h2 { font-size: 1.2rem; padding: 0; }
body.ol-low .ol-style-head small { display: none; }
body.ol-low #ol-style-go { min-width: 0; min-height: 42px; font-size: 1.1rem; }
body.ol-low .ol-style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; }
body.ol-low .ol-style-tile { min-height: 0; padding: 0.3rem; gap: 0.4rem; }
body.ol-low .ol-style-art { width: 3.2rem; }
body.ol-low .ol-style-body b { font-size: 0.98rem; }
body.ol-low .ol-style-body small { font-size: 0.78rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
body.ol-low .ol-style-body i { display: none; }

/* ════════ телефон вертикально (08.11, body.ol-port: портрет, ширина до 600): одна колонка, крупные кнопки, без горизонтальной прокрутки.
   Главное (ты, «Найти соперника», кнопки) — без прокрутки; списки «В сети / Друзья / Задания» — ниже, лобби листается целиком */
body.ol-port #menu.ol { background: linear-gradient(180deg, rgba(5, 6, 10, 0.9), rgba(5, 6, 10, 0.78)); }
body.ol-port .ol-lobby { flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 0.6rem; overflow-x: hidden; overflow-y: auto; pointer-events: auto;
  -webkit-overflow-scrolling: touch; padding: max(0.5rem, env(safe-area-inset-top)) max(0.6rem, env(safe-area-inset-right)) max(0.8rem, env(safe-area-inset-bottom)) max(0.6rem, env(safe-area-inset-left)); }
body.ol-port .ol-left, body.ol-port .ol-right { width: auto; max-width: none; flex: none; padding: 0; overflow: visible; justify-content: flex-start; }
body.ol-port .ol-left { gap: 0.3rem; }
body.ol-port .ol-left .logo { display: none; }
body.ol-port .ol-plate { width: auto; margin: 0 3.1rem; }   /* слева громкость, справа «во весь экран» */
body.ol-port .ol-find { min-height: 3.4rem; font-size: 1.45rem !important; }
body.ol-port .ol-grid { gap: 0 0.45rem; }
body.ol-port .ol-grid .btn { min-height: 50px; font-size: 1.08rem !important; margin: 0.18rem 0 !important; }
body.ol-port .ol-row2 .btn { min-height: 46px; font-size: 0.98rem !important; }
body.ol-port .ol-row2.ol-three .btn { font-size: 0.9rem !important; }
body.ol-port .ol-dl { display: none; }
body.ol-port .ol-side { max-height: none; overflow: visible; padding: 0.5rem 0.6rem; }
body.ol-port .ol-pane { overflow: visible; }
body.ol-port .ol-sidetabs button { min-height: 46px; font-size: 1rem; }
body.ol-port .ol-row { min-height: 48px; }
body.ol-port .btn.mini-btn { min-height: 44px; }
/* вход и регистрация: поля друг под другом, кнопка во всю ширину */
body.ol-port .ol-auth { align-items: flex-start; padding-top: max(3.4rem, env(safe-area-inset-top)); }
body.ol-port .ol-auth-box { width: 100%; padding: 0.7rem 0.9rem; }
body.ol-port .ol-auth-box .logo { font-size: 2.6rem; }
body.ol-port .ol-auth-box .sub { margin: 0.2rem 0 0.5rem; font-size: 0.95rem; }
body.ol-port .ol-field input { min-height: 48px; font-size: 1.1rem; }
body.ol-port #ol-auth-go { min-height: 52px; }
/* «Выбери стиль»: плитки в столбик, «Начать» — сверху справа, всегда на виду */
body.ol-port .ol-style { align-items: flex-start; padding-top: max(3.4rem, env(safe-area-inset-top)); }
body.ol-port .ol-style-box { padding: 0.5rem 0.6rem; gap: 0.45rem; }
body.ol-port .ol-style-top { gap: 0.5rem; }
body.ol-port .ol-style-head h2 { font-size: 1.3rem; padding: 0; }
body.ol-port .ol-style-head small { display: none; }
body.ol-port #ol-style-go { min-width: 0; min-height: 46px; font-size: 1.05rem; padding: 0 0.8rem; max-width: 55%; white-space: normal; line-height: 1.1; }
body.ol-port .ol-style-grid { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
body.ol-port .ol-style-tile { min-height: 0; padding: 0.35rem; gap: 0.55rem; }
body.ol-port .ol-style-art { width: 3.9rem; }
body.ol-port .ol-style-body b { font-size: 1.05rem; }
body.ol-port .ol-style-body small { font-size: 0.86rem; line-height: 1.25; }
body.ol-port .ol-style-body i { font-size: 0.74rem; }
/* лавка, наборы, профиль: на весь экран, шапка в две строки (вкладки — второй строкой во всю ширину) */
body.ol-port .ol-scr.panel-screen { align-items: stretch; justify-content: stretch;
  padding: max(0.35rem, env(safe-area-inset-top)) max(0.35rem, env(safe-area-inset-right)) max(0.35rem, env(safe-area-inset-bottom)) max(0.35rem, env(safe-area-inset-left)); }
body.ol-port .ol-scr .panel { max-height: none; }
body.ol-port .panel.wide.ol-shop, body.ol-port .panel.wide.ol-prof, body.ol-port .panel.wide.ol-packscr { width: 100%; height: calc(var(--ol-vh) - 0.7rem); padding: 0.45rem 0.55rem; }
body.ol-port .ol-top { gap: 0.4rem; row-gap: 0.4rem; }
body.ol-port .ol-top h2 { font-size: 1.25rem; padding: 0 0 0.2rem; margin-left: 2.9rem; }
body.ol-port .ol-top .btn { min-height: 44px; padding: 0 0.7rem; font-size: 1rem; }
body.ol-port .ol-tabs { order: 10; width: 100%; flex-wrap: nowrap; }
body.ol-port .ol-tabs button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 0.3rem; font-size: 0.95rem; white-space: normal; line-height: 1.1; }
body.ol-port .ol-purse { font-size: 1.1rem; gap: 0.6rem; }
body.ol-port .ol-packs { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
body.ol-port .ol-pack .ol-pack-art { height: 7.5rem; }
body.ol-port .ol-pack-buy .btn { min-height: 48px; flex: 1; }
body.ol-port .ol-decks { grid-template-columns: minmax(0, 1fr); }
body.ol-port .ol-deck-buy .btn { min-height: 46px; }
body.ol-port .ol-packs-main { flex-direction: column; gap: 0.5rem; }
body.ol-port .ol-stacks { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; flex: none; padding: 0 0 0.2rem; }
body.ol-port .ol-stack { flex: none; }
body.ol-port .ol-stage-pack .ol-pack-art { width: 12rem; height: 10rem; }
body.ol-port .ol-stage-pack .ol-pack-art::before, body.ol-port .ol-stage-pack .ol-pack-art::after { width: 5.8rem; height: 7.8rem; }
body.ol-port .ol-open-btns { flex-direction: column; align-items: stretch; width: min(20rem, 100%); }
body.ol-port .ol-open-btns .btn { min-height: 50px; }
body.ol-port .ol-oc { width: min(8rem, 28vw); }
body.ol-port .ol-many .ol-oc { width: min(6rem, 22vw); }
body.ol-port .ol-prof-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
body.ol-port .ol-prof-head .ol-face.huge { width: 4.6rem; height: 4.6rem; }
body.ol-port .ol-pw input { min-height: 46px; }
/* окна (вызов, вопрос, состав колоды, отмена): во всю ширину, кнопки крупно */
body.ol-port #ol-inv-in .panel, body.ol-port #ol-ask .panel, body.ol-port #ol-pwa .panel, body.ol-port #ol-cancel .panel { width: calc(100vw - 1rem); }
body.ol-port #ol-inv-in .setup-row .btn, body.ol-port #ol-ask .setup-row .btn, body.ol-port #ol-cancel .btn { min-height: 48px; }
body.ol-port .ol-deck-panel { width: calc(100vw - 1rem); }
body.ol-port .ol-toast { max-width: calc(100vw - 1rem); font-size: 0.98rem; }
/* шапка лавки вертикально: «Лавка … Назад», затем «Открыть наборы» и кошелёк, затем вкладки */
body.ol-port .ol-top h2 { flex: 1 1 auto; }
body.ol-port #ol-shop-back { order: 1; }
body.ol-port .ol-to-packs { order: 2; flex: 1 1 auto; }
body.ol-port .ol-shop .ol-purse { order: 3; }

/* ════════ большой экран «в книжную» (08.11, body.ol-tall: высота больше ширины, ширина больше 600 — монитор повёрнут, планшет):
   лобби — одной колонкой по центру разумной ширины (46rem; rem здесь от ширины окна, css/mobile.css), крупным масштабом;
   по высоте — по центру, если влезает, иначе листается с самого верха (auto-поля не уводят начало за край). Экраны и окна — шире и выше */
/* стол в высоком окне — полосой посередине (камера стола, js/view/scene.js); лобби стоит поверх, поэтому стол приглушён ровно,
   а колонка — своей подложкой: меню читается как меню, а не как часть стола */
body.ol-tall #menu.ol { background: rgba(5, 6, 10, 0.62); }
body.ol-tall .ol-lobby > .ol-left { background: rgba(10, 8, 6, 0.62); padding: 1rem 1.2rem 1.1rem; border-radius: 0.6rem; box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.55); }
body.ol-tall .ol-lobby { flex-direction: column; align-items: center; justify-content: flex-start; gap: 1.1rem; overflow-x: hidden; overflow-y: auto; pointer-events: auto;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(1.5rem, env(safe-area-inset-bottom)); }
body.ol-tall .ol-lobby > .ol-left { margin-top: auto; }
body.ol-tall .ol-lobby > .ol-right { margin-bottom: auto; }
body.ol-tall .ol-left, body.ol-tall .ol-right { width: min(100%, 46rem); max-width: none; flex: none; padding: 0; overflow: visible; justify-content: flex-start; box-sizing: border-box; }
body.ol-tall .ol-left { gap: 0.45rem; }
body.ol-tall .ol-left .logo { text-align: center; font-size: 5rem; margin-bottom: 0.8rem; }
body.ol-tall .ol-plate-body > b { font-size: 1.8rem; }
body.ol-tall .ol-plate .ol-face.big { width: 5rem; height: 5rem; }
body.ol-tall .ol-money { font-size: 1.3rem; }
body.ol-tall .ol-find { min-height: 5rem; font-size: 2.2rem !important; margin-top: 0.6rem !important; }
body.ol-tall .ol-grid { gap: 0 0.6rem; }
body.ol-tall .ol-grid .btn { min-height: 4.1rem; font-size: 1.45rem !important; margin: 0.3rem 0 !important; }
body.ol-tall .ol-row2 .btn { min-height: 3.3rem; font-size: 1.2rem !important; }
body.ol-tall .ol-row2.ol-three .btn { font-size: 1.05rem !important; }
body.ol-tall .ol-dl { justify-content: center; }
body.ol-tall .ol-side { max-height: calc(var(--ol-vh) * 0.38); min-height: 18rem; padding: 0.8rem 1rem; }
body.ol-tall .ol-sidetabs button { min-height: 3rem; font-size: 1.15rem; }
body.ol-tall .ol-row { min-height: 3.2rem; }
body.ol-tall .ol-row-body b { font-size: 1.1rem; }
body.ol-tall .ol-elsewhere { justify-content: center; }
/* вход и регистрация — крупнее */
body.ol-tall .ol-auth-box { width: min(38rem, 92vw); padding: 1.6rem 2rem; }
body.ol-tall .ol-auth-box .logo { font-size: 4.4rem; }
body.ol-tall .ol-auth-box .sub { font-size: 1.3rem; }
body.ol-tall .ol-field { font-size: 1.15rem; }
body.ol-tall .ol-field input { font-size: 1.4rem; min-height: 3.4rem; }
body.ol-tall .ol-auth-tabs button { font-size: 1.2rem; min-height: 3rem; }
body.ol-tall #ol-auth-go { min-height: 3.8rem; font-size: 1.6rem !important; }
body.ol-tall .ol-note, body.ol-tall .ol-forgot { font-size: 1.05rem; }
/* «Выбери стиль»: две колонки крупных плиток */
body.ol-tall .ol-style-box { width: min(60rem, 96vw); }
body.ol-tall .ol-style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
body.ol-tall .ol-style-tile { min-height: 9rem; padding: 0.6rem; }
body.ol-tall .ol-style-art { width: 7.5rem; }
body.ol-tall .ol-style-body b { font-size: 1.45rem; }
body.ol-tall .ol-style-body small { font-size: 1.1rem; }
body.ol-tall #ol-style-go { min-height: 3.6rem; font-size: 1.4rem; min-width: 14rem; }
/* лавка, наборы, профиль: почти весь экран по высоте, по ширине — не шире 64rem */
body.ol-tall .ol-scr .panel { max-height: none; }
body.ol-tall .panel.wide.ol-shop, body.ol-tall .panel.wide.ol-prof, body.ol-tall .panel.wide.ol-packscr { width: min(64rem, 96vw); height: min(calc(var(--ol-vh) - 3rem), 70rem); }
/* профиль — по содержимому, не на весь экран */
body.ol-tall .panel.wide.ol-prof { height: auto; max-height: calc(var(--ol-vh) - 3rem); }
body.ol-tall .ol-prof-body { flex: none; }
/* шапка лавки: вкладки — второй строкой, «Назад» — в первой */
body.ol-tall .ol-tabs { order: 10; }
body.ol-tall .ol-top .btn, body.ol-tall .ol-tabs button { min-height: 3rem; font-size: 1.15rem; }
body.ol-tall .ol-top h2 { font-size: 2rem; }
body.ol-tall .ol-packs { grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr)); }
body.ol-tall .ol-packs-main { flex-direction: column; }
body.ol-tall .ol-stacks { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; flex: none; padding: 0 0 0.3rem; }
body.ol-tall .ol-stack { flex: none; }
body.ol-tall .ol-open-btns .btn { min-height: 3.4rem; font-size: 1.3rem; }
/* окна: шире и крупнее */
body.ol-tall #ol-inv-in .panel, body.ol-tall #ol-ask .panel, body.ol-tall #ol-pwa .panel, body.ol-tall #ol-cancel .panel { width: min(40rem, 92vw); }
body.ol-tall .ol-inv-text { font-size: 1.2rem; }
body.ol-tall #ol-inv-in .setup-row .btn, body.ol-tall #ol-ask .setup-row .btn, body.ol-tall #ol-cancel .btn { min-height: 3.4rem; font-size: 1.3rem; }
body.ol-tall .ol-deck-panel { width: min(52rem, 94vw); }

/* «Против бота» онлайн: партия на сервере — задания засчитываются */
.ol-bot-note { margin: 0.4rem 0 0.2rem; padding: 0.4rem 0.7rem; color: var(--ink); font-size: 0.92rem; line-height: 1.35; border-left: 3px solid var(--ol-gold); background: rgba(240, 200, 110, 0.07); }
.ol-bot-note b { color: #b8e08a; font-weight: normal; }
