:root { --t0: #3aa4ff; --t1: #ff8428; --ink: #e8edf3; --dim: #8b97a6; --bg: rgba(10, 14, 20, .78); --line: rgba(255, 255, 255, .12); --gold: #f5c542; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1117; color: var(--ink); font: 15px/1.35 system-ui, "Segoe UI", Roboto, sans-serif; user-select: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ── Меню ── */
.panelWrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 30; background: linear-gradient(120deg, rgba(8, 12, 20, .62), rgba(8, 12, 20, .22) 60%, rgba(8, 12, 20, .55)); overflow: auto; padding: 16px; }
#pause { background: rgba(6, 9, 14, .62); backdrop-filter: blur(3px); }
/* Без backdrop-filter: он делает панель точкой отсчёта для position: fixed, и меню аккаунта (fixed от края экрана) уезжало за край панели, где его обрезала прокрутка. Плотность — заливкой. */
.panel { scrollbar-width: thin; width: 480px; max-width: 100%; max-height: calc(100vh - 32px - var(--upd-h, 0px)); overflow: auto; background: rgba(10, 14, 20, .9); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; box-shadow: 0 18px 60px rgba(0, 0, 0, .5); }
.panel.wide { width: 640px; }
h1 { margin: 6px 0 4px; font-size: 46px; letter-spacing: 1px; font-weight: 800; background: linear-gradient(95deg, var(--t0), #9fb4ff 45%, #ffb36b 60%, var(--t1)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1 .gameVer, h2 .gameVer { font-size: 13px; font-weight: 500; color: var(--dim); -webkit-text-fill-color: var(--dim); letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 24px; }
h3 { margin: 0 0 8px; font-size: 14px; color: var(--dim); font-weight: 600; }
.lead { margin: 4px 0 14px; color: #c8d2de; }
.lead b { color: #fff; }
.homeLink { color: var(--dim); text-decoration: none; font-size: 13px; }
.homeLink:hover { color: #fff; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.row.twoc { align-items: stretch; flex-wrap: nowrap; }
.card { flex: 1; min-width: 0; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.card .row { margin: 0 0 8px; flex-wrap: nowrap; }
.card > button { width: 100%; }
/* Своя ширина у поля и списков: иначе они просят ширину по содержимому (поле с разрядкой букв — около 255 px), и ряд из двух блоков вылезает за панель */
.card #code { flex: 1 1 60px; width: 60px; }
.card #joinCode { flex: 0 0 auto; }
.card select { width: 0; }
.card #arena { flex: 2 1 0; }
.card #skill { flex: 3 1 0; }
label.row > span { min-width: 54px; color: var(--dim); }
input, select { flex: 1; min-width: 0; background: rgba(255, 255, 255, .07); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; outline: none; user-select: text; }
select option { background: #151b24; }
input:focus, select:focus { border-color: #6aa9ff; }
input:disabled { opacity: .6; }
#code { text-transform: uppercase; letter-spacing: 3px; text-align: center; }
button, .btn { font: inherit; color: var(--ink); background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; cursor: pointer; text-decoration: none; display: inline-block; transition: background .12s, transform .08s, border-color .12s; }
button:hover, .btn:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .28); }
button:active, .btn:active { transform: translateY(1px); }
button.main { width: 100%; background: linear-gradient(95deg, #2076d6, #3aa4ff 55%, #ff9b4a); border: 0; color: #fff; font-weight: 700; padding: 11px; }
button.main:hover { filter: brightness(1.12); }
button.big { font-size: 20px; padding: 14px; }
button.big small { display: block; font-size: 12px; font-weight: 400; opacity: .9; }
button.danger:hover { background: #a3342f; }
.links > * { flex: 1; text-align: center; white-space: nowrap; }
#err { color: #ff8a80; min-height: 18px; margin-top: 6px; }
#accBar { margin-bottom: 6px; }
#accBar .offnet { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; padding: 4px 12px; border-radius: 999px; border: 1px solid #24406b; background: rgba(56,189,248,.08); color: #bae6fd; font-size: 13px; }
#accBar .offnet b { color: #fff; }
#accBar .offnet a { color: #7dd3fc; }
#loadBar { position: relative; height: 22px; margin-top: 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
#loadFill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--t0), var(--t1)); transition: width .15s; }
#loadTxt { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 22px; }
.setRow { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.setRow > span { min-width: 142px; color: var(--dim); font-size: 13px; }
.setRow input[type=range] { padding: 0; }
.setRow b { min-width: 30px; font-weight: 500; font-size: 13px; text-align: right; }
.segs { display: flex; flex: 1; gap: 4px; }
.segs button { flex: 1; padding: 5px 4px; font-size: 13px; }
.segs button.on { background: #3a78c2; border-color: #6aa9ff; }
#netStats { font-size: 12px; color: var(--dim); margin-top: 8px; }

/* ── Бой: сверху ── */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; text-shadow: 0 1px 3px rgba(0, 0, 0, .75); }
#top { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 8px; }
.side { display: flex; align-items: center; gap: 8px; }
.sc { font-size: 30px; font-weight: 800; min-width: 44px; text-align: center; padding: 2px 8px; border-radius: 8px; }
.s0 .sc { background: color-mix(in srgb, var(--t0) 78%, black); }
.s1 .sc { background: color-mix(in srgb, var(--t1) 78%, black); }
.pips { display: flex; gap: 4px; width: 124px; }
.s0 .pips { justify-content: flex-end; }
.pips i { width: 20px; height: 26px; border-radius: 4px; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .15); transition: background .15s, transform .15s; }
.s0 .pips i.on { background: var(--t0); box-shadow: 0 0 8px var(--t0); }
.s1 .pips i.on { background: var(--t1); box-shadow: 0 0 8px var(--t1); }
.pips i.me { border-color: #fff; }
#clock { min-width: 96px; text-align: center; background: var(--bg); border-radius: 8px; padding: 2px 10px; }
#timer { font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
#timer.low { color: #ff6a5a; }
#phaseTxt { font-size: 11px; color: var(--dim); margin-top: -2px; }
#paintBar { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); width: 360px; height: 9px; background: rgba(255, 255, 255, .1); border-radius: 5px; overflow: hidden; display: flex; justify-content: space-between; }
#paintBar i { display: block; height: 100%; transition: width .4s; }
#pb0 { background: var(--t0); } #pb1 { background: var(--t1); }
#pbTxt { position: absolute; left: 50%; top: 11px; transform: translateX(-50%); font-size: 11px; color: var(--dim); white-space: nowrap; }
#paintBar { overflow: visible; }
#capBox { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); width: 300px; text-align: center; }
#capTxt { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
#capLine { height: 14px; background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .25); border-radius: 7px; overflow: hidden; }
#capFill { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
#bonusBox { position: absolute; top: 162px; left: 50%; transform: translateX(-50%); width: 340px; text-align: center; font-size: 12px; font-weight: 600; color: #dfe6ee; text-shadow: 0 1px 2px #000; pointer-events: none; }
#bonusBox.done #bonusLine { display: none; }
#bonusLine { position: relative; height: 5px; margin-top: 3px; background: rgba(0,0,0,.45); border-radius: 3px; overflow: hidden; }
#bonusFill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .3s; }
#bonusFoe { position: absolute; right: 0; top: 0; bottom: 0; width: 0; opacity: .7; transition: width .3s; }
#bonusMark { position: absolute; left: 50%; top: -1px; bottom: -1px; width: 2px; background: #fff; }
#role { position: absolute; top: 10px; left: 262px; font-size: 13px; background: var(--bg); padding: 5px 10px; border-radius: 8px; max-width: 280px; }
#role b { font-weight: 700; }
#map { position: absolute; top: 10px; left: 10px; width: 240px; height: 240px; border-radius: 10px; background: rgba(8, 12, 18, .72); border: 1px solid var(--line); }
/* ── Лента ── */
#feed { position: absolute; top: 10px; right: 10px; width: 400px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.fi { background: rgba(8, 12, 18, .78); padding: 4px 10px; border-radius: 7px; font-size: 14px; animation: fin .18s ease-out; white-space: nowrap; }
.fi.mine { outline: 2px solid var(--gold); background: rgba(40, 32, 10, .86); }
.fi .w { color: var(--dim); margin: 0 7px; font-size: 12px; }
.fi .hs { color: var(--gold); }
@keyframes fin { from { transform: translateX(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.t0 { color: #7cc5ff; font-weight: 600; } .t1 { color: #ffb36b; font-weight: 600; }
/* ── Прицел ── */
#cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#cross .c { position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
#cross .u, #cross .d { width: 2px; height: 8px; left: -1px; } #cross .l, #cross .r { width: 8px; height: 2px; top: -1px; }
#cross .dot { position: absolute; left: -1px; top: -1px; width: 2px; height: 2px; background: #fff; }
#cross.enemy .c, #cross.enemy .dot { background: #ff5546; }
#cross.hide { display: none; }
#hitm { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#hitm i { position: absolute; width: 14px; height: 3px; background: #fff; box-shadow: 0 0 3px #000; left: -7px; top: -1.5px; }
#hitm i:nth-child(1) { transform: rotate(45deg) translateX(15px); } #hitm i:nth-child(2) { transform: rotate(135deg) translateX(15px); } #hitm i:nth-child(3) { transform: rotate(225deg) translateX(15px); } #hitm i:nth-child(4) { transform: rotate(315deg) translateX(15px); }
#hitm.head i { background: var(--gold); }
#hitm.kill i { background: #ff4438; width: 20px; left: -10px; }
#hitm.on { animation: hit .24s ease-out; }
@keyframes hit { 0% { opacity: 1; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.25); } }
#killBanner { position: absolute; left: 50%; top: 61%; transform: translateX(-50%); font-size: 22px; font-weight: 800; color: #ff5a4a; opacity: 0; white-space: nowrap; letter-spacing: .5px; }
#killBanner small { display: block; font-size: 14px; color: #fff; font-weight: 500; text-align: center; }
#killBanner.on { animation: kb 1.7s ease-out; }
@keyframes kb { 0% { opacity: 0; transform: translateX(-50%) scale(1.5); } 10% { opacity: 1; transform: translateX(-50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
#big { position: absolute; left: 50%; top: 21%; transform: translateX(-50%); text-align: center; font-size: 44px; font-weight: 800; opacity: 0; transition: opacity .25s; width: 80%; }
#big small { display: block; font-size: 19px; font-weight: 500; color: #dfe6ee; margin-top: 4px; }
#big.on { opacity: 1; }
#dmgs { position: absolute; inset: 0; overflow: hidden; }
.dn { position: absolute; font-size: 20px; font-weight: 800; color: #fff; animation: dn .7s ease-out forwards; }
.dn.head { color: var(--gold); font-size: 25px; }
@keyframes dn { 0% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -44px) scale(.95); } }
#pointMark { position: absolute; left: 0; top: 0; text-align: center; font-size: 12px; font-weight: 700; color: #fff4c8; transform: translate(-50%, -50%); }
#pointMark b { display: block; font-size: 24px; line-height: 1; color: #ffe08a; text-shadow: 0 0 8px rgba(255, 210, 110, .9), 0 1px 3px #000; }
#pointMark.edge b { font-size: 18px; }
.hurtDir { position: absolute; left: 50%; top: 50%; width: 170px; height: 170px; margin: -85px; border-radius: 50%; border: 9px solid transparent; border-top-color: rgba(255, 60, 40, .9); filter: blur(1px); animation: hd .8s ease-out forwards; }
@keyframes hd { from { opacity: 1; } to { opacity: 0; } }
.heardDir { position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -55px; border-radius: 50%; border: 3px solid transparent; border-top-color: rgba(255, 255, 255, .5); animation: hd .55s ease-out forwards; }
/* ── Внизу ── */
#vitals { position: absolute; left: 14px; bottom: 14px; background: var(--bg); padding: 8px 12px; border-radius: 10px; min-width: 250px; }
#hpWrap, #arWrap { display: flex; align-items: center; gap: 8px; }
.ic { font-size: 18px; width: 20px; text-align: center; }
#hp { font-size: 34px; font-weight: 800; min-width: 60px; font-variant-numeric: tabular-nums; }
#ar { font-size: 20px; font-weight: 700; min-width: 60px; }
#hpLine, #arLine { flex: 1; height: 10px; background: rgba(255, 255, 255, .13); border-radius: 5px; overflow: hidden; }
#hpFill { display: block; height: 100%; width: 100%; background: #5be27a; transition: width .12s; }
#hpFill.low { background: #ff5146; } #hpFill.mid { background: #f5c542; }
#arFill { display: block; height: 100%; background: #9ec8f0; }
#under { font-size: 13px; margin-top: 4px; min-height: 18px; }
#under .fast { color: #7dffa0; font-weight: 700; } #under .slow { color: #ff9a8d; font-weight: 700; } #under .plain { color: var(--dim); }
#ammoBox { position: absolute; right: 14px; bottom: 14px; background: var(--bg); padding: 8px 14px; border-radius: 10px; min-width: 210px; text-align: right; }
#wName { color: var(--dim); font-size: 13px; }
#ammo b { font-size: 38px; font-weight: 800; font-variant-numeric: tabular-nums; }
#ammo b.low { color: #ff6a5a; }
#ammo span { color: var(--dim); margin-left: 8px; font-size: 18px; }
/* #311: подзарядка на своей краске — запас зеленеет и плавно дышит (без мерцания), рядом полоска до следующего патрона */
#ammo span.chg { color: #7dffa0; animation: chg 1.6s ease-in-out infinite; }
@keyframes chg { 0%, 100% { opacity: 1; } 50% { opacity: .62; } }
#rcLine { height: 3px; margin: 3px 0 0 auto; width: 120px; background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden; }
#rcLine i { display: block; height: 100%; width: 0; background: #7dffa0; transition: width .12s linear; }
#rcLine.hidden { display: none; }
#under .chg { color: #7dffa0; }
#slots { font-size: 12px; color: var(--dim); }
#money { color: #9affb2; font-size: 17px; font-weight: 700; }
#tut { position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%); width: 560px; max-width: 80%; background: rgba(10, 20, 40, .9); border: 2px solid #6aa9ff; border-radius: 12px; padding: 11px 16px; font-size: 16px; text-align: center; text-shadow: none; animation: fin .2s ease-out; }
#tut b { color: #ffe08a; }
kbd { display: inline-block; background: #27303c; border: 1px solid #58657a; border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; font: 600 13px system-ui; margin: 0 1px; }
#note { position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); color: #ffd68a; font-size: 15px; }
#spect { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); background: var(--bg); padding: 6px 14px; border-radius: 8px; text-align: center; }
/* Наблюдение после гибели: полоса и рамка цвета команды того, чьими глазами смотрим — сразу видно, что это не вы */
#spect.on { top: 96px; padding: 8px 22px 7px; border: 2px solid var(--tc, #fff); border-radius: 10px; background: rgba(8, 12, 20, .82); box-shadow: 0 0 18px color-mix(in srgb, var(--tc, #fff) 45%, transparent); }
#spect.on b { display: block; font-size: 20px; letter-spacing: .02em; text-transform: none; }
#spect.on small { display: block; margin-top: 2px; font-size: 13px; color: #b9c4d2; }
#spectFrame { position: absolute; inset: 0; border: 4px solid var(--tc, #fff); box-shadow: inset 0 0 60px color-mix(in srgb, var(--tc, #fff) 30%, transparent); opacity: .85; }
#chatLog { position: absolute; left: 14px; bottom: 124px; width: 420px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.cl { background: rgba(8, 12, 18, .58); padding: 2px 8px; border-radius: 5px; width: fit-content; max-width: 100%; animation: clf 10s forwards; overflow-wrap: anywhere; user-select: text; }
.cl.sys { color: #c7d0dc; font-style: italic; }
@keyframes clf { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
#chatLog.open .cl { animation: none; opacity: 1; }
#chatIn { position: absolute; left: 14px; bottom: 95px; width: 420px; display: flex; gap: 6px; align-items: center; pointer-events: auto; background: var(--bg); padding: 4px 8px; border-radius: 8px; }
#chatTo { font-size: 13px; color: var(--dim); }
#scopeO { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0 36vh, rgba(0, 0, 0, .97) 36.4vh); }
#scopeO::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(255, 255, 255, .7); }
#scopeO::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(255, 255, 255, .7); }
#clickHint { position: absolute; left: 50%; top: 42%; transform: translateX(-50%); background: rgba(10, 20, 40, .92); border: 2px solid #6aa9ff; border-radius: 10px; padding: 10px 18px; font-size: 19px; font-weight: 700; animation: fin .2s ease-out; }
#netLine { position: absolute; left: 262px; top: 48px; font-size: 11px; color: var(--dim); }
#netLine.warn { color: #ffb36b; }
/* ── Подписи над роботами ── */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
.lb { position: absolute; left: 0; top: 0; text-align: center; transform-origin: 50% 100%; white-space: nowrap; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px #000; will-change: transform; }
.lb .nm { display: block; margin-bottom: 2px; }
.lb .bar { display: block; width: 56px; height: 6px; margin: 0 auto; background: rgba(0, 0, 0, .65); border: 1px solid rgba(255, 255, 255, .35); border-radius: 3px; overflow: hidden; }
.lb .bar i { display: block; height: 100%; transition: width .1s; }
.lb.e .nm { color: #ff9f93; } .lb.e .bar i { background: #ff5146; }
.lb.a .nm { color: #d4eeff; } .lb.a .bar i { background: #5be27a; }
.lb .chev { display: block; font-size: 15px; line-height: 12px; }
.lb.hideName .nm { display: none; }
/* ── Таблица и покупка ── */
#board { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 800px; max-width: 96vw; z-index: 20; background: rgba(8, 12, 18, .9); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
#board h2 { font-size: 18px; display: flex; justify-content: space-between; margin-bottom: 8px; }
#board table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 10px; }
#board th { color: var(--dim); font-weight: 500; text-align: right; padding: 2px 6px; font-size: 12px; }
#board td { text-align: right; padding: 3px 6px; font-variant-numeric: tabular-nums; }
#board td:first-child, #board th:first-child { text-align: left; }
#board tr.me td { background: rgba(255, 255, 255, .09); }
#board tr.dead td { opacity: .5; }
#board .tc0 th:first-child { color: #7cc5ff; } #board .tc1 th:first-child { color: #ffb36b; }
#board .acts { display: flex; gap: 8px; pointer-events: auto; }
#buy { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 880px; max-width: 96vw; z-index: 22; background: rgba(8, 12, 18, .94); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; }
#buy h2 { font-size: 20px; display: flex; justify-content: space-between; align-items: center; }
#buy .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.item { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: left; cursor: pointer; display: block; width: 100%; color: inherit; font: inherit; }
.item:hover:not(.no) { background: rgba(106, 169, 255, .18); border-color: #6aa9ff; }
.item.no { opacity: .45; cursor: default; }
.item.own { border-color: #5be27a; }
.item .thumb { display: block; width: 100%; height: 64px; object-fit: contain; border-radius: 7px; margin-bottom: 6px; background: radial-gradient(ellipse at 50% 60%, #2a3240, #161b23 75%); }
.item.no .thumb { filter: grayscale(.7) brightness(.7); }
.item b { display: flex; justify-content: space-between; font-size: 15px; }
.item b span { color: #9affb2; }
.item small { display: block; color: var(--dim); margin: 2px 0; font-size: 12px; }
.item .stat { display: flex; gap: 8px; font-size: 12px; color: #c9d4e0; }
#buy .note { color: var(--dim); font-size: 13px; margin-top: 8px; }
