/* Меню паузы, настройки, управление и экран приветствия (ui/menu.js, ui/settings_view.js). Тёмная тема,
   полупрозрачные панели; заголовки — пиксельным шрифтом игры (холсты .vm-pix), текст — системный sans.
   Размер — от экрана (1080p ≈ 16 px), поправка — настройка «Размер меню» (--ui-k). */

:root {
  --vm-bg: rgba(17, 20, 27, 0.86);
  --vm-bg2: rgba(255, 255, 255, 0.045);
  --vm-line: rgba(255, 255, 255, 0.09);
  --vm-text: #e9edf3;
  --vm-muted: #a3adbb;
  --vm-faint: #6f7987;
  --vm-acc: #79d384;
  --vm-acc2: #a6e8ad;
  --vm-acc-ink: #0d1f11;
  --vm-cheap: #79d384;
  --vm-mid: #f0b54a;
  --vm-high: #f2766b;
  --vm-fast: #62c8ec;
  --vm-bad: #ff6b5f;
  --ui-k: 1;
}

.vm, #help {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: calc(clamp(12px, min(0.833vw, 1.515vh), 18px) * var(--ui-k));
  color: var(--vm-text);
  -webkit-font-smoothing: antialiased;
}
.vm *, #help * { box-sizing: border-box; }
.vm [hidden] { display: none !important; }
.vm-ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.vm-pix { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }

/* ------------------------------------------------------------ оверлей */
.vm { position: fixed; inset: 0; z-index: 50; display: none; outline: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(10, 13, 19, 0.38), rgba(5, 7, 11, 0.74));
  backdrop-filter: blur(5px) saturate(1.1); -webkit-backdrop-filter: blur(5px) saturate(1.1); }
.vm.no-blur { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(7, 9, 13, 0.66); }
.vm.open { display: flex; align-items: center; justify-content: center; animation: vm-fade 0.16s ease-out; }
.vm-screen { display: none; }
.vm-screen.on { display: flex; }
.vm-card { background: var(--vm-bg); border: 1px solid var(--vm-line); border-radius: 1em;
  box-shadow: 0 1.5em 4em rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: vm-pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes vm-fade { from { opacity: 0; } }
@keyframes vm-pop { from { opacity: 0; transform: translateY(0.6em) scale(0.985); } }
@keyframes vm-in { from { opacity: 0; transform: translateY(0.3em); } }
.vm.no-anim, .vm.no-anim * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .vm, .vm * { animation: none !important; transition: none !important; } }
body.vm-open #cross { display: none !important; }
body.no-debug-text #hud { display: none !important; }
#prof { z-index: 60; }
#toast { z-index: 70; }

.vm button { font: inherit; color: inherit; }
.vm :focus { outline: none; }
.vm :focus-visible { outline: 2px solid var(--vm-acc); outline-offset: 2px; }
.vm kbd, .vm-key, #help kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em;
  height: 1.75em; padding: 0 0.5em; border-radius: 0.4em; font: 600 0.82em/1 "Inter", "Segoe UI", system-ui, sans-serif;
  color: #dfe5ee; background: linear-gradient(#3a414d, #2c323c); border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-width: 3px; border-bottom-color: rgba(0, 0, 0, 0.45); white-space: nowrap; }

/* ------------------------------------------------------------ пауза */
.vm-pause { flex-direction: column; align-items: stretch; width: min(25em, calc(100vw - 2em)); padding: 1.7em 1.6em 1.4em; }
.vm-head { display: flex; flex-direction: column; align-items: center; gap: 0.45em; margin-bottom: 1.3em; }
.vm-sub { margin: 0; color: var(--vm-muted); font-size: 0.92em; }
.vm-btns { display: flex; flex-direction: column; gap: 0.5em; }
.vm-btn { display: flex; align-items: center; gap: 0.8em; width: 100%; min-height: 3.1em; padding: 0 1em;
  background: var(--vm-bg2); border: 1px solid var(--vm-line); border-radius: 0.7em; cursor: pointer;
  font-size: 1.04em; font-weight: 550; text-align: left; transition: background 0.12s, border-color 0.12s, transform 0.08s; }
.vm-btn span { flex: 1; }
.vm-btn .vm-ic { color: var(--vm-muted); width: 1.3em; height: 1.3em; transition: color 0.12s; }
.vm-btn:hover, .vm-btn:focus-visible { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.18); }
.vm-btn:hover .vm-ic, .vm-btn:focus-visible .vm-ic { color: var(--vm-text); }
.vm-btn:active { transform: translateY(1px); }
.vm-btn.primary { background: var(--vm-acc); color: var(--vm-acc-ink); border-color: transparent; }
.vm-btn.primary .vm-ic { color: var(--vm-acc-ink); }
.vm-btn.primary:hover, .vm-btn.primary:focus-visible { background: var(--vm-acc2); }
.vm-btn.primary kbd { background: rgba(0, 0, 0, 0.18); color: var(--vm-acc-ink); border-color: rgba(0, 0, 0, 0.15); }
.vm-btn em { font-style: normal; font-size: 0.78em; font-weight: 600; padding: 0.2em 0.6em; border-radius: 1em;
  background: rgba(255, 255, 255, 0.08); color: var(--vm-muted); }
.vm-btn em.on { background: rgba(121, 211, 132, 0.18); color: var(--vm-acc); }
.vm-quick { margin-top: 1.2em; padding-top: 1.1em; border-top: 1px solid var(--vm-line); display: flex;
  flex-direction: column; gap: 0.55em; }
.vm-quick > div:first-child { display: flex; justify-content: space-between; align-items: baseline; color: var(--vm-muted); font-size: 0.86em; }
.vm-quick .vm-seg { width: 100%; }
.vm-auto { font-size: 0.78em; color: var(--vm-muted); line-height: 1.35; }

/* ------------------------------------------------------------ общее: кнопки-иконки, сегменты, переключатели */
.vm-icbtn { display: inline-flex; align-items: center; justify-content: center; width: 2.3em; height: 2.3em; flex: none;
  border-radius: 0.6em; border: 1px solid transparent; background: transparent; color: var(--vm-muted); cursor: pointer;
  transition: background 0.12s, color 0.12s; }
.vm-icbtn:hover, .vm-icbtn:focus-visible { background: rgba(255, 255, 255, 0.08); color: var(--vm-text); }
.vm-textbtn { display: inline-flex; align-items: center; gap: 0.5em; padding: 0.55em 0.95em; border-radius: 0.6em;
  border: 1px solid var(--vm-line); background: var(--vm-bg2); cursor: pointer; font-size: 0.9em; font-weight: 550;
  transition: background 0.12s; white-space: nowrap; }
.vm-textbtn:hover, .vm-textbtn:focus-visible { background: rgba(255, 255, 255, 0.09); }
.vm-textbtn.danger { color: #ffb0a8; }
.vm-textbtn.armed { background: rgba(255, 107, 95, 0.18); border-color: rgba(255, 107, 95, 0.5); color: #ffd0cb; }
.vm-textbtn.acc { background: var(--vm-acc); color: var(--vm-acc-ink); border-color: transparent; }
.vm-textbtn.acc:hover { background: var(--vm-acc2); }

.vm-seg { display: inline-flex; padding: 0.2em; gap: 0.15em; border-radius: 0.65em; background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--vm-line); max-width: 100%; }
.vm-seg button { flex: 1 1 0; min-width: 0; padding: 0.42em 0.6em; border: 0; border-radius: 0.48em; background: transparent;
  color: var(--vm-muted); cursor: pointer; font-size: 0.86em; font-weight: 550; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; transition: background 0.12s, color 0.12s; }
.vm-seg button:hover { color: var(--vm-text); background: rgba(255, 255, 255, 0.06); }
.vm-seg button[aria-checked="true"] { background: rgba(255, 255, 255, 0.15); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3); }

.vm-switch { position: relative; width: 2.75em; height: 1.55em; flex: none; border-radius: 1em; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); transition: background 0.15s; }
.vm-switch::after { content: ""; position: absolute; top: 0.2em; left: 0.2em; width: 1.15em; height: 1.15em; border-radius: 50%;
  background: #f4f7fb; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); transition: transform 0.16s cubic-bezier(0.3, 0.7, 0.3, 1); }
.vm-switch[aria-checked="true"] { background: var(--vm-acc); }
.vm-switch[aria-checked="true"]::after { transform: translateX(1.2em); }

.vm-range { position: relative; width: 100%; height: 1.6em; display: flex; align-items: center; }
.vm-range input { -webkit-appearance: none; appearance: none; width: 100%; height: 1.6em; margin: 0; background: transparent;
  cursor: pointer; position: relative; z-index: 1; --p: 50%; }
.vm-range input::-webkit-slider-runnable-track { height: 0.36em; border-radius: 1em;
  background: linear-gradient(to right, var(--vm-acc) var(--p), rgba(255, 255, 255, 0.14) var(--p)); }
.vm-range input::-webkit-slider-thumb { -webkit-appearance: none; width: 1.15em; height: 1.15em; margin-top: -0.395em;
  border-radius: 50%; background: #f4f7fb; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55); transition: box-shadow 0.12s; }
.vm-range input:hover::-webkit-slider-thumb, .vm-range input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55), 0 0 0 0.35em rgba(121, 211, 132, 0.25); }
.vm-range input:focus-visible { outline: none; }
.vm-range input::-moz-range-track { height: 0.36em; border-radius: 1em; background: rgba(255, 255, 255, 0.14); }
.vm-range input::-moz-range-progress { height: 0.36em; border-radius: 1em; background: var(--vm-acc); }
.vm-range input::-moz-range-thumb { width: 1.15em; height: 1.15em; border-radius: 50%; background: #f4f7fb; border: 0; }
/* Метка значения по умолчанию на дорожке. */
.vm-tick { position: absolute; top: 50%; width: 2px; height: 0.9em; margin: -0.45em 0 0 -1px; border-radius: 1px;
  background: rgba(255, 255, 255, 0.35); left: calc(0.575em + (100% - 1.15em) * var(--d, 0)); pointer-events: none; }

/* Цена по FPS: три столбика. */
.vm-cost { display: inline-flex; align-items: center; gap: 0.32em; padding: 0.14em 0.5em 0.14em 0.42em; border-radius: 1em;
  font-size: 0.72em; font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; vertical-align: 0.12em;
  background: rgba(255, 255, 255, 0.06); color: var(--vm-faint); }
.vm-cost .bars { display: inline-flex; align-items: flex-end; gap: 0.14em; height: 0.95em; }
.vm-cost .bars i { width: 0.26em; border-radius: 0.1em; background: currentColor; opacity: 0.25; }
.vm-cost .bars i:nth-child(1) { height: 40%; } .vm-cost .bars i:nth-child(2) { height: 70%; } .vm-cost .bars i:nth-child(3) { height: 100%; }
.vm-cost.c1 { color: var(--vm-cheap); background: rgba(121, 211, 132, 0.1); }
.vm-cost.c2 { color: var(--vm-mid); background: rgba(240, 181, 74, 0.11); }
.vm-cost.c3 { color: var(--vm-high); background: rgba(242, 118, 107, 0.12); }
.vm-cost.c1 .bars i:nth-child(-n+1), .vm-cost.c2 .bars i:nth-child(-n+2), .vm-cost.c3 .bars i { opacity: 1; }
.vm-cost.cf { color: var(--vm-fast); background: rgba(98, 200, 236, 0.12); }
.vm-cost .vm-ic { width: 1.05em; height: 1.05em; }

/* ------------------------------------------------------------ настройки */
.vm-settings { width: min(74em, calc(100vw - 2em)); height: min(50em, calc(100vh - 2em)); overflow: hidden; }
.vm-side { width: 15em; flex: none; display: flex; flex-direction: column; padding: 1.3em 0.8em 0.9em;
  border-right: 1px solid var(--vm-line); background: rgba(0, 0, 0, 0.16); }
.vm-side .vm-brand { display: flex; align-items: center; gap: 0.65em; padding: 0 0.55em 1.2em; color: var(--vm-acc); }
.vm-side .vm-brand .vm-ic { width: 1.5em; height: 1.5em; }
.vm-tabs { display: flex; flex-direction: column; gap: 0.2em; flex: 1; overflow: auto; }
.vm-tab { display: flex; align-items: center; gap: 0.75em; width: 100%; padding: 0.68em 0.75em; border: 0; border-radius: 0.6em;
  background: transparent; color: var(--vm-muted); cursor: pointer; text-align: left; font-size: 0.97em; font-weight: 550;
  transition: background 0.12s, color 0.12s; position: relative; }
.vm-tab span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-tab:hover { background: rgba(255, 255, 255, 0.05); color: var(--vm-text); }
.vm-tab[aria-selected="true"] { background: rgba(121, 211, 132, 0.13); color: #fff; }
.vm-tab[aria-selected="true"] .vm-ic { color: var(--vm-acc); }
.vm-tab[aria-selected="true"]::before { content: ""; position: absolute; left: -0.8em; top: 0.55em; bottom: 0.55em; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--vm-acc); }
.vm-tab small, .vm-badge { font-size: 0.7em; font-weight: 700; padding: 0.15em 0.5em; border-radius: 1em;
  background: rgba(255, 255, 255, 0.08); color: var(--vm-faint); }
.vm-tab small.bad { background: rgba(255, 107, 95, 0.2); color: #ffb0a8; }
.vm.searching .vm-tab[aria-selected="true"] { background: transparent; color: var(--vm-muted); }
.vm.searching .vm-tab[aria-selected="true"]::before { display: none; }
.vm-side-foot { padding-top: 0.8em; border-top: 1px solid var(--vm-line); display: flex; flex-direction: column; gap: 0.4em; }
.vm-side-foot .vm-textbtn { justify-content: center; }

.vm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vm-top { display: flex; align-items: center; gap: 0.8em; padding: 1.05em 1.1em 0.95em 1.5em; border-bottom: 1px solid var(--vm-line); }
.vm-top .vm-ttl { flex: 1; min-width: 0; }
.vm-top h2 { margin: 0; font-size: 1.35em; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-top p { margin: 0.15em 0 0; color: var(--vm-muted); font-size: 0.86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-search { position: relative; width: 15em; flex: none; }
.vm-search .vm-ic { position: absolute; left: 0.7em; top: 50%; margin-top: -0.55em; width: 1.1em; height: 1.1em; color: var(--vm-faint); pointer-events: none; }
.vm-search input { width: 100%; height: 2.4em; padding: 0 2em 0 2.3em; border-radius: 0.65em; border: 1px solid var(--vm-line);
  background: rgba(0, 0, 0, 0.28); color: var(--vm-text); font: inherit; font-size: 0.92em; outline: none; transition: border-color 0.12s, background 0.12s; }
.vm-search input::placeholder { color: var(--vm-faint); }
.vm-search input:focus { border-color: rgba(121, 211, 132, 0.6); background: rgba(0, 0, 0, 0.38); }
.vm-search input:focus-visible { outline: none; }
.vm-search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.7); cursor: pointer; }
.vm-search kbd { position: absolute; right: 0.5em; top: 50%; transform: translateY(-50%); font-size: 0.7em; min-width: 1.6em; height: 1.6em; opacity: 0.7; }
.vm-search input:focus + kbd, .vm-search input:not(:placeholder-shown) + kbd { display: none; }

.vm-scroll { flex: 1; overflow: auto; padding: 0.6em 1.3em 1.6em 1.3em; scroll-behavior: smooth; overscroll-behavior: contain; }
.vm-scroll::-webkit-scrollbar { width: 10px; }
.vm-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.vm-body { animation: vm-in 0.16s ease-out; }
.vm-group { margin-top: 1.25em; }
.vm-group > h3 { margin: 0 0 0.35em 0.3em; font-size: 0.74em; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--vm-faint);
  display: flex; align-items: center; gap: 0.6em; }
.vm-group > h3 .vm-ic { width: 1.3em; height: 1.3em; }
.vm-group > h3 .grow { flex: 1; }
.vm-group > h3 .vm-textbtn { text-transform: none; letter-spacing: 0; font-size: 1.2em; padding: 0.35em 0.7em; }

.vm-row { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) minmax(12em, 19em) 2.2em; align-items: center; gap: 0 0.9em;
  padding: 0.72em 0.6em 0.72em 0.65em; border-radius: 0.75em; transition: background 0.12s, opacity 0.15s; }
.vm-row:hover { background: rgba(255, 255, 255, 0.035); }
.vm-row + .vm-row { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.vm-row:hover + .vm-row, .vm-row:hover { box-shadow: none; }
.vm-row-ic { width: 2.2em; height: 2.2em; border-radius: 0.6em; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.05); color: var(--vm-muted); }
.vm-row-ic .vm-ic { width: 1.2em; height: 1.2em; }
.vm-row-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25em 0.6em; font-weight: 600; font-size: 0.98em; }
.vm-hint { margin-top: 0.22em; color: var(--vm-muted); font-size: 0.84em; line-height: 1.38; }
.vm.no-hints .vm-hint { display: none; }
.vm-row-ctl { display: flex; flex-direction: column; align-items: stretch; gap: 0.25em; min-width: 0; }
.vm-row-ctl.inline { flex-direction: row; align-items: center; justify-content: flex-end; gap: 0.7em; }
.vm-val { align-self: flex-end; font-size: 0.86em; font-weight: 600; color: var(--vm-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-row-ctl.inline .vm-val { color: var(--vm-muted); min-width: 3em; text-align: right; }
.vm-row-ctl .vm-seg { align-self: stretch; }
.vm-reset { visibility: hidden; }
.vm-row.changed .vm-reset { visibility: visible; }
.vm-row.changed .vm-row-ic { color: var(--vm-acc); background: rgba(121, 211, 132, 0.1); }
.vm-row.dep-off { opacity: 0.45; }
.vm-row.dep-off:hover { opacity: 0.8; }
.vm-row.soon { opacity: 0.5; pointer-events: none; }
.vm-row.flash { animation: vm-flash 0.9s ease-out; }
@keyframes vm-flash { from { background: rgba(121, 211, 132, 0.2); } }
.vm mark { background: rgba(121, 211, 132, 0.28); color: inherit; border-radius: 0.2em; padding: 0 0.08em; }

/* Пресеты. */
.vm-presets-wrap { margin-top: 0.9em; }
.vm-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65em; }
.vm-preset { display: flex; flex-direction: column; gap: 0.45em; padding: 0.85em 0.9em 0.8em; text-align: left; cursor: pointer;
  border-radius: 0.8em; border: 1px solid var(--vm-line); background: var(--vm-bg2); transition: background 0.12s, border-color 0.12s, transform 0.1s; }
.vm-preset:hover { background: rgba(255, 255, 255, 0.075); border-color: rgba(255, 255, 255, 0.16); }
.vm-preset:active { transform: translateY(1px); }
.vm-preset[aria-checked="true"] { border-color: var(--vm-acc); background: rgba(121, 211, 132, 0.1);
  box-shadow: inset 0 0 0 1px var(--vm-acc); }
.vm-preset .top { display: flex; align-items: center; gap: 0.5em; font-weight: 700; font-size: 1.02em; }
.vm-preset .top .vm-ic { color: var(--vm-muted); }
.vm-preset[aria-checked="true"] .top .vm-ic { color: var(--vm-acc); }
.vm-preset .top .vm-check { margin-left: auto; color: var(--vm-acc); opacity: 0; }
.vm-preset[aria-checked="true"] .top .vm-check { opacity: 1; }
.vm-preset p { margin: 0; flex: 1; font-size: 0.8em; line-height: 1.38; color: var(--vm-muted); }
.vm-meters { display: flex; flex-direction: column; gap: 0.25em; font-size: 0.74em; color: var(--vm-faint); font-weight: 600; }
.vm-meter { display: flex; align-items: center; gap: 0.45em; }
.vm-meter > span { width: 4.4em; }
.vm-meter i { flex: 1; height: 0.38em; border-radius: 1em; background: rgba(255, 255, 255, 0.1); }
.vm-meter.fps i.on { background: var(--vm-fast); }
.vm-meter.heat i.on { background: var(--vm-mid); }
.vm-meter.heat i.on.hot { background: var(--vm-high); }
.vm-custom { display: flex; align-items: center; gap: 0.6em; margin-top: 0.65em; padding: 0.6em 0.85em; border-radius: 0.7em;
  font-size: 0.85em; color: var(--vm-muted); background: rgba(255, 255, 255, 0.03); border: 1px dashed var(--vm-line); }
.vm-custom.on { color: var(--vm-text); border-style: solid; border-color: rgba(240, 181, 74, 0.5); background: rgba(240, 181, 74, 0.08); }
.vm-custom.on .vm-ic { color: var(--vm-mid); }
.vm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 0.9em; margin: 1em 0.3em 0; font-size: 0.8em; color: var(--vm-faint); }
.vm-legend .vm-cost { font-size: 0.9em; }

/* Клавиши. */
.vm-binds { display: grid; grid-template-columns: repeat(auto-fill, minmax(19em, 1fr)); gap: 0.3em 1.1em; }
.vm-bind { display: flex; align-items: center; gap: 0.7em; padding: 0.45em 0.4em 0.45em 0.6em; border-radius: 0.6em; min-height: 2.75em; }
.vm-bind:hover { background: rgba(255, 255, 255, 0.035); }
.vm-bind .name { flex: 1; min-width: 0; font-size: 0.93em; }
.vm-bind .name small { display: block; color: var(--vm-faint); font-size: 0.82em; margin-top: 0.1em; }
.vm-bind .vm-key { min-width: 4.2em; height: 2.05em; font-size: 0.85em; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.vm-bind button.vm-key:hover { border-color: rgba(121, 211, 132, 0.7); }
.vm-bind .vm-key.fixed { cursor: default; opacity: 0.75; gap: 0.35em; }
.vm-bind .vm-key.fixed .vm-ic { width: 0.95em; height: 0.95em; }
.vm-bind.capture .vm-key { background: rgba(121, 211, 132, 0.2); border-color: var(--vm-acc); color: #fff; animation: vm-pulse 1s ease-in-out infinite; }
@keyframes vm-pulse { 50% { box-shadow: 0 0 0 0.3em rgba(121, 211, 132, 0.18); } }
.vm-bind.conflict .vm-key { border-color: var(--vm-bad); color: #ffc6c0; background: linear-gradient(#4a2b2b, #3a2323); }
.vm-bind.conflict .name small { color: #ff9d94; }
.vm-bind .vm-reset { width: 1.9em; height: 1.9em; }
.vm-bind.changed .vm-reset { visibility: visible; }
.vm-note { display: flex; gap: 0.7em; align-items: flex-start; margin-top: 0.9em; padding: 0.75em 0.9em; border-radius: 0.7em;
  font-size: 0.85em; line-height: 1.4; color: var(--vm-muted); background: rgba(98, 200, 236, 0.07); border: 1px solid rgba(98, 200, 236, 0.18); }
.vm-note .vm-ic { color: var(--vm-fast); margin-top: 0.05em; }
.vm-note.warn { background: rgba(255, 107, 95, 0.08); border-color: rgba(255, 107, 95, 0.3); }
.vm-note.warn .vm-ic { color: var(--vm-bad); }

/* Пусто и «скоро». */
.vm-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.7em; padding: 3em 1em 1em; color: var(--vm-muted); }
.vm-empty .big { width: 4.2em; height: 4.2em; border-radius: 1.2em; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.05); color: var(--vm-acc); }
.vm-empty .big .vm-ic { width: 2.2em; height: 2.2em; stroke-width: 1.6; }
.vm-empty h4 { margin: 0.3em 0 0; font-size: 1.15em; color: var(--vm-text); }
.vm-empty p { margin: 0; max-width: 30em; font-size: 0.9em; line-height: 1.45; }
.vm-tiles { display: flex; flex-wrap: wrap; gap: 0.4em 1em; margin: 0.6em 0.4em 0; font-size: 0.82em; color: var(--vm-muted); }
.vm-tiles i { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 0.2em; margin-right: 0.35em; vertical-align: -0.05em; }

/* ------------------------------------------------------------ управление (справка) */
.vm-help { flex-direction: column; width: min(60em, calc(100vw - 2em)); max-height: calc(100vh - 2em); overflow: hidden; }
.vm-help .vm-top { padding-left: 1.2em; }
.vm-help .vm-scroll { padding-top: 1em; }
.vm-cheat { display: grid; grid-template-columns: repeat(auto-fill, minmax(17em, 1fr)); gap: 1.1em 1.6em; }
.vm-cheat section h3 { margin: 0 0 0.5em; font-size: 0.74em; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--vm-faint); }
.vm-cheat .it { display: flex; align-items: center; justify-content: space-between; gap: 0.8em; padding: 0.32em 0; font-size: 0.92em; }
.vm-cheat .it + .it { border-top: 1px solid rgba(255, 255, 255, 0.04); }
.vm-cheat .it .k { display: flex; gap: 0.25em; flex-wrap: wrap; justify-content: flex-end; }
.vm-help-foot { display: flex; flex-wrap: wrap; gap: 0.6em; justify-content: flex-end; padding: 0.9em 1.3em; border-top: 1px solid var(--vm-line); }

/* ------------------------------------------------------------ экран приветствия (#help в index.html) */
#help { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: radial-gradient(ellipse at 50% 40%, rgba(12, 18, 30, 0.3), rgba(6, 9, 15, 0.72));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#help .vm-welcome { cursor: default; width: min(34em, calc(100vw - 2em)); padding: 1.9em 1.8em 1.5em; display: flex; flex-direction: column;
  align-items: stretch; gap: 1.1em; background: rgba(17, 20, 27, 0.94); border: 1px solid var(--vm-line); border-radius: 1em;
  box-shadow: 0 1.5em 4em rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06); animation: vm-pop 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
#help .logo { display: flex; flex-direction: column; align-items: center; gap: 0.5em; min-height: 2.5em; }
#help .logo b { font-size: 1.6em; }
#help .logo p { margin: 0; color: var(--vm-muted); font-size: 0.92em; }
#help .play { display: flex; align-items: center; justify-content: center; gap: 0.7em; min-height: 3.3em; border: 0; border-radius: 0.75em;
  background: var(--vm-acc); color: var(--vm-acc-ink); font: inherit; font-size: 1.1em; font-weight: 700; cursor: pointer; transition: background 0.12s; }
#help .play:hover { background: var(--vm-acc2); }
#help .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5em; }
#help .row button { display: flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 2.6em; padding: 0 0.6em; border-radius: 0.65em;
  border: 1px solid var(--vm-line); background: var(--vm-bg2); color: var(--vm-text); font: inherit; font-size: 0.9em; font-weight: 550; cursor: pointer; }
#help .row button:hover { background: rgba(255, 255, 255, 0.09); }
#help .row .vm-ic { width: 1.15em; height: 1.15em; color: var(--vm-muted); }
#help .keys { display: none; grid-template-columns: 1fr 1fr; gap: 0.3em 1.4em; font-size: 0.86em; color: var(--vm-muted); }
#help.first .keys { display: grid; }
#help .keys div { display: flex; align-items: center; justify-content: space-between; gap: 0.6em; }
#help .keys span { display: flex; gap: 0.2em; }
#help .tip { margin: 0; text-align: center; font-size: 0.8em; color: var(--vm-faint); line-height: 1.45; }
#help .tip kbd { font-size: 0.85em; height: 1.5em; min-width: 1.6em; }

/* ------------------------------------------------------------ узкие окна */
@media (max-width: 760px), (max-height: 520px) {
  .vm-settings { flex-direction: column; }
  .vm-side { width: auto; flex-direction: row; align-items: center; padding: 0.5em 0.6em; border-right: 0; border-bottom: 1px solid var(--vm-line); gap: 0.4em; }
  .vm-side .vm-brand { padding: 0 0.3em; }
  .vm-side .vm-brand .vm-pix { display: none; }
  .vm-tabs { flex-direction: row; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .vm-tabs::-webkit-scrollbar { display: none; }
  .vm-tab { width: auto; flex: none; padding: 0.5em 0.65em; gap: 0.45em; font-size: 0.9em; }
  .vm-tab[aria-selected="true"]::before { display: none; }
  .vm-tab small { display: none; }
  .vm-side-foot { display: none; }
  .vm-top { padding: 0.6em 0.8em 0.6em 1em; }
  .vm-top h2 { font-size: 1.15em; }
  .vm-top p { display: none; }
  .vm-search { width: 12em; }
  .vm-scroll { padding: 0.2em 0.8em 1.2em; }
  .vm-group { margin-top: 0.9em; }
  .vm-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vm-preset p { display: none; }
  .vm-pause { padding: 1.1em 1.2em 1em; }
  .vm-head { margin-bottom: 0.8em; }
  .vm-btn { min-height: 2.6em; }
  .vm-quick { margin-top: 0.8em; padding-top: 0.8em; }
}
@media (max-width: 600px) {
  .vm-row { grid-template-columns: 2.2em minmax(0, 1fr) 2.2em; }
  .vm-row-ctl { grid-column: 2 / 3; grid-row: 2; margin-top: 0.5em; }
  .vm-row .vm-reset { grid-column: 3; grid-row: 1; }
  .vm-tab span { display: none; }
  .vm-search { width: 9em; }
  #help .row { grid-template-columns: 1fr; }
  #help .keys { grid-template-columns: 1fr; }
}
