/* ===================== FrontBox: общие переменные ===================== */
:root {
  --ol: #58663a; --ol2: #46532f; --ol3: #333f23; --ol4: #252d19; --ol-l: #7d8d55; --edge: #131809; --txt: #f4f6ea; --red: #c9382d; --red2: #8f2219;
  --gold: #ffcb3d; --good: #6fdc6f; --bad: #ff6a58; --hi: #51603f;
  --px: 'Press Start 2P', 'Courier New', monospace; --ui: 'Arial Narrow', 'Roboto Condensed', 'Segoe UI', Roboto, Arial, sans-serif;
  --topH: 46px; --tabH: 50px; --panH: 192px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a1630; color: var(--txt); font-family: var(--ui); font-weight: 700; user-select: none; -webkit-user-select: none; }
canvas#view { position: fixed; inset: 0; touch-action: none; display: block; cursor: crosshair; }
body[data-tool="cmd"] canvas#view { cursor: default; }
.hide { display: none !important; }
.pxi { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
/* масштаб интерфейса: весь HUD растягивается целиком (иконки перерисовываются в нативном разрешении) */
#hud { zoom: var(--k, 1); }
button { font-family: var(--ui); font-weight: 800; color: var(--txt); cursor: pointer; }
input, select { font-family: var(--ui); font-weight: 600; background: #10150a; color: #fff; border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px var(--ol-l); padding: 6px 8px; font-size: 14px; border-radius: 3px; }
.dim { color: #aab68c; font-size: 12px; font-weight: 600; }
.dot { display: inline-block; width: 11px; height: 11px; border: 2px solid #000; margin-right: 6px; vertical-align: middle; }
.ol { text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000, 1px 1px #000, -1px -1px #000; }

/* ===================== UI-KIT: компоненты меню ===================== */
/* Panel — оливковая рамка панели */
#bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; }
#panel { display: none; }
#panel.open { display: block; }
.kpanel { display: flex; gap: 8px; height: var(--panH); padding: 9px 10px; align-items: flex-start; overflow: hidden;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 3px, transparent 3px 6px), linear-gradient(var(--ol), var(--ol2));
  border: 3px solid var(--edge); border-bottom: 0; box-shadow: inset 0 0 0 2px var(--ol-l), inset 0 0 0 4px var(--ol3); }

/* TabBar — вкладки сверху, активная красная с подписью */
#tabs { height: var(--tabH); display: flex; justify-content: center; align-items: flex-end; gap: 5px; padding: 0 8px; }
.ktab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 66px; height: 42px; padding: 2px 0 0; cursor: pointer;
  background: linear-gradient(var(--ol), var(--ol3)); border: 3px solid var(--edge); border-bottom: 0; border-radius: 11px 11px 0 0;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18); color: #fff; transition: height .08s; }
.ktab .pxi { opacity: .72; filter: saturate(.8); }
.ktab span { display: none; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .2px; text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000; }
.ktab:hover .pxi { opacity: 1; }
.ktab.on { height: 50px; background: linear-gradient(#e0493a, var(--red2)); box-shadow: inset 0 2px 0 rgba(255,255,255,.35); }
.ktab.on .pxi { opacity: 1; filter: none; }
.ktab.on span { display: block; }

/* PinnedGroup — закреплённые кнопки слева (пауза, скорость) */
.kpin { display: flex; flex-direction: column; gap: 6px; padding: 5px 4px; background: #2d2818; border: 3px solid var(--edge); border-radius: 7px; box-shadow: inset 0 0 0 2px #4b4128; flex: 0 0 auto; }
/* Divider — разделитель с ручкой */
.kdiv { position: relative; align-self: stretch; width: 11px; flex: 0 0 auto; background: var(--ol4); border: 2px solid var(--edge); border-radius: 4px; box-shadow: inset 0 0 0 1px var(--ol3); }
.kdiv i { position: absolute; left: 50%; top: 50%; width: 5px; height: 28px; transform: translate(-50%, -50%); background: linear-gradient(#f0c043, #b5761b 55%, #7d2a18); border: 1px solid #000; border-radius: 2px; }

/* ActionGrid — два ряда, колонки по мере заполнения */
.kgrid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(var(--rows, 2), min-content); grid-auto-columns: max-content; justify-content: start; gap: 6px 8px; flex: 0 1 auto; min-width: 0; align-content: start; align-self: stretch; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: var(--ol-l) var(--ol4); }

/* IconButton — плитка с пиксельной иконкой и подписью */
.kbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 72px; padding: 0; background: none; border: 0; }
.kbtn .kt { position: relative; display: flex; align-items: center; justify-content: center; width: 58px; height: 50px;
  background: linear-gradient(#475538, #33402a); border: 3px solid var(--edge); border-radius: 7px; box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.28); }
.kbtn:hover .kt { background: linear-gradient(#586a45, #3d4c31); }
.kbtn:active .kt { transform: translateY(1px); }
.kbtn.on .kt { border-color: var(--gold); background: linear-gradient(#7a6a2a, #4e431a); box-shadow: 0 0 0 2px var(--red), inset 0 2px 0 rgba(255,255,255,.3); }
.kbtn.dis { opacity: .5; }
.kl { font-size: 10px; line-height: 1.05; font-weight: 900; color: #fff; text-transform: uppercase; text-align: center; max-width: 72px; letter-spacing: -.2px; overflow-wrap: anywhere; hyphens: auto; text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000, 1px 1px #000, -1px -1px #000; }
.ks { font-size: 9px; line-height: 1; color: var(--gold); font-weight: 900; text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000; }
.kbadge { position: absolute; right: 3px; bottom: 1px; font-style: normal; font-size: 11px; font-weight: 900; color: #ffe27a; text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000; }

/* InfoCard — карточка с заголовком (выбор, телеметрия) */
.kcard { background: linear-gradient(var(--ol3), var(--ol4)); border: 3px solid var(--edge); border-radius: 6px; box-shadow: inset 0 0 0 2px var(--ol2); padding: 8px 10px; }
.kch { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; color: #ffb347; text-transform: uppercase; margin-bottom: 6px; }
.kch b { font-weight: 900; display: flex; align-items: center; gap: 6px; }
.kcb { font-size: 13px; font-weight: 600; }
.kca { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.kcb .line { margin: 4px 0; }
/* ProgressBar */
.kbar { height: 8px; background: #141a0c; border: 2px solid #000; margin-top: 5px; flex: 1; border-radius: 2px; }
.kbar i { display: block; height: 100%; background: #3d8bff; }
.kbar.amb i { background: #ffb02e; }
.kbar.grn i { background: #5fd35f; }
.kbar.red i { background: #e8453a; }
.kcb .dim { color: #b9c2a4; font-weight: 500; }
.kcb .stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; }
.kcb .stats span { display: flex; flex-direction: column; font-size: 10px; text-transform: uppercase; color: #aab59a; font-weight: 800; }
.kcb .stats b { font-size: 14px; color: #fff; }
.kcb i.rel { font-style: normal; font-weight: 900; padding: 0 5px; border-radius: 3px; background: #3a4a2a; }
.kcb i.rel.r1 { background: #7a2018; color: #ffd0c8; }
.kcb i.rel.r2 { background: #1d4a7a; color: #cfe6ff; }
.kcb i.rel.r0 { background: #2d6a2d; }
/* маленькая текстовая кнопка */
.ktb { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; font-size: 11px; font-weight: 900; text-transform: uppercase; background: linear-gradient(#475538, #33402a); border: 2px solid var(--edge); border-radius: 5px; box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.ktb:hover { background: linear-gradient(#586a45, #3d4c31); }
.ktb:disabled { opacity: .45; }
.ktb.x { padding: 2px 7px; }

/* ===================== Верхняя панель ===================== */
#top { position: fixed; top: 0; left: 0; right: 0; min-height: var(--topH); display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 4px 8px; z-index: 10;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 3px, transparent 3px 6px), linear-gradient(var(--ol), var(--ol2)); border-bottom: 3px solid var(--edge); box-shadow: inset 0 -2px 0 var(--ol-l); }
#top .grow { flex: 1; }
.chip { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; min-height: 32px; background: var(--ol4); border: 2px solid var(--edge); border-radius: 5px; box-shadow: inset 0 0 0 1px var(--ol3); font-size: 15px; font-weight: 900; white-space: nowrap; }
.chip b { font-weight: 900; color: #fff; }
.chip small { color: var(--good); font-size: 11px; font-weight: 800; }
.chip.bad b { color: var(--bad); animation: blink 1s steps(2) infinite; }
.chip .sw { width: 16px; height: 16px; background: var(--c, #888); border: 2px solid #000; display: inline-block; }
.chip.menu { padding: 3px 6px; cursor: pointer; }
@keyframes blink { 50% { opacity: .35; } }

/* лента событий */
#feed { position: fixed; top: calc(var(--topH) + 12px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; z-index: 9; width: min(92vw, 640px); }
.toast { background: rgba(28,34,19,.92); color: #fff; padding: 6px 14px; font-size: 14px; font-weight: 800; line-height: 1.3; border: 2px solid var(--edge); border-radius: 5px; text-align: center; transition: opacity .7s; box-shadow: inset 0 0 0 1px var(--ol-l); }
.toast.out { opacity: 0; }
.toast.war, .toast.hit, .toast.err { background: rgba(96,24,18,.94); }
.toast.good, .toast.peace { background: rgba(28,76,32,.94); }
.toast.offer { background: rgba(110,86,16,.95); }
.toast.chat { background: rgba(30,54,100,.94); }

/* телеметрия ракеты (как в игре-образце) */
#telem { position: fixed; top: calc(var(--topH) + 12px); left: 8px; width: 300px; z-index: 8; background: linear-gradient(var(--ol3), var(--ol4)); border: 3px solid var(--edge); border-radius: 6px; box-shadow: inset 0 0 0 2px var(--ol2); padding: 8px 10px; }
#telem .th { display: flex; gap: 10px; align-items: center; }
#telem b { display: block; font-size: 13px; font-weight: 900; color: #ffb347; text-transform: uppercase; }
#telem small { font-size: 11px; color: #b7c49a; font-weight: 800; text-transform: uppercase; }
#telem .tl { font-size: 12px; font-weight: 900; margin: 8px 0 3px; color: #fff; }
#hint { position: fixed; top: calc(var(--topH) + 8px); right: 8px; background: rgba(20,24,12,.85); padding: 6px 10px; font-size: 13px; font-weight: 800; color: var(--gold); border: 2px solid var(--edge); border-radius: 5px; z-index: 8; max-width: 50vw; line-height: 1.35; }

/* миникарта */
#mini { position: fixed; right: 8px; bottom: calc(var(--tabH) + 8px); border: 3px solid var(--edge); box-shadow: 0 0 0 2px var(--ol-l); z-index: 7; cursor: pointer; image-rendering: pixelated; background: #000; transition: bottom .12s; }
body.panel-open #mini { bottom: calc(var(--tabH) + var(--panH) + 8px); }

#btnDrag { position: fixed; right: 8px; bottom: calc(var(--tabH) + var(--miniH, 130px) + 20px); z-index: 7; display: flex; align-items: center; gap: 6px; padding: 6px 10px; font: 900 12px/1 inherit; text-transform: uppercase; color: #fff; background: linear-gradient(#475538, #33402a); border: 3px solid var(--edge); border-radius: 5px; box-shadow: inset 0 0 0 2px var(--ol2); cursor: pointer; transition: bottom .12s; }
body.panel-open #btnDrag { bottom: calc(var(--tabH) + var(--panH) + var(--miniH, 130px) + 20px); }
#btnDrag.sel { background: linear-gradient(#2e6a2e, #1f4a1f); }
#btnDrag.hide { display: none; }

/* панель выбора */
#selpanel { position: fixed; left: 8px; bottom: calc(var(--tabH) + 8px); width: min(350px, calc(58vw / var(--k, 1))); z-index: 8; max-height: calc(46vh / var(--k, 1)); overflow-y: auto; }
body.panel-open #selpanel { bottom: calc(var(--tabH) + var(--panH) + 8px); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip2 { display: inline-flex; align-items: center; gap: 4px; background: var(--ol4); border: 1px solid #000; border-radius: 4px; padding: 2px 7px 2px 3px; font-size: 12px; font-weight: 800; }
.kprod { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.kprod .kbtn { width: 66px; } .kprod .kt { width: 52px; height: 44px; }
.queue { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.qi { display: flex; align-items: center; gap: 6px; font-size: 12px; } .qi span { min-width: 96px; }

/* панели с карточками: дипломатия и опции */
.note { align-self: center; max-width: 440px; font-size: 13px; font-weight: 700; color: #e4ebcc; padding: 0 10px; }
.dip, .offers { display: flex; gap: 8px; align-items: stretch; }
.offers { flex-direction: column; margin-right: 4px; }
.dc { display: flex; flex-direction: column; gap: 4px; min-width: 200px; padding: 6px 9px; background: linear-gradient(var(--ol3), var(--ol4)); border: 3px solid var(--edge); border-radius: 6px; box-shadow: inset 0 0 0 2px var(--ol2); font-size: 12px; flex: 0 0 auto; }
.dc .dn { display: flex; align-items: center; gap: 4px; } .dc b { font-size: 14px; font-weight: 900; text-transform: uppercase; } .dc small { color: #b7c49a; font-size: 12px; font-weight: 700; }
.dc .rl { margin-left: auto; font-size: 11px; font-weight: 900; color: var(--gold); text-transform: uppercase; } .dc.war { box-shadow: inset 0 0 0 2px var(--red); } .dc.war .rl { color: var(--bad); } .dc.dead { opacity: .4; }
.db { display: flex; flex-wrap: wrap; gap: 4px; } .db .ktb { padding: 4px 6px; font-size: 10px; }
.of { background: rgba(110,86,16,.95); border: 2px solid var(--edge); border-radius: 5px; padding: 4px 8px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.opts { display: flex; gap: 10px; align-items: flex-start; flex: 0 0 auto; }
.og { display: flex; flex-direction: column; gap: 6px; min-width: 210px; font-size: 13px; padding: 7px 10px; background: linear-gradient(var(--ol3), var(--ol4)); border: 3px solid var(--edge); border-radius: 6px; box-shadow: inset 0 0 0 2px var(--ol2); }
.og b { font-weight: 900; color: #ffb347; text-transform: uppercase; } .ogr { display: flex; gap: 4px; } .og select, .og input { font-size: 12px; padding: 4px; } .pl { display: block; font-weight: 700; }

/* баннер победы */
#banner { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); z-index: 30; }
.bn { background: linear-gradient(var(--ol), var(--ol2)); border: 4px solid var(--edge); box-shadow: inset 0 0 0 3px var(--ol-l); padding: 24px 36px; text-align: center; }
.bn h2 { margin: 0 0 12px; font-family: var(--px); font-size: 20px; text-shadow: 3px 3px 0 #000; } .bn.win h2 { color: var(--gold); } .bn.lose h2 { color: var(--bad); } .bn p { font-size: 18px; margin: 0 0 16px; }
.bn button, .go, .tabs2 button { padding: 10px 16px; font-size: 14px; font-weight: 900; text-transform: uppercase; background: linear-gradient(#475538, #33402a); border: 3px solid var(--edge); border-radius: 6px; box-shadow: inset 0 2px 0 rgba(255,255,255,.2); }

/* ===================== Главное меню ===================== */
#menu { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; overflow: auto;
  background: radial-gradient(ellipse at 50% 30%, #3e6a34 0, #223f45 45%, #0a1630 100%); }
#menu.hide { display: none; }
.logo { font-family: var(--px); font-size: clamp(30px, 8vw, 64px); text-shadow: 4px 4px 0 #000; letter-spacing: 2px; }
.logo .l1 { color: #ffcb3d; } .logo .l2 { color: #ff5a4a; }
.sub { font-family: var(--px); font-size: clamp(8px, 2vw, 11px); color: #d7e8ff; text-shadow: 2px 2px 0 #000; text-align: center; }
.card { width: min(480px, 94vw); background: linear-gradient(var(--ol3), var(--ol4)); border: 4px solid var(--edge); box-shadow: inset 0 0 0 3px var(--ol2); padding: 16px; display: flex; flex-direction: column; gap: 12px; border-radius: 8px; }
.card label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #dbe6c0; } .card .row { display: flex; gap: 10px; } .card .row label { flex: 1; }
.card label.chk { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; }
.tabs2 { display: flex; gap: 4px; } .tabs2 button { flex: 1; } .tabs2 button.on { background: linear-gradient(#e0493a, var(--red2)); }
.go { width: 100%; font-size: 16px; padding: 13px; background: linear-gradient(#3f8a3f, #276227); margin-top: 4px; }
.go:hover { filter: brightness(1.15); }
.err { color: var(--bad); font-size: 14px; min-height: 16px; } .hint { font-size: 13px; color: #b7c49a; margin: 0; font-weight: 600; } code { background: #000; padding: 1px 5px; color: #9f9; }
.help { max-width: 720px; text-align: center; font-size: 13px; color: #c9d6aa; line-height: 1.6; text-shadow: 1px 1px 0 #000; font-weight: 600; }

@media (max-width: 700px) {
  :root { --topH: 40px; --tabH: 46px; --panH: 176px; }
  .chip { padding: 2px 6px 2px 4px; font-size: 12px; gap: 4px; min-height: 28px; } .chip small { display: none; }
  .ktab { width: 46px; height: 38px; } .ktab.on { height: 44px; width: 60px; }
  .kbtn { width: 58px; } .kbtn .kt { width: 50px; height: 44px; } .kl { font-size: 9px; max-width: 60px; }
  #selpanel { width: calc(64vw / var(--k, 1)); max-height: calc(34vh / var(--k, 1)); } #hint { max-width: calc(42vw / var(--k, 1)); } #telem { width: 230px; }
}

/* плавающие окна зданий */
#wins { position: fixed; inset: 0; pointer-events: none; z-index: 12; }
#hud.hide ~ #wins { display: none; }
.fwin { position: absolute; width: calc(318px * var(--k, 1)); pointer-events: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.55)); }
.fwin.pinned { filter: drop-shadow(0 4px 10px rgba(0,0,0,.55)) drop-shadow(0 0 3px #ffd24a); }
.fwin.drag { opacity: .92; }
.fw-in { zoom: var(--k, 1); width: 318px; display: flex; flex-direction: column; }
.fw-h { display: flex; align-items: center; gap: 6px; background: linear-gradient(var(--ol2), var(--ol3)); border: 3px solid var(--edge); border-bottom: 0; border-radius: 6px 6px 0 0; padding: 5px 8px; font-weight: 800; font-size: 13px; cursor: grab; touch-action: none; user-select: none; }
.fwin.drag .fw-h { cursor: grabbing; }
.fw-sp { flex: 1; }
.fw-b { border-radius: 0; max-height: calc(58vh / var(--k, 1)); overflow-y: auto; overscroll-behavior: contain; }
.fw-a { display: flex; flex-wrap: wrap; gap: 4px; background: var(--ol3); border: 3px solid var(--edge); border-top: 0; border-radius: 0 0 6px 6px; padding: 5px 6px; }
.fw-a:empty { display: none; }
.psec { margin: 8px 0 3px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #aab58a; }
.prow { display: flex; align-items: center; gap: 7px; padding: 3px 4px; margin-bottom: 3px; background: var(--ol4); border: 1px solid #000; border-radius: 5px; }
.prow.dis { opacity: .55; }
.prow .pi { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.prow .pi b { font-size: 13px; } .prow .pi small { font-size: 11px; color: #c9d3a8; }
.prow .ktb { min-width: 34px; }
.ktb.inf { font-size: 15px; font-weight: 900; } .ktb.inf.on { background: #b88a12; color: #fff; outline: 2px solid #ffd24a; }
.line .ktb { padding: 1px 6px; margin-left: 4px; }
@media (max-width: 700px) { .fwin { width: calc(min(318px, 94vw / var(--k, 1)) * var(--k, 1)); } .fw-in { width: min(318px, calc(94vw / var(--k, 1))); } }

.kgsep { display: flex; align-items: center; justify-content: center; width: 16px; background: var(--ol4); border: 2px solid var(--edge); border-radius: 4px; box-shadow: inset 0 0 0 1px var(--ol3); }
.kgsep span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #e9d9a0; white-space: nowrap; }
.kgap { min-width: 1px; }

#stats { position: fixed; z-index: 60; left: 50%; top: 56px; transform: translateX(-50%); width: min(680px, 96vw); background: var(--ol4, #3a3d22); border: 2px solid var(--edge, #14181d); border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.55); padding: 8px 10px 10px; color: #e9e3c0; font-size: 12px; max-height: calc(100vh - 140px); overflow: auto; }
#stats.hide { display: none; }
#stats .shead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
#stats .stabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
#stats .stabs .ktb.on { outline: 2px solid #ffd24a; }
#stats canvas { width: 100%; height: auto; display: block; border-radius: 4px; }
#stats .slegend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
#stats .slegend i, #stats .stable i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
#stats .stable table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
#stats .stable th, #stats .stable td { padding: 3px 5px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.1); }
#stats .stable th:first-child, #stats .stable td:first-child { text-align: left; }
#stats .stable tr.me td { color: #ffd24a; font-weight: 700; }
.kgsep { cursor: pointer; } .kgsep:hover { filter: brightness(1.25); } .kgsep.closed { background: #4a4a28; }

/* ===================== Редактор модов ===================== */
.modbtn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; cursor: pointer; border: 3px solid var(--edge); border-radius: 8px;
  background: linear-gradient(135deg, #5b4a1c, #3a2f12 60%, #2c2410); box-shadow: inset 0 2px 0 rgba(255,255,255,.18), 0 3px 0 #000; transition: transform .08s, filter .15s; }
.modbtn:hover { filter: brightness(1.18); transform: translateY(-1px); }
.modbtn .mi { font-size: 26px; filter: drop-shadow(0 2px 0 #000); }
.modbtn .mt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.modbtn .mt b { font-size: 16px; text-transform: uppercase; letter-spacing: .5px; color: var(--gold); }
.modbtn .mt small { font-size: 11px; font-weight: 600; color: #cdbf8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modbtn .mn2 { font-size: 11px; padding: 4px 8px; border-radius: 10px; background: #1b1d12; border: 2px solid var(--edge); color: #9aa07e; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modbtn.on .mn2 { background: #1f5d2a; color: #c9ffc9; box-shadow: 0 0 8px #3fd25f88; }

#modUI { position: fixed; inset: 0; z-index: 70; background: rgba(4,7,2,.84); backdrop-filter: blur(3px); display: flex; padding: 14px; animation: muIn .16s ease-out; user-select: none; }
@keyframes muIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.mu-win { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border: 4px solid var(--edge); border-radius: 6px;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 3px, transparent 3px 6px), linear-gradient(#2e3820, #1c2313); box-shadow: inset 0 0 0 3px var(--ol2), 0 10px 40px #000; }
.mu-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: linear-gradient(#5a4a1a, #3a2f12); border-bottom: 3px solid var(--edge); box-shadow: inset 0 2px 0 rgba(255,255,255,.15); flex-wrap: wrap; }
.mu-logo { font-size: 17px; letter-spacing: 1px; color: var(--gold); text-shadow: 2px 2px 0 #000; white-space: nowrap; }
.mu-name { flex: 0 1 260px; min-width: 120px; font-size: 16px; font-weight: 800; padding: 7px 10px; }
.mu-badge { font-size: 11px; padding: 4px 9px; border-radius: 10px; background: #1b1d12; color: #99a07e; border: 2px solid var(--edge); white-space: nowrap; }
.mu-badge.on { background: #6b4a12; color: #ffe08a; }
.mu-sp { flex: 1; }
.mu-b { padding: 7px 12px; font-size: 13px; text-transform: uppercase; background: linear-gradient(#4b5a3a, #34412a); border: 3px solid var(--edge); border-radius: 6px; box-shadow: inset 0 2px 0 rgba(255,255,255,.2); white-space: nowrap; }
.mu-b:hover:not(:disabled) { filter: brightness(1.2); } .mu-b:disabled { opacity: .35; cursor: default; }
.mu-b.go { background: linear-gradient(#3f8a3f, #276227); } .mu-b.x { background: linear-gradient(#c9382d, #8f2219); } .mu-b.act { background: linear-gradient(#d1a12a, #8a6812); color: #fff7d0; } .mu-b.bad { background: linear-gradient(#a9382d, #6f1d16); }
.mu-body { flex: 1; display: flex; min-height: 0; }
.mu-side { width: 232px; flex: none; overflow-y: auto; padding: 8px; background: rgba(0,0,0,.28); border-right: 3px solid var(--edge); }
.mu-sec { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #b9c48d; margin: 10px 2px 6px; }
.mu-list { display: flex; flex-direction: column; gap: 5px; }
.mu-mod { padding: 7px 9px; border: 2px solid var(--edge); border-radius: 5px; background: linear-gradient(#3b4729, #2a3320); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.mu-mod:hover { filter: brightness(1.18); } .mu-mod.sel { background: linear-gradient(#e0493a, var(--red2)); }
.mu-mod .t { font-size: 14px; display: flex; align-items: center; gap: 6px; } .mu-mod .s { font-size: 11px; font-weight: 600; color: #c4cfa2; margin-top: 1px; line-height: 1.2; }
.mu-mod.pr { background: linear-gradient(#35402a, #262e1d); } .mu-mod.pr .s { color: #9ba67e; }
.dotg { width: 9px; height: 9px; border-radius: 50%; background: #55e070; box-shadow: 0 0 6px #55e070; display: inline-block; }
.mu-btns { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; } .mu-btns.left { justify-content: flex-start; }
.mu-btns button:not(.mu-b) { flex: 1; padding: 6px 7px; font-size: 12px; background: linear-gradient(#475538, #33402a); border: 2px solid var(--edge); border-radius: 5px; white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.mu-btns button:not(.mu-b):hover:not(:disabled) { filter: brightness(1.22); } .mu-btns button:disabled { opacity: .35; } .mu-btns button.bad { background: linear-gradient(#a9382d, #6f1d16); }
.mu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mu-tabs { display: flex; gap: 4px; padding: 8px 10px 0; overflow-x: auto; border-bottom: 3px solid var(--edge); background: rgba(0,0,0,.18); flex: none; }
.mu-tabs button { padding: 8px 13px; font-size: 13px; white-space: nowrap; background: linear-gradient(#3b4729, #2a3320); border: 3px solid var(--edge); border-bottom: 0; border-radius: 8px 8px 0 0; }
.mu-tabs button.on { background: linear-gradient(#e0493a, var(--red2)); box-shadow: inset 0 2px 0 rgba(255,255,255,.3); }
.mu-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.mu-card { background: rgba(0,0,0,.26); border: 3px solid var(--edge); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; box-shadow: inset 0 0 0 2px rgba(120,140,80,.18); }
.mu-ct { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--gold); margin-bottom: 8px; } .mu-ct small { text-transform: none; letter-spacing: 0; font-size: 11px; color: #a8b383; font-weight: 600; margin-left: 6px; }
.mu-card textarea, #modUI textarea { width: 100%; min-height: 56px; resize: vertical; font-family: var(--ui); font-weight: 600; font-size: 13px; background: #10150a; color: #fff; border: 2px solid var(--edge); box-shadow: inset 0 0 0 1px var(--ol-l); padding: 7px 9px; border-radius: 3px; user-select: text; }
#modUI input, #modUI select { user-select: text; }
.mu-row { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 4px; flex-wrap: wrap; }
.mu-row:hover { background: rgba(255,255,255,.04); } .mu-row.md { background: rgba(255,200,60,.1); box-shadow: inset 3px 0 0 var(--gold); }
.mu-row .l { flex: 0 0 210px; font-size: 14px; } .mu-row .l small { display: block; font-size: 10.5px; color: #98a47a; font-weight: 600; line-height: 1.15; }
.mu-row input[type=range] { flex: 1; min-width: 100px; accent-color: #e0a52a; height: 22px; padding: 0; background: none; border: 0; box-shadow: none; cursor: pointer; }
.mu-row .mn { width: 84px; text-align: right; font-weight: 800; color: #ffe08a; } .mu-row .mn.txt { width: 54px; text-align: center; }
.mu-row .suf { color: #aab68c; font-size: 12px; } .mu-row .was { width: 76px; font-size: 11px; color: #8d9a70; font-weight: 600; text-align: right; }
.rs { width: 28px; height: 28px; padding: 0; font-size: 15px; background: linear-gradient(#475538, #33402a); border: 2px solid var(--edge); border-radius: 5px; } .rs:hover { filter: brightness(1.3); } .rs.bad { background: #8f2219; }
.mu-ent { display: flex; gap: 12px; height: 100%; min-height: 0; } .mu-elist { width: 218px; flex: none; display: flex; flex-direction: column; min-height: 0; }
.mu-search input { width: 100%; } .mu-chips { display: flex; gap: 4px; margin: 6px 0; } .mu-chips button { flex: 1; padding: 5px 4px; font-size: 12px; background: #2a3320; border: 2px solid var(--edge); border-radius: 12px; } .mu-chips button.on { background: #b8892a; color: #fff; }
.mu-ents { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 3px; }
.mu-it { display: flex; align-items: center; gap: 7px; padding: 4px 7px; border: 2px solid var(--edge); border-radius: 5px; background: linear-gradient(#35402a, #262e1d); cursor: pointer; font-size: 13px; }
.mu-it:hover { filter: brightness(1.25); } .mu-it.sel { background: linear-gradient(#e0493a, var(--red2)); } .mu-it span:not(.th) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-it i { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 8px; } .mu-it i.md { background: var(--gold); color: #000; } .mu-it i.cln { background: #3f8a8a; }
.th { flex: none; width: 28px; height: 28px; image-rendering: pixelated; } .th.e { display: inline-flex; align-items: center; justify-content: center; }
.mu-edit { flex: 1; min-width: 0; overflow-y: auto; padding-right: 4px; }
.mu-ehead { display: flex; gap: 12px; margin-bottom: 8px; } #muPrev { width: 132px; height: 132px; flex: none; border: 3px solid var(--edge); border-radius: 6px; }
.mu-ehead .ei { flex: 1; min-width: 0; } .mu-en { width: 100%; font-size: 20px; font-weight: 900; padding: 6px 9px; margin-bottom: 4px; } .mu-ehead code { background: #10150a; padding: 1px 5px; border-radius: 3px; color: #bcd; }
.mu-ed { min-height: 46px; margin-bottom: 8px; }
.mu-stats { margin-top: 10px; padding: 10px 12px; background: rgba(0,0,0,.28); border: 3px solid var(--edge); border-radius: 6px; }
.bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; } .bar > span { width: 112px; } .bar > b { width: 52px; text-align: right; color: #ffe08a; }
.bt { position: relative; flex: 1; height: 12px; background: #10150a; border: 2px solid var(--edge); border-radius: 3px; } .bf { height: 100%; background: #8fa14f; transition: width .12s; } .bf.up { background: #4fcf6a; } .bf.dn { background: #e0693a; }
.bt i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; box-shadow: 0 0 0 1px #000; }
.eff { margin-top: 8px; font-size: 14px; } .eff.up b { color: #6fdc6f; } .eff.dn b { color: #ff7a5a; } .eff b { color: #ffe08a; }
.mu-gfx { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.mu-gc { padding: 8px 6px; border: 2px solid var(--edge); border-radius: 6px; background: linear-gradient(#35402a, #262e1d); text-align: center; } .mu-gc.has { box-shadow: 0 0 0 2px var(--gold); }
.mu-gc .gp { display: flex; justify-content: center; margin-bottom: 4px; } .mu-gc .th { width: 56px; height: 56px; } .mu-gc .gn { font-size: 12px; min-height: 30px; line-height: 1.15; }
.mu-gc .gb { display: flex; gap: 4px; justify-content: center; } .mu-gc button { padding: 3px 9px; font-size: 13px; background: #475538; border: 2px solid var(--edge); border-radius: 4px; } .mu-gc button.bad { background: #8f2219; }
.mu-tb { width: 100%; border-collapse: collapse; font-size: 13px; } .mu-tb th, .mu-tb td { padding: 5px 7px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.1); } .mu-tb th:first-child, .mu-tb td:first-child { text-align: left; }
.mu-tb th { cursor: pointer; color: #b9c48d; position: sticky; top: 0; background: #232b19; } .mu-tb th.on { color: var(--gold); } .mu-tb tr[data-a] { cursor: pointer; } .mu-tb tr[data-a]:hover { background: rgba(255,255,255,.07); }
.mu-tb td .th { width: 20px; height: 20px; vertical-align: middle; margin-right: 4px; display: inline-block; } .mu-tb td.ef { min-width: 150px; } .mu-tb td.ef .bt { display: inline-block; width: 90px; margin-right: 6px; vertical-align: middle; height: 10px; }
.mu-tb td.hot { color: #ff7a5a; } .mu-tb td.hot .bf { background: #e0493a; } .mu-tb td.cold { color: #8fa0c8; } .mu-tb td.cold .bf { background: #5a78c8; }
.mu-df { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 13px; } .mu-df small { color: #98a47a; } .mu-df span { margin-left: auto; color: #cdd7ae; } .mu-df em { font-style: normal; color: #ffe08a; font-weight: 900; }
.mu-df i { font-style: normal; font-size: 11px; margin-left: 4px; } .mu-df i.up { color: #6fdc6f; } .mu-df i.dn { color: #ff7a5a; }
.mu-help p { font-size: 14px; line-height: 1.4; margin: 7px 0; font-weight: 600; color: #e3ead0; }
.mu-pop { position: absolute; inset: 0; background: rgba(0,0,0,.62); display: flex; align-items: center; justify-content: center; z-index: 5; padding: 14px; }
.mu-pop .pp { width: min(560px, 100%); background: linear-gradient(#2e3820, #1c2313); border: 4px solid var(--edge); border-radius: 6px; padding: 14px; box-shadow: 0 8px 30px #000; } .mu-pop textarea { min-height: 150px; }
@media (max-width: 760px) {
  #modUI { padding: 0; } .mu-win { border-width: 0; } .mu-body { flex-direction: column; } .mu-side { width: auto; max-height: 150px; border-right: 0; border-bottom: 3px solid var(--edge); }
  .mu-ent { flex-direction: column; } .mu-elist { width: auto; max-height: 190px; } .mu-row .l { flex-basis: 100%; } .mu-row .was { display: none; } .mu-ehead { flex-direction: column; } .mu-name { flex-basis: 100%; }
}
.mu-b.go, .mu-pop .mu-b.go { width: auto; margin: 0; font-size: 13px; padding: 7px 12px; }

/* ===== Быстрые окна: войска (E) и улучшения (Q) ===== */
#lstUI { position: fixed; left: 10px; top: calc(var(--topH) + 10px); bottom: calc(var(--panH) + 16px); width: min(430px, calc(100vw - 20px)); z-index: 30; display: flex; flex-direction: column; min-height: 120px;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 3px, transparent 3px 6px), linear-gradient(#3a4527, #232b19); border: 3px solid var(--edge); border-radius: 6px; box-shadow: inset 0 0 0 2px var(--ol-l), 0 6px 24px #000a; animation: muIn .12s ease-out; user-select: none; }
#lstUI.me { border-color: #0e1a08; } #lstUI.mu .ls-h { background: linear-gradient(#6b5316, #46350d); }
.ls-h { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: linear-gradient(#e0493a, var(--red2)); border-bottom: 3px solid var(--edge); font-size: 15px; letter-spacing: .5px; }
#lstUI.mu .ls-h { background: linear-gradient(#c79a22, #7c5c0e); } .ls-tot { font-size: 12px; background: rgba(0,0,0,.35); padding: 2px 8px; border-radius: 9px; } .sp { flex: 1; }
.ls-h button { padding: 2px 8px; font-size: 13px; background: #00000055; border: 2px solid var(--edge); border-radius: 4px; }
.ls-chips { display: flex; align-items: center; gap: 4px; padding: 6px 8px; flex-wrap: wrap; border-bottom: 2px solid #0006; } .ls-chips button { padding: 4px 9px; font-size: 12px; background: #2a3320; border: 2px solid var(--edge); border-radius: 12px; } .ls-chips button.on { background: #b8892a; }
.ls-chips button.go { background: linear-gradient(#3f8a3f, #276227); border-radius: 5px; } .ls-chips button:disabled { opacity: .4; }
.ls-body { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; } .ls-empty { padding: 18px 8px; color: #b9c48d; font-size: 13px; text-align: center; }
.ls-r { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border: 2px solid var(--edge); border-radius: 5px; background: linear-gradient(#3b4729, #2a3320); } .ls-g .ls-u { margin-left: 28px; }
.ls-r .ico { flex: none; } .ls-n { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; } .ls-n b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ls-n small { font-size: 10.5px; color: #aab68c; font-weight: 600; }
.ls-c { font-size: 16px; color: var(--gold); min-width: 44px; text-align: right; }
.ls-r button, .ls-u { cursor: pointer; } .ls-r button { padding: 3px 7px; font-size: 13px; background: linear-gradient(#475538, #33402a); border: 2px solid var(--edge); border-radius: 4px; } .ls-r button:hover:not(:disabled) { filter: brightness(1.3); }
.ls-hp { width: 48px; height: 8px; background: #10150a; border: 1px solid #000; border-radius: 2px; flex: none; } .ls-hp div { height: 100%; } .ls-hp.s { width: 60px; display: inline-block; }
.ls-u { display: flex; align-items: center; gap: 8px; padding: 2px 8px; font-size: 12px; border-radius: 4px; background: rgba(0,0,0,.2); } .ls-u:hover { background: rgba(255,255,255,.1); } .ls-u.sel { outline: 2px solid var(--gold); } .ls-u small { color: #a9b58a; margin-left: auto; }
.ls-lv { display: flex; gap: 2px; } .ls-lv i { width: 7px; height: 14px; background: #10150a; border: 1px solid #000; } .ls-lv i.on { background: #e0b43a; } .ls-lv i.nx { background: #6f8a3a; }
.ls-r button.up { background: linear-gradient(#3f8a3f, #276227); font-weight: 800; white-space: nowrap; } .ls-r button.up.no { background: #4a3a30; color: #a99; }
.ls-f { padding: 4px 10px; font-size: 11px; color: #9eaa80; border-top: 2px solid #0006; }
@media (max-width: 700px) { #lstUI { width: calc(100vw - 20px); } }

/* ===== Миры (мультисервер) и лидеры ===== */
.realms-h { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 13px; color: #dbe6c0; }
.rfb { padding: 2px 9px; font-size: 14px; background: linear-gradient(#475538, #33402a); border: 2px solid var(--edge); border-radius: 4px; }
.realms { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.realm { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 2px solid var(--edge); border-radius: 6px; background: linear-gradient(#3b4729, #2a3320); }
.realm.off { opacity: .55; } .realm .rn { flex: 1; min-width: 0; display: flex; flex-direction: column; } .realm b { font-size: 15px; } .realm small { font-size: 11px; font-weight: 600; color: #b9c48d; }
.realm i { font-style: normal; font-size: 10px; background: #b8892a; color: #fff; padding: 1px 6px; border-radius: 8px; margin-left: 4px; } .realm i.rm { background: #3f6f8a; }
.realm .go { width: auto; margin: 0; padding: 7px 14px; font-size: 13px; }
.leaders table { width: 100%; font-size: 12px; border-collapse: collapse; } .leaders td { padding: 2px 6px; border-bottom: 1px solid rgba(255,255,255,.08); } .leaders td:nth-child(3), .leaders td:nth-child(4) { text-align: right; color: #ffe08a; }
.bn .go { display: inline-block; width: auto; padding: 10px 18px; margin-right: 8px; }

/* ===================== Новое главное меню ===================== */
#menu { background: #0a1630; justify-content: center; }
#mmBg { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.mm-vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 30% 50%, rgba(5,10,20,.1) 0, rgba(5,10,20,.45) 55%, rgba(2,5,12,.82) 100%), linear-gradient(rgba(0,0,0,.35), transparent 25%, transparent 70%, rgba(0,0,0,.55)); }
.mm-wrap { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: clamp(20px, 5vw, 70px); width: min(1100px, 100%); padding: 10px; flex-wrap: wrap; }
.mm-left { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: min(400px, 100%); }
.mm-left .logo { font-size: clamp(38px, 7vw, 76px); line-height: 1; filter: drop-shadow(0 0 22px rgba(255,150,40,.45)); animation: mmGlow 4s ease-in-out infinite; }
@keyframes mmGlow { 50% { filter: drop-shadow(0 0 34px rgba(255,90,60,.65)); } }
.mm-left .sub { text-align: left; color: #cfe3ff; line-height: 1.6; }
.mm-nav { display: flex; flex-direction: column; gap: 9px; width: 100%; margin-top: 8px; }
.mm-nav button { display: flex; align-items: center; gap: 14px; padding: 11px 14px; text-align: left; cursor: pointer; border: 3px solid var(--edge); border-radius: 9px; backdrop-filter: blur(3px);
  background: linear-gradient(135deg, rgba(60,74,42,.92), rgba(32,40,24,.92)); box-shadow: inset 0 2px 0 rgba(255,255,255,.16), 0 4px 0 #000a; transition: transform .1s, filter .15s, box-shadow .1s; }
.mm-nav button:hover { transform: translateX(6px); filter: brightness(1.2); } .mm-nav button:active { transform: translateX(6px) translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.16), 0 2px 0 #000a; }
.mm-nav button.on { background: linear-gradient(135deg, #e0493a, #8f2219); } .mm-nav button.on small { color: #ffd9d2; }
.mm-nav i { font-style: normal; font-size: 26px; width: 34px; text-align: center; filter: drop-shadow(0 2px 0 #000); }
.mm-nav span { flex: 1; display: flex; flex-direction: column; min-width: 0; } .mm-nav b { font-size: 17px; text-transform: uppercase; letter-spacing: .6px; } .mm-nav small { font-size: 11.5px; font-weight: 600; color: #b9c8a0; margin-top: 1px; }
.mm-nav button.modbtn { background: linear-gradient(135deg, rgba(110,86,28,.92), rgba(58,46,16,.92)); } .mm-nav button.modbtn b { color: var(--gold); }
.mm-nav em { font-style: normal; font-size: 11px; padding: 3px 9px; border-radius: 10px; background: #1b1d12; border: 2px solid var(--edge); color: #9aa07e; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-nav button.on em, .mm-nav button.modbtn.on em { background: #1f5d2a; color: #c9ffc9; }
.mm-ver { font-size: 11px; color: #8fa0b8; font-weight: 600; letter-spacing: .5px; margin-top: 4px; }
.mm-right { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(500px, 100%); }
.mm-right .card { width: 100%; background: linear-gradient(rgba(36,46,26,.93), rgba(20,26,15,.93)); backdrop-filter: blur(5px); box-shadow: inset 0 0 0 3px var(--ol2), 0 14px 40px #000b; max-height: calc(100vh - 80px); overflow-y: auto; }
.mm-right .help { font-size: 12px; color: #b9c6a0; }
.mm-snd { position: absolute; right: 14px; top: 14px; z-index: 3; width: 44px; height: 44px; font-size: 20px; border: 3px solid var(--edge); border-radius: 50%; background: rgba(32,40,24,.85); }
.mm-snd:hover { filter: brightness(1.3); }
.mm-foot { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 11px; color: #7e8fa8; z-index: 2; pointer-events: none; }
.modbtn { all: unset; }
.mm-nav button.modbtn { all: unset; display: flex; align-items: center; gap: 14px; padding: 11px 14px; cursor: pointer; border: 3px solid var(--edge); border-radius: 9px; box-sizing: border-box; background: linear-gradient(135deg, rgba(110,86,28,.92), rgba(58,46,16,.92)); box-shadow: inset 0 2px 0 rgba(255,255,255,.16), 0 4px 0 #000a; width: 100%; color: var(--txt); transition: transform .1s, filter .15s; font-family: var(--ui); font-weight: 800; }
.mm-nav button.modbtn:hover { transform: translateX(6px); filter: brightness(1.2); }
@media (max-width: 880px) { .mm-wrap { flex-direction: column; justify-content: flex-start; padding-top: 24px; } .mm-left { align-items: center; } .mm-left .sub { text-align: center; } .mm-nav { max-width: 420px; } #menu { justify-content: flex-start; } }

/* ===================== Настройки ===================== */
#setUI { position: fixed; inset: 0; z-index: 80; background: rgba(4,7,2,.82); backdrop-filter: blur(3px); display: flex; padding: 14px; animation: muIn .16s ease-out; }
#setUI .mu-win { max-width: 860px; margin: 0 auto; } #setUI .mu-row .l { flex-basis: 260px; }
.sv { min-width: 56px; text-align: right; color: #ffe08a; font-size: 15px; }
.swt { width: 54px; height: 28px; padding: 0; position: relative; border: 3px solid var(--edge); border-radius: 16px; background: #1b2013; box-shadow: inset 0 2px 5px #000a; transition: background .15s; }
.swt i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #8a947a; box-shadow: 0 1px 0 #000; transition: left .15s, background .15s; }
.swt.on { background: #2f7d3c; } .swt.on i { left: 28px; background: #eaffea; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; justify-content: flex-end; } .seg button { padding: 6px 12px; font-size: 13px; background: linear-gradient(#3b4729, #2a3320); border: 2px solid var(--edge); border-radius: 6px; } .seg button.on { background: linear-gradient(#e0b43a, #a8741a); color: #1a1405; }
.kt { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 4px 18px; } .kr { display: flex; align-items: center; gap: 10px; padding: 4px 2px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 13px; }
kbd { flex: none; min-width: 74px; text-align: center; padding: 3px 8px; font-family: var(--ui); font-weight: 900; font-size: 12px; background: #10150a; border: 2px solid var(--edge); border-bottom-width: 4px; border-radius: 5px; color: #ffe08a; }
#fpsBox { position: fixed; left: 8px; bottom: 8px; z-index: 95; font: 800 12px var(--ui); color: #9f9; background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 4px; pointer-events: none; }
