:root {
  --bg: #14181d; --panel: rgba(18, 22, 27, 0.78); --panel-solid: #1a1f25; --line: rgba(255, 255, 255, 0.09);
  --text: #ece8e1; --muted: #9a9890; --dim: #6b6a65;
  --def: #8fb5d8; --def-deep: #4d6a87; --atk: #e0ad6e; --atk-deep: #8c6a3e;
  --accent: #e3a25a; --danger: #e5634c; --ok: #8cc49a;
  --r: 14px; --u: clamp(9px, 1.05vmin + 4px, 14px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  font-family: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
b, em { font-style: normal; }

/* ---------- HUD */
.hud { position: fixed; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; z-index: 2; }
.hud .top { position: absolute; top: calc(10px + var(--safe-t)); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); display: flex; justify-content: center; }
.radar-wrap { position: absolute; left: 0; top: 0; width: clamp(92px, 17vmin, 150px); aspect-ratio: 1; border-radius: 50%; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25); }
#radar { width: 100%; height: 100%; display: block; }
.scorebar { pointer-events: auto; display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 10px;
  background: var(--panel); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px 7px; min-width: min(360px, 46vw); }
.scorebar .team { display: flex; align-items: center; gap: 8px; font-size: calc(var(--u) * 1.0); }
.scorebar .team.def { justify-content: flex-end; color: var(--def); }
.scorebar .team.atk { color: var(--atk); }
.scorebar .team b { font-size: calc(var(--u) * 1.9); font-weight: 750; color: var(--text); line-height: 1; }
.scorebar .tname { letter-spacing: 0.04em; font-weight: 600; opacity: 0.95; }
.scorebar .clock { display: flex; flex-direction: column; align-items: center; min-width: 66px; }
.scorebar #clock { font-size: calc(var(--u) * 1.75); font-weight: 700; line-height: 1; letter-spacing: 0.02em; }
.scorebar .phase { font-size: calc(var(--u) * 0.72); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-top: 3px; }
.scorebar.planted #clock { color: var(--danger); animation: pulse 1s infinite; }
.scorebar.planted .phase { color: var(--danger); }
.pips { display: flex; gap: 4px; }
.pips.def { grid-column: 1; justify-content: flex-end; } .pips.atk { grid-column: 3; }
.pips i { width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.pips.def i { color: var(--def); } .pips.atk i { color: var(--atk); }
.pips i.dead { opacity: 0.2; }
.feed { position: absolute; right: 0; top: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 38vw; }
.kf { display: flex; align-items: center; gap: 7px; font-size: calc(var(--u) * 0.92); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; white-space: nowrap; transition: opacity 0.8s; }
.kf.me { border-color: rgba(227, 162, 90, 0.55); }
.kf.old { opacity: 0; }
.kf .def { color: var(--def); font-weight: 600; } .kf .atk { color: var(--atk); font-weight: 600; }
.kf .wi svg { width: 34px; height: 13px; display: block; color: var(--text); opacity: 0.85; }
.kf .hs { color: var(--danger); font-size: 0.95em; }

.crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 6px; --len: 8px; --th: 2px; color: rgba(245, 245, 240, 0.95); filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.8)); }
.crosshair i { position: absolute; background: currentColor; transition: transform 0.06s linear; }
.crosshair .l, .crosshair .r { width: var(--len); height: var(--th); top: calc(var(--th) / -2); }
.crosshair .t, .crosshair .b { height: var(--len); width: var(--th); left: calc(var(--th) / -2); }
.crosshair .l { right: var(--gap); } .crosshair .r { left: var(--gap); }
.crosshair .t { bottom: var(--gap); } .crosshair .b { top: var(--gap); }
.crosshair .d { width: 2px; height: 2px; left: -1px; top: -1px; border-radius: 1px; }
.crosshair.sniper .l, .crosshair.sniper .r, .crosshair.sniper .t, .crosshair.sniper .b { opacity: 0.35; }
.hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
.hitmarker i { position: absolute; width: 10px; height: 2px; background: #fff; left: -5px; top: -1px; }
.hitmarker i:nth-child(1) { transform: rotate(45deg) translateX(11px); } .hitmarker i:nth-child(2) { transform: rotate(135deg) translateX(11px); }
.hitmarker i:nth-child(3) { transform: rotate(225deg) translateX(11px); } .hitmarker i:nth-child(4) { transform: rotate(315deg) translateX(11px); }
.hitmarker.show { opacity: 1; }
.hitmarker.head i { background: #ffd27a; }
.hitmarker.kill i { background: var(--danger); width: 14px; left: -7px; }
.dmgdirs { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dmgdir { position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; }
.dmgdir i { position: absolute; left: 50%; top: 0; width: 64px; height: 14px; margin-left: -32px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; border-top: 4px solid rgba(229, 99, 76, 0.9); }

.center-msg { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 6px); text-align: center; opacity: 0; transition: opacity 0.25s, transform 0.25s; padding: 10px 26px 12px; border-radius: 16px; background: rgba(14, 17, 21, 0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); white-space: nowrap; }
.center-msg.show { opacity: 1; transform: translate(-50%, 0); }
.center-msg .big { font-size: calc(var(--u) * 2.4); font-weight: 750; letter-spacing: 0.01em; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45); }
.center-msg .small { font-size: calc(var(--u) * 1.0); color: #d9d5cc; margin-top: 4px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.center-msg.win .big { color: var(--ok); } .center-msg.lose .big { color: #f0a08f; } .center-msg.warn .big { color: var(--danger); }
.usebar { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); width: min(300px, 50vw); text-align: center; font-size: calc(var(--u) * 0.9); color: #e8e4dc; }
.usebar .track { margin-top: 6px; height: 6px; background: rgba(0, 0, 0, 0.45); border-radius: 3px; overflow: hidden; }
.usebar .track i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.hint { position: absolute; left: 50%; bottom: calc(22% + var(--safe-b)); transform: translateX(-50%); font-size: calc(var(--u) * 0.92); color: #ebe6dc; background: rgba(18, 22, 27, 0.55); padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.hint:empty { display: none; }
.spectate { position: absolute; left: 50%; bottom: calc(15% + var(--safe-b)); transform: translateX(-50%); font-size: calc(var(--u) * 0.95); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }

.hud .bottom { position: absolute; left: calc(16px + var(--safe-l)); right: calc(16px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); display: flex; justify-content: space-between; align-items: flex-end; }
.vitals { display: flex; flex-direction: column; gap: 6px; }
.vitals .money { font-size: calc(var(--u) * 1.05); font-weight: 650; color: #d9c49b; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 4px 10px; align-self: flex-start; }
.vitals .row { display: flex; gap: 8px; }
.stat { display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 6px 12px 6px 10px; }
.stat svg { width: calc(var(--u) * 1.35); height: calc(var(--u) * 1.35); color: var(--muted); }
.stat b { font-size: calc(var(--u) * 2.0); font-weight: 720; line-height: 1; min-width: 2.2ch; }
.stat.hp svg { color: #e9e3d6; }
.stat.armor svg { color: var(--def); }
.stat.bomb { color: var(--accent); padding: 6px 9px; } .stat.bomb svg { color: var(--accent); }
#hp.low { color: var(--danger); }
.weapon { pointer-events: auto; text-align: right; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 7px 14px 8px; min-width: 150px; }
.weapon .wname { font-size: calc(var(--u) * 0.82); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.weapon .ammo { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
.weapon .ammo b { font-size: calc(var(--u) * 2.4); font-weight: 750; line-height: 1.05; }
.weapon .ammo b.low { color: var(--danger); }
.weapon .ammo span { color: var(--dim); } .weapon .ammo em { color: var(--muted); font-size: calc(var(--u) * 1.15); }
.weapon .slots { display: flex; justify-content: flex-end; gap: 6px; margin-top: 3px; }
.weapon .slots i { width: 44px; height: 16px; opacity: 0.35; } .weapon .slots i.cur { opacity: 0.95; }
.weapon .slots svg { width: 100%; height: 100%; color: var(--text); }

.scope { z-index: 1; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 0, transparent 34vmin, rgba(5, 6, 8, 0.97) 34.3vmin); }
.scope .ring { position: absolute; left: 50%; top: 50%; width: 68vmin; height: 68vmin; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6); }
.scope::before, .scope::after { content: ''; position: absolute; background: rgba(10, 10, 10, 0.85); }
.scope::before { left: 0; right: 0; top: 50%; height: 1px; } .scope::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at center, transparent 45%, rgba(190, 40, 30, 0.45)); }
.flash.hurt { animation: hurt 0.45s ease-out; }
@keyframes hurt { from { opacity: 1; } to { opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.55; } }
.toast { position: fixed; left: 50%; top: 18%; transform: translate(-50%, -6px); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-size: calc(var(--u) * 0.95); opacity: 0; transition: 0.2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- touch */
.touch { position: fixed; inset: 0; touch-action: none; z-index: 1; }
.stick { position: absolute; left: 0; top: 0; width: 120px; height: 120px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.22); background: rgba(20, 24, 29, 0.25);
  transform: translate(calc(70px + var(--safe-l)), calc(100vh - 210px)); opacity: 0.55; transition: opacity 0.15s; pointer-events: none; }
.stick.on { opacity: 1; transition: none; }
.knob { position: absolute; left: 36px; top: 36px; width: 48px; height: 48px; border-radius: 50%; background: rgba(236, 232, 225, 0.6); }
.tb { position: absolute; border: 1.5px solid rgba(255, 255, 255, 0.2); background: rgba(20, 24, 29, 0.45); border-radius: 50%; display: grid; place-items: center; color: #efebe3; padding: 0; touch-action: none; }
.tb svg { width: 46%; height: 46%; }
.tb.on { background: rgba(227, 162, 90, 0.45); border-color: rgba(227, 162, 90, 0.8); }
.tb.fire { width: 84px; height: 84px; right: calc(28px + var(--safe-r)); bottom: calc(108px + var(--safe-b)); background: rgba(160, 60, 45, 0.38); border-color: rgba(229, 99, 76, 0.55); }
.tb.fire2 { width: 62px; height: 62px; left: calc(24px + var(--safe-l)); top: 34%; background: rgba(160, 60, 45, 0.32); border-color: rgba(229, 99, 76, 0.5); }
.tb.jump { width: 56px; height: 56px; right: calc(124px + var(--safe-r)); bottom: calc(78px + var(--safe-b)); }
.tb.reload { width: 50px; height: 50px; right: calc(124px + var(--safe-r)); bottom: calc(150px + var(--safe-b)); }
.tb.scopeb { width: 56px; height: 56px; right: calc(40px + var(--safe-r)); bottom: calc(206px + var(--safe-b)); }
.tb.use { width: auto; height: 46px; border-radius: 23px; padding: 0 18px; right: calc(190px + var(--safe-r)); bottom: calc(118px + var(--safe-b)); font-size: 14px; font-weight: 650; background: rgba(227, 162, 90, 0.4); border-color: rgba(227, 162, 90, 0.8); }
.tb.buy { width: 48px; height: 48px; left: calc(50% - 24px); top: calc(88px + var(--safe-t)); font-size: 20px; font-weight: 700; color: #e9cf9c; }
.tb.menu { width: 38px; height: 38px; right: calc(12px + var(--safe-r)); top: calc(10px + var(--safe-t)); opacity: 0.85; }
.is-touch .hud .bottom { bottom: calc(8px + var(--safe-b)); }
.is-touch .weapon { margin-right: 0; }
.is-touch .feed { top: 46px; }
.is-touch .hud .top { right: calc(12px + var(--safe-r)); }

/* ---------- screens */
.screen { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 10; }
.screen.show { display: flex; }
.panel-screen { background: rgba(10, 12, 15, 0.45); }
.panel-screen.passive { pointer-events: none; background: transparent; }
.is-touch .panel-screen.passive { pointer-events: auto; }
#scr-title { background: linear-gradient(90deg, rgba(14, 17, 21, 0.9) 0%, rgba(14, 17, 21, 0.72) 40%, rgba(14, 17, 21, 0.05) 75%); justify-content: flex-start; padding-left: max(5vw, calc(var(--safe-l) + 16px)); }
.title-card { width: min(520px, 90vw); display: flex; flex-direction: column; gap: clamp(10px, 2.6vh, 22px); max-height: 100%; overflow: auto; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand .mark { width: clamp(44px, 8vh, 64px); height: clamp(44px, 8vh, 64px); color: var(--accent); border: 1.5px solid rgba(227, 162, 90, 0.4); border-radius: 14px; display: grid; place-items: center; }
.brand .mark svg { width: 70%; height: 70%; }
.brand h1 { margin: 0; font-size: clamp(34px, 9vh, 64px); font-weight: 820; letter-spacing: 0.14em; line-height: 1; }
.brand .sub { margin: 6px 0 0; color: var(--muted); font-size: clamp(12px, 2.2vh, 15px); letter-spacing: 0.02em; }
.pick .label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.16em; margin: 0 0 7px; }
.pick .label + .teams { margin-bottom: clamp(8px, 2vh, 16px); }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.teamcard { text-align: left; background: rgba(255, 255, 255, 0.04); border: 1.5px solid var(--line); border-radius: var(--r); padding: clamp(9px, 2vh, 14px) 14px; display: flex; flex-direction: column; gap: 4px; transition: border-color 0.15s, background 0.15s; }
.teamcard b { font-size: clamp(16px, 3vh, 20px); font-weight: 720; }
.teamcard span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.teamcard.def b { color: var(--def); } .teamcard.atk b { color: var(--atk); }
.teamcard.def.sel { border-color: var(--def); background: rgba(143, 181, 216, 0.1); }
.teamcard.atk.sel { border-color: var(--atk); background: rgba(224, 173, 110, 0.1); }
.seg { display: inline-flex; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.seg button { background: none; border: 0; padding: 7px 15px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.seg button.sel { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.btn { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); padding: 11px 22px; border-radius: 12px; font-size: 15px; font-weight: 600; transition: transform 0.1s, background 0.15s; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: #1b1610; border-color: transparent; }
.btn.primary:hover { background: #ecb06c; }
.btn.big { font-size: 18px; padding: 14px 30px; align-self: flex-start; min-width: 200px; letter-spacing: 0.02em; }
.btn:disabled { opacity: 0.5; }
.loading { margin: -6px 0 0; color: var(--dim); font-size: 13px; } .loading.done { display: none; }
.controls-hint { color: var(--dim); font-size: 12.5px; line-height: 1.5; max-width: 470px; }
.controls-hint.mob { display: none; } .is-touch .controls-hint.mob { display: block; } .is-touch .controls-hint.desk { display: none; }
.foot { color: var(--dim); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

.panel { background: rgba(20, 24, 29, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); max-height: calc(100% - 24px); overflow: auto; }
.panel header { display: flex; align-items: center; gap: 14px; padding: 14px 18px 10px; }
.panel h2 { margin: 0; font-size: 20px; font-weight: 720; letter-spacing: 0.02em; }
.panel .x { margin-left: auto; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 10px; }
.buy { width: min(860px, 94vw); }
.buy-money { color: #d9c49b; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.buy-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 4px 18px 10px; }
.item { text-align: left; background: rgba(255, 255, 255, 0.035); border: 1.5px solid var(--line); border-radius: 13px; padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 5px; transition: border-color 0.12s, background 0.12s, transform 0.1s; }
.item:hover { border-color: rgba(227, 162, 90, 0.6); background: rgba(227, 162, 90, 0.06); }
.item:active { transform: scale(0.98); }
.item .ih { display: flex; justify-content: space-between; align-items: center; }
.item .key { font-size: 11px; color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.item .cat { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; text-align: right; }
.item .icon { height: 34px; color: #d8d3c9; } .item .icon svg { width: 100%; height: 100%; }
.item .nm { font-size: 16px; font-weight: 700; }
.item .st { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.item .st i { height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; } .item .st b { display: block; height: 100%; background: #c9c3b6; }
.item .desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.item .price { margin-top: auto; padding-top: 4px; font-weight: 700; font-size: 15px; color: #d9c49b; font-variant-numeric: tabular-nums; }
.item.poor { opacity: 0.42; } .item.poor .price { color: var(--danger); }
.item.owned { border-color: rgba(140, 196, 154, 0.5); } .item.owned .price { color: var(--ok); }
.buy footer { display: flex; justify-content: space-between; padding: 6px 18px 14px; color: var(--muted); font-size: 12.5px; }
.buy footer .keys { color: var(--dim); }
.is-touch .buy footer .keys { display: none; }

.scoreboard { width: min(860px, 94vw); }
.sb-score { font-size: 22px; font-weight: 750; margin-left: auto; font-variant-numeric: tabular-nums; }
.sb-score .def { color: var(--def); } .sb-score .atk { color: var(--atk); }
.sb-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 18px 16px; }
.sbt .sbh { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 6px; border-bottom: 2px solid; }
.sbt.def .sbh { border-color: var(--def-deep); color: var(--def); } .sbt.atk .sbh { border-color: var(--atk-deep); color: var(--atk); }
.sbt .sbh span:first-child { font-weight: 720; font-size: 15px; } .sbt .sbh span:last-child { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.sbt table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.sbt th { font-size: 10.5px; color: var(--dim); font-weight: 600; text-align: right; padding: 6px 4px; }
.sbt th:first-child, .sbt td:first-child { text-align: left; }
.sbt td { padding: 5px 4px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.sbt tr.dead td { color: var(--dim); } .sbt tr.me td { color: #f3dcb6; font-weight: 650; }
.sbt .bm { font-size: 10px; color: var(--accent); border: 1px solid rgba(227, 162, 90, 0.5); border-radius: 4px; padding: 0 4px; margin-left: 4px; }

.pause { width: min(440px, 92vw); }
.settings { display: flex; flex-direction: column; gap: 12px; padding: 4px 18px 12px; }
.settings label { display: grid; grid-template-columns: 1fr 140px 44px; align-items: center; gap: 10px; font-size: 13.5px; color: #d8d4cb; }
.settings label.toggle { grid-template-columns: 1fr auto; }
.settings input[type=range] { width: 100%; accent-color: var(--accent); }
.settings input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.settings output { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.btns { display: flex; gap: 10px; padding: 6px 18px 18px; }
.end { width: min(520px, 92vw); text-align: center; padding: 22px 10px 6px; }
.end-kicker { color: var(--dim); text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; }
.end h2 { font-size: 42px; margin: 6px 0 4px; } .end h2.win { color: var(--ok); } .end h2.lose { color: #f0a08f; }
.end-score { font-size: 20px; font-weight: 700; display: flex; justify-content: center; gap: 10px; font-variant-numeric: tabular-nums; }
.end-score .def { color: var(--def); } .end-score .atk { color: var(--atk); } .end-score .sep { color: var(--dim); }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 12px 14px; }
.end-stats div { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; display: flex; flex-direction: column; gap: 2px; }
.end-stats b { font-size: 18px; } .end-stats span { font-size: 11px; color: var(--muted); }
.end .btns { justify-content: center; }

.rotate { display: none; position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 30; align-items: center; gap: 10px; background: var(--panel-solid); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; }
.rotate svg { width: 22px; height: 22px; color: var(--accent); }
.is-touch.portrait .rotate { display: flex; }

/* ---------- compact layouts (phones in landscape) */
@media (max-height: 500px) {
  .buy-grid { grid-template-columns: repeat(5, 1fr); gap: 7px; padding: 2px 12px 8px; }
  .item { padding: 7px 8px 8px; gap: 3px; } .item .st { grid-template-columns: 58px 1fr; font-size: 9.5px; } .item .icon { height: 22px; } .item .nm { font-size: 14px; }
  .item .desc { font-size: 10.5px; }
  .panel header { padding: 10px 14px 6px; } .panel h2 { font-size: 17px; }
  .buy footer { padding: 4px 14px 10px; }
  .sbt table { font-size: 12px; } .sbt td { padding: 3px 4px; }
  .weapon { min-width: 120px; padding: 5px 11px 6px; }
  .stat { padding: 4px 10px 4px 8px; }
  .title-card { gap: 10px; }
  .scorebar { padding: 4px 12px 5px; }
  .end h2 { font-size: 32px; } .end-stats { margin: 10px 12px 8px; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .buy-grid { grid-template-columns: repeat(2, 1fr); }
  .sb-tables { grid-template-columns: 1fr; }
  .feed { display: none; }
  .scorebar { min-width: 0; }
  #scr-title { background: rgba(14, 17, 21, 0.82); padding: 0 6vw; }
}
.tb.fire.on, .tb.fire2.on { background: rgba(229, 99, 76, 0.62); border-color: rgba(255, 150, 120, 0.9); }
