:root {
  --bg: #14161a;
  --panel: rgba(20, 22, 28, 0.92);
  --line: #2c313b;
  --text: #f1ede4;
  --muted: #9aa0aa;
  --accent: #ffb238;
  --red: #ff6b5a;
  --blue: #5aa8ff;
  --good: #6ee07a;
  --bad: #ff5a4c;
  --px: 'Rubik', system-ui, sans-serif;
  --ui: 'Rubik', system-ui, sans-serif;
  --safe-t: var(--tg-content-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-b: var(--tg-content-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-l: var(--tg-content-safe-area-inset-left, env(safe-area-inset-left, 0px));
  --safe-r: var(--tg-content-safe-area-inset-right, env(safe-area-inset-right, 0px));
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--ui); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; image-rendering: pixelated; }
.hidden { display: none !important; }

/* ---------- Экраны и карточки ---------- */
.screen { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l)); overflow-y: auto; touch-action: pan-y; }
.modal { background: rgba(8, 9, 12, 0.6); z-index: 40; }
.card { background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); padding: 16px; }
.dialog { width: min(440px, 100%); display: flex; flex-direction: column; gap: 10px; margin: auto; }
.dialog.wide { width: min(820px, 100%); }
h2 { font-family: var(--px); font-size: 22px; color: var(--accent); letter-spacing: 1px; margin-bottom: 4px; }
h3 { font-family: var(--px); font-size: 14px; color: var(--accent); margin: 8px 0 6px; }
.lbl { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 10px 0 6px; font-weight: 700; }
.lbl b { color: var(--text); }
input[type=text], input:not([type]) { width: 100%; padding: 10px 12px; background: #0d0f13; border: 2px solid var(--line); color: var(--text); font: 600 15px var(--ui); outline: none; }
input:focus { border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.note { font-size: 12px; color: var(--muted); min-height: 1em; }

.btn { font-family: var(--px); font-size: 15px; padding: 12px 16px; border: 2px solid #000; background: var(--accent); color: #1a1206; cursor: pointer; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 rgba(255, 255, 255, 0.3); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.25); }
.btn.big { font-size: 14px; padding: 16px 26px; }
.btn.ghost { background: #2a2f38; color: var(--text); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 80px; padding: 10px 8px; background: #20242c; color: var(--text); border: 2px solid var(--line); font: 700 13px var(--ui); cursor: pointer; }
.seg button.on { border-color: var(--accent); background: #3a2e14; color: #ffd27a; }

.swatches { display: flex; gap: 8px; }
.swatches button { width: 38px; height: 38px; border: 3px solid var(--line); cursor: pointer; }
.swatches button.on { border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Справка ---------- */
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 13px; line-height: 1.7; }
kbd { font-family: var(--px); font-size: 12px; background: #2a2f38; border: 1px solid #444; padding: 2px 5px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; font-family: var(--px); }
#radar { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); width: 150px; height: 150px; border: 2px solid rgba(0, 0, 0, 0.6); background: rgba(10, 12, 16, 0.55); image-rendering: pixelated; }
#topbar { position: absolute; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 0; }
.team-score { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(10, 12, 16, 0.7); font-size: 18px; }
.team-score.red span { color: var(--red); }
.team-score.blue span { color: var(--blue); }
.alive { display: flex; gap: 3px; }
.alive i { width: 9px; height: 14px; display: block; background: currentColor; }
.alive i.dead { opacity: 0.2; }
.team-score.red .alive { color: var(--red); }
.team-score.blue .alive { color: var(--blue); }
.clock { background: rgba(0, 0, 0, 0.8); padding: 6px 14px; text-align: center; min-width: 96px; }
#timer { font-size: 18px; }
#timer.low { color: var(--bad); }
#round { font-size: 11px; color: var(--muted); margin-top: 4px; }
#points { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
#points:empty { display: none; }
#points i { font-style: normal; font-size: 13px; width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid currentColor; }
#points i.blink { animation: blink 0.5s steps(2) infinite; }
#topbar[data-mode="ffa"] .alive { display: none; }
#topbar[data-mode="ffa"] .team-score.red span { color: #fff; }
#topbar[data-mode="ffa"] .team-score.blue span { color: #ffd27a; }
#topbar[data-mode="ffa"] .team-score span::before { font-size: 7px; color: var(--muted); display: block; margin-bottom: 2px; }
#topbar[data-mode="ffa"] .team-score.red span::before { content: 'ВЫ'; }
#topbar[data-mode="ffa"] .team-score.blue span::before { content: 'ЛИДЕР'; }
#killfeed { position: absolute; top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-family: var(--ui); font-weight: 700; font-size: 13px; }
.kf { background: rgba(10, 12, 16, 0.7); padding: 5px 9px; display: flex; gap: 8px; align-items: center; animation: kfIn 0.15s ease-out; }
.kf.me { border: 2px solid #c33; }
.kf .w { color: #ddd; font-family: var(--px); font-size: 11px; }
.kf img.w { height: 22px; width: 44px; object-fit: contain; image-rendering: pixelated; }
.kf .hs { color: #ff6060; font-family: var(--px); font-size: 11px; }
.kf .red { color: var(--red); } .kf .blue { color: var(--blue); }
.kf .rv { color: #4dff6a; font-size: 15px; }
@keyframes kfIn { from { transform: translateX(20px); opacity: 0; } }

#labels { position: absolute; inset: 0; overflow: hidden; }
.ag-label { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; will-change: transform; }
.ag-label b { font: 800 15px var(--ui); color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; white-space: nowrap; }
.ag-label i { width: 64px; height: 7px; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(0, 0, 0, 0.8); display: block; }
.ag-label s { display: block; height: 100%; background: #4dd06a; text-decoration: none; transition: width 0.15s; }
.ag-label.foe b { color: #ff7b6e; }
.ag-label.foe s { background: #ff4d3d; }
.ag-label.mate.red b { color: #ffb0a6; }
.ag-label.mate.blue b { color: #a9cfff; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; background: #6eff74; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7); }
#crosshair .u, #crosshair .d { width: 2px; height: 8px; left: -1px; }
#crosshair .l, #crosshair .r { height: 2px; width: 8px; top: -1px; }
#crosshair b { position: absolute; left: -1px; top: -1px; width: 2px; height: 2px; background: #6eff74; }
#crosshair.enemy i, #crosshair.enemy b { background: #ff3b30; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; }
#hitmarker::before, #hitmarker::after { content: ''; position: absolute; background: #fff; }
#hitmarker::before { left: 10px; top: 0; width: 2px; height: 22px; background: linear-gradient(#fff 35%, transparent 35% 65%, #fff 65%); }
#hitmarker::after { top: 10px; left: 0; height: 2px; width: 22px; background: linear-gradient(90deg, #fff 35%, transparent 35% 65%, #fff 65%); }
#hitmarker.head::before, #hitmarker.head::after { filter: hue-rotate(0deg) sepia(1) saturate(8) hue-rotate(-50deg); }
#dmg-ind { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dmg-arc { position: absolute; left: -40px; top: -130px; width: 80px; height: 20px; transform-origin: 40px 130px; background: linear-gradient(rgba(255, 40, 30, 0.85), transparent); clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%); animation: dmgFade 1.2s forwards; }
@keyframes dmgFade { to { opacity: 0; } }
#center-msg { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font-family: var(--ui); font-weight: 900; font-size: 18px; text-shadow: 2px 2px 0 #000; text-align: center; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
#banner { position: absolute; left: 0; right: 0; top: 26%; text-align: center; opacity: 0; transition: opacity 0.25s; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.75) 20% 80%, transparent); padding: 14px 0; }
.b-title { font-size: clamp(16px, 3.4vw, 28px); text-shadow: 3px 3px 0 #000; }
.b-sub { font-family: var(--ui); font-weight: 700; font-size: 14px; margin-top: 8px; color: #ddd; }
#buy-hint { position: absolute; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); font-size: 12px; background: rgba(0, 0, 0, 0.6); padding: 6px 10px; color: var(--accent); }
#use-hint { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); font-size: 14px; background: rgba(0, 0, 0, 0.65); padding: 7px 12px; color: #4dff6a; display: none; }
#action-bar { position: absolute; left: 50%; top: 60%; transform: translateX(-50%); width: 240px; display: none; text-align: center; }
#action-bar span { display: block; font-family: var(--ui); font-weight: 800; font-size: 14px; text-shadow: 1px 1px 0 #000; margin-bottom: 6px; }
#action-bar div { height: 10px; background: rgba(0, 0, 0, 0.7); border: 2px solid #1d3a22; }
#action-bar i { display: block; height: 100%; width: 0; background: #4dff6a; }
#over-score small { font-size: 10px; color: var(--muted); margin-left: 10px; }
#spec-label { position: absolute; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%); font-family: var(--ui); font-weight: 700; background: rgba(0, 0, 0, 0.6); padding: 6px 12px; display: none; }

#bl { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); display: flex; flex-direction: column; gap: 6px; }
.vitals { display: flex; gap: 6px; }
.vital { display: flex; align-items: center; gap: 8px; background: rgba(10, 12, 16, 0.7); padding: 8px 12px; font-size: 22px; min-width: 104px; }
.vital i { font-style: normal; font-size: 18px; }
.vital.hp i { color: #ff5a4c; }
.vital.ar i { color: #9cc8ff; }
.vital.low span { color: var(--bad); animation: blink 0.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
#br { position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#wname { font-size: 14px; color: #ddd; text-shadow: 2px 2px 0 #000; }
#ammo { background: rgba(10, 12, 16, 0.7); padding: 8px 12px; font-size: 26px; }
#ammo small { font-size: 13px; color: var(--muted); margin-left: 4px; }
#ammo.empty #mag { color: var(--bad); }
#nades { display: flex; gap: 4px; }
.nade { font-size: 11px; padding: 4px 6px; background: rgba(10, 12, 16, 0.7); border: 2px solid transparent; }
.nade.on { border-color: var(--accent); }
#reload-bar { width: 140px; height: 6px; background: rgba(0, 0, 0, 0.6); display: none; }
#reload-bar div { height: 100%; width: 0; background: var(--accent); }

#scope { position: absolute; inset: 0; display: none; }
#scope .scope-ring { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0 min(38vw, 38vh), #000 calc(min(38vw, 38vh) + 2px)); }
#scope .scope-h { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000; }
#scope .scope-v { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #000; }
#flash-ov { position: absolute; inset: 0; background: #fff; opacity: 0; }
#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 120px rgba(160, 0, 0, 0.0); transition: box-shadow 0.3s; }

/* ---------- Магазин и счёт ---------- */
.buy-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
#buy-money { font-family: var(--px); color: var(--good); font-size: 19px; }
#buy-time { font-size: 12px; color: var(--muted); margin-left: auto; }
#buy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 58vh; overflow-y: auto; touch-action: pan-y; }
.buy-cat { grid-column: 1 / -1; font-family: var(--px); font-size: 12px; color: var(--muted); margin-top: 6px; }
.buy-item { background: #0d0f13; border: 2px solid var(--line); padding: 8px 10px; color: var(--text); text-align: left; cursor: pointer; font-family: var(--ui); display: flex; flex-direction: column; gap: 3px; }
.buy-item:hover:not(:disabled) { border-color: var(--accent); }
.buy-item:disabled { opacity: 0.35; cursor: default; }
.buy-item.owned { border-color: var(--good); }
.buy-item b { font-size: 14px; }
.buy-item .price { font-family: var(--px); font-size: 14px; color: var(--good); }
.buy-item small { color: var(--muted); font-size: 11px; }
#buy-msg { min-height: 18px; color: var(--bad); font-weight: 700; font-size: 13px; }
.sb-team h3 { font-size: 11px; }
.sb-team.red h3 { color: var(--red); } .sb-team.blue h3 { color: var(--blue); }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 700; }
th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; padding: 4px 6px; }
td { padding: 5px 6px; border-top: 1px solid var(--line); }
tr.dead td { opacity: 0.45; }
tr.me td { background: rgba(255, 178, 56, 0.12); }
#over-score { font-family: var(--px); font-size: 30px; text-align: center; margin: 6px 0 10px; }

/* ---------- Панель оружия и способностей ---------- */
#wbar { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); display: flex; gap: 6px; }
#wbar button, #abil button { position: relative; width: 76px; height: 64px; background: rgba(12, 14, 20, 0.62); border: 2px solid rgba(255, 255, 255, 0.18); color: #fff; padding: 0; cursor: pointer; touch-action: none; }
#wbar button img, #abil button img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: block; padding: 6px 4px 12px; }
#wbar button b, #abil button b { position: absolute; left: 3px; top: 2px; font-family: var(--px); font-size: 12px; color: #fff; text-shadow: 1px 1px 0 #000; }
#wbar button em, #abil button em { position: absolute; right: 4px; bottom: 2px; font: 900 12px var(--ui); font-style: normal; text-shadow: 1px 1px 0 #000; }
#wbar button.on { border-color: #fff; background: rgba(40, 46, 64, 0.85); box-shadow: 0 -3px 0 #fff inset; transform: translateY(-4px); }
#wbar button.empty img { filter: grayscale(1) brightness(0.5); }
#wbar button.nade { width: 58px; margin-left: 8px; }
#abil { position: fixed; z-index: 25; left: calc(12px + var(--safe-l)); bottom: calc(92px + var(--safe-b)); display: flex; gap: 8px; }
#abil button { width: 62px; height: 62px; border-radius: 50%; overflow: hidden; border-color: #2f6fe0; }
#abil button img { padding: 10px; }
#abil button i { position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, 0.7) var(--p, 0%), transparent 0); }
#abil button em { left: 0; right: 0; top: 50%; bottom: auto; transform: translateY(-50%); text-align: center; font-size: 18px; }
#abil button b { left: 50%; top: auto; bottom: 2px; transform: translateX(-50%); background: #2f6fe0; padding: 2px 4px; }
#abil button.ready { border-color: #8fa8ff; box-shadow: 0 0 10px rgba(110, 160, 255, 0.6); }
body.touch #wbar button { width: 56px; height: 46px; }
body.touch #wbar button.nade { width: 44px; margin-left: 4px; }
body.touch #wbar { bottom: calc(4px + var(--safe-b)); }
body.touch #bl { left: calc(12px + var(--safe-l)); transform: none; top: calc(124px + var(--safe-t)); bottom: auto; flex-direction: column; align-items: flex-start; }
body.touch #abil { bottom: auto; top: 40%; left: calc(110px + var(--safe-l)); }
body.touch #abil button { width: 52px; height: 52px; }
body.touch #tb-switch, body.touch #tb-nade { display: none !important; }

/* ---------- Сенсорное управление ---------- */
#touch { position: fixed; inset: 0; z-index: 20; }
#t-move { position: absolute; left: 0; top: 30%; bottom: 0; width: 42%; }
#t-look { position: absolute; right: 0; top: 0; bottom: 0; width: 58%; }
#t-stick { position: absolute; width: 120px; height: 120px; border: 3px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.18); border-radius: 50%; left: calc(40px + var(--safe-l)); bottom: calc(40px + var(--safe-b)); pointer-events: none; }
#t-knob { position: absolute; width: 54px; height: 54px; left: 33px; top: 33px; background: rgba(255, 255, 255, 0.45); border-radius: 50%; }
.tb { position: absolute; width: 58px; height: 58px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.4); background: rgba(10, 12, 16, 0.45); color: #fff; font: 700 20px var(--ui); display: flex; align-items: center; justify-content: center; touch-action: none; }
.tb.on, .tb:active { background: rgba(255, 178, 56, 0.55); }
#tb-fire { width: 86px; height: 86px; font-size: 32px; right: calc(110px + var(--safe-r)); bottom: calc(64px + var(--safe-b)); border-color: rgba(255, 90, 76, 0.7); }
#tb-fire2 { left: calc(28px + var(--safe-l)); top: 34%; border-color: rgba(255, 90, 76, 0.7); }
#tb-jump { right: calc(24px + var(--safe-r)); bottom: calc(150px + var(--safe-b)); }
#tb-crouch { right: calc(24px + var(--safe-r)); bottom: calc(76px + var(--safe-b)); }
#tb-reload { right: calc(214px + var(--safe-r)); bottom: calc(40px + var(--safe-b)); }
#tb-scope { right: calc(286px + var(--safe-r)); bottom: calc(146px + var(--safe-b)); }
#tb-switch { right: calc(214px + var(--safe-r)); bottom: calc(116px + var(--safe-b)); }
#tb-nade { right: calc(286px + var(--safe-r)); bottom: calc(70px + var(--safe-b)); }
#tb-use { width: 74px; height: 74px; font-size: 30px; right: calc(110px + var(--safe-r)); bottom: calc(166px + var(--safe-b)); border-color: rgba(77, 255, 106, 0.8); color: #4dff6a; }
.tb.top { width: 44px; height: 44px; font-size: 16px; border-radius: 6px; top: calc(8px + var(--safe-t)); }
#tb-pause { right: calc(10px + var(--safe-r)); }
#tb-score { right: calc(60px + var(--safe-r)); }
#tb-buy { right: calc(110px + var(--safe-r)); color: var(--good); }

body.touch #killfeed { top: calc(60px + var(--safe-t)); font-size: 11px; }
body.touch #radar { width: 104px; height: 104px; }
body.touch #br { bottom: auto; top: calc(116px + var(--safe-t)); right: calc(12px + var(--safe-r)); }
body.touch #ammo { font-size: 18px; padding: 6px 10px; }
body.touch .vital { font-size: 16px; padding: 6px 10px; min-width: 78px; }
body.touch #bl { left: 50%; transform: translateX(-50%); bottom: calc(6px + var(--safe-b)); flex-direction: row; align-items: center; }
body.touch #buy-hint { display: none; }
body.touch .team-score { font-size: 14px; padding: 4px 8px; }
body.touch .alive i { width: 6px; height: 10px; }
body.touch #timer { font-size: 14px; }

#rotate-hint { display: none; position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 60; background: rgba(0, 0, 0, 0.8); padding: 8px 14px; font-weight: 700; font-size: 13px; pointer-events: none; }
@media (orientation: portrait) and (pointer: coarse) { body.playing #rotate-hint { display: block; } }

@media (max-width: 720px) { .help-cols { grid-template-columns: 1fr; } }

/* ---------- Общие элементы мета-игры ---------- */
.ico-coin, .ico-gem { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; flex: none; }
.ico-coin { background: radial-gradient(circle at 35% 35%, #fff3a8 0 18%, #ffcf3a 19% 58%, #c88a12 59% 70%, transparent 71%); }
.ico-gem { width: 14px; height: 14px; margin: 2px; background: linear-gradient(135deg, #b9fbff, #3ccbe6 45%, #1a7fa8); transform: rotate(45deg); box-shadow: 0 0 0 2px #0d4a63; }
.lvl-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.lvl { font-family: var(--px); font-size: 15px; min-width: 30px; height: 26px; display: grid; place-items: center; background: #3a5bd8; border: 2px solid #8fa8ff; box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5); color: #fff; }
.xpbar { position: relative; flex: 1; height: 18px; min-width: 120px; background: #0d1018; border: 2px solid #2b3550; overflow: hidden; }
.xpbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(#5aa8ff, #2f6fe0); transition: width 0.6s; }
.xpbar em { position: relative; display: block; text-align: center; font: 700 11px var(--ui); line-height: 14px; font-style: normal; text-shadow: 1px 1px 0 #000; }
.xpbar.big { height: 24px; margin-top: 10px; }
.xpbar.big em { line-height: 20px; font-size: 13px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; background: rgba(16, 20, 32, 0.78); color: #fff; border: 2px solid #2b3550; cursor: pointer; }
.icon-btn.sm { width: 32px; height: 32px; font-size: 16px; }
.icon-btn:hover { border-color: var(--accent); }
.muted { color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 70; background: rgba(12, 14, 20, 0.95); border: 2px solid var(--accent); padding: 10px 16px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: 0.2s; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Лобби ---------- */
.lobby { display: block; padding: 0; overflow: hidden; touch-action: none; }
#lb-stage { position: absolute; inset: 0; cursor: grab; }
.lobby > *:not(#lb-stage) { position: absolute; z-index: 1; }
.lb-top { top: calc(12px + var(--safe-t)); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.lb-top > * { pointer-events: auto; }
.lb-player { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; background: rgba(16, 20, 32, 0.8); border: 2px solid #2b3550; color: var(--text); cursor: pointer; text-align: left; min-width: 260px; }
.lb-player canvas { width: 56px; height: 56px; image-rendering: pixelated; background: #0d1018; border: 2px solid #2b3550; }
.lb-pinfo { flex: 1; min-width: 0; }
.lb-pinfo .xpbar { min-width: 90px; }
.lb-pinfo b { font-size: 18px; }
.lb-cur { display: flex; gap: 8px; align-items: center; }
.cur { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; background: rgba(16, 20, 32, 0.8); border: 2px solid #2b3550; font-size: 18px; }
.cur b { font-family: var(--px); font-size: 18px; }
.cur .plus { width: 26px; height: 26px; margin-right: -4px; background: #2f6fe0; border: 2px solid #8fa8ff; color: #fff; font: 900 16px var(--ui); cursor: pointer; }
.lb-nav { left: calc(12px + var(--safe-l)); top: calc(96px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; }
.lb-nav button { display: flex; align-items: center; gap: 12px; width: 210px; padding: 11px 14px; background: rgba(16, 20, 32, 0.78); border: 2px solid #2b3550; color: var(--text); font: 800 17px var(--ui); cursor: pointer; text-align: left; }
.lb-nav button i { font-style: normal; font-size: 20px; width: 26px; text-align: center; }
.lb-nav button:hover { border-color: var(--accent); background: rgba(40, 32, 18, 0.85); }
.lb-side { right: calc(12px + var(--safe-r)); top: calc(96px + var(--safe-t)); display: flex; flex-direction: column; gap: 10px; width: 230px; }
.lb-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: rgba(16, 20, 32, 0.8); border: 2px solid #2b3550; color: var(--text); text-align: left; font-family: var(--ui); }
.lb-card small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.lb-card b { font-size: 16px; }
.lb-card span { color: var(--accent); font-weight: 700; font-size: 13px; }
.lb-card.season { cursor: pointer; background: linear-gradient(135deg, rgba(70, 40, 120, 0.9), rgba(20, 24, 50, 0.9)); border-color: #6a4fc0; }
.lb-bottom { left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); display: flex; align-items: stretch; gap: 10px; }
.lb-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 104px; padding: 8px 6px; background: rgba(16, 20, 32, 0.8); border: 2px solid #2b3550; color: var(--text); font: 800 13px var(--ui); cursor: pointer; }
.lb-tile i { font-style: normal; font-size: 26px; }
.lb-tile:hover { border-color: var(--accent); }
.lb-playbtn { min-width: 240px; padding: 0 36px; font-family: var(--px); font-size: 30px; color: #1a1206; cursor: pointer; border: 3px solid #000; background: linear-gradient(#ffd060, #ff9f1c); box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.25), inset 4px 4px 0 rgba(255, 255, 255, 0.45), 4px 4px 0 rgba(0, 0, 0, 0.5); }
.lb-playbtn:hover { filter: brightness(1.07); }
.lb-playbtn:active { transform: translateY(2px); }
.lb-playbtn.small { min-width: 200px; height: 60px; font-size: 18px; }
#lb-status { left: 50%; transform: translateX(-50%); bottom: calc(108px + var(--safe-b)); color: #ffb0a8; font-weight: 700; font-size: 13px; text-shadow: 1px 1px 0 #000; white-space: nowrap; }

/* ---------- Страницы (режимы, профиль) ---------- */
.page { background: rgba(8, 10, 18, 0.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); align-items: flex-start; z-index: 35; }
.page-wrap { width: min(1080px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.page-head { display: flex; align-items: center; gap: 14px; }
.page-head h1 { font-family: var(--px); font-size: clamp(18px, 3.4vw, 30px); text-shadow: 3px 3px 0 #000; }
.back { width: 48px; height: 48px; font: 900 24px var(--ui); background: rgba(16, 20, 32, 0.85); color: #fff; border: 2px solid #2b3550; cursor: pointer; }
.back:hover { border-color: var(--accent); }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.mode-card { position: relative; min-height: 120px; padding: 12px; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; cursor: pointer; color: #fff; font-family: var(--ui); border: 3px solid rgba(0, 0, 0, 0.6);
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 8px, transparent 8px 16px), linear-gradient(160deg, hsl(var(--h), 70%, 46%), hsl(var(--h), 60%, 18%)); box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5); }
.mode-card .mi { position: absolute; right: 10px; top: 6px; font-size: 40px; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5)); }
.mode-card b { font-size: 18px; font-weight: 900; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); }
.mode-card small { font-size: 12px; font-weight: 700; opacity: 0.9; }
.mode-card.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent), 3px 3px 0 rgba(0, 0, 0, 0.5); }
.mode-card.locked { filter: grayscale(0.85) brightness(0.7); }
.md-opts { display: grid; grid-template-columns: 1fr; gap: 10px; }

.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.map-card { background: #0d0f13; border: 2px solid var(--line); padding: 6px; cursor: pointer; text-align: left; color: var(--text); font-family: var(--ui); }
.map-card.on { border-color: var(--accent); }
.map-card canvas { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; background: #000; }
.map-card b { display: block; font-family: var(--px); font-size: 12px; margin: 6px 0 2px; }
.page-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 0; padding: 10px 0 calc(4px + var(--safe-b)); background: linear-gradient(transparent, rgba(8, 10, 18, 0.95) 40%); }
.page-foot p { color: #cfd5e0; font-weight: 700; }

.pf-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pf-head canvas { width: 96px; height: 96px; image-rendering: pixelated; border: 2px solid #2b3550; background: #0d1018; }
.pf-info { flex: 1; min-width: 220px; }
.pf-name-row { display: flex; align-items: center; gap: 8px; }
#pf-name { font-size: 26px; font-weight: 900; display: flex; gap: 6px; }
#pf-name input { width: 200px; font-size: 18px; padding: 6px 8px; }
#pf-name .btn { padding: 8px 10px; }
.pf-look { min-width: 190px; }
.pf-tabs { max-width: 360px; margin-bottom: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stat { background: #0d1018; border: 2px solid #232a3c; padding: 10px 12px; }
.stat small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat b { display: block; font-size: 22px; margin-top: 6px; }

/* ---------- Инвентарь ---------- */
.inv-wrap { width: min(1200px, 100%); height: 100%; }
.inv-head-r { margin-left: auto; display: flex; gap: 8px; }
.inv-switch { font-size: 13px; padding: 9px 12px; }
.inv-empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--muted); font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.inv-head-r .cur small { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.inv-body { display: grid; grid-template-columns: 170px 1fr 330px; gap: 10px; min-height: 0; flex: 1; }
.inv-tabs { display: flex; flex-direction: column; gap: 6px; }
.inv-tabs button { display: flex; align-items: center; gap: 10px; padding: 12px; background: rgba(16, 20, 32, 0.85); border: 2px solid #2b3550; color: var(--text); font: 800 14px var(--ui); cursor: pointer; text-align: left; }
.inv-tabs button i { font-style: normal; font-size: 18px; }
.inv-tabs button.on { background: #2f6fe0; border-color: #8fa8ff; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; overflow-y: auto; touch-action: pan-y; max-height: calc(100vh - 120px); }
.inv-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; background: rgba(16, 20, 32, 0.85); border: 2px solid #2b3550; border-bottom: 4px solid var(--rc); color: var(--text); font-family: var(--ui); cursor: pointer; text-align: left; }
.inv-card img { width: 100%; aspect-ratio: 5 / 3; object-fit: contain; image-rendering: pixelated; }
.inv-card b { font-size: 14px; }
.inv-card .lv { font-family: var(--px); font-size: 12px; color: #8fb8ff; }
.inv-card .price { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 13px; }
.inv-card .lock { font-size: 12px; color: var(--muted); font-weight: 700; }
.inv-card .eq { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; display: grid; place-items: center; background: #2e9e48; color: #fff; font-weight: 900; font-size: 14px; }
.inv-card.sel { border-color: #8fa8ff; box-shadow: 0 0 0 2px #2f6fe0; }
.inv-card.locked img { filter: grayscale(1) brightness(0.6); }
.inv-card:not(.owned):not(.locked) img { opacity: 0.85; }
.inv-detail { display: flex; flex-direction: column; gap: 8px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; touch-action: pan-y; }
.inv-preview { background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rc) 35%, transparent), transparent 70%); border-bottom: 2px solid #232a3c; }
.inv-preview img { width: 100%; aspect-ratio: 5 / 3; object-fit: contain; image-rendering: pixelated; display: block; }
.inv-title { display: flex; align-items: baseline; gap: 10px; }
.inv-title b { font-size: 22px; font-weight: 900; }
.inv-title span { color: var(--muted); font-weight: 800; }
.inv-rarity { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.inv-desc { color: #cfd5e0; font-weight: 700; font-size: 13px; line-height: 1.4; }
.inv-stats { display: flex; flex-direction: column; gap: 7px; }
.st { display: grid; grid-template-columns: 1fr 64px auto; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #cfd5e0; }
.st .bar { height: 10px; background: #0d1018; border: 1px solid #232a3c; }
.st .bar i { display: block; height: 100%; background: #d8dde8; }
.st b { font-size: 14px; white-space: nowrap; }
.st em { font-style: normal; color: #4dff6a; margin-left: 6px; font-size: 12px; }
.inv-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.inv-actions .btn { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.inv-actions .btn:disabled { filter: grayscale(0.8); opacity: 0.6; cursor: default; }
.inv-actions .btn.up { background: #4dd06a; }
.inv-actions .btn.gem { background: #3ccbe6; }

@media (max-width: 900px), (max-height: 500px) {
  .inv-body { grid-template-columns: 1fr 260px; grid-template-rows: max-content minmax(0, 1fr); }
  .inv-tabs { grid-column: 1 / -1; flex-direction: row; overflow-x: auto; min-height: max-content; }
  .inv-tabs button { padding: 7px 10px; font-size: 12px; flex: none; }
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); max-height: calc(100vh - 150px); }
  .inv-card b { font-size: 12px; }
  .inv-title b { font-size: 17px; }
  .inv-head-r .cur { height: 34px; padding: 0 8px; }
}
@media (orientation: portrait) {
  .inv-body { grid-template-columns: 1fr; }
  .inv-head-r { width: 100%; }
}

/* ---------- Метка «есть награда» ---------- */
.dot { position: relative; }
.dot::after { content: ''; position: absolute; right: 6px; top: 6px; width: 12px; height: 12px; background: #ff4d3d; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); animation: blink 1s steps(2) infinite; }

/* ---------- Награды дня ---------- */
.dl-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.dl-day { position: relative; background: #0d1018; border: 2px solid #232a3c; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; min-height: 92px; justify-content: center; }
.dl-day small { color: var(--muted); font-weight: 800; font-size: 11px; text-transform: uppercase; }
.dl-rw { display: flex; flex-direction: column; gap: 4px; font-weight: 900; font-size: 14px; }
.dl-rw span { display: inline-flex; align-items: center; gap: 4px; justify-content: center; }
.dl-day.got { opacity: 0.55; }
.dl-day.got b { position: absolute; right: 6px; top: 4px; color: #4dff6a; }
.dl-day.now { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: #2a2210; }
.dl-day.big { background: linear-gradient(160deg, #3a2a5a, #141826); }
@media (max-width: 640px) { .dl-days { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Задания и лидеры ---------- */
.qs-timer { margin-left: auto; font-weight: 700; font-size: 13px; }
.qs-tabs { max-width: 640px; }
.qs-tabs button { position: relative; }
.qs-list { display: flex; flex-direction: column; gap: 8px; }
.qs-row { display: grid; grid-template-columns: 1fr auto 170px; gap: 14px; align-items: center; background: rgba(16, 20, 32, 0.88); border: 2px solid #2b3550; padding: 12px 14px; }
.qs-row.ready { border-color: #4dd06a; }
.qs-row.claimed { opacity: 0.6; }
.qs-main b { display: block; margin-bottom: 6px; font-size: 15px; }
.qs-reward { display: flex; gap: 10px; font-weight: 900; min-width: 96px; justify-content: flex-end; }
.qs-reward span { display: inline-flex; align-items: center; gap: 5px; }
.qs-row .btn { font-size: 13px; }
.qs-row .btn.up { background: #4dd06a; }
.ld-mine { margin-top: 10px; font-weight: 800; color: var(--accent); }
#ld-table td:first-child { width: 48px; }
@media (max-width: 640px) { .qs-row { grid-template-columns: 1fr; } }

/* ---------- Кастомизация ---------- */
.inv-card .sale { position: absolute; right: 6px; top: 6px; background: #ff4d3d; color: #fff; font: 900 12px var(--ui); padding: 2px 6px; }
.inv-card.mini { cursor: default; }
.inv-card.mini img { aspect-ratio: 5 / 4; }
.case-note { grid-column: 1 / -1; color: var(--muted); font-weight: 800; }
.case-box { font-size: 86px; text-align: center; padding: 10px 0; background: radial-gradient(circle, rgba(255, 178, 56, 0.35), transparent 70%); }
.skin-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.skin-chips small { width: 100%; color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: 11px; }
.skin-chips em { color: var(--muted); font-size: 12px; font-style: normal; }
.chip { padding: 6px 10px; background: #20242c; border: 2px solid var(--line); color: var(--text); font: 800 12px var(--ui); cursor: pointer; }
.chip.on { border-color: var(--accent); color: #ffd27a; }
.roll-view { position: relative; overflow: hidden; height: 150px; background: #0d1018; border: 2px solid #232a3c; }
.roll-track { display: flex; height: 100%; will-change: transform; }
.roll-item { flex: none; width: 128px; margin: 0 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(16, 20, 32, 0.9); border-bottom: 5px solid var(--rc); }
.roll-item img { width: 110px; height: 90px; object-fit: contain; image-rendering: pixelated; }
.roll-item b { font-size: 12px; text-align: center; }
.roll-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); transform: translateX(-50%); }
.roll-result { min-height: 48px; text-align: center; font-size: 18px; font-weight: 900; }
.roll-result small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- Кристаллы за Stars ---------- */
.gem-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 12px; background: linear-gradient(160deg, rgba(40, 70, 120, 0.9), rgba(16, 20, 32, 0.95)); border: 2px solid #3a5a9a; color: var(--text); font-family: var(--ui); cursor: pointer; }
.gem-card:hover { border-color: #8fd8ff; }
.gem-card .sale { position: absolute; right: 6px; top: 6px; background: #ff4d3d; color: #fff; font: 900 12px var(--ui); padding: 2px 6px; }
.gem-card b { font: 26px var(--px); }
.gem-card small { color: #ffd27a; font-weight: 900; text-transform: uppercase; font-size: 11px; }
.gem-card .gem-big .ico-gem { width: 34px; height: 34px; }
.gem-card .stars { font-weight: 900; font-size: 15px; background: #ffb238; color: #1a1206; padding: 6px 14px; }
.gem-card.starter { grid-column: 1 / -1; background: linear-gradient(120deg, rgba(150, 90, 20, 0.95), rgba(30, 24, 16, 0.95)); border-color: #ffb238; }
.gem-card.starter b { font-size: 22px; }
.gem-items { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.gem-card.pass { background: linear-gradient(160deg, rgba(90, 50, 150, 0.95), rgba(20, 16, 36, 0.95)); border-color: #8a6af0; }
.gem-card.pass b { font-size: 18px; }

/* ---------- Сезонный пропуск ---------- */
.ps-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.ps-season b { display: block; font: 22px var(--px); }
.ps-season small { color: var(--muted); font-weight: 800; }
.ps-buy { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-prem { color: #c9a8ff; font-weight: 900; }
.ps-rows { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: stretch; }
.ps-label { display: grid; grid-template-rows: 24px 1fr 1fr; gap: 6px; font-weight: 900; }
.ps-label span { display: flex; align-items: center; background: rgba(16, 20, 32, 0.85); padding: 0 10px; border: 2px solid #2b3550; }
.ps-label span:first-child { grid-row: 2; }
.ps-label span.p { grid-row: 3; color: #c9a8ff; border-color: #6a4fc0; }
.ps-track { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; touch-action: pan-x; }
.ps-col { flex: none; width: 98px; display: grid; grid-template-rows: 24px 1fr 1fr; gap: 6px; }
.ps-num { text-align: center; font: 13px var(--px); background: #232a3c; line-height: 24px; }
.ps-col.reached .ps-num { background: #2f6fe0; }
.ps-cell { position: relative; min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; background: rgba(16, 20, 32, 0.88); border: 2px solid #2b3550; color: var(--text); font: 800 13px var(--ui); }
.ps-cell img { width: 80px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.ps-cell em { font-style: normal; font-size: 11px; text-align: center; color: #cfd5e0; }
.ps-cell span { display: inline-flex; align-items: center; gap: 4px; }
.ps-cell.premium { background: rgba(40, 26, 70, 0.88); border-color: #4a3a8a; }
.ps-cell.ready { border-color: #4dd06a; box-shadow: 0 0 10px rgba(77, 208, 106, 0.5); cursor: pointer; }
.ps-cell.claimed { opacity: 0.45; }
.ps-cell.locked { filter: grayscale(0.6); opacity: 0.75; }
.ps-cell b.ok, .ps-cell b.lock { position: absolute; right: 4px; top: 2px; font-size: 13px; color: #4dff6a; }
@media (max-width: 720px) { .ps-head { grid-template-columns: 1fr; } .ps-rows { grid-template-columns: 1fr; } .ps-label { display: none; } }

/* ---------- Награда после матча ---------- */
#over-reward { background: #0d1018; border: 2px solid #232a3c; padding: 12px; }
.rw-row { display: flex; gap: 18px; justify-content: center; font-family: var(--px); font-size: 22px; }
.rw { display: flex; align-items: center; gap: 8px; }
.rw.xp { color: #8fb8ff; }
.rw-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; font-weight: 700; }
.rw-wait { text-align: center; color: var(--muted); }
.rw-level { margin-top: 10px; text-align: center; font-family: var(--px); font-size: 16px; color: var(--accent); display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.rw-level span { font-family: var(--ui); font-weight: 900; color: var(--text); display: inline-flex; gap: 4px; align-items: center; }
.rw-level small { flex-basis: 100%; font-family: var(--ui); color: #cfd5e0; }

/* ---------- Компактный экран (телефон горизонтально) ---------- */
@media (max-height: 500px) {
  .lb-player { min-width: 220px; padding: 6px 10px 6px 6px; }
  .lb-player canvas { width: 44px; height: 44px; }
  .lb-pinfo b { font-size: 15px; }
  .cur { height: 38px; padding: 0 10px; }
  .icon-btn { width: 38px; height: 38px; font-size: 18px; }
  .lb-nav, .lb-side { top: calc(74px + var(--safe-t)); }
  .lb-nav { gap: 6px; }
  .lb-nav button { width: 168px; padding: 7px 10px; font-size: 14px; }
  .lb-side { width: 190px; gap: 6px; }
  .lb-card { padding: 8px 10px; }
  .lb-card b { font-size: 14px; }
  .lb-tile { width: 84px; padding: 4px; font-size: 11px; }
  .lb-tile i { font-size: 20px; }
  .lb-playbtn { min-width: 180px; font-size: 17px; }
  #lb-status { bottom: calc(80px + var(--safe-b)); }
  .mode-card { min-height: 84px; }
  .mode-card .mi { font-size: 28px; }
  .mode-card b { font-size: 15px; }
  .stat-grid { grid-template-columns: repeat(5, 1fr); }
  .stat b { font-size: 17px; }
  .pf-head canvas { width: 64px; height: 64px; }
}
/* ---------- Портрет ---------- */
@media (orientation: portrait) {
  .lb-top { flex-wrap: wrap; }
  .lb-player { min-width: 0; flex: 1; }
  .lb-nav { top: auto; bottom: calc(150px + var(--safe-b)); left: 12px; right: 12px; flex-direction: row; overflow-x: auto; }
  .lb-nav button { width: auto; flex: none; padding: 8px 12px; font-size: 14px; }
  .lb-side { display: none; }
  .lb-bottom { width: calc(100% - 24px); }
  .lb-tile { flex: 1; width: auto; }
  .lb-playbtn { min-width: 0; flex: 2; padding: 0 10px; font-size: 16px; }
  .md-opts { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Поиск матча */
#search { z-index: 60; background: rgba(8, 10, 16, 0.82); }
.sr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; background: rgba(16, 20, 32, 0.95); border: 2px solid #2b3550; padding: 26px 34px; min-width: 260px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.sr-box h2 { font: 22px var(--px); margin: 4px 0 0; }
.sr-box p { margin: 0; color: var(--muted); font-weight: 800; }
.sr-time { font: 30px var(--px); color: var(--accent); letter-spacing: 1px; }
.sr-spin { display: grid; grid-template-columns: repeat(2, 14px); gap: 4px; animation: sr-turn 1.2s steps(4) infinite; }
.sr-spin i { width: 14px; height: 14px; background: var(--accent); }
.sr-spin i:nth-child(2), .sr-spin i:nth-child(3) { opacity: 0.35; }
@keyframes sr-turn { to { transform: rotate(360deg); } }

/* Друзья, отряд, клан */
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.small { font-size: 12px; padding: 8px 12px; }
.so-body { display: flex; flex-direction: column; gap: 10px; }
.so-list { display: flex; flex-direction: column; gap: 6px; }
.so-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(16, 20, 32, 0.88); border: 2px solid #2b3550; padding: 10px 12px; }
.so-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.so-name b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-name small { color: var(--muted); font-weight: 700; }
.so-act { display: flex; gap: 6px; align-items: center; flex: none; }
.so-tag { color: #ffd27a; }
.so-in { color: var(--muted); font-weight: 800; font-size: 13px; }
.so-code { color: var(--accent); letter-spacing: 1px; user-select: all; }
.so-invite { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; }
.so-invite .so-add { grid-column: 1 / -1; }
.so-add { display: flex; gap: 8px; }
.so-add input { flex: 1; min-width: 0; padding: 10px 12px; background: #0d1018; border: 2px solid #2b3550; color: var(--text); font: 700 15px var(--ui); }
.so-add input.tag { flex: 0 0 90px; text-transform: uppercase; }
.so-create, .so-clan-find { display: flex; flex-direction: column; gap: 10px; }
.so-create .btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; }
.so-clan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.so-clan-head h2 { font: 22px var(--px); margin: 0 0 4px; }
.so-h { font: 16px var(--px); margin: 8px 0 0; }
.so-h small { font: 700 13px var(--ui); }
.lb-squad { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(112px + var(--safe-b)); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; background: rgba(16, 20, 32, 0.85); border: 2px solid #2b3550; padding: 6px 10px; cursor: pointer; max-width: 92vw; }
.lb-squad .sq-title { font: 12px var(--px); color: var(--muted); margin-right: 4px; }
.lb-squad .sq-mem { font-weight: 800; font-size: 14px; padding: 2px 8px; background: #20242c; }
.lb-squad .sq-mem.lead { color: #ffd27a; }
.lb-squad .sq-wait { font-size: 12px; color: var(--muted); font-weight: 700; }
@media (max-width: 640px) { .so-invite { grid-template-columns: 1fr; } .so-clan-head { flex-direction: column; align-items: flex-start; } .lb-squad { bottom: calc(200px + var(--safe-b)); } }

/* TON-кошелёк и турнир */
.pf-ton { display: flex; flex-direction: column; gap: 10px; }
.ton-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ton-head > b { font: 16px var(--px); margin-right: auto; }
.ton-addr { font-family: monospace; font-weight: 700; color: var(--accent); }
.ton-nfts { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-ton a { color: var(--accent); }
.inv-card .sale.nft { background: #2a7bd8; color: #fff; }
.lb-card.tour { cursor: pointer; background: linear-gradient(135deg, rgba(120, 70, 20, 0.9), rgba(30, 22, 14, 0.9)); border-color: #c8862c; }
.lb-card.tour.ready { border-color: #4dd06a; box-shadow: 0 0 12px rgba(77, 208, 106, 0.5); }
.tr-head, .tr-claim { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.tr-claim { border-color: #4dd06a; }
.tr-claim .qs-reward { justify-content: flex-start; margin-top: 6px; }
.tr-prize { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tr-prize span { display: inline-flex; align-items: center; gap: 5px; }
.tr-item img { width: 40px; height: 24px; object-fit: contain; image-rendering: pixelated; }
@media (max-width: 640px) { .tr-head, .tr-claim { flex-direction: column; align-items: stretch; } }

/* Читаемый шрифт: Rubik вместо узкого «пиксельного» заголовочного */
h1, h2, h3, .btn, kbd, #hud, .map-card b { font-weight: 700; letter-spacing: 0; }
.map-dice { aspect-ratio: 1; display: grid; place-items: center; font-size: 56px; background: repeating-linear-gradient(45deg, #1a1f2b 0 10px, #141822 10px 20px); }

/* ---------- Настройки: вкладки слева, панель справа ---------- */
.set-page { z-index: 45; display: grid; grid-template-columns: 82px 1fr; grid-template-rows: auto minmax(0, 1fr) auto; gap: 18px 40px;
  padding: calc(18px + var(--safe-t)) calc(20px + var(--safe-r)) calc(18px + var(--safe-b)) calc(20px + var(--safe-l));
  align-items: stretch; justify-content: stretch; background: linear-gradient(rgba(14, 18, 34, 0.72), rgba(14, 18, 34, 0.82)), radial-gradient(circle at 70% 20%, #3b2a5c, #10131f 70%); font-family: var(--ui); overflow: hidden; }
.set-page.hidden { display: none; }
.set-title { grid-column: 1 / -1; font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: 2px; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.set-rail { grid-row: 2 / 4; display: flex; flex-direction: column; gap: 22px; }
.set-rail button, .set-back { width: 80px; height: 80px; border: 0; border-radius: 14px; background: rgba(60, 68, 96, 0.35); cursor: pointer; display: grid; place-items: center; }
.set-rail button.on { background: #2196f3; box-shadow: 0 4px 16px rgba(33, 150, 243, 0.4); }
.set-rail svg, .set-back svg { width: 36px; height: 36px; fill: #e8ebf2; stroke: #e8ebf2; }
.set-rail button:not(.on) svg { opacity: 0.75; }
.set-rail .hole { fill: #2b3150; stroke: none; }
.set-rail button.on .hole { fill: #2196f3; }
.set-back { position: absolute; left: calc(20px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); background: rgba(40, 46, 70, 0.6); }
.set-panel { grid-column: 2; grid-row: 2; min-height: 0; align-self: stretch; background: rgba(46, 54, 84, 0.55); backdrop-filter: blur(6px); border-radius: 26px; padding: 14px 32px; overflow-y: auto; touch-action: pan-y; }
.set-row { display: flex; align-items: center; gap: 20px; min-height: 92px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.set-row:last-child { border-bottom: 0; }
.set-row.slim { min-height: 64px; }
.set-row > label { flex: 1; font-size: 21px; font-weight: 500; color: #f2f4f8; display: flex; align-items: center; gap: 12px; }
.set-row > label.small { font-size: 15px; }
.set-sub { font-size: 17px; color: #9aa3b8; font-weight: 500; padding: 14px 0 2px; }
.set-val { min-width: 76px; text-align: center; padding: 8px 12px; border-radius: 22px; background: rgba(255, 255, 255, 0.1); font-size: 19px; font-weight: 600; }
.set-range { flex: 0 0 min(46%, 640px); -webkit-appearance: none; appearance: none; height: 12px; border-radius: 6px; background: linear-gradient(to right, #fff var(--p, 50%), rgba(255, 255, 255, 0.08) var(--p, 50%)); outline: none; }
.set-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #2196f3; border: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.set-range::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #2196f3; border: 0; }
.set-opts { display: flex; gap: 6px; flex: 0 0 auto; }
.set-opts button { min-width: 180px; padding: 12px 18px; border: 0; border-radius: 30px; background: transparent; color: #8a93a8; font: 600 22px var(--ui); cursor: pointer; }
.set-opts button.on { background: rgba(255, 255, 255, 0.1); color: #fff; }
.set-opts button.tiny { min-width: 0; font-size: 15px; line-height: 1.15; text-transform: uppercase; }
.set-btn { padding: 14px 40px; border: 0; border-radius: 30px; background: rgba(255, 255, 255, 0.1); color: #fff; font: 600 21px var(--ui); cursor: pointer; display: inline-flex; align-items: center; gap: 10px; }
.set-btn.primary { background: #2196f3; }
.set-btn.danger { background: rgba(255, 80, 80, 0.15); color: #ff6262; }
.set-keys { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.set-keys > div + div { border-left: 1px solid rgba(255, 255, 255, 0.12); padding-left: 40px; }
.set-key { display: flex; align-items: center; justify-content: space-between; min-height: 68px; font-size: 21px; font-weight: 500; }
.set-key button { width: 210px; padding: 12px; border: 0; border-radius: 30px; background: rgba(255, 255, 255, 0.1); color: #fff; font: 700 22px var(--ui); letter-spacing: 1px; cursor: pointer; }
.set-key button.wait { background: #2196f3; }
.set-foot { grid-column: 2; grid-row: 3; display: flex; justify-content: flex-end; gap: 18px; }
.set-foot.hidden { display: none; }
.set-lang-off { min-width: 180px; text-align: center; font-size: 22px; color: #8a93a8; font-weight: 500; }
.set-lang-on { min-width: 180px; text-align: center; padding: 12px; border-radius: 30px; background: rgba(255, 255, 255, 0.1); color: #4ade80; font-size: 26px; font-weight: 800; }
.legal-text { max-height: 55vh; overflow-y: auto; line-height: 1.5; color: #cfd5e0; white-space: pre-line; touch-action: pan-y; }
#ping { position: fixed; top: calc(4px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 60; font: 700 13px var(--ui); color: #b8f5c0; background: rgba(0, 0, 0, 0.45); padding: 3px 8px; border-radius: 10px; pointer-events: none; }
#ping.hidden { display: none; }
#ping.mid { color: #ffd166; } #ping.bad { color: #ff6b5a; }
@media (max-width: 900px), (max-height: 700px) {
  .set-page { grid-template-columns: 56px 1fr; gap: 10px 14px; }
  .set-rail { gap: 10px; } .set-rail button, .set-back { width: 54px; height: 54px; } .set-rail svg, .set-back svg { width: 26px; height: 26px; }
  .set-panel { padding: 6px 16px; border-radius: 18px; }
  .set-row { min-height: 60px; gap: 10px; flex-wrap: wrap; } .set-row > label { font-size: 16px; }
  .set-range { flex: 1 1 200px; } .set-val { min-width: 56px; font-size: 15px; }
  .set-opts button { min-width: 0; font-size: 16px; padding: 8px 12px; } .set-btn { font-size: 16px; padding: 10px 22px; }
  .set-keys { grid-template-columns: 1fr; } .set-keys > div + div { border-left: 0; padding-left: 0; }
  .set-key { font-size: 16px; min-height: 52px; } .set-key button { width: 140px; font-size: 16px; padding: 8px; }
  .set-lang-off, .set-lang-on { min-width: 110px; font-size: 16px; }
}
.brand { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 800 17px var(--ui); }
.brand.g { color: #4285f4; background: #fff; }
.brand.y { color: #fff; background: #fc3f1d; }
.set-opts button.tiny { max-width: 190px; white-space: normal; }

/* Настройки в общем стиле игры: квадратные рамки, тёмные панели, оранжевый акцент */
.set-page { background: rgba(8, 10, 18, 0.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.set-title { font-family: var(--px); font-weight: 900; letter-spacing: 0; text-shadow: 3px 3px 0 #000; }
.set-rail button, .set-back { border-radius: 0; background: rgba(16, 20, 32, 0.85); border: 2px solid #2b3550; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5); }
.set-rail button:hover, .set-back:hover { border-color: var(--accent); }
.set-rail button.on { background: rgba(40, 32, 18, 0.9); border-color: var(--accent); box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5); }
.set-rail button.on svg { fill: var(--accent); stroke: var(--accent); opacity: 1; }
.set-rail .hole, .set-rail button.on .hole { fill: rgba(16, 20, 32, 0.95); }
.set-panel { border-radius: 0; background: var(--panel); border: 2px solid var(--line); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); backdrop-filter: none; }
.set-row { border-bottom-color: var(--line); }
.set-row > label { font-weight: 700; color: var(--text); }
.set-sub { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }
.set-val { border-radius: 0; background: #0d0f13; border: 2px solid var(--line); color: var(--accent); font-weight: 800; }
.set-range { height: 10px; border-radius: 0; background: linear-gradient(to right, var(--accent) var(--p, 50%), #0d0f13 var(--p, 50%)); border: 2px solid var(--line); }
.set-range::-webkit-slider-thumb { border-radius: 0; width: 22px; height: 28px; background: #fff; border: 2px solid #000; box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5); }
.set-range::-moz-range-thumb { border-radius: 0; width: 22px; height: 28px; background: #fff; border: 2px solid #000; }
.set-opts { gap: 0; border: 2px solid var(--line); }
.set-opts button { border-radius: 0; color: var(--muted); font-weight: 800; background: #20242c; }
.set-opts button + button { border-left: 2px solid var(--line); }
.set-opts button.on { background: var(--accent); color: #1a1206; }
.set-btn { border-radius: 0; border: 2px solid #000; font-weight: 800; background: #2a2f38; color: var(--text); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 rgba(255, 255, 255, 0.12); }
.set-btn.primary { background: var(--accent); color: #1a1206; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 rgba(255, 255, 255, 0.3); }
.set-btn.danger { background: #3a1c1a; color: var(--bad); }
.set-keys > div + div { border-left-color: var(--line); }
.set-key { font-weight: 700; }
.set-key button { border-radius: 0; background: #0d0f13; border: 2px solid var(--line); font-weight: 800; }
.set-key button:hover { border-color: var(--accent); }
.set-key button.wait { background: var(--accent); color: #1a1206; border-color: #000; }
.set-lang-off { color: var(--muted); font-weight: 800; }
.set-lang-on { border-radius: 0; background: rgba(40, 32, 18, 0.9); border: 2px solid var(--accent); color: var(--good); }
#ping { border-radius: 0; border: 1px solid var(--line); }
#legal, #help { z-index: 50; }
.pf-look { display: flex; flex-direction: column; gap: 6px; }
.pf-look .btn.sm { padding: 8px 12px; font-size: 13px; align-self: flex-start; }
.swatches.locked button:disabled { opacity: 0.25; cursor: default; }
/* пинг: в бою — под радаром, в меню — в левом нижнем углу; ничего не перекрывает */
#ping { top: auto; bottom: calc(8px + var(--safe-b)); left: calc(10px + var(--safe-l)); transform: none; }
body.playing #ping { bottom: auto; top: calc(166px + var(--safe-t)); }
body.playing.touch #ping { top: calc(120px + var(--safe-t)); }

/* Комплекты: образ + скин оружия + брелок */
.set-box { border: 2px solid rgba(255, 255, 255, 0.12); background: rgba(0, 0, 0, 0.25); padding: 8px 10px; display: grid; gap: 4px; }
.set-box.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.set-box small { color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: 11px; }
.set-box b { font-size: 14px; }
.set-box em { color: var(--accent); font-style: normal; font-weight: 800; font-size: 12px; text-transform: uppercase; }
.set-parts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); font-weight: 700; }
.set-parts .ok { color: #8ef08a; }
.set-bonus { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; font-weight: 800; color: #ffd27a; }
.set-bonus i { font-style: normal; color: #cfd5e0; }

/* Пояснения к валютам и премиуму */
.cur.info { cursor: pointer; font: inherit; color: inherit; }
.cur.info i { font-style: normal; font-size: 11px; font-weight: 900; color: var(--accent); border: 1px solid var(--accent); width: 15px; height: 15px; display: inline-grid; place-items: center; margin-left: 4px; }
.info-pop { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; padding: 16px; }
.info-box { background: #141925; border: 2px solid var(--accent); max-width: 440px; width: 100%; max-height: 86vh; overflow: auto; padding: 16px; display: grid; gap: 8px; font-size: 14px; line-height: 1.4; }
.info-box h3 { margin: 0; font-size: 18px; }
.info-box p, .info-box ul { margin: 0; }
.info-box ul { padding-left: 18px; }
.info-box table { border-collapse: collapse; font-weight: 700; }
.info-box td, .info-box th { padding: 3px 10px 3px 0; text-align: left; }
.info-box .ok { color: #8ef08a; font-weight: 800; }
.info-box .btn { justify-self: end; }
.pp-items { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-item { display: grid; justify-items: center; font-size: 11px; font-weight: 800; width: 84px; text-align: center; }
.pp-item img { width: 80px; image-rendering: pixelated; }
/* Премиум-пропуск: золотая рамка и звезда */
.lb-player.premium, .lb-player.premium canvas { border-color: #e6b84a; box-shadow: 0 0 0 1px #e6b84a inset; }
.lb-player.premium #lb-name { color: #ffd27a; }
#pf-name.premium { color: #ffd27a; }
.prem-star { color: #ffd27a; }

/* ---------- Кнопки: объёмные, с подсветкой сверху и «полом» снизу, как физическая клавиша ---------- */
.btn { border: 0; border-radius: 8px; background: linear-gradient(180deg, #ffd56b 0%, #ffb238 48%, #f2900f 100%); color: #3a1d00; font-weight: 800; letter-spacing: 0.3px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); box-shadow: 0 4px 0 #9c5604, 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #9c5604, 0 3px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.btn.ghost { background: linear-gradient(180deg, #3d4555 0%, #2a303c 100%); color: #eef1f6; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 0 #12151c, 0 8px 18px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn.ghost:active { box-shadow: 0 1px 0 #12151c, inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn:disabled, .btn[disabled] { filter: grayscale(0.7) brightness(0.8); transform: none; cursor: default; }
.lb-playbtn { border: 0; border-radius: 12px; background: linear-gradient(180deg, #ffe07a 0%, #ffb93a 45%, #f28a0a 100%); color: #3a1d00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); box-shadow: 0 6px 0 #9c5604, 0 14px 28px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.75), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease; }
.lb-playbtn:hover { filter: brightness(1.05); transform: translateY(-2px); }
.lb-playbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #9c5604, 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.5); }

/* ---------- Тег клана и значок VIP рядом с ником ---------- */
.clan-tag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #dfe4ee; font: 800 0.72em var(--ui); letter-spacing: 0.6px; vertical-align: 0.12em; text-shadow: none; }
.vip-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: linear-gradient(180deg, #fff0b3 0%, #f6c84e 45%, #d99a1c 100%);
  color: #3d2500; font: 900 0.68em var(--ui); letter-spacing: 0.8px; vertical-align: 0.15em; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 10px rgba(255, 196, 70, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.8); }
.ag-label b .clan-tag, .ag-label b .vip-badge { font-size: 11px; }

/* ---------- VIP-карточка игрока в лобби: тонкая золотая рамка с бликом и мягким свечением ---------- */
.lb-player.premium { border: 2px solid transparent; border-radius: 10px;
  background: linear-gradient(rgba(18, 20, 30, 0.92), rgba(18, 20, 30, 0.92)) padding-box,
    linear-gradient(135deg, #fff4c8 0%, #e8b448 30%, #8a5a12 55%, #f6d27a 80%, #b07a1e 100%) border-box;
  box-shadow: 0 0 22px rgba(255, 190, 70, 0.22), 0 6px 18px rgba(0, 0, 0, 0.35); }
.lb-player.premium canvas { border-color: #d9a53a; border-radius: 6px; box-shadow: 0 0 0 1px rgba(255, 230, 160, 0.4); }
.lb-player.premium #lb-name .nm, #pf-name.premium { background: linear-gradient(180deg, #fff3c8, #f2c14e); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ================= Премиальный слой интерфейса =================
   Стеклянные тёмные панели со скруглением, тонкой светлой гранью сверху и мягкой тенью;
   активный пункт — тёплое оранжевое свечение; значки — контурные SVG вместо эмодзи */
:root { --glass: linear-gradient(180deg, rgba(34, 40, 58, 0.86), rgba(15, 18, 27, 0.9)); --edge: rgba(255, 255, 255, 0.09);
  --edge-hi: rgba(255, 255, 255, 0.16); --glow: 0 0 0 1px rgba(255, 178, 56, 0.55), 0 0 22px rgba(255, 160, 40, 0.22);
  --lift: 0 10px 26px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
.ui-ic { width: 22px; height: 22px; display: block; }

.lb-nav button, .lb-tile, .lb-card, .cur, .icon-btn, .lb-player, .inv-tabs button, .inv-card, .set-box {
  background: var(--glass); border: 1px solid var(--edge); border-radius: 12px; box-shadow: var(--lift);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease; }

.lb-nav { gap: 10px; }
.lb-nav button { padding: 12px 16px; font: 800 16px var(--ui); letter-spacing: 0.2px; }
.lb-nav button i, .lb-tile i, .inv-tabs button i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--accent);
  background: radial-gradient(circle at 30% 25%, rgba(255, 200, 110, 0.22), rgba(255, 178, 56, 0.06)); box-shadow: inset 0 0 0 1px rgba(255, 178, 56, 0.25); font-size: 0; }
.lb-nav button:hover, .lb-tile:hover, .inv-tabs button:hover, .icon-btn:hover { border-color: rgba(255, 178, 56, 0.45); transform: translateX(2px); background: linear-gradient(180deg, rgba(48, 44, 46, 0.9), rgba(22, 20, 24, 0.92)); }
.lb-tile:hover, .icon-btn:hover { transform: translateY(-2px); }

.lb-tile { width: 112px; gap: 8px; padding: 12px 8px; font: 800 13px var(--ui); }
.lb-tile i { width: 40px; height: 40px; border-radius: 11px; }
.lb-tile i .ui-ic { width: 24px; height: 24px; }

.icon-btn { color: var(--accent); }
.icon-btn .ui-ic { width: 22px; height: 22px; }
.cur { border-radius: 12px; }
.cur .plus { border: 0; border-radius: 7px; background: linear-gradient(180deg, #6fd8ff, #2b9ee0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 0 #1c6ea0; }

.lb-card { border-radius: 14px; }
.lb-card.season { background: linear-gradient(135deg, rgba(92, 56, 170, 0.88), rgba(24, 22, 56, 0.92)); border-color: rgba(170, 140, 255, 0.35); }
.lb-card.tour { background: linear-gradient(135deg, rgba(150, 90, 24, 0.88), rgba(36, 24, 14, 0.92)); border-color: rgba(255, 190, 90, 0.4); }

/* вкладки магазина/инвентаря */
.inv-tabs { gap: 7px; }
.inv-tabs button { padding: 9px 12px; gap: 12px; font: 800 14px var(--ui); }
.inv-tabs button i { width: 30px; height: 30px; border-radius: 8px; }
.inv-tabs button i .ui-ic { width: 18px; height: 18px; }
.inv-tabs button.on { background: linear-gradient(180deg, rgba(70, 50, 24, 0.95), rgba(36, 26, 14, 0.95)); border-color: rgba(255, 178, 56, 0.7); box-shadow: var(--glow), var(--lift); color: #fff3dc; }
.inv-tabs button.on i { background: linear-gradient(180deg, #ffd56b, #f2900f); color: #3a1d00; box-shadow: none; }

/* карточки предметов: свечение по редкости, плашка цены, мягкое выделение */
.inv-grid { gap: 12px; }
.inv-card { padding: 10px; border-bottom: 1px solid var(--edge); overflow: hidden; }
.inv-card::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--rc) 28%, transparent), transparent 60%); }
.inv-card::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--rc); box-shadow: 0 0 14px var(--rc); }
.inv-card > * { position: relative; }
.inv-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--rc) 55%, transparent); }
.inv-card.sel { border-color: rgba(255, 178, 56, 0.85); box-shadow: var(--glow), var(--lift); }
.inv-card b { font-size: 15px; font-weight: 800; }
.inv-card .price { align-self: flex-start; padding: 3px 9px 3px 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); font-size: 14px; }
.inv-card .sale { right: 8px; top: 8px; border-radius: 999px; padding: 3px 8px; background: linear-gradient(180deg, #ff6a55, #e2321f); box-shadow: 0 4px 10px rgba(226, 50, 31, 0.4); }
.inv-card .eq { left: 8px; top: 8px; border-radius: 8px; background: linear-gradient(180deg, #5fe07a, #23a446); box-shadow: 0 4px 10px rgba(35, 164, 70, 0.4); }

/* панель выбранного предмета */
.inv-detail { padding: 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--edge); box-shadow: var(--lift); }
.inv-preview { border-radius: 12px; border-bottom: 0; background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--rc) 38%, transparent), transparent 70%), rgba(0, 0, 0, 0.25); }
.inv-title b { font-size: 24px; }
.inv-rarity { letter-spacing: 1.5px; }
.set-box { border-radius: 12px; padding: 10px 12px; background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.set-box.on { border-color: rgba(255, 178, 56, 0.7); box-shadow: var(--glow); }
.inv-actions { gap: 10px; }
.inv-actions .btn { font-size: 15px; padding: 13px 16px; }
.inv-actions .btn.gem { background: linear-gradient(180deg, #8fe9ff 0%, #3cc7ec 48%, #1d93c4 100%); color: #06283a; box-shadow: 0 4px 0 #11618a, 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.inv-actions .btn.up { background: linear-gradient(180deg, #8ff0a2 0%, #4dd06a 48%, #24a043 100%); color: #06300f; box-shadow: 0 4px 0 #17702c, 0 8px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
#namepick { z-index: 49; }
#namepick input { font-size: 18px; padding: 12px 14px; border-radius: 10px; }

/* =====================================================================
   ДИЗАЙН-СИСТЕМА v2 — «тактический люкс»
   Unbounded — заголовки и цифры, Manrope — текст. Графит с холодным отливом, янтарный акцент,
   бирюза для кристаллов. Стекло с тонкой гранью, единые радиусы 10/14/18, мягкие тени.
   ===================================================================== */
:root {
  --bg: #0b0e14; --panel: rgba(20, 24, 34, 0.82); --line: rgba(255, 255, 255, 0.08);
  --text: #eef1f6; --muted: #8b93a6; --accent: #ffb547; --accent-2: #ff7a1a; --cyan: #4fd8ff; --good: #5fe07a; --bad: #ff5a4c;
  --px: 'Unbounded', 'Rubik', system-ui, sans-serif; --ui: 'Manrope', 'Rubik', system-ui, sans-serif;
  --r-s: 10px; --r-m: 14px; --r-l: 18px;
  --surface: linear-gradient(180deg, rgba(30, 35, 50, 0.88) 0%, rgba(14, 17, 25, 0.92) 100%);
  --surface-2: rgba(255, 255, 255, 0.035);
  --hair: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --amber: linear-gradient(180deg, #ffd27a 0%, #ffb547 45%, #ff8a1f 100%);
}
body { font-family: var(--ui); letter-spacing: 0.1px; }
h1, h2, h3, .page-head h1, .set-title { font-family: var(--px); font-weight: 700; letter-spacing: -0.2px; text-shadow: none; }
h2 { color: var(--text); font-size: 22px; }
h3 { color: var(--muted); font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; }
.lbl, .set-sub, .lb-card small, .inv-rarity { letter-spacing: 1.4px; }

/* поверхности */
.card, .dialog.card, #over-reward, .set-panel { background: var(--surface); border: 0; border-radius: var(--r-l); box-shadow: var(--hair), var(--shadow); padding: 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.page { background: radial-gradient(1200px 600px at 20% -10%, rgba(255, 150, 40, 0.10), transparent 60%), radial-gradient(900px 500px at 110% 10%, rgba(80, 140, 255, 0.10), transparent 60%), rgba(8, 10, 16, 0.78); backdrop-filter: blur(8px); }
.modal { background: rgba(6, 8, 12, 0.66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* заголовок страницы и кнопка «назад» */
.page-head { gap: 16px; margin-bottom: 4px; }
.page-head h1 { font-size: clamp(20px, 3.2vw, 32px); }
.back, .set-back { width: 46px; height: 46px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: var(--hair); color: var(--text); font-size: 20px; }
.back:hover, .set-back:hover { box-shadow: var(--hair), 0 0 0 1px rgba(255, 181, 71, 0.5); color: var(--accent); }

/* уровень и опыт */
.lvl { font-family: var(--px); font-size: 13px; font-weight: 700; min-width: 34px; height: 28px; border: 0; border-radius: 9px; background: var(--amber); color: #3a1d00; box-shadow: 0 4px 12px rgba(255, 138, 31, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.xpbar { height: 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.xpbar i { border-radius: 999px; background: linear-gradient(90deg, #ff8a1f, #ffd27a); box-shadow: 0 0 12px rgba(255, 170, 60, 0.6); }
.xpbar em { font: 700 10px var(--ui); line-height: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.xpbar.big { height: 16px; } .xpbar.big em { line-height: 16px; font-size: 11px; }

/* переключатели-сегменты */
.seg { gap: 0; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); width: max-content; max-width: 100%; }
.seg button { border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 800 13px var(--ui); padding: 9px 16px; min-width: 0; }
.seg button.on { background: var(--amber); color: #3a1d00; box-shadow: 0 4px 12px rgba(255, 138, 31, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55); }

/* статистика: цифры крупно, подпись мелко сверху, тонкая подсветка */
.stat-grid { gap: 12px; }
.stat { position: relative; border: 0; border-radius: var(--r-m); padding: 14px 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: linear-gradient(180deg, var(--accent), transparent); opacity: 0.7; }
.stat small { font: 700 11px var(--ui); color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }
.stat b { font: 700 26px var(--px); margin-top: 8px; letter-spacing: -0.5px; }

/* профиль */
.pf-head { gap: 22px; }
.pf-head canvas { width: 104px; height: 104px; border: 0; border-radius: 18px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.5); }
#pf-name { font: 700 28px var(--px); letter-spacing: -0.4px; }
.pf-name-row .icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.swatches button { width: 40px; height: 40px; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12); }
.swatches button.on { box-shadow: 0 0 0 2px var(--accent), 0 0 16px rgba(255, 181, 71, 0.5); transform: none; }
.pf-ton { gap: 12px; }

/* поля ввода */
input[type=text], input:not([type]), select, textarea { border: 0; border-radius: 12px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); color: var(--text); font: 600 15px var(--ui); padding: 12px 14px; }
input:focus { outline: none; box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.8), 0 0 0 4px rgba(255, 181, 71, 0.15); }

/* итоги боя и таблица */
#over-score { font: 700 40px var(--px); letter-spacing: -1px; }
.rw-row { font-family: var(--px); }
.sb-team table { border-collapse: separate; border-spacing: 0 4px; width: 100%; }
.sb-team th { font: 700 11px var(--ui); letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; }
.sb-team td { background: rgba(255, 255, 255, 0.035); padding: 9px 10px; font-weight: 700; }
.sb-team td:first-child { border-radius: 10px 0 0 10px; } .sb-team td:last-child { border-radius: 0 10px 10px 0; }
.sb-team tr.me td { background: linear-gradient(90deg, rgba(255, 181, 71, 0.22), rgba(255, 181, 71, 0.06)); }

/* валюта и прочие плашки */
.cur b { font: 700 16px var(--px); letter-spacing: -0.3px; }
.lb-card b { font: 700 15px var(--px); letter-spacing: -0.2px; }
.lb-nav button { font-family: var(--ui); font-weight: 800; }
.btn, .lb-playbtn, .set-btn { font-family: var(--px); font-weight: 700; letter-spacing: 0.2px; }
.lb-playbtn { font-size: 26px; }
.seg button { white-space: nowrap; flex: 0 0 auto; }
.inv-grid { grid-auto-rows: max-content; }
.inv-card { min-height: max-content; }
/* повёрнутый ромб кристалла шире своей коробки — даём ему место, чтобы не налезал на цифры и текст */
.ico-gem { margin: 2px 6px 2px 5px; }
.ico-coin { margin-right: 4px; }
.info-box { border: 0; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--hair), var(--shadow), 0 0 0 1px rgba(255, 181, 71, 0.35); padding: 20px; gap: 12px; }
.info-box h3 { font: 700 18px var(--px); color: var(--accent); text-transform: none; letter-spacing: 0; }
.info-box li { margin: 4px 0; }

/* карточки карт: настоящий кадр карты, название и описание поверх снизу */
.maps { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.map-card { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #0d0f13; box-shadow: var(--hair), 0 10px 26px rgba(0, 0, 0, 0.4); transition: transform 0.12s ease, box-shadow 0.15s ease; }
.map-card:hover { transform: translateY(-3px); }
.map-card.on { box-shadow: 0 0 0 2px var(--accent), 0 0 24px rgba(255, 170, 60, 0.35), 0 10px 26px rgba(0, 0, 0, 0.4); }
.map-card canvas, .map-card .map-shot, .map-card .map-dice { width: 100%; aspect-ratio: 16 / 10; display: block; object-fit: cover; }
.map-card canvas { image-rendering: pixelated; }
.map-card b { position: absolute; left: 12px; right: 12px; bottom: 26px; margin: 0; font: 700 14px var(--px); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }
.map-card .map-desc { position: absolute; left: 12px; right: 12px; bottom: 8px; font: 600 11px var(--ui); color: #cfd5e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); }
.map-card::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(6, 8, 12, 0.88)); pointer-events: none; }
.map-card b, .map-card .map-desc { z-index: 1; }
.map-card.map-auto .map-desc { display: none; }
.map-card.map-auto b { bottom: 12px; }
#pf-name .clan-tag, #pf-name .vip-badge { font-size: 14px; vertical-align: 0.35em; }
#pf-name .pf-clan { display: block; font: 700 13px var(--ui); color: var(--muted); letter-spacing: 0; margin-top: 2px; }
#pf-name.premium .nm { background: linear-gradient(180deg, #fff3c8, #f2c14e); -webkit-background-clip: text; background-clip: text; color: transparent; }
#pf-name { display: flex; flex-wrap: wrap; align-items: center; }
#pf-name .pf-clan { flex-basis: 100%; }
