: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); }
.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"] .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; }
#damage-numbers { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.damage-number { position: absolute; left: 0; top: 0; color: #ffdc35; font: 900 28px var(--ui); line-height: 1; white-space: nowrap; text-shadow: -2px -2px 0 #111, 2px -2px 0 #111, -2px 2px 0 #111, 2px 2px 0 #111; will-change: transform, opacity; }
.damage-number.critical { color: #ff4949; }
.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; }
#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; }
#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: 2px; background: #111; box-shadow: 0 0 1px 1px #fff; }
#scope .scope-v { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #111; box-shadow: 0 0 1px 1px #fff; }
#scope::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; transform: translate(-50%, -50%); border-radius: 50%; background: #f33; border: 1px solid #fff; }
#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 {
  --touch-safe-l: max(var(--safe-l), var(--tg-safe-area-inset-left, 0px), env(safe-area-inset-left, 0px));
  --touch-safe-r: max(var(--safe-r), var(--tg-safe-area-inset-right, 0px), env(safe-area-inset-right, 0px));
  --touch-safe-b: max(var(--safe-b), var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --touch-top: calc(var(--safe-t) + 4px);
  --touch-score-top: max(3px, var(--tg-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  --touch-weapon-size: clamp(34px, 10.5vh, 46px);
  --touch-weapon-bottom: calc(9px + var(--touch-safe-b));
  --touch-action-size: clamp(34px, 10vh, 44px);
  --touch-action-gap: clamp(4px, 1.25vh, 8px);
  --touch-actions-bottom: max(calc(17px + var(--touch-safe-b)), 6vh);
  --touch-pause-size: 26px;
}
#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: clamp(74px, 23vh, 108px); aspect-ratio: 1; border: 2px solid rgba(255, 255, 255, 0.3); background: rgba(10, 12, 16, 0.13); border-radius: 50%; left: calc(18px + var(--touch-safe-l)); bottom: calc(31px + var(--touch-safe-b)); pointer-events: none; }
#t-knob { position: absolute; inset: 30%; background: rgba(255, 255, 255, 0.4); border-radius: 50%; }
#touch-actions { position: absolute; right: calc(10px + var(--touch-safe-r)); bottom: var(--touch-actions-bottom); display: flex; align-items: flex-end; gap: var(--touch-action-gap); pointer-events: none; }
.touch-column { display: flex; flex-direction: column; align-items: center; gap: var(--touch-action-gap); }
.tb { position: relative; display: grid; place-items: center; width: var(--touch-action-size); height: var(--touch-action-size); border: 0; background: rgba(10, 12, 16, 0.63); color: #fff; font: 700 17px/1 var(--ui); clip-path: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0 72%, 0 28%); touch-action: none; pointer-events: auto; }
.tb.on, .tb:active:not(:disabled) { background: rgba(55, 103, 145, 0.86); }
#touch-utility { margin-bottom: calc(var(--touch-action-size) + var(--touch-action-gap)); }
#touch-utility .tb { width: calc(var(--touch-action-size) - 4px); height: calc(var(--touch-action-size) - 4px); background-color: rgba(10, 12, 16, 0.5); }
#touch-utility .tb.on:not(:disabled), #touch-utility .tb:active:not(:disabled) { background-color: rgba(55, 103, 145, 0.86); }
#touch-utility .tb:disabled { opacity: 0.55; }
#tb-fire { width: clamp(52px, 16vh, 70px); height: auto; aspect-ratio: 1; }
#tb-fire::before { content: ''; width: 18%; height: 48%; border-radius: 60% 60% 12% 12% / 35% 35% 7% 7%; background: linear-gradient(#fff 0 70%, transparent 70% 78%, #fff 78%); transform: rotate(-42deg); }
#tb-sprint .ui-ic { display: block; width: 18px; height: 18px; }
#touch-edge { margin-bottom: calc(var(--touch-action-size) + var(--touch-action-gap) + 35px); }
#tb-nade { overflow: hidden; }
#tb-nade img { width: 70%; height: 70%; object-fit: contain; image-rendering: pixelated; }
#tb-nade:disabled img { filter: grayscale(1); opacity: .5; }
#tb-nade span { position: absolute; top: 5px; right: 5px; min-width: 13px; padding: 2px 3px; border-radius: 8px; background: #f5f4ee; color: #15171a; text-align: center; font-size: 9px; }
#tb-jump { font-size: 20px; }
#tb-pause { position: absolute; top: var(--touch-top); right: calc(10px + var(--touch-safe-r)); width: var(--touch-pause-size); height: var(--touch-pause-size); border-radius: 7px; clip-path: none; }
#tb-pause::before { content: ''; width: 9px; height: 10px; border-inline: 3px solid #fff; border-radius: 1px; }
body.touch #abil { position: static; flex-direction: column-reverse; gap: var(--touch-action-gap); }
body.touch #abil button { width: calc(var(--touch-action-size) + 4px); height: calc(var(--touch-action-size) + 4px); border-radius: 13px; pointer-events: auto; }
body.touch #abil button img { padding: 6px; }
body.touch #abil button em { font-size: 13px; }
body.touch #abil button b { display: none; }

/* ---------- Мобильный HUD ---------- */
#player-scores { position: absolute; top: var(--touch-top); left: calc(6px + var(--touch-safe-l)); width: clamp(92px, 17vw, 134px); max-height: 38vh; overflow: auto; scrollbar-width: none; touch-action: pan-y; list-style: none; color: #eee; font: 700 9px/1.22 var(--ui); text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#player-scores li { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
#player-scores .player-score-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player-scores .red .player-score-name { color: #ff9c8f; }
#player-scores .blue .player-score-name { color: #95cfff; }
#player-scores .me .player-score-name { color: #fff; }
#player-scores .player-score-value { flex: none; font-variant-numeric: tabular-nums; }
#player-scores .vip-badge { width: 10px; height: 10px; margin-left: 2px; }
#player-scores .clan-tag { display: inline; padding: 0; border: 0; margin-right: 3px; background: none; font-size: inherit; }
body.touch #topbar { top: var(--touch-score-top); gap: 4px; align-items: center; font-variant-numeric: tabular-nums; }
body.touch #topbar .team-score { justify-content: center; min-width: 22px; border-radius: 5px; padding: 3px 5px; font-size: 11px; line-height: 1; }
body.touch #topbar .team-score.red { background: rgba(166, 46, 48, 0.88); }
body.touch #topbar .team-score.blue { background: rgba(32, 91, 163, 0.88); }
body.touch #topbar .team-score span { color: #fff; text-align: center; }
body.touch #topbar[data-mode="ffa"] .team-score.red { background: rgba(32, 91, 163, 0.88); }
body.touch #topbar[data-mode="ffa"] .team-score.blue { background: rgba(166, 46, 48, 0.88); }
body.touch #topbar[data-mode="ffa"] .team-score span::before { color: #fff; font-size: 6px; margin-bottom: 1px; }
body.touch #topbar .clock { min-width: 50px; padding: 4px 7px; border-radius: 6px; line-height: 1; }
body.touch #timer { font-size: 13px; }
body.touch #round { display: none; }
body.touch #topbar[data-phase="freeze"] #round { display: block; margin-top: 3px; font-size: 8px; }
body.touch #points { gap: 3px; }
body.touch #points i { width: 13px; height: 13px; border-width: 1px; font-size: 9px; }
body.touch #killfeed { top: calc(var(--touch-top) + var(--touch-pause-size) + 5px); right: calc(10px + var(--touch-safe-r)); max-width: 35vw; gap: 2px; font-size: 8px; line-height: 1; }
body.touch #killfeed .kf { gap: 3px; max-width: 100%; padding: 2px 4px; border-radius: 4px; }
body.touch #killfeed .kf.me { border-width: 1px; }
body.touch #killfeed .kf:nth-last-child(n + 4) { display: none; }
body.touch #killfeed .kf span:not(.w, .hs, .rv) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.touch #killfeed .kf :is(.w, .hs, .rv) { flex: none; font-size: 8px; }
body.touch #killfeed .kf img.w { width: 22px; height: 11px; }
body.touch #spec-label { top: calc(20% + var(--safe-t)); bottom: auto; font-size: 11px; }
body.touch #center-msg { font-size: 13px; }
body.touch .b-title { font-size: 16px; }
body.touch .b-sub, body.touch #action-bar span { font-size: 11px; }
body.touch #buy-hint { display: none; }
body.touch #br { left: 50%; right: auto; bottom: calc(var(--touch-weapon-bottom) + var(--touch-weapon-size) + 6px); transform: translateX(-50%); }
body.touch #reload-bar { width: calc(var(--touch-weapon-size) * 4 + 12px); height: 3px; }
body.touch #wbar { bottom: var(--touch-weapon-bottom); gap: 4px; }
body.touch #wbar button { width: var(--touch-weapon-size); height: var(--touch-weapon-size); border-width: 1px; border-radius: 8px; }
body.touch #wbar button b { display: none; }
body.touch #wbar button img { padding: 4px 3px 8px; }
body.touch #wbar button em { right: 3px; bottom: 2px; font-size: 9px; }
body.touch #wbar button.on { transform: none; box-shadow: inset 0 0 0 1px #fff; }
body.playing #bl { left: 0; right: 0; width: 100%; transform: none; top: auto; bottom: 0; flex-direction: row; align-items: stretch; }
body.playing #bl .vitals { width: 100%; gap: 0; }
body.playing #bl .vital.hp { position: relative; width: 100%; height: 7px; min-width: 0; padding: 0; border-radius: 0; background: linear-gradient(90deg, #e3342f 0 var(--hp, 100%), rgba(0, 0, 0, 0.55) var(--hp, 100%) 100%); }
body.playing #bl .vital.hp i, body.playing #bl .vital.hp span, body.playing #bl .vital.ar { display: none; }
body.playing.touch #bl .vital.hp { height: 5px; }

@media (orientation: portrait) {
  body.touch { --touch-top: calc(var(--safe-t) + 40px); --touch-score-top: var(--touch-top); --touch-actions-bottom: calc(var(--touch-weapon-bottom) + var(--touch-weapon-size) + 8px); }
}

#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 {
  width: 32px;
  height: 32px;
  vertical-align: -8px;
  background: url(../img/gold_token.png) center / contain no-repeat;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(255, 165, 0, 0.7));
}
.ico-gem { width: 28px; height: 28px; margin: 0 4px; vertical-align: -7px; background: url(../img/crystal_icon.png) center / contain no-repeat; filter: drop-shadow(0 0 6px rgba(0, 150, 255, 0.6)); }
.cur .ico-coin, .cur .ico-gem { width: 28px; height: 28px; vertical-align: -7px; }
/* 3D-иконки ключей и осколков в шапке инвентаря */
.cur .cur-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: block;
  align-self: center;
  object-fit: contain;
}
.cur .cur-icon-key { filter: drop-shadow(0px 0px 5px rgba(255, 165, 0, 0.7)); }
.cur .cur-icon-shards { filter: drop-shadow(0px 0px 5px rgba(0, 255, 0, 0.7)); }
/* Такие же иконки внутри наград, кнопок и справок */
.res-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 3px;
  object-fit: contain;
  flex: none;
}
.res-icon-key { filter: drop-shadow(0px 0px 4px rgba(255, 165, 0, 0.7)); }
.res-icon-shards { filter: drop-shadow(0px 0px 4px rgba(0, 255, 0, 0.7)); }
.res-icon-lg { width: 22px; height: 22px; vertical-align: -5px; }
@keyframes crystal-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(0, 150, 255, 0.5)); }
  50% { filter: drop-shadow(0 0 6px rgba(0, 150, 255, 1)); }
}
@keyframes coin-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 165, 0, 0.5)); }
  50% { filter: drop-shadow(0 0 6px rgba(255, 165, 0, 1)); }
}
.cur .ico-gem { animation: crystal-pulse 3s ease-in-out infinite; }
.cur .ico-coin { animation: coin-pulse 3s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .cur .ico-gem, .cur .ico-coin { animation: none; }
}
.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: 80; /* поверх окна входа Google (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-pinfo #lb-name { display: flex; align-items: center; gap: 5px; min-height: 28px; line-height: 1.1; }
.lb-pinfo #lb-name .vip-badge { flex: none; margin-left: 2px; vertical-align: middle; }
.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(124px + 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: flex-end; 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%); }

.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 { 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; }
/* Ящики — отдельный экран из лобби, без бокового меню разделов */
#cases-screen .inv-body { grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: minmax(0, 1fr); }
.inv-tabs { display: flex; flex-direction: column; gap: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #3a3f4a transparent; }
.inv-tab-group { display: flex; flex-direction: column; gap: 6px; }
.inv-tab-title { font-size: 12px; color: rgba(255, 255, 255, 0.4); text-transform: uppercase; margin-top: 20px; margin-bottom: 10px; padding-left: 10px; font-weight: 800; letter-spacing: 0.8px; }
.inv-tabs-sep { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); margin: 16px 0 0; width: 100%; }
.inv-tabs button .tab-hot { width: 8px; height: 8px; margin-left: auto; flex: none; border-radius: 50%; background: #ff4d3d; box-shadow: 0 0 8px rgba(255, 77, 61, 0.85); }
.inv-tabs::-webkit-scrollbar { width: 6px; height: 6px; }
.inv-tabs::-webkit-scrollbar-track { background: transparent; }
.inv-tabs::-webkit-scrollbar-thumb { background: #3a3f4a; border-radius: 3px; }
.inv-tabs::-webkit-scrollbar-thumb:hover { background: #4a5060; }
.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(4, 1fr); gap: 15px; width: 100%; align-content: start; align-items: stretch; overflow-y: auto; touch-action: pan-y; max-height: calc(100vh - 120px); }
.inv-grid > .inv-card, .inv-grid > .gem-card { width: 100%; min-width: 0; }
.inv-grid > .inv-empty, .inv-grid > .case-note { width: 100%; grid-column: 1 / -1; }
.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.skin-card {
  background:
    radial-gradient(circle at 50% 32%, rgba(255, 96, 58, 0.20), transparent 58%),
    linear-gradient(155deg, #1b1226 0%, #0c0a10 52%, #2a0d0b 100%);
  border-color: #3a2a4a;
}
/* Большая модель в правой панели: живой WebGL-рендер, вращение внутри Icons.preview */
.inv-preview .preview-3d {
  width: 100%;
  aspect-ratio: 5 / 3;
  display: block;
  background: transparent;
}
.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; }
/* Двойная цена: «750 + 💎75» — компактнее обычной, чтобы влезала в узкую карточку */
.inv-card .price.dual { gap: 2px; font-size: 10px; padding: 2px 6px 2px 3px; }
.inv-card .price.dual .ico-coin, .inv-card .price.dual .ico-gem { width: 14px; height: 14px; margin: 0; vertical-align: -2px; }
.price-plus { color: var(--muted); font-weight: 900; }
/* Значок осколков в цене — обычная иконка, а не картинка товара на всю ширину */
.inv-card .price .res-icon { width: 18px; height: 18px; aspect-ratio: auto; object-fit: contain; image-rendering: auto; margin-right: 0; }
.inv-card .lock { font-size: 12px; color: var(--muted); font-weight: 700; }
.inv-card .req { font-size: 11px; color: var(--muted); font-weight: 700; opacity: .9; }
.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; }
/* Элементы панели не сжимаются: из-за min-height: 1em у .note абзацы сплющивались и налезали
   друг на друга, а кнопка покупки перекрывала текст. Панель вместо этого прокручивается,
   кнопка остаётся внизу под всем текстом. */
.inv-detail > * { flex-shrink: 0; }
.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 b small { display: block; color: #a9b3c4; font-size: 10px; font-weight: 500; white-space: normal; }
.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; gap: 6px; overflow-x: auto; overflow-y: hidden; min-height: max-content; }
  .inv-tab-group { display: contents; }
  .inv-tab-title, .inv-tabs-sep { display: none; }
  .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; overflow-wrap: anywhere; }
  /* двойная цена должна помещаться в узкую карточку */
  .inv-card .price .ico-coin, .inv-card .price .ico-gem { width: 16px; height: 16px; margin: 0; vertical-align: -2px; }
  .inv-title b { font-size: 17px; }
  .inv-head-r .cur { height: 34px; padding: 0 8px; }
}
@media (max-width: 900px), (max-height: 500px) {
  #cases-screen .inv-body { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (orientation: portrait) {
  .inv-body { grid-template-columns: 1fr; }
  #cases-screen .inv-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .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; box-shadow: 0 0 0 1px rgba(77, 208, 106, 0.18), 0 0 18px rgba(77, 208, 106, 0.12); }
.qs-row.claimed { opacity: 0.6; }
.qs-ready-note { display: block; margin: -2px 0 6px; color: #66ef84; font-size: 11px; font-weight: 900; letter-spacing: 0.3px; text-transform: uppercase; }
.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, .qs-row .quest-play { background: #4dd06a; color: #06300f; }
.qs-target { display: block; margin: -2px 0 6px; font-size: 12px; }
.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 { width: 100%; flex: 1 1 100%; 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%); }
.case-box.coin-detail { display: flex; align-items: center; justify-content: center; min-height: 170px; }
.case-box.coin-detail .ico-coin { width: 110px; height: 110px; vertical-align: 0; }
.case-box.premium-detail { display: flex; align-items: center; justify-content: center; min-height: 190px; }
.premium-badge { width: 150px; height: 150px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255, 196, 70, 0.5)); }
.case-box.booster-detail { display: flex; align-items: center; justify-content: center; min-height: 210px; }
.case-box.crystal-detail { display: flex; align-items: center; justify-content: center; min-height: 190px; }
.crystal-badge { width: 150px; height: 150px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 0 10px rgba(0, 150, 255, 0.6)); }
.gem-ic { object-fit: contain; filter: drop-shadow(0 0 6px rgba(0, 150, 255, 0.6)); }
.inv-tabs button i .ui-ic.gem-ic { width: 24px; height: 24px; }
.booster-art { object-fit: contain; max-width: 100%; pointer-events: none; filter: drop-shadow(0 0 10px rgba(255, 165, 0, 0.5)); }
.gem-card.booster-card { padding: 20px 10px; gap: 8px; }
.booster-card .booster-art { width: 110px; height: 110px; }
.booster-detail .booster-art.big { width: 160px; height: 160px; }
.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: 1px solid #b8860b; color: var(--text); font-family: var(--ui); cursor: pointer; transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.gem-card:hover, .gem-card:focus-visible, .gem-card.premium-card.best:hover, .gem-card.booster-card.on:hover {
  transform: translateY(-5px);
  border-color: #ffd27a;
  box-shadow: 0 0 22px rgba(255, 180, 60, 0.38), 0 12px 26px rgba(0, 0, 0, 0.45);
  z-index: 2;
  outline: none;
}
.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: 1.5rem var(--px); }
.gem-card small { color: #ffd27a; font-weight: 900; text-transform: uppercase; font-size: 11px; }
.gem-card .gem-big .ico-gem { width: 60px; height: 60px; }
.gem-card .gem-big .ico-coin { width: 64px; height: 64px; }
.gem-card.coin-card { padding-top: 32px; }
.gem-card .stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  font-weight: 900;
  font-size: 18px;
  color: #3a1d00;
  padding: 8px 18px;
  border: 1px solid rgba(120, 60, 0, 0.55);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff3b0 0%, #ffd15c 38%, #f59e0b 72%, #c0560a 100%);
  box-shadow: inset 0px -3px 0px rgba(0, 0, 0, 0.3), 0 2px 1px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: filter 0.12s ease, transform 0.12s ease;
}
.gem-card:hover .stars { filter: brightness(1.06); }
.gem-card:active .stars { transform: translateY(1px); }
.gem-card.starter { grid-column: 1 / -1; width: 100%; max-width: 100%; box-sizing: border-box; margin: 0 0 20px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; background: linear-gradient(120deg, rgba(150, 90, 20, 0.95), rgba(30, 24, 16, 0.95)); border-color: #ffb238; }
.gem-card.starter .gem-items { flex-wrap: wrap; justify-content: center; text-align: center; overflow-wrap: anywhere; }
.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; }
.gem-card.premium-card { padding: 30px 12px 14px; background: linear-gradient(160deg, #25123f 0%, #140b24 55%, #07060b 100%); border: 1px solid #b8860b; }
.gem-card.premium-card:hover { border-color: #ffd27a; box-shadow: 0 0 24px rgba(255, 190, 70, 0.35), 0 12px 26px rgba(0, 0, 0, 0.5); }
.gem-card.premium-card.best { border-color: #ffd27a; box-shadow: 0 0 18px rgba(255, 210, 122, 0.28); }
.gem-card.premium-card .premium-term { font: 800 22px/1.15 var(--ui); color: #fff; text-align: center; }
.gem-card.premium-card .premium-days { font: 700 14px var(--ui); color: rgba(255, 255, 255, 0.62); }
.gem-card.booster-card.on { border-color: #ffd27a; box-shadow: 0 0 14px rgba(255, 210, 122, 0.3); }
.gem-card.booster-card.sel { border-color: #ffd27a; box-shadow: 0 0 18px rgba(255, 180, 60, 0.4); }
.gem-card .sale.best { top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px; font-size: 10px; letter-spacing: 0.3px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); background: #ffd27a; color: #1a1206; }
.booster-timer { color: #c9ffc9; font-weight: 900; font-size: 12px; }

.btn.premium-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid #ffd27a; border-radius: 10px;
  background: linear-gradient(180deg, #f8d77a 0%, #e9a326 45%, #a94f05 100%); color: #fff; font: 800 15px var(--ui);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 2px 1px rgba(0, 0, 0, 0.35), 0 0 14px rgba(255, 180, 60, 0.25); }
.btn.premium-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.premium-btn:active { transform: translateY(1px); }
.premium-btn-icon { width: 24px; height: 24px; object-fit: contain; filter: drop-shadow(0 0 5px rgba(255, 200, 80, 0.6)); }

/* ---------- Сезонный пропуск ---------- */
.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 minmax(0, 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; min-width: 0; max-width: 100%; overflow-x: auto; padding-bottom: 0; touch-action: pan-x; overscroll-behavior-x: contain; scrollbar-width: none; -ms-overflow-style: none; }
.ps-track::-webkit-scrollbar { width: 0; height: 0; display: none; }
.ps-track:focus-visible { outline: 2px solid rgba(255, 181, 71, 0.6); outline-offset: 4px; border-radius: 6px; }
/* Свой горизонтальный скролл в стиле интерфейса: тёмная дорожка, золотой бегунок и стрелки. */
.ps-scrollbar { display: flex; align-items: center; gap: 8px; margin: 10px 0 0 118px; min-height: 24px; }
.ps-scrollbar.hidden { display: none; }
.ps-scroll-btn { flex: 0 0 28px; width: 28px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: var(--surface); box-shadow: var(--hair); color: var(--muted); cursor: pointer; transition: color .12s ease, box-shadow .15s ease, opacity .15s ease; }
.ps-scroll-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ps-scroll-btn:hover:not(:disabled) { color: var(--accent); box-shadow: var(--hair), 0 0 0 1px rgba(255, 181, 71, 0.5); }
.ps-scroll-btn:active:not(:disabled) { transform: translateY(1px); }
.ps-scroll-btn:disabled { opacity: 0.3; cursor: default; }
.ps-rail { position: relative; flex: 1 1 auto; min-width: 60px; height: 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); cursor: pointer; }
.ps-thumb { position: absolute; left: 0; top: 0; height: 100%; width: 40px; border-radius: 999px; background: linear-gradient(90deg, #ff8a1f, #ffd27a); box-shadow: 0 0 10px rgba(255, 170, 60, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.55); cursor: grab; touch-action: none; }
.ps-thumb.dragging { cursor: grabbing; background: linear-gradient(90deg, #ffb547, #ffe6a8); }
.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; }
/* Рамку рисуем inset-тенью: обычный border-right иногда перекрывается соседней
   ячейкой при дробном DPI и горизонтальном скролле — контур выглядел обрезанным. */
.ps-cell { position: relative; min-width: 0; 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 transparent; box-shadow: inset 0 0 0 2px #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); box-shadow: inset 0 0 0 2px #4a3a8a; }
.ps-cell.ready { z-index: 1; box-shadow: inset 0 0 0 2px #4dd06a, 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; } .ps-scrollbar { margin-left: 0; } }

/* ---------- Награда после матча ---------- */
#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-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); }
#search.match-starting { background: #0b0c13; }
#search.match-starting #sr-cancel, #search.match-starting #sr-time { display: none; }
.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-ref { display: grid; gap: 8px; margin-top: 10px; }
.so-ref .so-row.done { border-color: #5a4a20; }
.so-ref .so-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.qs-channel .qs-main small { display: block; margin-top: 2px; }
.qs-channel .qs-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pf-prem-row { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.pf-prem { margin: 4px 0; color: #ffcf4d; font-weight: 700; font-size: 14px; }
.pf-prem small { color: var(--muted); font-weight: 600; }
.pf-prem-info { flex: none; width: 27px !important; height: 27px !important; border-radius: 50% !important; font-size: 14px !important; }
.premium-pop-head { display: flex; align-items: center; gap: 10px; }
.premium-pop-head h3 { margin: 0; }
.premium-pop-icon { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255, 196, 70, 0.5)); }
.info-box ul.premium-benefits { display: grid; gap: 7px; padding: 0; list-style: none; }
.premium-benefits li { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); font-weight: 800; }
.premium-benefits li::before { content: '✦'; color: var(--accent); margin-right: 8px; }
.tr-prem { color: #ffcf4d; font-weight: 700; }
.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 9.75px var(--ui); color: #b8f5c0; background: rgba(0, 0, 0, 0.45); padding: 2.25px 6px; 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: repeat(2, minmax(0, 1fr)); column-gap: 18px; } .set-keys > div + div { border-left: 0; padding-left: 18px; }
  .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 { top: auto; bottom: calc(14px + var(--safe-b)); left: calc(10px + var(--safe-l)); transform: none; }
body.playing.touch #ping { bottom: calc(9px + var(--touch-safe-b)); left: calc(6px + var(--touch-safe-l)); border: 0; border-radius: 4px; padding: 1.5px 3px; font-size: 6.75px; }

/* Комплекты: образ + скин оружия + брелок */
.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; width: 30px; height: 30px; margin-left: 6px; object-fit: contain; vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(255, 196, 70, 0.55)); transition: transform 0.15s ease, filter 0.15s ease; }
.vip-badge:hover { filter: brightness(1.08) drop-shadow(0 0 10px rgba(255, 196, 70, 0.7)); transform: translateY(-1px); }
#pf-name .vip-badge { width: 30px; height: 30px; }
.lb-pinfo #lb-name .vip-badge { width: 24px; height: 24px; margin-left: 4px; }
.ag-label b .clan-tag { font-size: 11px; }
.ag-label b .vip-badge { width: 24px; height: 24px; margin-left: 4px; vertical-align: middle; filter: drop-shadow(0 0 4px rgba(255, 196, 70, 0.6)); }
.sb-team .vip-badge { width: 18px; height: 18px; margin-left: 4px; vertical-align: middle; transform: translateY(-1px); filter: drop-shadow(0 0 5px rgba(255, 196, 70, 0.5)); }

/* ---------- 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; }
.coin-ic { object-fit: contain; filter: drop-shadow(0 0 5px rgba(255, 165, 0, 0.7)); }
.crown-ic { object-fit: contain; filter: drop-shadow(0 0 5px rgba(255, 196, 70, 0.55)); }
.inv-tabs button i .ui-ic.crown-ic { width: 24px; height: 24px; }

.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)); }
/* Колонка вкладок обрезает горизонтальный overflow — со сдвигом у кнопки пропадала правая обводка.
   Подсветку при наведении оставляем, а сдвиг убираем. */
.inv-tabs button:hover { transform: none; }
.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: 0; }
.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: 15px; padding: 8px 6px 6px; } /* запас под подъём и свечение выделенной карточки — иначе верхний ряд обрезается */
.inv-card { padding: 10px; border: 2px solid transparent; 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); }
.inv-card.sel { border-color: var(--rc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 45%, transparent), 0 0 24px color-mix(in srgb, var(--rc) 32%, transparent), var(--lift); }
.inv-card b { font-size: 15px; font-weight: 800; }
.inv-card .price { align-self: center; justify-content: center; 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 .owned-price { opacity: 0.55; }
.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.dual-price { font-size: 12px; gap: 4px; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.inv-actions .btn.dual-price .ico-coin, .inv-actions .btn.dual-price .ico-gem { width: 20px; height: 20px; margin: 0; vertical-align: -4px; }
.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: 0 4px; }
.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-shot-placeholder, .map-card .map-dice { width: 100%; aspect-ratio: 16 / 10; display: block; object-fit: cover; }
/* пока 3D-обложка рендерится — мягкая заглушка, а не плоская схема карты */
.map-card .map-shot-placeholder { position: relative; background: linear-gradient(110deg, #10151f 18%, #1d2532 38%, #10151f 58%); background-size: 220% 100%; animation: map-shot-shimmer 1.4s linear infinite; }
.map-card .map-shot-placeholder::after { content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.12); border-top-color: var(--accent); animation: map-shot-spin 0.9s linear infinite; }
.map-card .map-shot-placeholder.failed { animation: none; background: radial-gradient(circle at 50% 35%, #2a313d, #080a0e 70%); }
.map-card .map-shot-placeholder.failed::after { content: none; }
@keyframes map-shot-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes map-shot-spin { to { transform: rotate(360deg); } }
.map-card img.map-shot { opacity: 0; transition: opacity 0.25s ease; }
.map-card img.map-shot.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .map-card .map-shot-placeholder, .map-card .map-shot-placeholder::after { animation: none; } }
.map-card .map-soon-art { width: 100%; aspect-ratio: 16 / 10; display: block; background: radial-gradient(circle at 50% 35%, #2a313d, #080a0e 70%); }
.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%; }

/* ---------- Телефон: экран «поверните устройство» и компактное лобби ---------- */
#rotate-screen { display: none; position: fixed; inset: 0; z-index: 100000; background: #12162a; color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; font: 700 28px/1.2 var(--ui); padding: 24px; touch-action: none; }
#rotate-screen svg { width: 76px; height: 76px; opacity: 0.55; animation: rot-tilt 2.4s ease-in-out infinite; }
@keyframes rot-tilt { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { #rotate-screen { display: flex; } }

@media (orientation: landscape) and (max-height: 560px) {
  .lb-top { top: calc(6px + var(--safe-t)); left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); gap: 6px; }
  .lb-player { min-width: 0; width: 200px; padding: 4px 8px 4px 4px; gap: 8px; border-radius: 10px; }
  .lb-player canvas { width: 38px; height: 38px; }
  .lb-pinfo b { font-size: 13px; }
  .lb-cur { gap: 5px; }
  .cur { height: 32px; padding: 0 8px; font-size: 13px; border-radius: 9px; }
  .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
  .icon-btn .ui-ic { width: 18px; height: 18px; }
  .lb-nav, .lb-side { top: calc(84px + var(--safe-t)); }
  .lb-nav { left: calc(8px + var(--safe-l)); gap: 4px; }
  .lb-nav button { width: 132px; padding: 4px 8px; gap: 8px; font-size: 12.5px; border-radius: 9px; }
  .lb-nav button i { width: 24px; height: 24px; border-radius: 7px; }
  .lb-nav button i .ui-ic { width: 16px; height: 16px; }
  .lb-side { right: calc(8px + var(--safe-r)); width: 150px; gap: 5px; }
  .lb-card { padding: 6px 9px; gap: 1px; border-radius: 10px; }
  .lb-card small { font-size: 9px; letter-spacing: 0.8px; }
  .lb-card b { font-size: 12px; }
  .lb-card span { font-size: 11px; }
  .lb-bottom { bottom: calc(6px + var(--safe-b)); gap: 6px; }
  .lb-tile { width: 66px; padding: 4px; gap: 2px; font-size: 10px; border-radius: 10px; }
  .lb-tile i { width: 28px; height: 28px; border-radius: 8px; }
  .lb-tile i .ui-ic { width: 18px; height: 18px; }
  .lb-playbtn { min-width: 150px; padding: 0 20px; font-size: 20px; border-radius: 10px; }
  #lb-status { bottom: calc(66px + var(--safe-b)); }
  .lb-squad { bottom: calc(70px + var(--safe-b)); padding: 3px 8px; }
  /* остальные экраны (магазин, инвентарь, профиль…) — мельче, чтобы влезало больше */
  .screen:not(.lobby) { zoom: 0.72; }
  /* магазин и инвентарь: меню разделов слева столбцом, как на большом экране */
  .inv-body { grid-template-columns: 144px 1fr 250px; grid-template-rows: minmax(0, 1fr); }
  .inv-tabs { grid-column: auto; flex-direction: column; overflow-x: hidden; overflow-y: auto; min-height: 0; gap: 0; touch-action: pan-y; max-height: calc(100vh / 0.72 - 90px); }
  .inv-tab-group { display: flex; }
  .inv-tab-title { display: block; }
  .inv-tabs-sep { display: block; }
  .inv-tabs button { padding: 6px 8px; gap: 8px; font-size: 12px; }
  .inv-tabs button i { width: 24px; height: 24px; }
  .inv-tabs button i .ui-ic { width: 15px; height: 15px; }
  .inv-tabs button i .ui-ic.crown-ic { width: 20px; height: 20px; }
  .gem-card.premium-card .premium-term { font-size: 18px; }
  .gem-card.premium-card .premium-days { font-size: 12px; }
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: calc(100vh / 0.72 - 90px); }
  .inv-detail { max-height: calc(100vh / 0.72 - 90px); padding: 10px; }
  /* Узкая правая панель: укорачиваем полоску, чтобы длинные значения («632 в/мин»)
     не вылезали за край и не обрезались. */
  .inv-detail .st { grid-template-columns: 1fr 32px auto; gap: 6px; }
  h2 { font-size: 17px; }
  .page-head h1 { font-size: 18px; }
  .card { padding: 10px; }
  .dialog { gap: 6px; }
  .btn { padding: 8px 12px; font-size: 13px; }
}

/* закрытые/тестовые карты: закрытая остаётся в сетке, но не кликается */
.map-card.locked { cursor: default; filter: saturate(0.35) brightness(0.66); }
.map-card.locked:hover { transform: none; }
.map-card .map-badge { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 8px; border-radius: 6px; background: rgba(8, 10, 14, 0.82); border: 1px solid rgba(255, 255, 255, 0.22); font: 800 10px var(--px); letter-spacing: 0.08em; color: #e6e9ee; text-shadow: none; }
.map-card .map-badge.test { background: rgba(36, 92, 140, 0.88); border-color: rgba(130, 190, 240, 0.55); color: #d9efff; }
.map-card.test-map { box-shadow: 0 0 0 1px rgba(86, 156, 214, 0.45), var(--hair), 0 10px 26px rgba(0, 0, 0, 0.4); }
.map-card:disabled { pointer-events: none; }
.map-loading { grid-column: 1 / -1; }
/* Быстрый старт и выбор матча — единый блок действий в лобби. */
.lb-play-group {
  display: flex; align-items: stretch; min-height: 76px; padding: 4px;
  border: 1px solid rgba(255, 220, 145, .25); border-radius: 17px;
  background: linear-gradient(145deg, rgba(68, 57, 49, .92), rgba(24, 29, 42, .94));
  box-shadow: 0 10px 26px rgba(0, 0, 0, .4), inset 0 1px rgba(255, 255, 255, .1);
}
.lb-play-group #lb-play { min-width: 220px; border-radius: 12px; box-shadow: inset 0 2px rgba(255,255,255,.65), inset 0 -3px rgba(135,69,0,.22), 0 3px 10px rgba(0,0,0,.25); }
.lb-play-group #lb-play:hover { transform: none; filter: brightness(1.09); }
.lb-play-group #lb-play:active { transform: scale(.98); }
.lb-mode-select {
  display: grid; place-items: center; width: 72px; flex: 0 0 72px; margin-left: 4px;
  color: #ffd075; background: transparent; border: 0; border-radius: 11px; cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.lb-mode-select svg { width: 27px; height: 27px; fill: currentColor; filter: drop-shadow(0 2px 5px rgba(255, 174, 46, .25)); }
.lb-mode-select:hover { color: #ffdf9c; background: rgba(255, 205, 109, .12); }
.lb-mode-select:active { transform: scale(.92); }
.lb-mode-select:focus-visible, .lb-play-group #lb-play:focus-visible { outline: 2px solid #fff0bd; outline-offset: 2px; }
@media (orientation: landscape) and (max-height: 560px) {
  .lb-play-group { min-height: 52px; padding: 3px; border-radius: 13px; }
  .lb-play-group #lb-play { min-width: 150px; border-radius: 9px; }
  .lb-mode-select { width: 52px; flex-basis: 52px; border-radius: 8px; }
  .lb-mode-select svg { width: 22px; height: 22px; }
}
@media (orientation: portrait) {
  .lb-play-group { flex: 2; min-width: 0; min-height: 60px; }
  .lb-play-group #lb-play { flex: 1; min-width: 0; }
  .lb-mode-select { width: 44px; flex-basis: 44px; }
  .lb-mode-select svg { width: 21px; height: 21px; }
}

/* кнопка жалобы в таблице результатов */
.sb-report { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 4px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 120, 90, 0.65); background: rgba(255, 80, 55, 0.14); color: #ff9a80; font: 800 11px var(--px); cursor: pointer; vertical-align: middle; }
.sb-report:hover { background: rgba(255, 80, 55, 0.3); color: #fff; }
#report textarea, #report select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; }
/* Вход: карточки провайдеров и раздельные сценарии входа и регистрации. */
.auth-overlay { position: fixed; inset: 0; z-index: 200000; display: grid; place-items: center; padding: max(16px, var(--safe-t)) max(16px, var(--safe-r)) max(16px, var(--safe-b)) max(16px, var(--safe-l)); background: rgba(8, 11, 22, .58); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font-family: var(--ui); overflow-y: auto; }
.auth-card { position: relative; width: min(760px, 100%); padding: 34px 36px 30px; border: 1px solid rgba(183, 197, 235, .12); border-radius: 26px; color: #f7f8fc; background: #1c2236; box-shadow: 0 28px 80px rgba(3, 6, 18, .55), inset 0 1px rgba(255, 255, 255, .04); text-align: center; }
.auth-close { position: absolute; top: 20px; right: 20px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #cdd2e0; background: #2a3044; font-size: 27px; line-height: 1; cursor: pointer; }
.auth-close:hover { background: #3b4259; color: white; }
.auth-tabs { display: flex; width: min(330px, calc(100% - 45px)); margin: 0 auto; padding: 4px; border-radius: 999px; background: #12192b; }
.auth-tabs button { flex: 1; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: #a7aebf; font: 800 14px var(--ui); cursor: pointer; transition: background .2s, color .2s; }
.auth-tabs button.on { color: #fff; background: #30374a; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.auth-heading { margin: 30px 0 27px; }
.auth-heading h2 { margin: 0; font: 800 clamp(21px, 2.3vw, 27px)/1.2 var(--ui); letter-spacing: -.025em; }
.auth-heading p { margin: 10px 0 0; color: #9ca4b5; font: 700 15px/1.4 var(--ui); }
.auth-providers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.auth-provider { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 164px; padding: 18px 8px; border: 1px solid rgba(255,255,255,.035); border-radius: 17px; background: #282f44; color: #f7f8fc; text-decoration: none; transition: background .18s, border-color .18s, transform .18s; }
.auth-telegram:hover { background: #303c56; border-color: rgba(61,183,239,.45); transform: translateY(-2px); }
.auth-provider strong { font: 800 20px/1.1 var(--ui); }
.auth-provider small { color: #a8b1c4; font: 700 11px/1.3 var(--ui); }
.auth-provider-icon { display: grid; place-items: center; width: 32px; height: 32px; }
.auth-provider-icon svg { width: 30px; height: 30px; }
.telegram-icon { color: #29a9e8; }
.yandex-icon { width: 28px; height: 28px; border-radius: 50%; background: #fc3f1d; font: 800 20px var(--ui); }
.auth-soon { position: absolute; top: 11px; right: 12px; color: #a2aabc; font: 800 9px var(--ui); letter-spacing: .08em; }
.auth-unavailable { opacity: .58; cursor: default; }
.auth-google-button { min-height: 40px; max-width: 100%; overflow: hidden; }
.auth-google-button iframe { max-width: 100%; }
.auth-locked { opacity: .55; }
.auth-telegram.auth-locked { cursor: not-allowed; }
.auth-status { margin: 12px 0 0; color: #ffad9e; font-size: 12px; font-weight: 700; }
.auth-status:empty { display: none; }
.auth-legal, .auth-consent { margin: 27px 0 0; color: #a4abba; font: 700 12px/1.5 var(--ui); }
.auth-legal a, .auth-consent a { color: #c5cedf; text-underline-offset: 3px; }
.auth-consent:not([hidden]) { display: flex; align-items: flex-start; justify-content: center; gap: 10px; }
.auth-consent input { accent-color: #f3b34b; width: 18px; height: 18px; margin: 0; flex: none; }
@media (max-width: 600px) { .auth-card { padding: 24px 16px; border-radius: 20px; } .auth-heading { margin: 20px 0; } .auth-providers { gap: 7px; } .auth-provider { min-height: 138px; padding: 12px 4px; border-radius: 12px; } .auth-provider strong { font-size: 15px; } .auth-provider small { font-size: 10px; } .auth-google-button { width: 100%; } .auth-legal, .auth-consent { margin-top: 19px; } }
@media (max-height: 500px) and (orientation: landscape) { .auth-overlay { align-items: start; } .auth-card { margin: auto; padding: 15px 24px; } .auth-tabs button { min-height: 32px; } .auth-heading { margin: 12px 0; } .auth-heading h2 { font-size: 20px; } .auth-heading p { margin-top: 4px; font-size: 12px; } .auth-provider { min-height: 108px; padding: 8px 5px; gap: 5px; } .auth-provider strong { font-size: 16px; } .auth-provider-icon, .auth-provider-icon svg { width: 24px; height: 24px; } .auth-legal, .auth-consent { margin-top: 12px; } }
body.auth-pending { visibility: hidden; background: #0c1120; }
#app-loading { display: none; }
/* Пока идёт загрузка, на фоне — размытое лобби, а не пустой тёмный экран. */
body.auth-pending #app-loading, body.match-loading #app-loading { visibility: visible; display: flex; position: fixed; inset: 0; z-index: 400000; overflow: hidden; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #0b0c13; color: #efdcc3; font: 700 15px var(--ui); letter-spacing: .04em; }
body.match-loading { overflow: hidden; }
body.auth-pending #app-loading::before, body.match-loading #app-loading::before { content: ""; position: absolute; inset: -28px; z-index: 0; background: url(../assets/backgrounds/bg_blockzone_day.jpg) center / cover no-repeat; filter: blur(16px) brightness(0.62) saturate(0.9); transform: scale(1.04); }
html[data-daynight="night"] body.auth-pending #app-loading::before, html[data-daynight="night"] body.match-loading #app-loading::before { background-image: url(../assets/backgrounds/bg_blockzone_night.jpg); }
body.auth-pending #app-loading::after, body.match-loading #app-loading::after { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 40%, rgba(53, 33, 43, 0.45), rgba(11, 12, 19, 0.82) 70%); pointer-events: none; }
body.auth-pending #app-loading > *, body.match-loading #app-loading > * { position: relative; z-index: 2; }
#app-loading img { width: 72px; height: 72px; filter: drop-shadow(0 0 18px rgba(255, 151, 54, .25)); }
#app-loading .app-loading-track { width: min(260px, 60vw); height: 7px; overflow: hidden; border: 1px solid rgba(255, 210, 150, .22); background: rgba(0, 0, 0, .3); }
#app-loading-fill { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #ff9a2e, #ffd36a); box-shadow: 0 0 12px rgba(255, 170, 40, .65); transition: width .18s ease-out; }
#app-loading-pct { font: 800 22px var(--px); color: #ffbe55; letter-spacing: .06em; }
#app-loading-text { text-align: center; }
.auth-overlay.auth-required { background: radial-gradient(ellipse at 50% 25%, #28304b, #101525 70%); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Экран входа использует графит и янтарь интерфейса Block Zone. */
.auth-overlay.auth-required {
  background-color: #0b0e14;
  background-image: radial-gradient(ellipse at 50% -15%, rgba(255, 155, 46, .13), transparent 55%),
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
}
.auth-card {
  width: min(780px, 100%); padding: 27px 36px 28px;
  background: linear-gradient(155deg, #202532 0%, #141822 52%, #10131b 100%);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--r-l);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5), inset 0 1px rgba(255, 255, 255, .08);
}
.auth-card::before { content: ''; position: absolute; top: -1px; left: 36px; width: 84px; height: 3px; background: var(--amber); border-radius: 0 0 4px 4px; box-shadow: 0 0 18px rgba(255, 181, 71, .5); }
.auth-brand { display: flex; justify-content: center; align-items: center; gap: 9px; margin-bottom: 23px; color: #eef1f6; font: 700 13px var(--px); letter-spacing: .06em; }
.auth-brand b { color: var(--accent); }
.auth-brand-mark { display: grid; grid-template-columns: repeat(2, 5px); gap: 2px; transform: rotate(-8deg); }
.auth-brand-mark i { width: 5px; height: 5px; border-radius: 1px; background: var(--accent); }
.auth-brand-mark i:nth-child(2) { opacity: .45; }
.auth-emblem { display: block; position: relative; z-index: 1; width: 88px; height: 88px; margin: -71px auto 12px; filter: drop-shadow(0 7px 20px rgba(255, 152, 38, .3)); }
.auth-overlay { padding-top: max(60px, var(--safe-t)); }
.auth-tabs { width: min(340px, 100%); border-radius: 12px; background: rgba(0,0,0,.32); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.auth-tabs button { border-radius: 9px; color: #a6aebd; }
.auth-tabs button.on { color: #3a1d00; background: var(--amber); box-shadow: 0 4px 12px rgba(255,138,31,.22), inset 0 1px rgba(255,255,255,.5); }
.auth-heading { margin: 25px 0 24px; }
.auth-eyebrow { display: block; margin-bottom: 9px; color: var(--accent); font: 800 10px var(--ui); letter-spacing: .17em; }
.auth-heading h2 { font: 700 clamp(21px, 2.4vw, 27px)/1.25 var(--px); letter-spacing: -.025em; }
.auth-heading p { max-width: 520px; margin: 10px auto 0; color: #a5adbb; font-size: 13px; }
.auth-provider { min-height: 162px; border-radius: var(--r-m); border: 1px solid rgba(255,255,255,.07); background: linear-gradient(155deg, rgba(255,255,255,.065), rgba(255,255,255,.025)); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.auth-provider strong { font: 700 15px var(--px); }
.auth-provider small { color: #a1a9b7; }
.auth-telegram:hover { background: linear-gradient(155deg, rgba(255,181,71,.12), rgba(255,255,255,.03)); border-color: rgba(255,181,71,.55); box-shadow: 0 0 20px rgba(255,155,40,.08), inset 0 1px rgba(255,255,255,.06); }
.auth-soon { color: #a6a2a0; }
.auth-legal, .auth-consent { color: #969eae; }
.auth-legal a, .auth-consent a { color: #d8be91; }
.auth-tabs button:focus-visible, .auth-provider:focus-visible, .auth-close:focus-visible, .auth-consent input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) { .auth-card { padding: 22px 16px; } .auth-brand { margin-bottom: 17px; } .auth-heading { margin: 18px 0; } .auth-provider { min-height: 140px; } .auth-provider strong { font-size: 12px; } }
@media (max-height: 500px) and (orientation: landscape) { .auth-card { padding: 12px 24px; } .auth-brand { margin-bottom: 8px; font-size: 10px; } .auth-heading { margin: 9px 0; } .auth-eyebrow { margin-bottom: 4px; font-size: 9px; } .auth-heading h2 { font-size: 18px; } .auth-provider { min-height: 100px; } .auth-provider strong { font-size: 12px; } }
@media (max-height: 500px) and (orientation: landscape) { .auth-overlay { padding-top: max(40px, var(--safe-t)); } .auth-emblem { width: 58px; height: 58px; margin: -41px auto 4px; } }

/* Матовые панели тактического лобби */
.lobby { font-family: 'Manrope', sans-serif; }
.lobby .lb-player, .lobby .cur, .lobby .lb-nav button, .lobby .lb-card,
.lobby .lb-tile, .lobby .lb-mode-select, .lobby .icon-btn {
  background: rgba(10, 19, 29, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.lobby button { transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease, filter 180ms ease; }
.lobby button:hover, .lobby button:focus-visible {
  border-color: #54d9f3;
  box-shadow: 0 0 18px rgba(47, 205, 240, 0.3), inset 0 0 14px rgba(47, 205, 240, 0.08);
}
.lobby .lb-playbtn { font-family: 'Manrope', sans-serif; color: #06131b; border: 1px solid #a1f4ff; background: linear-gradient(135deg, #8af1ff, #25aacb); box-shadow: 0 0 24px rgba(40, 203, 236, 0.25); }
#lb-stage:active { cursor: grabbing; }

/* Лобби: стекло и акценты в цветах заката. */
.lobby .lb-top { align-items: center; }
.lobby .lb-cur { display: flex; align-items: center; gap: 8px; }
.lobby .lb-player, .lobby .cur, .lobby .lb-nav button, .lobby .lb-card,
.lobby .lb-tile, .lobby .lb-mode-select, .lobby .icon-btn {
  background: rgba(20, 20, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lobby .lb-cur .icon-btn { flex: 0 0 auto; color: #e6e6eb; }
.lobby .lb-cur .icon-btn i { display: grid; place-items: center; }
.lobby button { transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease, filter 180ms ease; }
.lobby button:hover, .lobby button:focus-visible {
  border-color: rgba(255, 177, 68, 0.8);
  box-shadow: 0 0 18px rgba(255, 155, 40, 0.22), inset 0 0 14px rgba(255, 170, 60, 0.06);
}
.lobby .lb-play-group #lb-play {
  color: #fff; font-family: 'Manrope', sans-serif; font-weight: 800;
  text-shadow: 0 2px 5px rgba(89, 39, 0, 0.55);
  border: 1px solid rgba(255, 215, 141, 0.8);
  background: linear-gradient(145deg, #ffad28 0%, #ff9900 42%, #cc6600 100%);
  box-shadow: inset 0 1px rgba(255, 239, 205, 0.65), inset 0 -3px rgba(120, 52, 0, 0.28), 0 8px 18px rgba(76, 30, 0, 0.4), 0 0 24px rgba(255, 144, 22, 0.18);
}
.lobby .lb-play-group #lb-play:hover, .lobby .lb-play-group #lb-play:focus-visible {
  transform: scale(1.03); filter: brightness(1.1); border-color: #ffe1a6;
  box-shadow: inset 0 1px rgba(255, 239, 205, 0.7), 0 10px 24px rgba(76, 30, 0, 0.45), 0 0 26px rgba(255, 159, 40, 0.35);
}
.lobby .lb-play-group #lb-play:active { transform: scale(0.98); }
@media (orientation: landscape) and (max-height: 560px) {
  .lobby .lb-cur { gap: 5px; }
}

/* Более компактные элементы лобби, не меняя размеры игровых экранов. */
body:not(.playing) #game { image-rendering: auto; }
.lobby .lb-top { align-items: flex-start; }
.lobby .lb-player { transform: scale(.7); transform-origin: top left; }
.lobby .lb-cur { transform: scale(.7); transform-origin: top right; }
.lobby .lb-nav { transform: scale(.7); transform-origin: top left; }
.lobby .lb-side { transform: scale(.7); transform-origin: top right; }
.lobby .lb-bottom { transform: translateX(-50%) scale(.7); transform-origin: bottom center; }
.lobby .lb-squad { transform: translateX(-50%) scale(.7); transform-origin: bottom center; }
@media (orientation: landscape) {
  .lobby .lb-nav { top: calc(90px + var(--safe-t)); }
  .lobby .lb-side { top: calc(76px + var(--safe-t)); }
}
@media (orientation: landscape) and (max-height: 560px) {
  .lobby .lb-nav, .lobby .lb-side { top: calc(65px + var(--safe-t)); }
}

/* Действия с игроками после матча. */
.sb-friend { display: inline-grid; place-items: center; vertical-align: middle; width: 28px; height: 28px; margin-left: 6px; padding: 4px; border: 1px solid rgba(106, 211, 126, .45); border-radius: 7px; background: rgba(41, 121, 64, .22); color: #90e9a3; cursor: pointer; }
.sb-friend svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sb-friend:hover, .sb-friend:focus-visible { border-color: #a9f7b9; background: rgba(51, 159, 77, .4); }
.sb-friend.sent { opacity: .5; cursor: default; }
.friend-requests { display: grid; gap: 8px; }
.friend-requests h3 { margin: 0; }
#over .menu-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
#over .menu-actions button { min-width: 150px; }
#over .dialog { max-height: calc(100dvh - 24px); }
/* Таблица участников забирает всё свободное место в карточке, кнопки остаются внизу.
   min-height: 0 обязателен — иначе флекс-элемент не сжимается и карточка вылезает за экран. */
#over-table { flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; }

/* ---------- Итоги матча на телефоне (горизонтально): игроки видны, кнопки снизу ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  /* Убираем общий zoom: .72 из компактного блока выше — вместе с ним уменьшался и
     max-height карточки, поэтому таблица участников сжималась до одного заголовка. */
  #over { zoom: 1; padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l)); }
  #over .dialog {
    align-self: stretch; max-height: none; margin: 0; padding: 8px 14px; border-radius: 14px;
    /* заголовок и счёт в одну строку — это освобождает место под список игроков.
       Две одинаковые боковые колонки держат счёт ровно по центру карточки. */
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "title score ." "reward reward reward" "table table table" "actions actions actions"; gap: 4px 10px;
  }
  #over-title { grid-area: title; align-self: center; margin: 0; font-size: 16px; line-height: 1.2; }
  #over-score { grid-area: score; align-self: center; justify-self: center; margin: 0; font: 700 26px/1.1 var(--px); }
  #over-reward { grid-area: reward; padding: 5px 10px; border-radius: 12px; }
  #over .rw-row { gap: 16px; font-size: 16px; }
  #over .rw-row .ico-coin { width: 16px; height: 16px; }
  #over .rw-note { margin-top: 2px; font-size: 10px; }
  #over .xpbar.big { height: 12px; }
  #over .xpbar.big em { line-height: 12px; font-size: 9px; }
  #over .menu-actions { grid-area: actions; gap: 8px; }
  #over .menu-actions .btn { min-width: 148px; padding: 8px 18px; font-size: 13px; }

  /* Командные режимы — две команды рядом, чтобы весь состав помещался без прокрутки. */
  #over-table { grid-area: table; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; align-items: start; gap: 2px 14px; padding-right: 2px; }
  #over-table .sb-team { min-width: 0; }
  #over-table .sb-team:only-child { grid-column: 1 / -1; }
  #over-table .sb-team h3 { margin: 0; font-size: 9px; letter-spacing: 1px; }
  #over-table table { font-size: 11.5px; border-spacing: 0 1px; }
  #over-table th { padding: 1px 5px; font-size: 8.5px; letter-spacing: .8px; }
  #over-table td { padding: 2px 5px; font-size: 11.5px; line-height: 1.25; }
  #over-table .sb-friend { width: 20px; height: 20px; margin-left: 4px; padding: 2px; border-radius: 5px; }
  #over-table .sb-friend svg { width: 14px; height: 14px; }
  #over-table .sb-report { width: 15px; height: 15px; margin-left: 2px; font-size: 9px; }
  #over-table .vip-badge { width: 14px; height: 14px; margin-left: 3px; }
  #over-table .clan-tag { margin-right: 3px; padding: 0 4px; font-size: 9px; }
}

/* ---------- Мобильный магазин и Чёрный рынок: уменьшенный десктоп ---------- */
@media (max-width: 768px) {
  .inv-body {
    display: flex; flex-direction: row; flex-wrap: nowrap; align-items: flex-start; gap: 10px;
    width: 100%; height: calc(100vh - 60px); min-height: 0;
    overflow-x: hidden; overflow-y: auto;
  }

  /* Левое меню — вертикальное, компактное */
  .inv-tabs {
    flex: 0 0 80px; width: 80px; flex-direction: column; flex-wrap: nowrap; gap: 0;
    min-height: 0; max-height: none; overflow-x: hidden; overflow-y: visible; touch-action: pan-y;
  }
  .inv-tab-group { display: flex; flex-direction: column; gap: 3px; }
  .inv-tab-title, .inv-tabs-sep { display: none; }
  .inv-tabs button {
    position: relative; flex: 0 0 auto; flex-direction: column; gap: 2px;
    padding: 5px; font-size: 10px; line-height: 1.05; text-align: center; white-space: normal;
  }
  .inv-tabs button i { width: 16px; height: 16px; border-radius: 5px; }
  .inv-tabs button i .ui-ic { width: 12px; height: 12px; }
  .inv-tabs button i .ui-ic.crown-ic { width: 14px; height: 14px; }
  .inv-tabs button .tab-hot { position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; margin: 0; }

  /* Шапка */
  .page-head { gap: 6px; flex-wrap: wrap; align-items: center; }
  .page-head h1 { font-size: 18px; }
  .inv-head-r { gap: 3px; margin-left: auto; }
  .inv-head-r .cur { height: 24px; padding: 0 4px; font-size: 10px; gap: 2px; }
  .inv-head-r .cur b { font-size: 11px; }
  .cur .ico-coin, .cur .ico-gem { width: 18px; height: 18px; }
  .cur .cur-icon { width: 20px; height: 20px; }
  .inv-switch { padding: 4px 6px; font-size: 10px; }

  /* Центральная сетка */
  .inv-grid {
    flex: 1 1 auto; min-width: 0; width: auto;
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 0;
    max-height: none; overflow: visible;
  }
  .inv-grid > .inv-card, .inv-grid > .gem-card { width: 100%; min-width: 0; }
  .inv-grid > .inv-empty, .inv-grid > .case-note { grid-column: 1 / -1; }
  .gem-card.starter {
    grid-column: 1 / -1; width: 100%; max-width: 100%;
    box-sizing: border-box; margin: 0 0 5px; padding: 5px;
  }

  /* Правая панель — остаётся справа */
  .inv-detail {
    flex: 0 0 130px; width: 130px; max-width: 130px; max-height: none;
    overflow: visible; align-self: flex-start; padding: 6px; box-sizing: border-box;
    white-space: normal; word-wrap: break-word;
  }
  .inv-detail .inv-title { gap: 4px; flex-wrap: wrap; }
  .inv-detail .inv-title b { font-size: 14px; }
  .inv-detail .inv-title span { font-size: 9px; }
  .inv-detail .inv-desc { font-size: 10px; line-height: 1.35; }
  .inv-detail .note { font-size: 9px; }
  .inv-detail .inv-actions .btn { font-size: 9px; padding: 4px; gap: 3px; }
  .inv-detail .inv-actions .btn.dual-price { font-size: 8px; padding: 3px; gap: 2px; }
  .inv-detail .inv-actions .btn.dual-price .ico-coin, .inv-detail .inv-actions .btn.dual-price .ico-gem { width: 14px; height: 14px; vertical-align: -2px; }
  .inv-detail .case-box { font-size: 40px; padding: 4px 0; }
  .inv-detail .case-box.premium-detail,
  .inv-detail .case-box.coin-detail,
  .inv-detail .case-box.booster-detail,
  .inv-detail .case-box.crystal-detail { min-height: 60px; }
  .premium-badge, .crystal-badge { width: 60px; height: 60px; }
  .inv-detail .case-box.coin-detail .ico-coin { width: 60px; height: 60px; }
  .booster-detail .booster-art.big { width: 60px; height: 60px; }

  /* Карточки */
  .inv-card { padding: 5px; }
  .inv-card b { font-size: 10px; overflow-wrap: anywhere; }
  .inv-card .price { font-size: 9px; }
  .gem-card { min-height: 0; padding: 5px; }
  .gem-card b { font-size: 1.2rem; white-space: nowrap; }
  .gem-card .gem-big .ico-gem { width: 40px; height: 40px; }
  .gem-card .gem-big .ico-coin { width: 40px; height: 40px; }
  .gem-card .stars {
    min-width: 0; max-width: 100%; padding: 2px 3px;
    font-size: 12px; white-space: nowrap; gap: 0;
  }
  .gem-card .sale { right: 3px; top: 3px; font-size: 8px; padding: 1px 3px; }
  .gem-card.premium-card { padding: 16px 4px 6px; }
  .gem-card.premium-card .premium-term { font-size: 12px; }
  .gem-card.premium-card .premium-days { font-size: 9px; }
  .gem-card.booster-card { padding: 8px 4px; }
  .booster-card .booster-art { width: 40px; height: 40px; }
  .gem-card.coin-card { padding-top: 14px; }
  .gem-card.starter b { font-size: 14px; }
  .gem-card.starter .gem-items { font-size: 9px; }
}

/* ============ Выключатель игры: размытое лобби и надпись администратора ============ */
body.game-gate-open { overflow: hidden !important; }
html.game-gate-open, body.game-gate-open { background: #0b0c12; }
body.game-gate-open #app-loading, body.game-gate-open #toast { display: none !important; }

#game-gate {
  position: fixed; inset: 0; z-index: 700000;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center;
  padding: max(54px, var(--safe-t)) max(20px, var(--safe-r)) max(20px, var(--safe-b)) max(20px, var(--safe-l));
  overflow: auto; isolation: isolate;
  color: #f5efe7; font-family: var(--ui, 'Manrope', system-ui, sans-serif);
  -webkit-tap-highlight-color: transparent;
}
/* Фон экрана техработ — то же новое лобби, что на загрузке и в игре. */
#game-gate .gg-bg {
  position: fixed; inset: -60px;
  background: #0b0c13 url('../assets/backgrounds/bg_blockzone_day.jpg') center / cover no-repeat;
  filter: blur(14px) brightness(.62) saturate(.95);
  transform: scale(1.08);
  z-index: -3;
}
html[data-daynight="night"] #game-gate .gg-bg { background-image: url('../assets/backgrounds/bg_blockzone_night.jpg'); }
#game-gate .gg-shade {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(24, 16, 22, .06), rgba(7, 8, 13, .66) 78%),
    linear-gradient(rgba(9, 10, 16, .12), rgba(9, 10, 16, .46));
}
#game-gate .gg-card {
  position: relative; z-index: 1;
  width: min(580px, 100%); min-width: 0; margin: auto;
  padding: clamp(26px, 5vw, 46px) clamp(20px, 5vw, 44px);
  padding-top: clamp(58px, 5vw, 60px);
  border-radius: 26px;
  border: 1px solid rgba(255, 190, 110, .26);
  background: rgba(17, 15, 22, .74);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .07);
  text-align: center;
  animation: gg-in .38s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes gg-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
#game-gate .gg-header {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; margin-bottom: 20px;
}
#game-gate .gg-brand {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  display: flex; justify-content: center;
}
#game-gate .gg-brand img { width: 84px; height: 84px; display: block; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .5)); }
#game-gate .gg-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid rgba(255, 190, 110, .3);
  background: rgba(255, 176, 80, .1);
  color: #ffcf8a; font: 800 clamp(14px, 2.4vw, 18px)/1.2 var(--ui, 'Manrope', sans-serif);
  letter-spacing: .08em; text-transform: uppercase;
}
#game-gate .gg-badge::before, #game-gate .gg-badge::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ffb44f; box-shadow: 0 0 12px #ff9b2e; animation: gg-pulse 1.8s ease-in-out infinite; }
@keyframes gg-pulse { 50% { opacity: .35; } }
#game-gate h1 {
  margin: 0 0 16px;
  color: #fff6e8;
  font: 800 clamp(24px, 4.4vw, 34px)/1.16 'Unbounded', 'Manrope', sans-serif;
  letter-spacing: -.01em;
}
#game-gate .gg-message {
  margin: 0 auto; max-width: 34em;
  color: #ffd9ab; white-space: pre-line; overflow-wrap: anywhere;
  font: 600 clamp(15px, 2.2vw, 18px)/1.55 var(--ui, 'Manrope', sans-serif);
}

@media (max-height: 520px) and (orientation: landscape) {
  #game-gate { padding-top: max(54px, var(--safe-t)); padding-bottom: max(12px, var(--safe-b)); }
  #game-gate .gg-card { padding: 54px 26px 18px; border-radius: 20px; }
  #game-gate .gg-header { margin-bottom: 10px; }
  #game-gate h1 { font-size: 21px; margin-bottom: 8px; }
  #game-gate .gg-message { font-size: 14px; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  #game-gate .gg-card, #game-gate .gg-badge::before, #game-gate .gg-badge::after { animation: none; }
}
