/* Карта мира (js/screens/map.js). Стоя (body.vertical) — крупнее, лёжа — прежние размеры; вид и поведение — одинаково
   (docs/UI_PLAN.md §2–§3: карточка объекта, выбор армии над целью, перенос замка — режимом, поиск — нижней панелью) */
.screen.world .viewport { background: #56723a; }
.screen.world canvas.map, .screen.world canvas.actors { position: absolute; left: 0; top: 0; display: block; }
.screen.world canvas.actors { pointer-events: none; } /* фигуры поверх земли (map.js drawActors): касания — земле и слою */
.screen.world .lord { cursor: pointer; }

/* ——— координаты (§3 п. 9): плашка X·Y сверху посередине, касание — «Найти клетку». Кнопок на ней больше нет: поиск,
   метки и обозы — в столбце слева (.wm-quick) ——— */
.coords {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 5px 16px; border-radius: 18px; cursor: pointer; color: var(--w-accent, var(--bronze-l)); font: 700 17px/1.1 var(--sans);
  text-shadow: var(--t-outline);
}
.coords .xy { white-space: nowrap; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.coords:active { transform: translateX(-50%) scale(0.96); }

/* ——— походы (§3 п. 9): всегда на экране, шапка сворачивает список; строка — лицо командира с номером армии, что
   делает, полоса пути, сколько осталось, «следить» или «ускорить»; последняя — «Новый поход» ——— */
.marches { position: absolute; left: 14px; top: 110px; width: 240px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.marches > *, .marches .ml > * { pointer-events: auto; }
.marches .ml { display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.marches .mh {
  display: flex; align-items: center; gap: 8px; height: 34px; padding-block: 0; padding-inline: 8px 12px; box-sizing: border-box; border-radius: 8px;
  background: var(--plate); border: 1px solid var(--bronze); color: var(--text); font: 700 16px/1 var(--sans); cursor: pointer; text-align: start;
}
.marches .mh .car { display: flex; transform: rotate(-90deg); transition: transform 0.15s; }
.marches.shut .mh .car { transform: rotate(180deg); }
[dir="rtl"] .marches.shut .mh .car { transform: none; }
.marches .mh .n { margin-inline-start: auto; color: var(--gold); font-variant-numeric: tabular-nums; }
.march {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px; box-sizing: border-box; border-radius: 8px;
  background: var(--plate); border: 1px solid var(--bronze-d); color: var(--text); font: inherit; cursor: pointer; text-align: start;
}
.march .fc {
  position: relative; width: 38px; height: 38px; flex: none; box-sizing: border-box; border-radius: 8px; border: 2px solid var(--bronze);
  background: var(--navy-l) center top / cover no-repeat;
}
.march .fc i { position: absolute; inset-inline-start: -6px; bottom: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--crimson);
  border: 2px solid #fff3d0; color: #fff; font: 700 11px/14px var(--sans); font-style: normal; text-align: center; }
.march .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.march .tx b { display: flex; align-items: center; gap: 4px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.march .tx b svg, .march .tx b img { flex: none; width: 1.15em; height: 1.15em; }
/* полоса пути похода (класс .mpb — не .pb: так зовутся якоря мест замка в kod.css, аудит karta-10) */
.march .mpb { position: relative; display: block; width: 100%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.march .mpb i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--steel-l), #9fd0ff); }
.march .tm { flex: none; color: var(--gold); font-size: 15px; font-variant-numeric: tabular-nums; }
.march .mb {
  width: 36px; height: 36px; flex: none; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 18px;
  border: 2px solid #fff; background: linear-gradient(var(--blue-l), var(--blue)); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); cursor: pointer;
}
.march .mb svg { width: 60%; height: 60%; }
.march .mb.ff { background: linear-gradient(#ffd25e, #ec9a1e); }
.march.add { justify-content: center; gap: 6px; border-style: dashed; color: #c8f0cc; font-weight: 700; font-size: 14px; }

/* ——— быстрые кнопки карты (§3 п. 9): поиск, метки, обозы, лазарет (светится, пока есть раненые), «Помочь всем»; лёжа —
   одним рядом над «Героями», стоя — столбцом слева ——— */
.wm-quick {
  position: absolute; left: calc(14px + var(--sal, 0px)); bottom: calc(126px + var(--sab, 0px)); display: grid; grid-template-columns: repeat(5, 70px);
  gap: 4px 2px; align-items: start; justify-items: center; pointer-events: none;
}
.wm-quick > * { pointer-events: auto; }
.wm-quick .hbtn .c { width: 50px; height: 50px; border-radius: 25px; }
.wm-quick .hbtn.lit .c { background: radial-gradient(circle at 50% 35%, #4f9a5f, #1f4a2a); border-color: #9fe0a8; box-shadow: 0 0 12px rgba(159, 224, 168, 0.75); }
.wm-quick .hbtn.help .c { background: radial-gradient(circle at 50% 35%, #8fd060, #3f7f22); border-color: #e8f7c8; }

/* охота: выносливость лорда */
.world .hud .stamina { position: absolute; left: 140px; top: 22px; padding: 6px 14px; display: flex; align-items: center; gap: 6px; font-size: 20px; color: var(--muted, #c9bfae); }
.world .hud .stamina b { color: var(--w-hi, #fff3d0); font-size: 22px; }
.world .hud .stamina .v { display: flex; align-items: center; gap: 6px; }
.world .hud .stamina .n { direction: ltr; unicode-bidi: isolate; } /* «80/120» справа налево не переставляется */
.world .hud .stamina .n b { margin-inline-end: 3px; }

/* ——— окно клетки (без живой карты, ?mapfx=0, и окна объектов на проверочных страницах) и окна объектов ——— */
.cell-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; font-size: var(--fs-body); }
.cell-head .pos { padding: 3px 10px; border-radius: 6px; background: var(--w-field, var(--navy-d)); border: 1px solid var(--w-line, var(--bronze-d)); color: var(--w-accent, var(--bronze-l)); font-weight: 700; }
.cell-head .shield { display: flex; align-items: center; gap: 4px; color: #a8d0f0; }
.cell-note.fire { color: #ff9a5a; font-weight: 700; } /* пожар замка (docs/ALLIANCE.md §4) */
.modal .cell-note.fire, .cp-card .cell-note.fire { color: #b3401a; }
.screen.world .req { margin-bottom: 8px; }
.screen.world .req b { margin-left: auto; }
.modal .req b:last-child { margin-left: auto; }
.cell-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.find-row { display: flex; align-items: flex-end; gap: 12px; }
.find-row .field { width: 140px; }
.mon-head { display: flex; gap: 18px; align-items: center; }
.mon-head img { width: 220px; height: 120px; object-fit: contain; flex: none; }
.mon-head > div { flex: 1; min-width: 0; }
.mon-hp { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.mon-hp .bar { flex: 1; height: 12px; border-radius: 6px; background: var(--w-track, rgba(0,0,0,.45)); overflow: hidden; }
.mon-hp .bar i { display: block; height: 100%; background: linear-gradient(90deg, #a3262a, #e0705f); }
.mon-note { color: var(--muted, #c9bfae); font-size: 16px; margin: 0; }
body.vertical .mon-note { font-size: var(--fs-sub); }
.mon-loot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin: 14px 0 6px; }
.mon-loot .t { color: var(--muted, #c9bfae); width: 100%; }
.mon-loot .loot b { color: var(--w-good, #9fe0a8); }
.mon-st { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.mon-st.lack b { color: var(--w-bad, #e0705f); }
.mon-lock { display: flex; align-items: center; gap: 8px; color: var(--w-bad, #e0705f); margin: 10px 0 0; }

/* ——— карточка объекта карты (§2.2, §3 п. 2–3; map.js openPop): светлая, тёмная полоса заголовка, хвостик к клетке;
   в углу — «В метки» и «В чат», внизу карточки (под прокруткой, всегда на виду) — второстепенные действия; под клеткой
   дугой — до трёх круглых крупных действий. Высота — не больше места у объекта (--cp-max из map.js popMax: стоя — над
   ним, лёжа — вся высота, карточка сбоку); длиннее — прокрутка с тенью внизу. Слой .cell-pop — во весь экран, касания
   ловят только карточка и кнопки; пока она открыта, HUD спрятан ——— */
.cell-pop { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.cell-pop.hidden, .world.placing .cell-pop, .world.far .cell-pop { display: none; }
.cp-card {
  --text: #1f2a38; --muted: #566274; --good: #23803e; --bad: #c0392b; --gold: #8a5a00;
  --w-hi: #16202c; --w-muted: #566274; --w-good: #23803e; --w-bad: #c0392b; --w-gold: #8a5a00; --w-accent: #7a4c14;
  --w-well: #d4e0ef; --w-track: rgba(30, 48, 76, 0.2); --w-field: #f3f6fa; --w-line: #a5b6cc;
  position: absolute; left: 0; top: 0; width: 400px; box-sizing: border-box; pointer-events: auto; color: var(--text);
  background: #c6cfda; border: 3px solid #2a3442; border-radius: 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  font-size: 15px; display: flex; flex-direction: column; max-height: var(--cp-max, 80%);
}
/* карточка вырастает из клетки (аудит karta-22: появлялась мгновенно): свойством scale от хвостика — место карточки ставит
   её transform (map.js placePop), scale с ним складывается; одна конечная анимация, html.kod-still — сразу */
.cp-card { transform-origin: var(--tx, 50%) calc(100% + 18px); animation: cp-in 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.22) both; }
.cp-card.below { transform-origin: var(--tx, 50%) -18px; }
.cp-card.side-r { transform-origin: -18px var(--ty, 50%); }
.cp-card.side-l { transform-origin: calc(100% + 18px) var(--ty, 50%); }
@keyframes cp-in { from { scale: 0.55; opacity: 0; } 60% { opacity: 1; } }
html.kod-still .cp-card { animation: none; }
/* хвостик к клетке: снизу карточки (карточка над объектом) или сверху (.below — под объектом); --tx — где клетка */
.cp-card::before, .cp-card::after { content: ''; position: absolute; left: var(--tx, 50%); width: 0; height: 0; border: solid transparent; pointer-events: none; }
.cp-card::before { bottom: -19px; margin-left: -16px; border-width: 16px 16px 0; border-top-color: #2a3442; }
.cp-card::after { bottom: -13px; margin-left: -12px; border-width: 12px 12px 0; border-top-color: #c6cfda; }
.cp-card.below::before { bottom: auto; top: -19px; border-width: 0 16px 16px; border-color: transparent transparent #405065; }
.cp-card.below::after { bottom: auto; top: -13px; border-width: 0 12px 12px; border-color: transparent transparent #405065; }
/* лёжа карточка сбоку от объекта: хвостик слева (.side-r — карточка справа от него) или справа (.side-l); --ty — высота клетки */
.cp-card:is(.side-r, .side-l)::before, .cp-card:is(.side-r, .side-l)::after { bottom: auto; top: var(--ty, 50%); }
.cp-card.side-r::before { left: -19px; margin: -16px 0 0; border-width: 16px 16px 16px 0; border-color: transparent #2a3442 transparent transparent; }
.cp-card.side-r::after { left: -13px; margin: -12px 0 0; border-width: 12px 12px 12px 0; border-color: transparent #c6cfda transparent transparent; }
.cp-card.side-l::before { left: auto; right: -19px; margin: -16px 0 0; border-width: 16px 0 16px 16px; border-color: transparent transparent transparent #2a3442; }
.cp-card.side-l::after { left: auto; right: -13px; margin: -12px 0 0; border-width: 12px 0 12px 12px; border-color: transparent transparent transparent #c6cfda; }
.cp-top {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding-block: 6px; padding-inline: 14px 8px; box-sizing: border-box;
  background: linear-gradient(#405065, #2a3442); border-radius: 10px 10px 0 0; color: #fff; flex: none;
}
.cp-t { flex: 1; min-width: 0; font: 700 20px/1.15 var(--sans); text-shadow: var(--t-outline); overflow-wrap: anywhere; }
.cp-tools { display: flex; gap: 6px; flex: none; }
.cp-i {
  width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  border: 2px solid #fff; background: linear-gradient(var(--blue-l), var(--blue)); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); cursor: pointer;
}
.cp-i svg, .cp-i img { width: 70%; height: 70%; }
.cp-i.on { background: linear-gradient(#ffd25e, #ec9a1e); }
.cp-i:active { transform: translateY(2px); box-shadow: none; }
.cp-body { display: flex; flex-direction: column; gap: 7px; flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 10px 12px 12px; }
.cp-body > * { margin: 0; flex-shrink: 0; }
/* ниже ещё есть: низ прокрутки тает (map.js popCue — пока не долистали до конца) */
.cp-body.more-down { -webkit-mask-image: linear-gradient(#000 calc(100% - 56px), rgba(0, 0, 0, 0.15)); mask-image: linear-gradient(#000 calc(100% - 56px), rgba(0, 0, 0, 0.15)); }
.cp-who { display: flex; align-items: center; gap: 10px; }
/* земля сбора: значок ресурса крупно и добыча в час (map.js openCell, аудит karta-13) */
.cp-res { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px 6px; border-radius: 12px;
  background: var(--w-well); border: 1px solid var(--w-line); }
.cp-res img, .cp-res svg { width: 52px; height: 52px; object-fit: contain; }
.cp-res b { font: 700 17px/1 var(--sans); color: var(--w-good); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-res b small { font-size: 0.75em; color: var(--w-muted); }
body.vertical .cp-res img, body.vertical .cp-res svg { width: 72px; height: 72px; }
body.vertical .cp-res b { font-size: 24px; }
.cp-who .ava { --ava-s: 48px; }
.cp-who .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.cp-who .tx b { font-size: 16px; line-height: 1.2; color: var(--w-hi); overflow-wrap: anywhere; }
.cp-pic { width: 76px; height: 56px; flex: none; object-fit: contain; }
.cp-xy {
  display: inline-block; padding: 2px 10px; border-radius: 8px; background: #2f8f3e; border: 1px solid #1e5a2a; color: #fff;
  font-weight: 700; font-variant-numeric: tabular-nums; unicode-bidi: isolate; text-shadow: var(--t-outline);
}
.cp-chips { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.cp-chip { display: inline-flex; align-items: center; gap: 4px; color: #2d5f8f; font-weight: 700; }
.cp-bar { display: flex; flex-direction: column; gap: 3px; }
.cp-bar .t { color: var(--muted); }
.cp-bar .bar { position: relative; display: block; height: 22px; border-radius: 11px; background: rgba(30, 48, 76, 0.22); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25); }
.cp-bar .bar i { display: block; height: 100%; background: linear-gradient(#7fd08e, #3f8f4f); }
.cp-bar.foe .bar i { background: linear-gradient(#e0705f, #a3262a); }
.cp-bar.gat .bar i { background: linear-gradient(#ffd25e, #c08a10); }
.cp-bar .bar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; text-shadow: var(--t-outline); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.cp-row { display: flex; align-items: center; gap: 8px; }
.cp-row > span { flex: 1; min-width: 0; }
.cp-row.rec b { font-size: 18px; color: var(--w-hi); }
.cp-row.st.lack b { color: var(--w-bad); }
.cp-card .req, .cp-flat .req { min-height: 0; margin: 0; padding: 6px 10px; gap: 8px; font-size: inherit; }
.cp-card .req b, .cp-flat .req b { margin-inline-start: auto; }
.cp-loot { display: flex; flex-direction: column; gap: 4px; }
.cp-loot .t { color: var(--muted); }
.cp-loot .ic-row, .cp-card .ic-row { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cp-loot .ic-row::-webkit-scrollbar { display: none; }
.cp-card .cell-note, .cp-flat .cell-note { margin: 0; font-size: 14px; line-height: 1.35; color: var(--muted); }
.cp-card .cell-note.cp-bad, .cp-flat .cell-note.cp-bad { color: var(--w-bad); font-weight: 700; }
.cp-card .mon-lock { margin: 0; color: var(--w-bad); font-size: 14px; }
.cp-card .kd-where { margin: 0; }
.cp-card .sect { font-size: 16px; }
.cp-more { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 12px; border-top: 1px solid rgba(42, 52, 66, 0.25); }
.cp-more .btn { flex: 1 1 auto; gap: 6px; }
.cp-flat { display: flex; flex-direction: column; gap: 8px; }
/* круглые действия дугой под клеткой: у крайних — выше, у средней — ниже */
.cp-acts { position: absolute; left: 0; top: 0; display: flex; justify-content: center; gap: 4px; pointer-events: auto; }
.cp-acts.n3 > :nth-child(2) { margin-top: 26px; }
.cp-acts.n2 { gap: 22px; }
.cp-b {
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 88px; padding: 0; border: 0; background: none;
  color: #fff; font: 700 13px/1.15 var(--sans); text-shadow: 0 1px 2px #000, 0 0 4px #000; cursor: pointer;
}
.cp-b .c {
  display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%;
  border: 3px solid #fff; background: radial-gradient(circle at 50% 30%, var(--blue-l), var(--blue)); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 -4px 0 rgba(8, 24, 48, 0.3);
}
.cp-b .c svg, .cp-b .c img { width: 58%; height: 58%; }
.cp-b.gold .c { background: radial-gradient(circle at 50% 30%, #ffd25e, #ec9a1e); }
.cp-b.green .c { background: radial-gradient(circle at 50% 30%, #8fd060, #4c9a2e); }
.cp-b.red .c { background: radial-gradient(circle at 50% 30%, var(--crimson-l), var(--crimson)); }
.cp-b .l { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
.cp-b.off .c { background: radial-gradient(circle at 50% 30%, #b7c0cb, #86909c); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); }
.cp-b.off .l { opacity: 0.8; }
.cp-b:hover .c { filter: brightness(1.1); }
@media (hover: none) { .cp-b:active .c { transform: scale(0.92); } }

/* метки карты (map.js openMarks): строка — к клетке и её карточка, справа — красная «Убрать метку» */
.mk-row { display: flex; align-items: stretch; gap: 8px; }
.mk-row .pick { flex: 1; min-width: 0; }
.mk-del { flex: none; width: 56px; min-width: 0; height: auto; min-height: 48px; padding: 0; }
body.vertical .mk-del { width: 84px; min-height: 84px; }

/* HUD прячется, пока открыта карточка объекта, выбор армии над целью или идёт перенос замка (как кольцо в замке) */
.world .hud.pop-on > :not(.cell-pop):not(.ws-bar), .world .hud.choose-on > :not(.ws-bar), .world.choosing .hud > .ws-bar {
  opacity: 0; visibility: hidden; transition: opacity 0.18s ease-out, visibility 0s linear 0.18s;
}

/* ——— дальний вид (как у образца): шапка трона, мини-карта и легенда — только издалека (класс far у экрана); походы,
   быстрые кнопки, координаты, чат и правый столбец издалека прячутся — остаются лорд, шапка, мини-карта, легенда и
   «Замок» ——— */
.world .wm-head, .world .wm-legend { opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.world.far .wm-head, .world.far .wm-legend { opacity: 1; pointer-events: auto; }
.world.far .hud > :is(.coords, .marches, .wm-quick, .gen, .stamina), .world.far .nav .chat { visibility: hidden; opacity: 0; }
.wm-head { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 18px; white-space: nowrap; }
.wm-head b { font-family: var(--title); font-size: 22px; color: #ffe39a; }
/* шапка мира волны 4 картинками (map.js renderHeadV2, аудит karta-20): знамя королевства, имя крупно, корона и король,
   отсчёты значками (мечи — война за престол, дракон — Драконий трон); касание — окно королевства */
.world.v2 .wm-head { gap: 12px; padding: 6px 18px 6px 8px; }
.wm-hflag { width: 52px; height: 66px; flex: none; margin: -12px 0 -8px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.wm-hflag.code { display: flex; align-items: flex-start; justify-content: center; padding-top: 10px; box-sizing: border-box; background: var(--kc);
  border: 2px solid rgba(255, 240, 200, 0.85); clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%); filter: none; }
.wm-htx { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.world.v2 .wm-head .wm-hname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 26px/1.1 var(--title); color: #ffe39a;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.6); }
.wm-hking { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; color: #fff3d0; }
.wm-hking i, .wm-hclock i { font-style: normal; white-space: nowrap; }
.wm-hcr { width: 22px; height: 22px; flex: none; }
.wm-hclock { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; font-weight: 700; color: #e8e0cc; font-variant-numeric: tabular-nums; }
.wm-hclock > span { display: inline-flex; align-items: center; gap: 5px; }
.wm-hclock .hot { color: #ff9a8a; }
/* мини-карта (владелец 08.11: «мелкую карту красивее в угол убрать»; map.js miniOpen) — на всех масштабах в правом
   верхнем углу, в нарисованной рамке map.minimap_frame (фоном, класс .art; нет картинки — рамка CSS), холст — внутри
   медной каймы рамки. Касание — растёт посередине экрана (.big, рост из угла — map.js miniFlip), касание по большой —
   перелёт туда (кольцо .wm-ping), мимо (затемнение .wm-mini-veil) — назад в угол */
.wm-mini-box {
  position: absolute; right: calc(12px + var(--sar, 0px)); top: calc(10px + var(--sat, 0px)); z-index: 2; width: 168px; height: 153px;
  box-sizing: border-box; cursor: pointer; transform-origin: 0 0; border-radius: 18%;
  background: center / 100% 100% no-repeat; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}
.wm-mini-box:not(.art) { border-radius: 24px; border: 2px solid var(--bronze); background-color: rgba(16, 20, 28, 0.86); }
.wm-mini-box .wm-mini { position: absolute; left: 11%; top: 10%; width: 78%; height: 80%; border-radius: 11% / 12%; display: block; pointer-events: none;
  box-shadow: 0 0 0 1.5px rgba(236, 196, 120, 0.7), 0 0 6px 1px rgba(0, 0, 0, 0.6); }
.wm-mini-box:not(.art) .wm-mini { left: 6px; top: 6px; width: calc(100% - 12px); height: calc(100% - 12px); border-radius: 18px; }
.wm-mini-box:active:not(.big) { filter: brightness(1.18); }
.wm-mini-box.big { z-index: 8; cursor: crosshair; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6); }
.wm-mini-veil { position: absolute; inset: 0; z-index: 7; background: rgba(8, 10, 16, 0.55); }
.wm-mini-veil.hidden { display: none; }
/* кольцо в точке касания раскрытой мини-карты: расходится и гаснет (одна конечная анимация) */
.wm-ping { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff3d0;
  box-shadow: 0 0 10px rgba(255, 227, 154, 0.9); pointer-events: none; animation: wm-ping 0.5s ease-out forwards; }
@keyframes wm-ping { from { transform: scale(0.4); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
html.kod-still .wm-ping { display: none; }
.wm-legend { position: absolute; right: calc(12px + var(--sar, 0px)); top: calc(171px + var(--sat, 0px)); display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; font-size: 14px; font-weight: 700; }
.wm-legend span { display: flex; align-items: center; gap: 8px; }
.wm-legend i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); flex: none; }
/* «Слава, Альянс, Почта, Сумка» (план 3.4) — справа над «Замком»; лёжа — две колонки, стоя — одна (portrait.css) */
.screen.world .gen { position: absolute; right: calc(8px + var(--sar)); bottom: calc(122px + var(--sab)); }
/* значок «Сбор войска альянса» (js/rallyflag.js) на карте: у правого края, ниже мини-карты и легенды дальнего вида */
.screen.world .rally-flag { right: 14px; top: 320px; }

/* плашка после своей стычки на карте (js/screens/mapfx.js): «Победа · Смотреть» — просмотр боя */
.mfx-chip { position: absolute; left: 50%; bottom: calc(132px + var(--sab, 0px)); transform: translateX(-50%); z-index: 3;
  padding: 9px 22px; border-radius: 22px; border: 2px solid #e8c66a; background: rgba(16, 20, 28, 0.9); color: #fff3d0;
  font: 700 18px var(--sans, sans-serif); letter-spacing: 0.3px; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  animation: mfx-chip-in 0.28s ease-out; }
.mfx-chip { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.mfx-chip svg { flex: none; }
.mfx-chip.win { border-color: #7fd08e; color: #c8f0cc; }
.mfx-chip.lose { border-color: #e0705f; color: #ffd0c8; }
.mfx-chip.hidden { display: none; }
.world.placing .mfx-chip { visibility: hidden; }
@keyframes mfx-chip-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .mfx-chip { animation: none; } }

/* ——— перенос замка (§3 п. 20) — режим: HUD спрятан, квадрат 3×3 тянется по карте; за ним (.mv-float, map.js
   placeMove: --gw/--gh — размер квадрата на экране) — плашка X·Y сверху, стрелки «на клетку» по сторонам, «Отмена» и
   «Перенести» с ценой снизу; внизу экрана — карточка: «Телепорт» и сколько есть, «+», можно ли ставить, «Случайно» ——— */
.world.placing .hud > :not(.mv-float):not(.wm-move):not(.wm-home) { visibility: hidden; }
.mv-float { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; display: none; --gw: 270px; --gh: 244px; }
.world.placing .mv-float { display: block; }
.mv-float > * { position: absolute; }
.mv-xy {
  left: 0; bottom: calc(var(--gh) / 2 + 56px); transform: translateX(-50%); padding: 4px 14px; border-radius: 10px; white-space: nowrap;
  background: #2f8f3e; border: 2px solid #e8f7c8; color: #fff; font: 700 18px/1.2 var(--sans); text-shadow: var(--t-outline);
  font-variant-numeric: tabular-nums; unicode-bidi: isolate; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.mv-float.bad .mv-xy { background: #a3262a; border-color: #ffd0c8; }
.mv-nd {
  width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 2px solid #fff; background: rgba(47, 143, 62, 0.92); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45); cursor: pointer;
}
.mv-float.bad .mv-nd { background: rgba(163, 38, 42, 0.92); }
.mv-nd svg { width: 70%; height: 70%; }
/* стрелки — по сторонам света карты (не зеркалятся справа налево); n-* — не путать с .up окна улучшения (kod.css) */
.mv-nd.n-up { left: -20px; top: calc(-1 * var(--gh) / 2 - 50px); transform: rotate(90deg); }
.mv-nd.n-dn { left: -20px; top: calc(var(--gh) / 2 + 10px); transform: rotate(-90deg); }
.mv-nd.n-lf { top: -20px; left: calc(-1 * var(--gw) / 2 - 50px); }
.mv-nd.n-rt { top: -20px; left: calc(var(--gw) / 2 + 10px); transform: rotate(180deg); }
.mv-btns { left: 0; top: calc(var(--gh) / 2 + 60px); transform: translateX(-50%); display: flex; gap: 12px; }
.mv-btns .btn { min-width: 150px; }
.mv-btns .btn.two { padding: 4px 18px; }
.wm-move {
  position: absolute; left: 50%; bottom: calc(14px + var(--sab)); transform: translateX(-50%); width: 560px; box-sizing: border-box;
  display: none; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; color: #1f2a38;
  background: #c6cfda; border: 3px solid #2a3442; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}
.world.placing .wm-move { display: flex; }
.wm-move .mv-item { position: relative; flex: none; display: flex; }
.wm-move .mv-item .plus { position: absolute; right: -8px; top: -8px; width: 28px; height: 28px; }
.wm-move .mv-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wm-move .mv-tx b { font: 700 18px/1.2 var(--sans); color: #16202c; }
.wm-move .mv-why { font-size: 15px; font-weight: 700; color: #23803e; }
.wm-move .mv-why.bad { color: #c0392b; }
.wm-move .btn { flex: none; }
/* «Рядом» (ближайшее место, где можно, map.js nearestFree) и «Случайно» — столбиком справа */
.wm-move .mv-alt { flex: none; display: flex; flex-direction: column; gap: 6px; }

/* замок земель (map.js openCastle, docs/REGIONS.md): полосы стен и охраны, война, почему нельзя */
.rg-bar { height: 10px; margin: -2px 0 10px; border-radius: 5px; background: var(--w-track, rgba(0, 0, 0, 0.45)); overflow: hidden; }
.rg-bar i { display: block; height: 100%; background: var(--w-good, #7fd08e); }
.rg-bar.foe i { background: var(--w-bad, #e0705f); }
.rg-war { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 7px 10px; border-radius: 8px; font-size: 15px; font-weight: 700;
  background: var(--w-well, rgba(16, 20, 28, 0.5)); border: 1px solid var(--w-bad, #e0705f); color: var(--w-bad, #ff9a8a); }
.rg-war svg { flex: none; }
.rg-war.on { background: var(--w-track, rgba(160, 30, 30, 0.25)); }
.rg-body .cell-note { color: var(--w-muted, #a8d0f0); }
.rg-body .cell-note.rg-why { color: var(--w-bad, #ff9a8a); }
/* шапка окна замка земель (map.js openCastle, аудит karta-08, karta-09): замок его уровня крупно и щиток уровня, справа
   хозяин, провинция, клетка и щит */
.rg-hero { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; }
.rg-pic { position: relative; flex: 0 0 52%; max-width: 300px; aspect-ratio: 384 / 348; display: flex; align-items: flex-end; justify-content: center;
  border-radius: 16px; background: radial-gradient(ellipse at 50% 70%, rgba(120, 160, 90, 0.55), rgba(60, 90, 50, 0.15) 70%, transparent 72%); }
/* у картинок замков сверху пустое поле (pad 72 из 420) — срезается: cover от низа */
.rg-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35)); }
.rg-lv { position: absolute; right: 2%; bottom: 4%; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  padding-bottom: 4px; box-sizing: border-box; background: center / contain no-repeat; font: 700 24px/1 var(--sans); font-style: normal;
  color: #fffaf0; text-shadow: 0 1px 0 #3a1a04, 0 0 3px #3a1a04, 0 0 3px #3a1a04; }
.rg-lv:not([style]) { border-radius: 10px; background: #e8a33a; border: 2px solid #3a2408; }
.rg-hero-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: max(14px, var(--fs-sub)); }
.rg-owner { display: flex; align-items: center; gap: 6px; font-size: max(15px, var(--fs-body)); color: var(--w-hi, var(--text)); }
.rg-owner.mine { color: var(--w-good, #3f8f4f); }
.rg-owner.foe { color: var(--w-bad, #c0392b); }
.rg-owner svg { flex: none; }
.rg-hero-tx .kd-where { margin: 0; font-size: inherit; }
.rg-hero-tx .pos { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px; background: var(--w-field, var(--navy-d));
  border: 1px solid var(--w-line, var(--bronze-d)); color: var(--w-accent, var(--bronze-l)); font-weight: 700; }
.rg-hero-tx .shield { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #2f6fa8; }
body.vertical .rg-body :is(.cell-note, .req, .rg-sub, .rg-war) { font-size: var(--fs-sub); }
body.vertical .rg-body .rg-des { font-size: var(--fs-body); }
body.vertical .rg-lv { width: 64px; height: 64px; font-size: 30px; }
body.phone-land .rg-body :is(.cell-note, .req, .rg-sub, .rg-war) { font-size: var(--fs-sub); }
body.phone-land .rg-pic { flex-basis: 40%; }
.rg-sub { margin: 4px 0 6px; font-weight: 700; color: var(--w-accent, var(--bronze-l)); }

/* указатель «Домой» (map.js placeHome): свой замок за краем экрана — у края кнопка, стрелка смотрит на замок */
.wm-home { position: absolute; left: 0; top: 0; z-index: 2; width: 64px; height: 64px; padding: 0; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; cursor: pointer;
  border: 2px solid #7fd08e; background: rgba(16, 20, 28, 0.82); color: #c8f0cc; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  font: 700 11px/1 var(--sans, sans-serif); }
.wm-home.hidden, .world.placing .wm-home { display: none; }
/* расстояние до замка — плашкой под кругом (map.js placeHome), крупно: видно, далеко ли ушла камера */
.wm-home .km { position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap;
  padding: 2px 8px; border-radius: 10px; background: rgba(16, 20, 28, 0.86); border: 1px solid #7fd08e; color: #e8ffe9;
  font: 700 13px/1.15 var(--sans, sans-serif); pointer-events: none; }
.wm-home .km:empty { display: none; }
body.vertical .wm-home .km, body.phone-land .wm-home .km { font-size: 17px; padding: 3px 10px; border-radius: 12px; }
.wm-home .ar { position: absolute; inset: -12px; pointer-events: none; }
.wm-home .ar::after { content: ''; position: absolute; right: 0; top: 50%; margin-top: -8px; border: 8px solid transparent;
  border-left: 11px solid #7fd08e; border-right: 0; }

/* ——— поиск целей (js/screens/search.js, §3 п. 19) — нижней панелью над картой: вкладки, плитки целей, уровень во всю
   ширину с «−/+», добыча, синяя «Искать» и «до какого уровня». Прежние правила .ws-* — css/waste.css (здесь — поверх) ——— */
.modal.ws-modal.sheet .modal-body { padding: 10px 14px 14px; }
.ws-search .ws-col { display: contents; } /* стоя — одним столбцом: плитки, уровень, что даст цель, «Искать» */
/* лёжа экран низкий: панель — не выше половины (§2.2), карта видна над ней. Под вкладками три столбца (search.js .ws-col):
   плитки цели и уровень | что даст цель | синяя «Искать» и откуда ищем — под правым большим пальцем; где ищем (земли
   королевства) — строкой под двумя последними */
body:not(.vertical) .modal.sheet.ws-modal { max-height: 52% !important; }
body:not(.vertical) .ws-modal .ws-search {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 0.7fr); grid-template-rows: auto auto 1fr;
  grid-template-areas: 'tabs tabs tabs' 'pick prev act' 'pick note note'; column-gap: 18px; align-items: start;
}
body:not(.vertical) .ws-modal .ws-tabs { grid-area: tabs; }
body:not(.vertical) .ws-modal .ws-pick { grid-area: pick; display: flex; flex-direction: column; min-width: 0; }
body:not(.vertical) .ws-modal .ws-pick .ws-kinds { margin-top: 4px; }
body:not(.vertical) .ws-modal .ws-info > .ws-prev { grid-area: prev; min-width: 0; margin: 4px 0 0; }
body:not(.vertical) .ws-modal .ws-prev .ic-row { flex-wrap: nowrap; } /* добыча — одной лентой вбок, а не в два ряда */
body:not(.vertical) .ws-modal .ws-info > .kd-note { grid-area: note; margin: 6px 0 0; }
body:not(.vertical) .ws-modal .ws-search > .act-bar { grid-area: act; position: static; margin: 4px 0 0; padding: 0; background: none; }
body:not(.vertical) .ws-modal .ws-scroll { display: contents; } /* лёжа — столбцы сетки, прокручивается всё тело */
.ws-modal .ws-tabs.q-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 2px; }
.ws-modal .ws-tabs.q-tabs::-webkit-scrollbar { display: none; }
.ws-modal .ws-tabs .q-tab { flex: 0 0 auto; }
.ws-kinds { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 10px 0 6px; padding-bottom: 2px; }
.ws-kinds::-webkit-scrollbar { display: none; }
.ws-kind {
  position: relative; flex: 0 0 auto; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px;
  box-sizing: border-box; border-radius: 12px; border: 2px solid #a5b6cc; background: linear-gradient(#e8eef6, #c9d4e1); color: #1f2a38;
  font: 700 13px/1.15 var(--sans); text-align: center; cursor: pointer; box-shadow: 0 3px 0 #8797ab, inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.ws-kind img, .ws-kind svg { width: 64px; height: 64px; object-fit: contain; }
.ws-kind.on { border-color: #ec9a1e; background: linear-gradient(#fff4d6, #f2d9a0); box-shadow: 0 3px 0 #b8741a, 0 0 0 2px #ffd25e; }
.ws-kind.one { cursor: default; } /* одна цель, выбирать нечего: плитка — что найдём, без «выбрано» */
.ws-modal .ws-lv { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.ws-modal .ws-lv > span { flex: none; color: var(--muted); }
.ws-modal .ws-lv .ws-range { flex: 1; min-width: 80px; }
.ws-modal .ws-lv .btn.sq { flex: none; }
.ws-modal .ws-lv b.lvb {
  flex: none; min-width: 64px; padding: 4px 10px; box-sizing: border-box; border-radius: 10px; text-align: center; color: #fff; font-size: 18px;
  background: linear-gradient(#405065, #2a3442); text-shadow: var(--t-outline);
}
.ws-modal .ws-prev { margin-bottom: 8px; }
.ws-modal .ws-prev > b { font-family: var(--sans); font-size: 17px; }
.ws-modal .ws-prev .ic-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ws-modal .act-bar { flex-direction: column; align-items: center; gap: 6px; }
.ws-modal .act-bar .btn { flex: none; }
.ws-modal .act-bar .ws-upto { font-size: var(--fs-sub); color: var(--muted); text-align: center; }
.ws-modal .act-bar .ws-from { margin: 0; display: inline-flex; align-items: center; gap: 6px; } /* откуда ищем — под кнопкой (css/waste.css — с полем сверху) */
.ws-rules { display: flex; flex-direction: column; gap: 10px; }
.ws-rules .mon-note, .ws-rules .kd-note { margin: 0; font-size: var(--fs-body, 18px); }

/* ——— стоя (docs/UI_PLAN.md §2.1, §3 п. 2, 9, 19, 20): крупнее, под большой палец ——— */
body.vertical .coords { top: calc(8px + var(--sat)); padding: 8px 22px; border-radius: 24px; font-size: 24px; }
body.vertical .world .hud .stamina { left: calc(10px + var(--sal)); top: calc(150px + var(--sat)); }
body.vertical .marches { left: calc(10px + var(--sal)); top: calc(210px + var(--sat)); width: 300px; gap: 8px; }
body.vertical .marches .ml { gap: 8px; }
body.vertical .marches .mh { height: 52px; padding-inline: 10px 14px; font-size: 22px; border-radius: 12px; }
body.vertical .march { height: 64px; padding: 0 6px; gap: 8px; border-radius: 12px; }
body.vertical .march .fc { width: 50px; height: 50px; border-radius: 10px; }
body.vertical .march .fc i { min-width: 22px; height: 22px; border-radius: 11px; font-size: 16px; line-height: 18px; }
body.vertical .march .tx b { font-size: 18px; }
body.vertical .march .mpb { height: 10px; border-radius: 5px; }
body.vertical .march .tm { font-size: 20px; }
body.vertical .march .mb { width: 52px; height: 52px; border-radius: 26px; }
body.vertical .march.add { font-size: 20px; }
body.vertical .wm-quick { left: calc(4px + var(--sal)); bottom: calc(150px + var(--sab)); grid-template-columns: 96px; gap: 6px; }
body.vertical .wm-quick .hbtn { width: 96px; }
body.vertical .wm-quick .hbtn .c { width: 70px; height: 70px; border-radius: 22px; }
body.vertical .wm-quick .hbtn > span:last-child { position: relative; margin-top: -14px; font-size: var(--fs-hud); line-height: 1.1; text-shadow: var(--t-outline), 0 0 6px #000; }
body.vertical .wm-quick .hbtn .cnt { min-width: 28px; height: 28px; border-radius: 14px; font-size: 16px; right: 6px; }
body.vertical .screen.world .gen { bottom: calc(150px + var(--sab)); } /* над нижней полосой HUD (css/hud.css) */
body.vertical .screen.world .rally-flag { right: calc(10px + var(--sar)); top: calc(306px + var(--sat)); }
body.vertical .mfx-chip { bottom: calc(150px + var(--sab, 0px)); padding: 14px 30px 14px 24px; border-width: 3px; border-radius: 34px; font-size: 28px; }
body.vertical .mfx-chip svg { width: 34px; height: 34px; }
body.vertical .wm-home { width: 84px; height: 84px; font-size: 16px; }
body.vertical .wm-home .ar::after { margin-top: -10px; border-width: 10px; border-left-width: 14px; }
/* дальний вид стоя: шапка в две строки (без многоточия), мини-карта 156 в углу, легенда 20 под ней (плитка «Замок» —
   нижняя полоса HUD) */
body.vertical .wm-head { left: calc(104px + var(--sal)); top: calc(104px + var(--sat)); transform: none; padding: 6px 14px;
  max-width: calc(100% - 290px - var(--sal) - var(--sar)); box-sizing: border-box; white-space: normal; } /* правее портрета, левее мини-карты */
body.vertical .wm-head b { font-family: var(--sans); font-size: 20px; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
body.vertical .world.v2 .wm-head { padding: 8px 18px 8px 10px; gap: 14px; border-radius: 18px; }
body.vertical .wm-hflag { width: 70px; height: 90px; margin: -16px 0 -12px; }
body.vertical .world.v2 .wm-head .wm-hname { font-size: 34px; }
body.vertical .wm-hking { font-size: var(--fs-sub); gap: 8px; }
body.vertical .wm-hcr { width: 30px; height: 30px; }
body.vertical .wm-hclock { font-size: var(--fs-sub); gap: 4px 16px; }
body.vertical .wm-hclock svg { width: 26px; height: 26px; }
body.vertical .wm-mini-box { right: calc(10px + var(--sar)); top: calc(8px + var(--sat)); width: 156px; height: 142px; }
/* легенда — под мини-картой (css/kingdom.css грузится позже — здесь вес выше) */
body.vertical .screen.world .wm-legend, body.vertical .screen.world.v2 .wm-legend { right: calc(10px + var(--sar)); top: calc(158px + var(--sat)); font-size: 20px; gap: 6px 12px; }
/* мир волны 4: шапка со знаменем выше прежней — легенда ниже её низа, не под ней */
body.vertical .screen.world.v2 .wm-legend { top: calc(248px + var(--sat)); }
body.vertical .screen.world.v2.far .rally-flag { top: calc(560px + var(--sat)); }
body.vertical .screen.world .wm-legend i { width: 18px; height: 18px; }
body.vertical .screen.world .kd-legend .kd-mode button { font-size: 18px; padding: 6px 10px; }

/* карточка стоя: шире (560), заголовок 30, строки 20–22, аватар 72, кнопки дугой — круг 84, подпись 20 */
body.vertical .cp-card { width: 560px; font-size: 20px; border-radius: 18px; }
body.vertical .cp-top { min-height: 64px; padding-block: 8px; padding-inline: 18px 10px; border-radius: 14px 14px 0 0; }
body.vertical .cp-t { font-size: 30px; }
body.vertical .cp-i { width: 52px; height: 52px; border-radius: 14px; }
body.vertical .cp-body { gap: 10px; padding: 12px 16px 16px; }
body.vertical .cp-who { gap: 14px; }
body.vertical .cp-who .ava { --ava-s: 72px; }
body.vertical .cp-who .ava .lv { font-size: 16px; }
body.vertical .cp-card .kd-where { font-size: 18px; }
body.vertical .cp-who .tx b { font-size: 22px; }
body.vertical .cp-pic { width: 112px; height: 80px; }
body.vertical .cp-xy { padding: 3px 12px; font-size: 22px; border-radius: 10px; }
body.vertical .cp-bar { gap: 4px; }
body.vertical .cp-bar .bar { height: 30px; border-radius: 15px; }
body.vertical .cp-bar .bar b { font-size: 18px; }
body.vertical .cp-row.rec b { font-size: 24px; }
body.vertical .cp-card .cell-note, body.vertical .cp-card .mon-lock, body.vertical .cp-flat .cell-note { font-size: 18px; }
body.vertical .cp-card .ic-cell { --ic: 80px; }
body.vertical .cp-card .sect { font-size: 20px; }
body.vertical .cp-more { gap: 8px; padding: 10px 16px 16px; }
body.vertical .cp-acts { gap: 6px; }
body.vertical .cp-acts.n3 > :nth-child(2) { margin-top: 34px; }
body.vertical .cp-acts.n2 { gap: 30px; }
body.vertical .cp-b { width: 112px; gap: 4px; font-size: 20px; text-shadow: var(--t-outline), 0 0 6px #000; }
body.vertical .cp-b .c { width: 84px; height: 84px; border-width: 4px; }
/* перенос стоя: стрелки 72 (аудит karta-32: были ~27 px на телефоне), кнопки 72, плашка X·Y 24; карточка внизу во всю
   ширину, «почему нельзя» — 22 */
body.vertical .mv-xy { font-size: 24px; padding: 6px 18px; border-radius: 12px; bottom: calc(var(--gh) / 2 + 82px); }
body.vertical .mv-nd { width: 72px; height: 72px; border-width: 3px; }
body.vertical .mv-nd.n-up { left: -36px; top: calc(-1 * var(--gh) / 2 - 80px); }
body.vertical .mv-nd.n-dn { left: -36px; top: calc(var(--gh) / 2 + 8px); }
body.vertical .mv-nd.n-lf { top: -36px; left: calc(-1 * var(--gw) / 2 - 80px); }
body.vertical .mv-nd.n-rt { top: -36px; left: calc(var(--gw) / 2 + 8px); }
body.vertical .mv-btns { top: calc(var(--gh) / 2 + 92px); gap: 16px; }
body.vertical .mv-btns .btn { height: 72px; min-height: 72px; min-width: 200px; }
body.vertical .mv-btns .btn.two .sub { font-size: 22px; }
body.vertical .wm-move { left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); width: auto; transform: none; bottom: calc(16px + var(--sab));
  gap: 14px; padding: 12px 16px; border-radius: 18px; }
body.vertical .wm-move .mv-item .ic-cell { --ic: 80px; }
body.vertical .wm-move .mv-item .plus { width: 40px; height: 40px; border-radius: 20px; right: -12px; top: -12px; }
body.vertical .wm-move .mv-tx b { font-size: 24px; }
body.vertical .wm-move .mv-why { font-size: var(--fs-sub); }
body.vertical .wm-move .mv-alt .btn { min-height: 56px; font-size: 20px; }
/* поиск стоя: плитки целей 140×150, уровень — кнопки 56 и значок 26, добыча 80 */
body.vertical .ws-kind { width: 140px; min-height: 150px; gap: 6px; padding: 8px 6px 10px; font-size: 18px; border-radius: 14px; }
body.vertical .ws-kind img, body.vertical .ws-kind svg { width: 92px; height: 92px; }
body.vertical .ws-modal .ws-lv { gap: 12px; margin: 8px 0 12px; }
body.vertical .ws-modal .ws-lv .btn.sq { width: 56px; height: 56px; font-size: 30px; }
body.vertical .ws-modal .ws-lv b.lvb { min-width: 88px; font-size: 26px; padding: 6px 12px; }
body.vertical .ws-modal .ws-prev > b { font-size: 22px; }
body.vertical .ws-modal .ws-prev .ic-cell { --ic: 80px; }
body.vertical .ws-modal .mon-note { font-size: 18px; }
/* полоска найденного (search.js showBar; .ws-bar — css/waste.css) стоя — во всю ширину над нижней строкой; пока она
   на экране, быстрые кнопки и правый столбец прячутся (им там места нет) */
body.vertical .screen.world .ws-bar { left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); transform: none; bottom: calc(124px + var(--sab));
  gap: 10px; padding: 8px 10px; border-radius: 16px; }
body.vertical .screen.world .ws-bar .t .pic { width: 84px; height: 84px; }
body.vertical .screen.world .ws-bar .tt b { font-size: 26px; }
body.vertical .screen.world .ws-bar .tt > span { font-size: var(--fs-sub); }
body.vertical .screen.world .ws-bar .btn.sq { width: 80px; height: 80px; min-height: 80px; border-radius: 16px; }
body.vertical .screen.world .ws-bar .btn.sq svg { width: 34px; height: 34px; }
/* поиск стоя (аудит karta-07: «Искать» липла поверх наград): шапка вкладок и «Искать» на месте, между ними — прокрутка
   (search.js .ws-scroll); где и до какого уровня ищем — под «!» в шапке */
body.vertical .ws-modal.sheet > .modal-body { display: flex; flex-direction: column; overflow: hidden; }
body.vertical .ws-modal .ws-search { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
body.vertical .ws-modal .ws-search > .ws-tabs { flex: none; }
/* шесть вкладок поиска стоя — сеткой 3×2, все на виду (аудит karta-29: лента резала крайнюю); второй ряд вкладок —
   панель чуть выше общей (55 % вместо 48), содержимое без прокрутки */
body.vertical .modal.sheet.ws-modal { max-height: 55% !important; }
body.vertical .ws-modal .ws-tabs.q-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; padding-top: 4px; }
body.vertical .ws-modal .ws-tabs.q-tabs > .q-tab { min-width: 0; }
body.vertical .ws-modal .ws-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
body.vertical .ws-modal .ws-search > .act-bar { position: static; flex: none; margin: 8px -6px 0; padding: 8px 16px 0; background: none; }
body.vertical .screen.world .hud:has(> .ws-bar) > :is(.wm-quick, .gen) { visibility: hidden; }

/* ——— лёжа на телефоне (body.phone-land, js/ui.js fitStage: сцена мельче 3/4, около 0,57): карточка клетки была на
   прежних px — текст 13–15 (7–9 css px), значки «В метки» и «В чат» — 36, кружки действий — 60 с подписью 13. Почти как
   стоя: карточка 500 (места сбоку от объекта лёжа хватает: сцена не уже 1280), заголовок 26, текст 20, пояснения 17, не
   мельче 16; значки в углу 52, кружки дугой — 76 с подписью 18 и тёмной обводкой; пояснения окна замка земель (map.js
   openCastle) — 17; на планшете и ПК лёжа и стоя — как было ——— */
body.phone-land .cp-card { width: 500px; font-size: var(--fs-body); border-radius: 16px; }
body.phone-land .cp-top { min-height: 60px; padding-block: 6px; padding-inline: 16px 10px; border-radius: 12px 12px 0 0; }
body.phone-land .cp-t { font-size: 26px; }
body.phone-land .cp-tools { gap: 8px; }
body.phone-land .cp-i { width: 52px; height: 52px; border-radius: 14px; }
body.phone-land .cp-body { gap: 9px; padding: 12px 14px 14px; }
body.phone-land .cp-who { gap: 12px; }
body.phone-land .cp-who .ava { --ava-s: 64px; }
body.phone-land .cp-who .ava .lv { font-size: 16px; }
body.phone-land .cp-who .tx b { font-size: var(--fs-list); }
body.phone-land :is(.cp-card .kd-where, .cp-chips, .cp-bar .t, .cp-loot .t) { font-size: var(--fs-sub); }
body.phone-land .cp-pic { width: 100px; height: 72px; }
body.phone-land .cp-xy { padding: 3px 12px; font-size: 20px; border-radius: 10px; }
body.phone-land .cp-bar .bar { height: 28px; border-radius: 14px; }
body.phone-land .cp-bar .bar b { font-size: 18px; }
body.phone-land .cp-row.rec b { font-size: var(--fs-num); }
body.phone-land :is(.cp-card .cell-note, .cp-card .mon-lock, .cp-flat .cell-note, .rg-body .cell-note, .rg-war) { font-size: var(--fs-sub); }
body.phone-land .cp-card .ic-cell { --ic: 80px; } /* число и ярлык ячейки — от --ic (css/itemcell.css): при 80 ярлык 16 */
body.phone-land .cp-card .sect { font-size: var(--fs-list); }
body.phone-land .cp-more { gap: 8px; padding: 10px 14px 14px; }
body.phone-land .cp-acts { gap: 6px; }
body.phone-land .cp-acts.n3 > :nth-child(2) { margin-top: 30px; }
body.phone-land .cp-acts.n2 { gap: 28px; }
body.phone-land .cp-b { width: 128px; gap: 4px; font-size: 18px; text-shadow: 0 1px 2px #000, 0 0 4px #000, 0 0 6px #000; } /* «Подкрепление» — одной строкой */
body.phone-land .cp-b .c { width: 76px; height: 76px; border-width: 4px; }
/* HUD карты и перенос замка лёжа на телефоне: плашка X·Y — кнопка 48 с числами 20; походы — шапка 48, строки 56 с лицом
   44, «к армии» и «ускорить» — 48, подписи 17; «Домой» — 72 с подписью 16; плашка стычки — 48; перенос — стрелки 48,
   «+» телепорта 40 (касание 52), цена на «Перенести» 18, подписи карточки 17–20 */
body.phone-land .coords { min-height: 48px; box-sizing: border-box; padding: 4px 20px; border-radius: 24px; font-size: 20px; }
body.phone-land .marches { width: 280px; }
body.phone-land .marches .mh { height: 48px; padding-inline: 10px 14px; border-radius: 10px; font-size: 18px; }
body.phone-land .march { height: 56px; border-radius: 10px; }
body.phone-land .march .fc { width: 44px; height: 44px; }
body.phone-land .march .fc i { min-width: 22px; height: 22px; border-radius: 11px; font-size: 16px; line-height: 18px; }
body.phone-land :is(.march .tx b, .march .tm, .march.add) { font-size: var(--fs-sub); }
body.phone-land .march .mb { width: 48px; height: 48px; border-radius: 24px; }
body.phone-land .wm-home { width: 72px; height: 72px; font-size: 16px; }
body.phone-land .mfx-chip { padding: 12px 28px 12px 22px; font-size: 24px; border-radius: 30px; }
body.phone-land .mfx-chip svg { width: 30px; height: 30px; }
body.phone-land .mv-nd { width: 48px; height: 48px; }
body.phone-land .mv-nd.n-up { left: -24px; top: calc(-1 * var(--gh) / 2 - 58px); }
body.phone-land .mv-nd.n-dn { left: -24px; }
body.phone-land .mv-nd.n-lf { top: -24px; left: calc(-1 * var(--gw) / 2 - 58px); }
body.phone-land .mv-nd.n-rt { top: -24px; }
body.phone-land .wm-move { width: 640px; }
body.phone-land .wm-move .mv-item .plus { width: 40px; height: 40px; border-radius: 20px; right: -12px; top: -12px; }
body.phone-land .wm-move .mv-item .plus::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; } /* касание — 52 */
body.phone-land .mv-btns .btn.two .sub { font-size: var(--fs-btn-s); }
body.phone-land .wm-move .mv-tx b { font-size: var(--fs-list); }
body.phone-land .wm-move .mv-why { font-size: var(--fs-sub); }
/* дальний вид лёжа на телефоне: шапка (касание — окно королевства) 48, легенда 17 с переключателем «Королевства /
   Альянсы» 48 (css/kingdom.css грузится позже — здесь вес выше); значок сбора альянса — ниже выросшей легенды */
body.phone-land .screen.world .wm-legend, body.phone-land .screen.world.v2 .wm-legend { font-size: var(--fs-sub); gap: 6px 12px; }
body.phone-land .screen.world .wm-legend i { width: 16px; height: 16px; }
body.phone-land .screen.world .kd-legend .kd-mode button { min-height: 48px; padding: 6px 12px; font-size: var(--fs-sub); }
body.phone-land .screen.world.v2.far .rally-flag { top: 440px; }
body.phone-land .wm-head { min-height: 48px; box-sizing: border-box; }
body.phone-land .world.v2 .wm-head b { font-size: 20px; }
body.phone-land .world.v2 .wm-head { top: calc(10px + var(--sat, 0px)); padding: 6px 20px 6px 10px; border-radius: 16px; }
body.phone-land .world.v2 .wm-head .wm-hname { font-size: 30px; }
body.phone-land .wm-hflag { width: 60px; height: 76px; }
body.phone-land :is(.wm-hking, .wm-hclock) { font-size: var(--fs-sub); }
body.phone-land .wm-hcr { width: 26px; height: 26px; }
/* поиск целей: подпись плитки цели — 16 (была 13); полоска найденного — картинка 72, кнопки 64, текст 22–24 */
body.phone-land .ws-kind { font-size: 16px; }
body.phone-land .screen.world .ws-bar { gap: 10px; padding: 6px 10px 6px 12px; border-radius: 16px; }
body.phone-land .screen.world .ws-bar .t .pic { width: 72px; height: 72px; }
body.phone-land .screen.world .ws-bar .tt b { font-size: var(--fs-list); }
body.phone-land .screen.world .ws-bar .tt > span { font-size: var(--fs-sub); }
body.phone-land .screen.world .ws-bar .btn.sq { width: 64px; height: 64px; min-height: 64px; border-radius: 14px; }
body.phone-land .screen.world .ws-bar .btn.sq svg { width: 30px; height: 30px; }
