/* ============================================================================
   UI.CSS — [controls-1, 03.10.2026, Opus] интерфейс «как в GTA» (спецификация §6, §2.5).
   Исполнитель D. Действует только при новом вводе (body.inputV2, ?input=2 / шаг 1в):
   при старом вводе страница выглядит как раньше.
   • подсказки — тёмная плашка слева вверху «Нажмите [E], чтобы…» (js/input/prompts.js);
   • рамка фокуса в окнах (js/menuNav.js);
   • пауза с вкладками «Карта» / «Меню»;
   • задания по ↑ (свернуть / развернуть), колесо предметов.
   Положение подсказки на телефоне ставит раскладка исполнителя B (js/input/touchLayout.js).
   ============================================================================ */

/* ---------- подсказки «Нажмите [E], чтобы…» ---------- */
body.inputV2 #prompt { top: 14px; left: 14px; bottom: auto; transform: none; max-width: min(440px, 60vw);
  flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 14px; border-radius: 6px;
  background: rgba(0, 0, 0, .72); border: 0; backdrop-filter: none; white-space: normal;
  color: #fff; font: 500 15px/1.35 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: .1px; z-index: 12; }
body.inputV2 #prompt .gtaRow { display: block; }
body.inputV2 #prompt .gtaRow + .gtaRow { padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .14); }
body.inputV2 #prompt .gtaTip { color: #e9e9e9; font-size: 14px; }
body.inputV2 #prompt .gtaKey { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 24px; height: 22px; padding: 0 6px;
  margin: 0 0 0 2px; vertical-align: -3px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .12);
  color: #fff; font: 700 13px/1 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; text-transform: none; box-shadow: 0 2px 0 rgba(255, 255, 255, .35); }
body.inputV2 #prompt .gtaMouseKey { padding: 0 4px; }
body.inputV2 #prompt .gtaMouse { width: 12px; height: 17px; color: #fff; }
body.inputV2 #prompt .gtaTouch { display: inline-block; padding: 1px 8px; margin: 0 0 0 2px; border-radius: 999px; background: rgba(255, 105, 0, .9);
  color: #fff; font-weight: 700; font-size: 13px; }
/* колонка «время / задания» уезжает под подсказку плавно (prompts.js двигает transform, без перерасчёта раскладки) */
body.inputV2:not(.mobile) #topLeft { transition: transform .15s ease-out; }
/* Vice City: плашка остаётся чёрной, как в GTA (тема меняет только акцент клавиши) */
body.inputV2 #prompt .kbd.gtaKey { color: #fff; }
/* телефон (§5.2): правее радара, под верхним рядом кнопок; точное место и масштаб ставит раскладка B
   (style.setProperty(…, 'important')) — здесь только снимаем прежнюю привязку «внизу по центру» */
body.inputV2.mobile > #hud #prompt { top: calc(60px + var(--sat)); left: calc(114px + var(--sal)); right: auto; bottom: auto; margin: 0; width: auto;
  max-width: 46vw; padding: 7px 11px; font-size: 13px; text-align: left; transform: none; }
body.inputV2.mobile > #hud #prompt .gtaTouch { font-size: 12px; }
/* [доработка, замечание «как в GTA» п.14] ПК: подсказка не заходит под панель курьера по центру сверху
   (#mission: left 330, right 205, до 460 px по центру), а колонка «кнопки + Задания» (#topLeft)
   опускается под подсказку (ui.js → _fitTopLeft), а не прячется под ней */
body.inputV2:not(.mobile) #prompt { max-width: min(440px, calc(50vw - 190px)); }
body.inputV2:not(.mobile) #topLeft { transition: transform .15s ease-out; }
/* узкое окно ПК (§3.2 п.9) */
@media (max-width: 899px), (max-height: 499px) {
  body.inputV2:not(.mobile) #prompt { font-size: 14px; max-width: 60vw; }
}
/* станция курса — подсказки прячет pizzacourse.js (.pcStation #prompt), здесь — то же для новых строк */
.pcStation #prompt { display: none !important; }
/* кнопка на телефоне мигает один раз, когда подсказка про неё появилась (§6) */
@keyframes gtaPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 105, 0, .95); transform: scale(1); } 40% { transform: scale(1.12); } 100% { box-shadow: 0 0 0 18px rgba(255, 105, 0, 0); transform: scale(1); } }
.gtaPulse { animation: gtaPulse .8s ease-out 1; }

/* ---------- рамка фокуса в окнах (menuNav.js) ---------- */
body.inputV2 .navFocus { outline: 3px solid #ffd15c !important; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(255, 209, 92, .25) !important; }
body.inputV2.navTouch .navFocus { outline: none !important; box-shadow: none !important; }
body.inputV2 input[type="range"].navFocus { outline-offset: 4px; }

/* ---------- пауза: вкладки «Карта» / «Меню» ---------- */
#pmTabs { display: none; }
body.inputV2 #pmTabs { display: flex; gap: 6px; margin: 0 0 14px; }
body.inputV2 .pmTab { min-width: 120px; padding: 9px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .35);
  color: #fff; font: 700 14px/1 var(--vcFont, -apple-system, Arial, sans-serif); letter-spacing: .6px; text-transform: uppercase; cursor: pointer; }
body.inputV2 .pmTab.on { background: #FF6900; border-color: #FF6900; }
#pmMap { display: none; }
body.inputV2 #pauseMenu.tabMap #pmMap { display: flex; }
body.inputV2 #pauseMenu.tabMap > .pmMenuItem { display: none !important; }
#pmMap { flex-direction: column; align-items: center; gap: 10px; }
#bigMapWrap { position: relative; border-radius: 14px; overflow: hidden; background: rgba(10, 12, 16, .65); border: 1px solid rgba(64, 240, 255, .35);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
#bigMap { display: block; }
#bigMapNorth { position: absolute; top: 10px; right: 12px; color: #fff; font: 700 12px/1.3 -apple-system, Arial, sans-serif; text-shadow: 0 1px 2px #000; opacity: .85; }
#bigMapScale { position: absolute; left: 12px; bottom: 10px; color: #fff; font: 600 12px/1 -apple-system, Arial, sans-serif; text-shadow: 0 1px 2px #000; }
#bigMapScale i { display: inline-block; height: 4px; margin-right: 6px; vertical-align: middle; background: #fff; border-radius: 2px; }
#pmLegend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 13px; color: #f4e6ff; }
#pmLegend span { display: inline-flex; align-items: center; gap: 6px; }
#pmLegend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1.5px solid #111; }
#pmZone { font: 700 15px/1.2 var(--vcFont, -apple-system, Arial, sans-serif); letter-spacing: .5px; color: #40f0ff; text-shadow: 0 0 8px rgba(64, 240, 255, .5); min-height: 18px; }
.pmHintV2 { display: none; }
body.inputV2 .pmHintV2 { display: block; }
body.inputV2 .pmHintV1 { display: none; }

/* ---------- старое / новое управление в текстах: показывается только своё ---------- */
body:not(.inputV2) .v2 { display: none !important; }
body.inputV2 .v1 { display: none !important; }

/* ---------- задания: ↑ сворачивает / разворачивает (как телефон в GTA) ---------- */
body.inputV2 #objectives.collapsed #objList { display: none; }
body.inputV2 #objectives.collapsed .t { margin-bottom: 0; }
body.inputV2 #objectives.collapsed .t::after { content: ' ▸'; }

/* ---------- колесо предметов ---------- */
body.inputV2 #cbWheel .wsec.on { box-shadow: 0 0 0 3px #ffd15c, 0 0 18px rgba(255, 209, 92, .6); }
body.inputV2 #cbWheel.locked #cbWheelHint::after { content: ' · выбрано'; color: #ffd15c; }
/* прицел ПКМ: перекрестие «прилипло» к цели (мягкий захват, §2.2) */
body.inputV2 #cbCross.aimLock { filter: drop-shadow(0 0 6px #ff3e9d) drop-shadow(0 0 2px #fff); }

/* ---------- экран «Управление» при новом вводе: длинная таблица прокручивается ---------- */
body.inputV2 #controlsScreen { justify-content: flex-start; overflow-y: auto; padding: 22px 12px 18px; box-sizing: border-box; }
body.inputV2 #controlsScreen table.ctrl { max-width: 760px; }
body.inputV2 table.ctrl tr.ctrlSec td { padding-top: 12px; color: #40f0ff; font-weight: 700; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; border-bottom-color: rgba(64, 240, 255, .3); }
body.inputV2 #prompt .gtaMouseT { font-size: 11px; font-weight: 700; margin-left: 2px; }

/* ---------- HUD на ПК как в GTA V (§6 [К1 п.23]): радар слева внизу, здоровье — полоской под ним,
   предмет и «Пицца-баттл» — справа вверху, чат — над радаром. Телефон раскладывает B (touchLayout). ---------- */
body.inputV2:not(.mobile) #minimapWrap { top: auto; right: auto; left: 22px; bottom: 30px; }
body.inputV2:not(.mobile) #cbHud { top: 14px; }
body.inputV2:not(.mobile) #cbHud #cbHealth { position: fixed; left: 22px; bottom: 10px; width: 180px; gap: 5px; }
body.inputV2:not(.mobile) #cbHud #cbHealth #cbHpTrack { flex: 1; width: auto; }
body.inputV2:not(.mobile) #chat { bottom: 232px; left: 22px; }
/* узкое окно ПК (§3.2 п.9): HUD ×0,85, мини-карта 130 px */
@media (max-width: 899px), (max-height: 499px) {
  body.inputV2:not(.mobile) #minimap { width: 130px; height: 130px; }
  body.inputV2:not(.mobile) #cbHud #cbHealth { width: 140px; }
  body.inputV2:not(.mobile) #chat { bottom: 186px; }
  body.inputV2:not(.mobile) #cbWeapon { zoom: .85; }   /* не transform у #cbHud: он сделал бы его опорой для «fixed»-полоски здоровья */
}

/* ---------- [controls-2] большая карта: кнопки масштаба, подсказка ---------- */
#bigMapBtns { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
#bigMapBtns button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(64, 240, 255, .45); background: rgba(10, 6, 20, .78);
  color: #fff; font: 700 18px/1 -apple-system, Arial, sans-serif; cursor: pointer; padding: 0; }
#bigMapBtns button:active { background: #FF6900; }
#bigMapHint { font: 600 12px/1.3 -apple-system, Arial, sans-serif; color: #e9dcff; opacity: .85; min-height: 15px; text-align: center; max-width: 560px; }
body.mobile #bigMapHint { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
body.mobile #pmZone { display: none; }
body.mobile #pmMap { gap: 4px; }
body.mobile #pmLegend { display: none; }

/* ---------- [controls-2] меню взаимодействия M (как в GTA Online): слева вверху, игру не останавливает ---------- */
#menuM { position: absolute; left: 14px; top: 64px; width: 300px; display: none; pointer-events: auto; z-index: 90;   /* выше тоста обучения */
  background: rgba(8, 8, 12, .82); border-radius: 4px; overflow: hidden; box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  font: 600 15px/1.2 -apple-system, "Segoe UI", Arial, sans-serif; color: #fff; user-select: none; -webkit-user-select: none; }
#menuM.show { display: block; }
#menuM .mmHead { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #FF6900;
  font: 700 17px/1 var(--vcFont, -apple-system, Arial, sans-serif); letter-spacing: .6px; text-transform: uppercase; }
#menuM .mmClose { background: none; border: 0; color: #fff; font: 700 16px/1 Arial, sans-serif; cursor: pointer; padding: 0 2px; }
#menuM .mmRow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-top: 1px solid rgba(255, 255, 255, .06); }
#menuM .mmRow.on { background: #f4f4f4; color: #111; }
#menuM .mmRow.dim { color: rgba(255, 255, 255, .55); }
#menuM .mmRow.on.dim { color: #555; }
#menuM .mmVal { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
#menuM .mmVal b { font-weight: 700; padding: 0 4px; opacity: .8; }
#menuM .mmHint { padding: 7px 12px; font-size: 12px; color: rgba(255, 255, 255, .6); border-top: 1px solid rgba(255, 255, 255, .08); }
body.menuMOpen #objectives { visibility: hidden; }
body.atNev1 #objectives { visibility: hidden; }   /* [фикс 04.10] у пиццерии Невинномысск-1 задания Нев-2 не показываем (js/nev1/nev1_gate.js) */   /* меню M встаёт на место «Заданий» (как в GTA Online) */
/* [проверка 2, дефект 2] телефон: меню по центру сверху — радар, ☰, ⛶, 🌙, здоровье и стик слева свободны (можно ходить,
   ☰ закрывает меню), справа — кнопки; в машине ◀ ▶ и педали меню не перекрывают. Высоту и «под подсказку» ставит menuM._place() */
body.mobile #menuM { left: 50%; transform: translateX(-50%); top: calc(6px + var(--sat, 0px)); width: 290px; max-width: calc(100% - 24px); overflow-y: auto; font-size: 13.5px; }
body.mobile.tchPortrait #menuM { top: calc(172px + var(--sat, 0px)); }
body.mobile #menuM .mmHead { padding: 7px 12px; font-size: 15px; }
body.mobile #menuM .mmRow { padding: 7px 12px; }
body.mobile #menuM .mmVal b { padding: 2px 9px; }
body.mobile #menuM .mmHint { display: none; }

/* ---------- [controls-2] название машины и улицы при посадке (GTA: справа внизу, 3 с) ---------- */
#carCaption { position: absolute; right: 28px; bottom: 120px; text-align: right; pointer-events: none; opacity: 0; transition: opacity .35s;
  color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .85), 0 0 2px #000; }
#carCaption.show { opacity: 1; }
#carCaption b { display: block; font: italic 800 30px/1.05 var(--vcFont, -apple-system, Arial, sans-serif); letter-spacing: .5px; }
#carCaption span { display: block; margin-top: 3px; font: 700 17px/1.2 -apple-system, Arial, sans-serif; color: #ffd15c; }
body.mobile #carCaption { right: calc(14px + var(--sar, 0px)); top: calc(106px + var(--sat, 0px)); bottom: auto; }   /* под подписью зоны (§6), не на кнопках 👁 💡 */
body.mobile #carCaption b { font-size: 19px; }
body.mobile #carCaption span { font-size: 13px; }
#carCaption.foot b { font: 700 19px/1.1 -apple-system, Arial, sans-serif; color: #ffd15c; }   /* пешком — только улица */
body.mobile #carCaption.foot b { font-size: 14px; }

/* [проверка 2, дефект 5] вертикаль: подпись машины — под кнопками 👁 💡 (радар справа сверху), не на радаре */
body.mobile.tchPortrait #carCaption { top: calc(222px + var(--sat, 0px)); }
/* [проверка 2, дефект 4] телефон: масштаб — двумя пальцами, кнопки «+ −» убраны (второй палец на них попадал), остаётся «⌖» */
body.mobile #bmZoomIn, body.mobile #bmZoomOut { display: none; }
body.mobile #bigMapHint { font-size: 12px; }
/* горизонтальный телефон: на вкладке «Карта» — слева вкладки и «Позвать друга», справа карта на всю высоту, сбоку подсказка и «Продолжить» */
body.inputV2.mobile.tchLand #pauseMenu.show.tabMap { grid-template-columns: minmax(0, 210px) auto; grid-template-rows: auto auto; align-content: center; }
body.inputV2.mobile.tchLand #pauseMenu.show.tabMap > h2, body.inputV2.mobile.tchLand #pauseMenu.show.tabMap > .hint { display: none; }
body.inputV2.mobile.tchLand #pauseMenu.show.tabMap > #pmTabs { grid-column: 1; grid-row: 1; flex-direction: column; margin: 0; }
body.inputV2.mobile.tchLand #pauseMenu.show.tabMap > #btnInvite { grid-column: 1; grid-row: 2; }
body.inputV2.mobile.tchLand #pauseMenu.tabMap #pmMap { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: auto 132px;
  grid-template-rows: 1fr auto auto 1fr; gap: 8px 12px; align-items: center; }
body.inputV2.mobile.tchLand #pauseMenu.tabMap #pmZone { display: none; }
body.inputV2.mobile.tchLand #pauseMenu.tabMap #bigMapWrap { grid-column: 1; grid-row: 1 / span 4; }
body.inputV2.mobile.tchLand #pauseMenu.tabMap #bigMapHint { grid-column: 2; grid-row: 2; white-space: normal; max-width: 132px; text-align: left; }
body.inputV2.mobile.tchLand #pauseMenu.tabMap #btnResumeMap { grid-column: 2; grid-row: 3; }
body.mobile #menuM { background: rgba(8, 8, 12, .94); }

/* [P2 04.10] телефон: полоска здоровья без подложки сливалась с вывеской фасада за ней («…ПИЦЦЕРИЯ» + «100» читалось
   как «я100», вертикально — прямо на уровне вывески). Тёмная подложка тенью — размеры и раскладка (touchLayout) те же */
body.mobile #cbHud #cbHealth { background: rgba(14, 8, 26, .62); border-radius: 9px; box-shadow: 0 0 0 4px rgba(14, 8, 26, .62); }
/* [P2] ПК: вкладка «Карта» в паузе — без заголовка «Пауза» и строки подсказки (вкладки и так видны), а если окно
   всё равно ниже содержимого — прокрутка от верха, а не обрезка сверху и снизу (было при 1280×720) */
body.inputV2:not(.mobile) #pauseMenu.tabMap > h2, body.inputV2:not(.mobile) #pauseMenu.tabMap > .hint { display: none; }
body.inputV2 #pauseMenu.show { justify-content: safe center; overflow-y: auto; }
