/* =====================================================================
   Dead Raid - UI stylesheet
   Design system: dark glass panels + film grain, amber accent, blood red
   danger/CTA, Bebas Neue display + Barlow Condensed body, crisp line icons.
   ===================================================================== */
/* metric-matched local fallbacks so tuned letter-spacing/line boxes survive when the web fonts can't load
   (offline / LAN party / slow phone networks): Impact ~ Bebas Neue, Arial Narrow ~ Barlow Condensed */
@font-face { font-family: 'Bebas Fallback'; src: local('Impact'), local('Haettenschweiler'), local('Arial Narrow Bold'); size-adjust: 88%; ascent-override: 98%; descent-override: 26%; line-gap-override: 0%; }
@font-face { font-family: 'Barlow Fallback'; src: local('Arial Narrow'), local('ArialNarrow'), local('Roboto Condensed'); size-adjust: 96%; ascent-override: 98%; descent-override: 24%; line-gap-override: 0%; }
:root {
  --bg: #07080a;
  --panel: rgba(13, 14, 17, .80);
  --panel-hi: rgba(28, 30, 35, .86);
  --line: rgba(255, 255, 255, .07);
  --line2: rgba(255, 255, 255, .15);
  --tx: #ece6da;
  --tx2: #c9c3b6;
  --dim: #948f84;
  --dim2: #5d5952;
  --beige: #d6cdb4;
  --acc: #e8a33a;
  --acc2: #ffc66b;
  --acc-a: rgba(232, 163, 58, .18);
  --gold: #e8b45a;
  --red: #d02a1d;
  --red2: #ff4a36;
  --blood: #8e1209;
  --chalk: #b3150c;
  --green: #7fd36a;
  --blue: #5aa8e6;
  --head: 'Bebas Neue', 'Bebas Fallback', Impact, 'Arial Narrow Bold', 'Arial Narrow', sans-serif;
  --body: 'Barlow Condensed', 'Barlow Fallback', 'Arial Narrow', 'Roboto Condensed', 'Helvetica Neue', Arial, sans-serif;
  --noiseD: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paint: #b3140f;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --pad: clamp(14px, 3vmin, 44px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: #000; color: var(--tx);
  font-family: var(--body); font-size: clamp(14px, 1.9vmin, 18px);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
  font-variant-numeric: tabular-nums;
}
body:has(#hud.on) { touch-action: none; }
input, select, textarea { user-select: text; -webkit-user-select: text; font-family: var(--body); }
button { font-family: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
b { font-weight: 700; }
img { -webkit-user-drag: none; user-select: none; }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; touch-action: none; outline: none; }

/* film grain over menus only (never over live gameplay) */
#grain { position: fixed; inset: -50%; z-index: 95; pointer-events: none; display: none; background-image: var(--noise); background-size: 180px; opacity: .07; mix-blend-mode: overlay; }
body:has(#menuBg.on) #grain, body:has(#gameover.on) #grain, body:has(#loading.on) #grain { display: block; animation: grain 1s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }

/* ---------------------------------------------------------------- shared surfaces */
.party, #yourLoadout, .wprev, .preset, .go-right, .setcard, .pz, .pp-card, #tooltip {
  --cb: rgba(232, 163, 58, .5);
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, rgba(26, 28, 33, .82), rgba(9, 10, 12, .88));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 18px 50px rgba(0, 0, 0, .45);
}
.party::before, #yourLoadout::before, .wprev::before, .go-right::before, .setcard::before, .pz::before, .pp-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--noise); background-size: 180px; opacity: .05;
}
.party::after, #yourLoadout::after, .wprev::after, .go-right::after, .setcard::after, .pz::after, .pp-card::after {
  content: ''; position: absolute; inset: -1px; pointer-events: none;
  background:
    linear-gradient(var(--cb), var(--cb)) 0 0 / 14px 1px, linear-gradient(var(--cb), var(--cb)) 0 0 / 1px 14px,
    linear-gradient(var(--cb), var(--cb)) 100% 0 / 14px 1px, linear-gradient(var(--cb), var(--cb)) 100% 0 / 1px 14px,
    linear-gradient(var(--cb), var(--cb)) 0 100% / 14px 1px, linear-gradient(var(--cb), var(--cb)) 0 100% / 1px 14px,
    linear-gradient(var(--cb), var(--cb)) 100% 100% / 14px 1px, linear-gradient(var(--cb), var(--cb)) 100% 100% / 1px 14px;
  background-repeat: no-repeat;
}

/* ---------------------------------------------------------------- screens */
.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: block; }
.menuscreen {
  z-index: 30; overflow: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--pad) + var(--sat)) calc(var(--pad) + var(--sar)) calc(var(--pad) + var(--sab)) calc(var(--pad) + var(--sal));
  touch-action: pan-x pan-y;
  scrollbar-width: thin; scrollbar-color: rgba(232,163,58,.35) transparent;
}
.menuscreen.on { animation: screenIn .45s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.menuscreen::-webkit-scrollbar { width: 6px; height: 6px; }
.menuscreen::-webkit-scrollbar-thumb { background: rgba(232,163,58,.3); }
#loadout, #tree, #settings { background: linear-gradient(90deg, rgba(5,6,8,.9), rgba(5,6,8,.72) 55%, rgba(5,6,8,.55)); }
#settings { z-index: 60; }

#menuBg {
  position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  transition: opacity .6s ease;
  background:
    radial-gradient(ellipse 60% 50% at 18% 108%, rgba(160, 24, 12, .32), transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 0%, rgba(232, 163, 58, .08), transparent 70%),
    radial-gradient(ellipse at 62% 42%, rgba(0,0,0,0) 0%, rgba(0,0,0,.4) 55%, rgba(0,0,0,.94) 100%),
    linear-gradient(90deg, rgba(5,6,8,.94) 0%, rgba(5,6,8,.62) 36%, rgba(5,6,8,.2) 66%, rgba(5,6,8,.6) 100%);
}
/* (no scanline overlay: the menu scene carries its own fine film grain) */
#menuBg.on { opacity: 1; }
/* phones (landscape): the 3D scene puts its vanishing point / doorway in the strip above the panels, so the
   clear hole of the vignette follows it there instead of sitting behind the PARTY panel */
@media (max-height: 520px) and (orientation: landscape) {
  #menuBg { background:
    radial-gradient(ellipse 60% 50% at 18% 108%, rgba(160, 24, 12, .28), transparent 70%),
    radial-gradient(ellipse 55% 70% at 42% 12%, rgba(0,0,0,0) 0%, rgba(0,0,0,.3) 55%, rgba(0,0,0,.85) 100%),
    linear-gradient(180deg, rgba(5,6,8,0) 0%, rgba(5,6,8,.15) 30%, rgba(5,6,8,.5) 100%); }
}

/* ---------------------------------------------------------------- generic controls */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 42px; padding: 8px 18px; border: 1px solid var(--line2); border-radius: 2px;
  background: linear-gradient(180deg, rgba(48, 50, 56, .85), rgba(26, 27, 31, .9)); color: var(--tx); cursor: pointer;
  font-family: var(--head); font-size: 1.25rem; letter-spacing: .1em; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 4px 14px rgba(0,0,0,.3);
  transition: background .18s, color .18s, border-color .18s, transform .12s, box-shadow .18s;
}
.btn:hover:not(:disabled) { border-color: rgba(232,163,58,.6); color: #fff; background: linear-gradient(180deg, rgba(70, 60, 44, .9), rgba(36, 31, 25, .95)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 18px rgba(232,163,58,.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: default; }
.btn.sm { min-height: 30px; padding: 5px 12px; font-size: 1rem; }
.btn.wide { width: 100%; }
.bic { width: 1.05em; height: 1.05em; flex: none; }

.done {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-width: 180px; min-height: 52px; padding: 10px 38px; margin-top: 22px;
  border: 0; border-radius: 2px; cursor: pointer; color: #1a1206;
  background: linear-gradient(180deg, var(--acc2), var(--acc) 55%, #c9821f);
  font-family: var(--head); font-size: 1.85rem; letter-spacing: .1em; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 28px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.4);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  transition: filter .18s, transform .12s, box-shadow .18s;
}
.done::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); transition: left .5s var(--ease); }
.done:hover { filter: brightness(1.08); transform: translateY(-1px); }
.done:hover::after { left: 130%; }
.done:active { transform: translateY(1px); }
.done.big { width: 100%; min-height: 62px; font-size: 1.85rem; margin: 18px 0 10px; white-space: nowrap; padding-left: 16px; padding-right: 16px; }
.done .bic { width: .8em; height: .8em; }

.lnk { background: none; border: 0; padding: 4px 2px; cursor: pointer; color: var(--acc); font-family: var(--head); font-size: 1.05rem; letter-spacing: .16em; transition: color .15s; }
.lnk:hover { color: var(--acc2); }

.gold { color: var(--gold); }
.dim { color: var(--dim2); }
.red { color: var(--red2) !important; }
.green { color: var(--green); }

/* menu items (lobby + pause) */
.mi {
  position: relative; display: flex; align-items: center; gap: .55em; width: 100%; max-width: 400px;
  padding: .3em .7em .24em .55em; margin: 0 0 3px; border: 0; border-radius: 0;
  background: transparent; color: rgba(236, 230, 218, .82); cursor: pointer; text-align: left;
  font-family: var(--head); font-size: clamp(1.55rem, 4vmin, 2.45rem); letter-spacing: .05em; line-height: 1;
  transition: background .22s var(--ease), color .2s, transform .22s var(--ease);
  animation: miIn .5s var(--ease) both;
}
#menuItems .mi:nth-child(2) { animation-delay: .04s; } #menuItems .mi:nth-child(3) { animation-delay: .08s; }
#menuItems .mi:nth-child(4) { animation-delay: .12s; } #menuItems .mi:nth-child(5) { animation-delay: .16s; } #menuItems .mi:nth-child(6) { animation-delay: .2s; }
@keyframes miIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.mi::before { content: ''; position: absolute; left: 0; top: 12%; bottom: 12%; width: 3px; background: var(--acc); transform: scaleY(0); transition: transform .22s var(--ease); box-shadow: 0 0 12px rgba(232,163,58,.7); }
.mi .mic { width: .62em; height: .62em; flex: none; opacity: .6; transition: opacity .2s, color .2s; }
.mi .mt { display: flex; flex-direction: column; min-width: 0; }
.mi small { font-family: var(--body); font-size: .36em; letter-spacing: .14em; text-transform: uppercase; opacity: .55; font-weight: 600; margin-top: .25em; line-height: 1; }
.mi:hover:not(.primary), .mi:focus-visible:not(.primary) { background: linear-gradient(90deg, rgba(232,163,58,.16), rgba(232,163,58,0) 85%); color: #fff; transform: translateX(6px); outline: none; }
.mi:hover::before, .mi:focus-visible::before { transform: scaleY(1); }
.mi:hover .mic, .mi:focus-visible .mic { opacity: 1; color: var(--acc); }
.mi.primary {
  overflow: hidden; color: #fff; padding: .4em .9em .32em .6em; margin-bottom: 10px;
  background: linear-gradient(90deg, #a8170e, #d02a1d 55%, #b81f14);
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  text-shadow: 0 2px 6px rgba(60,0,0,.6);
}
.mi.primary .mic { opacity: 1; color: #fff; }
.mi.primary::before { display: none; }
.mi.primary::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent); transform: skewX(-20deg); animation: sheen 4.5s ease-in-out infinite 1s; }
@keyframes sheen { 0%, 70% { left: -40%; } 100% { left: 130%; } }
.mi.primary:hover, .mi.primary:focus-visible { background: linear-gradient(90deg, #c01d12, #ec3a2a 55%, #c8261b); transform: translateX(4px); }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em; height: 1.5em; padding: 0 .35em; margin-left: auto;
  background: var(--acc); color: #1a1206; border-radius: 2px;
  font-family: var(--head); font-style: normal; font-size: .5em; letter-spacing: 0; line-height: 1;
  box-shadow: 0 0 14px rgba(232,163,58,.55); animation: pulseGlow 1.8s ease-in-out infinite;
}
@keyframes pulseGlow { 50% { box-shadow: 0 0 4px rgba(232,163,58,.2); } }

/* header (level / bank) */
.prof { display: flex; align-items: center; gap: 14px; justify-content: flex-end; flex-wrap: wrap; }
.lvbadge { position: relative; width: 44px; height: 48px; flex: none; display: flex; align-items: center; justify-content: center; }
.lvbadge svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(232,163,58,.14); stroke: var(--acc); stroke-width: 2; filter: drop-shadow(0 0 8px rgba(232,163,58,.35)); }
.lvbadge b { position: relative; font-family: var(--head); font-weight: 400; font-size: 1.6rem; line-height: 1; color: #fff; margin-top: 2px; }
.prof .lvlbar { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.prof .lvlbar span { display: flex; justify-content: space-between; gap: 10px; font-size: .72rem; letter-spacing: .14em; color: var(--dim); font-weight: 600; }
.prof .lvlbar em { font-style: normal; color: var(--tx); font-weight: 700; }
.prof .lvlbar i { display: block; height: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.prof .lvlbar i b { display: block; height: 100%; background: linear-gradient(90deg, #b8761c, var(--acc2)); box-shadow: 0 0 8px rgba(232,163,58,.7); transition: width .6s var(--ease); }
.prof .bank { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--head); font-size: clamp(1.4rem, 3vmin, 1.95rem); color: var(--acc2); letter-spacing: .04em; line-height: .95; padding: 6px 12px 5px; border: 1px solid rgba(232,163,58,.3); background: linear-gradient(180deg, rgba(232,163,58,.1), rgba(0,0,0,.35)); }
.prof .bank small { font-family: var(--body); font-size: .62rem; font-weight: 700; letter-spacing: .24em; color: var(--dim); }

.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: clamp(12px, 2.5vmin, 28px); padding-bottom: 12px; border-bottom: 1px solid var(--line); position: relative; }
.topbar::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 120px; height: 2px; background: var(--acc); box-shadow: 0 0 10px rgba(232,163,58,.6); }
.topbar h1 { margin: 0; font-family: var(--head); font-weight: 400; font-size: clamp(2.6rem, 8vmin, 5.2rem); letter-spacing: .03em; line-height: .9; color: var(--tx); text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.topbar h1 .gold { color: var(--acc); }

/* shared footer bar (loadout / skills / settings): key hint left, actions right; sticks to the bottom when scrolling */
#loadout.on, #tree.on { display: flex; flex-direction: column; }
.sfoot {
  flex: none; position: sticky; z-index: 3; bottom: calc(-1 * (var(--pad) + var(--sab))); margin: auto calc(-1 * var(--pad)) calc(-1 * (var(--pad) + var(--sab)));
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px var(--pad) calc(12px + var(--sab));
  background: linear-gradient(180deg, rgba(8,9,11,.7), rgba(5,6,8,.94)); border-top: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sfoot::before { content: ''; position: absolute; left: var(--pad); top: -1px; width: 120px; height: 2px; background: var(--acc); box-shadow: 0 0 10px rgba(232,163,58,.6); }
.sf-keys { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-size: 1.1rem; letter-spacing: .16em; color: var(--tx2); }
.sf-keys kbd, kbd.k { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 26px; padding: 0 7px; background: linear-gradient(180deg, #2a2b31, #1b1c21); border: 1px solid rgba(255,255,255,.16); border-bottom: 3px solid rgba(0,0,0,.6); border-radius: 3px; font-family: var(--head); font-size: .95rem; letter-spacing: .08em; color: #fff; }
.sf-hint { flex: 1 1 260px; font-size: .9rem; color: var(--dim); letter-spacing: .04em; }
.sf-hint b { color: var(--tx); font-weight: 700; }
.sf-hint b.gold { color: var(--acc2); }
.sf-act { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.sfoot .done { margin-top: 0; min-height: 48px; }
.sfoot .btn { min-height: 48px; }
@media (pointer: coarse) { .sf-keys { display: none; } }

/* painted round marker (HUD, round announcement, pause, game over) */
/* (tally stroke colours, #hRound and paint-filter rules live in the single "ROUND MARKER" block at the end of this file) */
.tally { display: block; width: auto; overflow: visible; }
.rdig {
  display: block; font-family: var(--head); font-weight: 400; line-height: .84; letter-spacing: .02em;
  color: transparent; -webkit-text-fill-color: transparent;
  background: var(--noiseD) 0 0 / 90px, linear-gradient(176deg, #d8291a, var(--paint) 45%, #7c0b06);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 1px rgba(70,4,2,.55);
}
.paint { filter: url(#paint) drop-shadow(0 0 12px rgba(160,0,0,.45)) drop-shadow(0 1px 0 rgba(0,0,0,.95)); }

/* ================================================================ LOBBY */
#menu {
  display: none; grid-template-columns: minmax(280px, 1fr) minmax(300px, 430px);
  grid-template-rows: 1fr auto; grid-template-areas: "left right" "chat right";
  column-gap: clamp(20px, 4vw, 60px); row-gap: 16px;
}
#menu.on { display: grid; }
.m-left { grid-area: left; display: flex; flex-direction: column; min-width: 0; }
.m-right { grid-area: right; display: flex; flex-direction: column; gap: 14px; min-width: 0; animation: screenIn .6s var(--ease) both .1s; }
.m-logo { display: flex; align-items: center; gap: 12px; font-family: var(--head); font-size: clamp(1.05rem, 2.6vmin, 1.5rem); letter-spacing: .34em; color: var(--tx2); line-height: 1; }
.m-logo span { font-family: var(--body); font-size: .5em; font-weight: 700; letter-spacing: .3em; color: var(--dim); padding-left: 12px; border-left: 1px solid var(--line2); }
.m-cube { position: relative; width: 22px; height: 22px; flex: none; transform: rotate(45deg) skew(-8deg, -8deg); }
.m-cube b { position: absolute; width: 10px; height: 10px; background: var(--red); box-shadow: 0 0 10px rgba(208,42,29,.6); }
.m-cube b:nth-child(1) { left: 0; top: 0; } .m-cube b:nth-child(2) { right: 0; top: 0; background: var(--acc); box-shadow: 0 0 10px rgba(232,163,58,.5); } .m-cube b:nth-child(3) { left: 0; bottom: 0; background: #6b120c; }
.m-title {
  margin: .05em 0 0 -.02em; font-family: var(--head); font-weight: 400; font-size: clamp(3.6rem, 15vmin, 9.5rem); line-height: .82; letter-spacing: .02em;
  color: var(--chalk); filter: url(#chalk) drop-shadow(0 0 22px rgba(190, 20, 10, .35));
  animation: titleIn 1.1s var(--ease) both;
}
@keyframes titleIn { from { opacity: 0; letter-spacing: .14em; } to { opacity: 1; letter-spacing: .02em; } }
.m-sub { display: flex; align-items: center; gap: 12px; margin: 6px 0 clamp(12px, 3.4vmin, 32px); }
.m-sub span { font-family: var(--head); font-size: clamp(1.1rem, 2.6vmin, 1.5rem); letter-spacing: .28em; color: var(--acc); padding: 2px 10px 1px; border: 1px solid rgba(232,163,58,.35); background: rgba(232,163,58,.08); }
.m-sub em { font-style: normal; font-size: .72rem; font-weight: 700; letter-spacing: .24em; color: var(--dim); white-space: nowrap; }
.m-sub::after { content: ''; flex: 0 1 160px; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
#menuItems { display: flex; flex-direction: column; }
.namefield { display: flex; align-items: center; gap: 12px; margin-top: clamp(12px, 3vmin, 26px); max-width: 400px; }
.namefield span { font-size: .72rem; letter-spacing: .24em; color: var(--dim); font-weight: 700; }
.namefield input, #joinCode, #chatInput {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 2px;
  background: rgba(0,0,0,.5); color: var(--tx); outline: none;
  font-family: var(--head); font-size: 1.3rem; letter-spacing: .08em;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.5);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.namefield input:hover, #joinCode:hover { border-color: rgba(255,255,255,.28); }
.namefield input:focus, #joinCode:focus, #chatInput:focus { border-color: var(--acc); background: rgba(0,0,0,.7); box-shadow: inset 0 2px 8px rgba(0,0,0,.5), 0 0 0 3px rgba(232,163,58,.15); }
#menuStats { position: relative; margin-top: auto; max-width: 520px; padding: 12px 14px 12px; background: linear-gradient(180deg, rgba(22,23,27,.78), rgba(8,9,11,.82)); border: 1px solid var(--line); border-top: 2px solid rgba(232,163,58,.55); box-shadow: 0 18px 50px rgba(0,0,0,.45); animation: screenIn .6s var(--ease) both .25s; }
.ms-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.ms-h h4 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 1.25rem; letter-spacing: .16em; color: var(--tx); }
.ms-h span, .ms-next span, .ms-next em { font-style: normal; font-size: .62rem; font-weight: 700; letter-spacing: .2em; color: var(--dim); }
.ms-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ms { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px 7px 8px; background: rgba(0,0,0,.35); border: 1px solid var(--line); min-width: 0; }
.ms .msi { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--acc); opacity: .85; }
.ms b { font-family: var(--head); font-weight: 400; font-size: 1.7rem; line-height: 1; color: #fff; }
.ms span { font-size: .6rem; letter-spacing: .18em; color: var(--dim); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-next { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 10px; }
.ms-next i { display: block; height: 4px; background: rgba(255,255,255,.1); }
.ms-next i b { display: block; height: 100%; background: linear-gradient(90deg, #b8761c, var(--acc2)); box-shadow: 0 0 8px rgba(232,163,58,.6); }
.ms-next em { color: var(--acc2); }

#menuHeader { min-height: 48px; }
.party { padding: 14px 16px 16px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.party-h { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.party-h h3 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 1.9rem; letter-spacing: .1em; line-height: 1; }
#partyCount { font-family: var(--head); font-size: 1.3rem; color: var(--acc); letter-spacing: .08em; }
#partyInfo { font-size: .92rem; color: var(--dim); line-height: 1.35; margin-bottom: 10px; }
#partyInfo .code { display: inline-block; padding: 1px 9px; margin: 0 2px; background: var(--acc); color: #1a1206; font-family: var(--head); font-size: 1.15rem; letter-spacing: .14em; cursor: pointer; border-radius: 2px; transition: background .15s; }
#partyInfo .code:hover { background: var(--acc2); }
#partyList { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.pm { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); border-left: 2px solid var(--beige); animation: miIn .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.pm.me { border-left-color: var(--acc); background: linear-gradient(90deg, rgba(232,163,58,.13), rgba(232,163,58,.02)); }
.pav { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 1.15rem; color: #1a1206; background: linear-gradient(135deg, var(--acc2), #b8761c); box-shadow: inset -4px -4px 0 rgba(0,0,0,.22), inset 4px 4px 0 rgba(255,255,255,.18); image-rendering: pixelated; }
.pm .pn { flex: 1; min-width: 0; font-family: var(--head); font-size: 1.3rem; letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; background: rgba(255,255,255,.04); font-family: var(--body); font-size: 10px; font-weight: 700; letter-spacing: .12em; line-height: 1; color: var(--tx2); white-space: nowrap; }
.pill.acc { border-color: rgba(232,163,58,.6); background: rgba(232,163,58,.14); color: var(--acc2); }
.pill.ok { border-color: rgba(127,211,106,.5); color: var(--green); }
.pill.off { color: var(--dim); border-style: dashed; }
.pm.empty { border-left: 2px dashed rgba(255,255,255,.12); background: rgba(255,255,255,.015); opacity: .55; }
.pm.empty .pav { background: transparent; color: var(--dim); border: 1px dashed rgba(255,255,255,.2); box-shadow: none; }
.pm.empty .pn { font-size: 1rem; color: var(--dim); letter-spacing: .16em; }
#partyActions { display: flex; flex-direction: column; gap: 8px; }
#partyActions:empty { display: none; }
.joinrow { display: flex; gap: 8px; }
#joinCode { text-transform: uppercase; letter-spacing: .3em; }
#yourLoadout { padding: 12px 16px 14px; font-size: .9rem; color: var(--dim); line-height: 1.4; }
.yl-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
#yourLoadout h4 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 1.3rem; letter-spacing: .12em; color: var(--tx); }
.yl-body { display: flex; align-items: center; gap: 14px; }
.yl-body img { width: 120px; aspect-ratio: 2 / 1; object-fit: contain; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.7)); }
.yl-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.yl-w { font-family: var(--head); font-weight: 400; font-size: 1.5rem; letter-spacing: .05em; color: #fff; line-height: 1; }
.yl-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.yl-chips span { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; background: rgba(232,163,58,.12); color: var(--acc2); border: 1px solid rgba(232,163,58,.25); }
.yl-chips span.none { background: transparent; border-color: var(--line); color: var(--dim); }
.yl-info small { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 600; }

#chatRow { grid-area: chat; align-self: end; max-width: 560px; width: 100%; }
#chatLog { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; max-height: 9.5em; overflow: hidden; justify-content: flex-end; }
.cl { font-size: .92rem; line-height: 1.3; color: var(--tx); text-shadow: 0 1px 3px #000; animation: clIn .25s ease; word-break: break-word; }
.cl b { color: var(--acc); font-weight: 700; }
@keyframes clIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.chatbar { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.6); border: 1px solid var(--line); padding: 4px 4px 4px 12px; }
.chatbar .lab { font-family: var(--head); font-size: 1.1rem; letter-spacing: .14em; color: var(--acc); }
.chatbar #chatInput { border: 0; background: transparent; height: 32px; font-family: var(--body); font-size: 1rem; letter-spacing: .02em; box-shadow: none; }
.chatbar #chatInput:focus { background: rgba(255,255,255,.04); box-shadow: none; }
.chatbar .hint { font-size: .7rem; font-weight: 700; letter-spacing: .16em; color: var(--dim2); padding: 4px 8px; border: 1px solid var(--line2); border-radius: 2px; }

#menuToast {
  position: fixed; left: 50%; bottom: calc(28px + var(--sab)); transform: translate(-50%, 12px);
  padding: 10px 20px; background: rgba(12,13,15,.95); border: 1px solid var(--line2); border-left: 3px solid var(--acc);
  font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); z-index: 5; white-space: nowrap;
}
#menuToast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- profile mode switch (co-op / offline single player) ---- */
.modesw { display: flex; gap: 0; margin-bottom: 14px; max-width: 400px; padding: 3px; background: rgba(0,0,0,.45); border: 1px solid var(--line); }
.modesw button { flex: 1; background: transparent; border: 0; color: var(--dim); font-family: var(--head); font-size: clamp(16px, 2.2vmin, 21px); letter-spacing: .08em; padding: .42em .7em .38em; cursor: pointer; text-align: left; line-height: 1; transition: background .2s, color .2s; }
.modesw button small { display: block; font-family: var(--body); font-size: .56em; font-weight: 600; letter-spacing: .12em; opacity: .65; margin-top: 2px; text-transform: uppercase; }
.modesw button.on { color: #fff; background: linear-gradient(180deg, rgba(232,163,58,.22), rgba(232,163,58,.08)); box-shadow: inset 0 -2px 0 var(--acc); }
.modesw button:hover:not(.on) { color: var(--tx); background: rgba(255,255,255,.04); }

/* ================================================================ LOADOUT */
.lo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: clamp(16px, 3vw, 40px); align-items: start; }
.lo-main { min-width: 0; counter-reset: sec; }
.lo-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.row { margin-bottom: clamp(12px, 2.4vmin, 22px); }
.rowlab { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; counter-increment: sec; }
.rowlab h3 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 1.5rem; letter-spacing: .12em; line-height: 1; color: var(--tx); }
.rowlab h3::before { content: counter(sec, decimal-leading-zero); font-size: .7em; color: var(--acc); margin-right: 8px; letter-spacing: .05em; vertical-align: .15em; }
.rowlab small { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  position: relative; width: 116px; height: 112px; padding: 8px 6px 7px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
  background: linear-gradient(180deg, rgba(30, 32, 37, .9), rgba(14, 15, 18, .92)); border: 1px solid var(--line); border-radius: 2px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: background .18s, border-color .18s, transform .18s var(--ease), opacity .18s, box-shadow .18s;
}
.tile:hover { border-color: rgba(232,163,58,.55); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.45), inset 0 0 22px rgba(232,163,58,.08); }
.tile img { width: 100%; height: 52px; object-fit: contain; margin-bottom: auto; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); }
.tile svg { width: 44px; height: 44px; color: #b9b5ab; margin: 3px auto auto; display: block; transition: color .18s; }
.tile:hover svg { color: #fff; }
.tile img[src^="icons/"] { width: 54px; height: 54px; }
.tile .tn { width: 100%; text-align: center; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.05; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tp { font-size: .66rem; font-weight: 700; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.tile .tp.price, .price { color: var(--acc2); }
.tile.eq { border-color: var(--acc); background: linear-gradient(180deg, rgba(232,163,58,.24), rgba(232,163,58,.06) 70%, rgba(14,15,18,.9)); box-shadow: 0 0 0 1px rgba(232,163,58,.35), 0 0 22px rgba(232,163,58,.18), inset 0 1px 0 rgba(255,255,255,.1); }
.tile.eq .tp { color: var(--acc2); }
.tile.eq svg { color: var(--acc2); }
.tile.eq::after { content: ''; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 18px 18px 0; border-color: transparent var(--acc) transparent transparent; }
.tile.locked { opacity: .4; filter: grayscale(.8); }
.tile.locked:hover { opacity: .65; }

.wlist { display: flex; flex-wrap: wrap; gap: 6px; }
.wpick {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px;
  background: linear-gradient(180deg, rgba(30, 32, 37, .9), rgba(14, 15, 18, .92)); border: 1px solid var(--line); border-radius: 2px; cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s var(--ease);
}
.wpick:hover { border-color: rgba(232,163,58,.5); transform: translateY(-1px); }
.wpick img { width: 58px; height: 29px; object-fit: contain; }
.wpick span { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.wpick i { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--acc); color: #1a1206; font-style: normal; font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 8px rgba(232,163,58,.6); }
.wpick.on { border-color: var(--acc); background: linear-gradient(180deg, rgba(232,163,58,.24), rgba(232,163,58,.07)); color: #fff; box-shadow: 0 0 16px rgba(232,163,58,.18); }

.wprev { padding: 14px 16px 16px; overflow: hidden; }
.wprev img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,0,.75)); background: radial-gradient(ellipse at center 60%, rgba(232,163,58,.12), transparent 65%); }
.wprev h2 { margin: 4px 0 0; font-family: var(--head); font-weight: 400; font-size: 2.3rem; letter-spacing: .05em; line-height: 1; }
.wprev > small { display: block; font-size: .74rem; letter-spacing: .16em; color: var(--acc); font-weight: 700; margin-bottom: 12px; }
.stat { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 10px; margin: 7px 0; }
.stat span { font-size: .72rem; font-weight: 700; letter-spacing: .12em; color: var(--dim); }
.stat i { position: relative; display: block; height: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.stat i::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(9,10,12,.9) calc(10% - 2px) 10%); }
.stat i b { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #a8a296, #f2ece0); transition: width .4s var(--ease); }
.stat i u { position: absolute; top: 0; bottom: 0; text-decoration: none; }
.stat i u.up { background: var(--green); box-shadow: 0 0 8px rgba(127,211,106,.7); }
.stat i u.dn { background: var(--red2); }
.ph { margin: 8px 0 0; font-family: var(--head); font-weight: 400; font-size: 1.45rem; letter-spacing: .14em; }
.preset { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "pt pb" "pd pb"; gap: 2px 10px; align-items: center; padding: 9px 12px; border-left: 2px solid rgba(232,163,58,.4); }
.preset .pt { grid-area: pt; font-family: var(--head); font-size: 1.2rem; letter-spacing: .1em; line-height: 1; }
.preset .pd { grid-area: pd; font-size: .8rem; color: var(--dim); line-height: 1.2; }
.preset .pb { grid-area: pb; display: flex; flex-direction: column; gap: 4px; }

/* pixel-art weapon sprites (re-drawn from the 3D render by ui.js) */
.wimg { image-rendering: pixelated; image-rendering: crisp-edges; transition: opacity .2s; }
.wimg:not(.px) { opacity: 0; }

/* ---- armory v2: two columns, class tabs, slot row; fits 1600x900 without scrolling ---- */
.ar-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 640px); gap: clamp(16px, 2.6vw, 40px); align-items: start; }
.ar-left, .ar-right { min-width: 0; display: flex; flex-direction: column; }
.sech { display: flex; align-items: baseline; gap: 12px; margin: 0 0 8px; }
.sech:not(:first-child) { margin-top: clamp(10px, 2.2vmin, 20px); }
.sech h3 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 1.45rem; letter-spacing: .12em; line-height: 1; color: var(--tx); }
.sech h3 em { font-style: normal; font-size: .7em; color: var(--acc); margin-right: 8px; letter-spacing: .05em; vertical-align: .15em; }
.sech small { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.ar-right .sech small { margin-left: auto; color: var(--acc2); }
/* spawn weapon chips */
.starters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stc { position: relative; display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 10px 6px 6px; text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 2px; background: linear-gradient(180deg, rgba(30,32,37,.9), rgba(14,15,18,.92)); color: var(--tx); transition: border-color .18s, background .18s, transform .18s var(--ease); }
.stc .wimg { grid-row: 1 / 3; width: 64px; height: 32px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)); }
.stc .stn { font-family: var(--head); font-size: 1.15rem; letter-spacing: .05em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stc .stp { display: inline-flex; align-items: center; gap: 4px; font-size: .64rem; font-weight: 700; letter-spacing: .14em; color: var(--acc2); }
.stc .stp.no { color: #ff7a62; }
.sti { width: 11px; height: 11px; flex: none; }
.stc:hover { border-color: rgba(232,163,58,.55); transform: translateY(-2px); }
.stc.eq { border-color: var(--acc); background: linear-gradient(180deg, rgba(232,163,58,.22), rgba(232,163,58,.05)); box-shadow: 0 0 18px rgba(232,163,58,.15); }
.stc.locked { opacity: .5; }
.stc.locked .wimg { filter: grayscale(1) brightness(.6); }
.stc.locked .stp { color: var(--dim); }
/* class tabs */
.ctabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line2); margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.ctab { position: relative; flex: none; display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px 9px; border: 0; background: transparent; cursor: pointer; color: var(--dim); font-family: var(--head); font-size: 1.25rem; letter-spacing: .1em; line-height: 1; transition: color .18s, background .18s; }
.ctab small { font-family: var(--body); font-size: .62rem; font-weight: 700; letter-spacing: .1em; opacity: .7; }
.ctab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--acc); transform: scaleX(0); transition: transform .22s var(--ease); box-shadow: 0 0 10px rgba(232,163,58,.7); }
.ctab::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 2px; background: var(--c); vertical-align: .2em; opacity: .7; }
.ctab:hover { color: var(--tx); background: rgba(255,255,255,.03); }
.ctab.on { color: #fff; background: linear-gradient(180deg, rgba(232,163,58,0), rgba(232,163,58,.1)); }
.ctab.on::after { transform: scaleX(1); }
/* weapon cards */
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wcard { position: relative; height: clamp(112px, 15.5vh, 140px); display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 2px; padding: 8px 10px 8px; text-align: left; cursor: pointer; overflow: hidden; color: var(--tx); border: 1px solid var(--line); border-radius: 2px; background: radial-gradient(ellipse 80% 70% at 50% 30%, rgba(255,255,255,.05), transparent 70%), linear-gradient(180deg, rgba(30,32,37,.92), rgba(12,13,16,.95)); transition: border-color .18s, transform .18s var(--ease), box-shadow .18s; }
.wcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--c); opacity: .55; }
.wcard .wimg { position: absolute; left: 8%; top: 8px; width: 84%; height: calc(100% - 56px); object-fit: contain; filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)); transition: transform .25s var(--ease); }
.wcard .wcn { position: relative; font-family: var(--head); font-size: 1.3rem; letter-spacing: .05em; line-height: 1; }
.wcard .wcs { position: relative; font-family: var(--head); font-size: .95rem; letter-spacing: .04em; color: var(--tx2); line-height: 1; white-space: nowrap; }
.wcard .wcs small { font-family: var(--body); font-size: .55rem; font-weight: 700; letter-spacing: .12em; color: var(--dim); margin: 0 6px 0 2px; }
.wca { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 4px; display: flex; align-items: center; justify-content: center; background: var(--acc); color: #1a1206; font-style: normal; font-size: .7rem; font-weight: 700; border-radius: 2px; }
.wcard.spawn::after { content: 'SPAWN'; position: absolute; top: 7px; left: 10px; font-size: .55rem; font-weight: 700; letter-spacing: .18em; color: var(--acc2); }
.wcard:hover { border-color: rgba(232,163,58,.5); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.wcard:hover .wimg { transform: scale(1.06); }
.wcard.on { border-color: var(--acc); background: radial-gradient(ellipse 80% 70% at 50% 30%, rgba(232,163,58,.2), transparent 70%), linear-gradient(180deg, rgba(48,38,22,.95), rgba(14,13,12,.96)); box-shadow: 0 0 0 1px rgba(232,163,58,.35), 0 0 24px rgba(232,163,58,.15); }
/* presets */
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.presets .preset { grid-template-columns: 1fr; grid-template-areas: "pt" "pd" "pb"; padding: 8px 10px; }
.presets .preset .pb { flex-direction: row; margin-top: 4px; }
.presets .preset .pb .btn { flex: 1; padding: 4px 8px; }
.ar-left > .done { align-self: flex-start; }
/* preview */
.ar-right .wprev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px; align-items: center; padding: 14px 16px; }
.wp-art { position: relative; align-self: stretch; display: flex; align-items: center; justify-content: center; min-height: clamp(170px, 30vh, 280px); background: radial-gradient(ellipse 60% 45% at 50% 55%, color-mix(in srgb, var(--c, #e8a33a) 30%, transparent), transparent 70%), repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 16px), repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 16px); border: 1px solid var(--line); }
.wp-art::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 18%; height: 10px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.6), transparent 70%); }
.wp-art .wimg { position: relative; z-index: 1; width: 100%; aspect-ratio: 2 / 1; object-fit: contain; filter: drop-shadow(0 0 1px rgba(255,210,150,.5)) drop-shadow(0 0 14px color-mix(in srgb, var(--c, #e8a33a) 45%, transparent)) drop-shadow(0 4px 0 rgba(0,0,0,.6)); }
.wp-cls { position: absolute; top: 6px; left: 8px; font-size: .6rem; font-weight: 700; letter-spacing: .22em; color: var(--c, var(--acc)); }
.wp-info h2 { margin: 0; font-family: var(--head); font-weight: 400; font-size: 2.3rem; letter-spacing: .05em; line-height: 1; }
.wp-info > small { display: block; font-size: .7rem; letter-spacing: .16em; color: var(--acc); font-weight: 700; margin: 2px 0 8px; }
.ar-right .stat { grid-template-columns: 104px 1fr; margin: 5px 0; }
/* attachment slots + options */
.aslots { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 5px; }
.aslot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px; cursor: pointer; border: 1px solid var(--line); border-radius: 2px; background: linear-gradient(180deg, rgba(30,32,37,.9), rgba(14,15,18,.92)); color: var(--tx2); transition: border-color .18s, background .18s, color .18s; min-width: 0; }
.aslot svg { width: 40px; height: 40px; margin: -4px 0 -2px; color: #8d8a82; transition: color .18s; }
.aslot .asn { font-family: var(--head); font-size: 1.05rem; letter-spacing: .1em; line-height: 1; color: var(--tx); }
.aslot .asv { max-width: 100%; font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aslot.has svg { color: var(--acc2); } .aslot.has .asv { color: var(--acc2); }
.aslot:hover { border-color: rgba(232,163,58,.5); }
.aslot.on { border-color: var(--acc); background: linear-gradient(180deg, rgba(232,163,58,.2), rgba(232,163,58,.04)); }
.aslot.on::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; margin-left: -5px; background: #1d1810; border-right: 1px solid var(--acc); border-bottom: 1px solid var(--acc); transform: rotate(45deg); }
.aopts { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); grid-auto-rows: minmax(88px, auto); align-content: start; gap: 6px; margin-top: 10px; padding: 8px; background: linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.18)); border: 1px solid rgba(232,163,58,.25); }
#loadout .ar-grid { flex: 1 1 auto; align-items: start; margin-bottom: 14px; }
/* weapon cards: fill the row (auto-fit), ~240px tall with the sprite at ~80% of the card width; 6+ cards -> 4 columns x shorter rows */
/* armory cards (desktop): class badge top-left, big sprite on a class-tinted glow, name + DMG/RPM/MAG mini bars.
   Height capped (~260px) so the sprite fills the card instead of floating in an empty gradient. */
#loadout .wcards { flex: none; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); grid-auto-rows: clamp(200px, 28vh, 260px); }
#loadout .wcards:has(> :nth-child(6)) { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 20vh, 190px); }
#loadout .wcard { height: auto; min-height: 0; padding: 10px 12px 10px;
  background: radial-gradient(ellipse 62% 40% at 50% 44%, color-mix(in srgb, var(--c) 17%, transparent), transparent 72%), linear-gradient(180deg, rgba(30,32,37,.92), rgba(12,13,16,.95)); }
#loadout .wcard.on { background: radial-gradient(ellipse 62% 40% at 50% 44%, color-mix(in srgb, var(--c) 26%, transparent), transparent 72%), radial-gradient(ellipse 80% 70% at 50% 30%, rgba(232,163,58,.14), transparent 70%), linear-gradient(180deg, rgba(48,38,22,.95), rgba(14,13,12,.96)); }
#loadout .wcard::after { content: none; }
#loadout .wcard.spawn::after { content: 'SPAWN'; position: absolute; right: 10px; left: auto; top: 10px; padding: 2px 6px 1px; font-size: .56rem; font-weight: 700; letter-spacing: .2em; line-height: 1.3; color: #1a1206; background: var(--acc); }
#loadout .wcard.spawn:has(.wca)::after { right: 34px; }
.wcb { position: absolute; left: 10px; top: 10px; z-index: 1; padding: 2px 6px 1px; font-size: .56rem; font-weight: 700; letter-spacing: .2em; line-height: 1.3; color: color-mix(in srgb, var(--c) 80%, #fff); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 10%, rgba(0,0,0,.4)); }
#loadout .wcard .wimg { left: 7%; top: 30px; width: 86%; height: calc(100% - 30px - 70px); filter: drop-shadow(0 3px 0 rgba(0,0,0,.55)) drop-shadow(0 0 16px color-mix(in srgb, var(--c) 22%, transparent)); }
#loadout .wcard .wcn { font-size: 1.45rem; }
#loadout .wcard .wcs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 5px; font-size: 16px; color: var(--tx); }
#loadout .wcard .wcs > span { display: flex; flex-wrap: wrap; align-items: baseline; min-width: 0; }
#loadout .wcard .wcs small { font-size: 9px; margin: 0 0 0 3px; letter-spacing: .14em; }
.wmb { flex: 0 0 100%; display: block; height: 4px; margin-top: 4px; background: rgba(255,255,255,.1); }
.wmb u { display: block; height: 100%; background: var(--c); box-shadow: 0 0 6px color-mix(in srgb, var(--c) 50%, transparent); }
#loadout .wcards:has(> :nth-child(6)) .wcard .wimg { top: 26px; height: calc(100% - 26px - 64px); }
#loadout .wcards:has(> :nth-child(6)) .wcard .wcn { font-size: 1.2rem; }
/* presets: one compact strip (~60px) */
#loadout .presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#loadout .presets .preset { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "pt pb" "pd pb"; padding: 8px 8px 8px 12px; min-height: 0; }
#loadout .presets .preset .pt { font-size: 1.1rem; }
#loadout .presets .preset .pd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#loadout .presets .preset .pb { flex-direction: row; margin-top: 0; gap: 4px; }
#loadout .presets .preset .pb .btn { flex: none; min-height: 34px; padding: 4px 10px; font-size: .95rem; }
.aopt .aop svg { grid-row: auto; width: 11px; height: 11px; color: currentColor; align-self: center; }
.aopt.na { cursor: not-allowed; opacity: .6; filter: grayscale(.85); border-style: dashed; background: rgba(14,15,18,.7); }
.aopt.na .aop { color: #8d877c; }
.aopt .lockb { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.18); border-radius: 2px; color: #d9d3c6; }
.aopt .lockb svg { grid-row: auto; width: 13px; height: 13px; color: currentColor; align-self: auto; }
.aopt.poor:not(.own) .aon { color: var(--tx2); }
.aopt { position: relative; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto 1fr auto; column-gap: 8px; row-gap: 2px; align-items: start; min-height: 88px; padding: 8px 10px 8px 8px; text-align: left; cursor: pointer; border: 1px solid var(--line); border-radius: 2px; background: linear-gradient(180deg, rgba(34,36,42,.92), rgba(16,17,20,.94)); color: rgba(255,255,255,.75); transition: border-color .18s, transform .18s var(--ease), background .18s; }
.aopt svg, .aopt img { grid-row: 1 / 4; width: 44px; height: 44px; color: #b9b5ab; align-self: center; }
.aopt .aon { font-family: var(--head); font-size: 1.2rem; letter-spacing: .05em; line-height: 1; color: #fff; }
.aopt .aod { font-size: 13px; line-height: 1.25; color: #b9b4aa; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aopt .aop { display: inline-flex; align-items: center; gap: 4px; font-size: .66rem; font-weight: 700; letter-spacing: .14em; color: var(--tx2); }
.aopt .aop.price { color: var(--acc2); } .aopt .aop.no { color: #ff7a62; }
.aopt:hover { border-color: rgba(232,163,58,.55); transform: translateY(-2px); }
.aopt:hover svg { color: #fff; }
.aopt.own svg { color: #e4ddd0; }
.aopt.eq { border-color: var(--acc); background: linear-gradient(180deg, rgba(232,163,58,.22), rgba(232,163,58,.05)); }
.aopt.eq svg, .aopt.eq .aop { color: var(--acc2); }
@media (max-width: 1100px) { .ar-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); } .starters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ar-right .wprev { grid-template-columns: 1fr; } }
/* single column: read in section order 01 spawn, 02 armory, (preview) 03 attachments, 04 presets last */
@media (max-width: 860px) {
  .ar-grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .ar-left, .ar-right { display: contents; }
  .ar-right > * { order: 1; }
  .ar-left > .sech:has(+ .presets), .ar-left > .presets { order: 2; }
}

/* tooltip */
#tooltip {
  position: fixed; left: 0; top: 0; z-index: 90; max-width: 310px; padding: 11px 14px;
  border-left: 3px solid var(--acc); background: rgba(10, 11, 13, .97);
  box-shadow: 0 12px 34px rgba(0,0,0,.65); pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .14s, transform .14s;
}
#tooltip.on { opacity: 1; visibility: visible; transform: none; }
#tooltip h5 { margin: 0 0 4px; font-family: var(--head); font-weight: 400; font-size: 1.35rem; letter-spacing: .06em; line-height: 1; color: #fff; }
#tooltip p { margin: 0 0 5px; font-size: .88rem; line-height: 1.3; color: #bdb9af; }
#tooltip b { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }

/* ================================================================ SKILL TREE */
#tree.on { display: flex; flex-direction: column; }
#tree .topbar { flex: none; }
.treewrap { position: relative; flex: 1 1 auto; min-height: 300px; }
.treesvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.treesvg .tring { fill: none; stroke: rgba(255,255,255,.05); stroke-width: 1; stroke-dasharray: 3 7; }
.treesvg .tcenter { fill: #1a1206; stroke: var(--acc); stroke-width: 2.5; filter: drop-shadow(0 0 10px rgba(232,163,58,.6)); }
.treesvg .tci { color: var(--acc2); pointer-events: none; }
.treesvg line.tl { stroke: rgba(255,255,255,.12); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 6; }
.treesvg line.tl.own { stroke-width: 4; stroke-dasharray: none; filter: drop-shadow(0 0 4px currentColor); }
.treesvg g.tn { cursor: default; color: #8d8a82; }
.treesvg g.tn circle { fill: #121317; stroke: #3c3d42; stroke-width: 2.5; transition: stroke .18s, fill .18s, filter .18s; }
.treesvg g.tn.can { cursor: pointer; color: #f2ece0; }
.treesvg g.tn.can circle { fill: #1e1f24; stroke-width: 3; animation: nodePulse 1.8s ease-in-out infinite; }
@keyframes nodePulse { 50% { stroke-opacity: .45; } }
.treesvg g.tn.can:hover circle { fill: #2b2c33; filter: drop-shadow(0 0 10px rgba(255,255,255,.35)); }
.treesvg g.tn.own { color: #120f0a; }
.treesvg g.tn.own circle { filter: drop-shadow(0 0 8px rgba(0,0,0,.6)); }
.treesvg g.tn:hover circle { stroke-width: 4; }
.treesvg g.tn .ti { pointer-events: none; }
.treesvg g.tn text { fill: currentColor; pointer-events: none; font-family: var(--body); font-weight: 700; }
.treesvg g.tn:not(.own):not(.can) { opacity: .6; }
.treesvg text.bl { font-family: var(--head); font-size: 30px; letter-spacing: 4px; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.65); stroke-width: 5px; }
/* skill tree v2: four branch lanes + detail panel */
.tr-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(16px, 2.6vw, 40px); align-items: start; align-content: start; margin-bottom: 14px; }
.lanes { display: flex; flex-direction: column; justify-content: flex-start; gap: clamp(8px, 1.6vmin, 14px); min-width: 0; }
.lane { min-height: clamp(84px, 15.5vh, 150px); }
/* next purchasable node per branch: amber dashed outline that breathes, so the eye knows where to go */
.sn.next::before { content: ''; position: absolute; inset: -7px; z-index: 0; border: 2px dashed var(--acc); border-radius: 5px; opacity: .9; pointer-events: none; animation: nextPulse 1.6s ease-in-out infinite; }
.sn.next { color: color-mix(in srgb, var(--c) 70%, #fff); border-color: color-mix(in srgb, var(--c) 55%, #3a3c42); }
.sn.cap.next::before { display: none; }
.sn.cap.next { filter: drop-shadow(0 0 2px var(--acc)) drop-shadow(0 0 10px rgba(232,163,58,.6)); }
@keyframes nextPulse { 50% { opacity: .35; transform: scale(1.04); } }
.tr-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 4px 0; font-size: .7rem; font-weight: 700; letter-spacing: .2em; color: var(--dim); }
.tr-legend .lg { display: inline-flex; align-items: center; gap: 8px; }
.tr-legend i { width: 14px; height: 14px; border: 2px solid #3a3c42; background: #15161a; }
.tr-legend .own i { background: var(--acc); border-color: var(--acc); box-shadow: 0 0 8px rgba(232,163,58,.5); }
.tr-legend .next i { border: 2px dashed var(--acc); background: transparent; }
.tr-legend .cap i { clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: #3a3c42; border: 0; width: 15px; height: 16px; }
.td-top { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.td-top .td-ic { margin-top: 0; flex: none; width: 72px; height: 72px; }
.td-top .tdi { width: 38px; height: 38px; }
.td-hd { min-width: 0; }
.td-hd h2 { margin: 4px 0 0 !important; }
.td-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.td-sum div { position: relative; flex-wrap: wrap; }
.td-sum div i { flex: 1 0 100%; display: block; height: 2px; margin-top: 6px; background: rgba(255,255,255,.08); }
.td-sum div i u { display: block; height: 100%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.td-foot .td-pts { margin-top: 0; padding-top: 14px; }
.td-pts span { display: flex; flex-direction: column; gap: 4px; }
.td-pts small { font-size: .78rem; font-weight: 600; letter-spacing: .06em; color: var(--tx2); text-transform: none; }
.td-pts:not(.has) b { color: var(--dim); text-shadow: none; }
.lane { --c: #e8a33a; display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: center; gap: 24px; padding: clamp(6px, 1.5vmin, 14px) 22px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, transparent), rgba(10,11,13,.55) 40%, rgba(10,11,13,.25)); border: 1px solid var(--line); border-left: 3px solid var(--c); animation: miIn .45s var(--ease) both; }
.lane:nth-child(2) { animation-delay: .05s; } .lane:nth-child(3) { animation-delay: .1s; } .lane:nth-child(4) { animation-delay: .15s; }
.lane-h { display: grid; grid-template-columns: 1fr auto; row-gap: 3px; min-width: 0; }
.lane-h b { font-family: var(--head); font-weight: 400; font-size: 1.9rem; letter-spacing: .1em; line-height: 1; color: var(--c); text-shadow: 0 0 18px color-mix(in srgb, var(--c) 40%, transparent); }
.lane-h small { grid-column: 1 / 3; grid-row: 2; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.lane-p { grid-column: 2; grid-row: 1; align-self: end; font-family: var(--head); font-size: 1.15rem; letter-spacing: .06em; color: var(--dim); }
.lane-p em { font-style: normal; color: #fff; }
.lane-bar { grid-column: 1 / 3; display: block; height: 3px; background: rgba(255,255,255,.08); margin-top: 3px; }
.lane-bar u { display: block; height: 100%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.lane-t { --h: 32px; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding-bottom: 22px; }
/* connectors: 3px solid track, filled with the branch colour up to the last unlocked rank (--p) */
.lane-t::before, .lane-t::after { content: ''; position: absolute; left: var(--h); top: calc(50% - 11px); height: 3px; margin-top: -1.5px; pointer-events: none; }
.lane-t::before { right: var(--h); background: rgba(255,255,255,.1); box-shadow: 0 1px 0 rgba(0,0,0,.5); }
.lane-t::after { width: calc((100% - var(--h) * 2) * var(--p, 0)); height: 3px; background: var(--c); box-shadow: 0 0 10px var(--c); }
.sn { --s: 70px; z-index: 1; position: relative; flex: none; width: var(--s); height: var(--s); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; border: 2px solid #3a3c42; border-radius: 3px; color: #75726b; background: linear-gradient(180deg, #1c1d22, #101114); box-shadow: inset 2px 2px 0 rgba(255,255,255,.09), inset -2px -2px 0 rgba(0,0,0,.45), 0 4px 10px rgba(0,0,0,.4); transition: transform .18s var(--ease), border-color .18s, box-shadow .18s, background .18s, color .18s; }
.sn.cap { --s: 88px; border: 0; background: transparent !important; box-shadow: none !important; animation: none !important; }
.sn.cap::after { content: ''; position: absolute; inset: 0; z-index: 0; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(180deg, #2c2d33, #121317); box-shadow: inset 0 0 0 2px #3a3c42; }
.sn.cap.can::after { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 40%, #1d1e23), #121317 80%); }
.sn.cap.can { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 55%, transparent)); }
.sn .sni { position: relative; z-index: 1; width: 50%; height: 50%; }
/* rank numeral under each node */
.sn em { position: absolute; z-index: 1; left: 50%; top: calc(100% + 10px); transform: translateX(-50%); font-style: normal; font-family: var(--head); font-size: 13px; line-height: 1; letter-spacing: .14em; color: #9a948a; pointer-events: none; }
.sn.own em, .sn.can em { color: color-mix(in srgb, var(--c) 75%, #fff); }
.sn.can { color: #f2ece0; border-color: var(--c, #e8a33a); box-shadow: inset 3px 3px 0 rgba(255,255,255,.06), inset -3px -3px 0 rgba(0,0,0,.35), 0 0 16px color-mix(in srgb, var(--lc, #e8a33a) 45%, transparent); animation: nodePulse2 1.8s ease-in-out infinite; }
.lane .sn.can { border-color: var(--c); --lc: var(--c); }
@keyframes nodePulse2 { 50% { box-shadow: inset 3px 3px 0 rgba(255,255,255,.06), inset -3px -3px 0 rgba(0,0,0,.35), 0 0 4px transparent; } }
.sn.own { color: #120f0a; border-color: var(--c); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 85%, #fff 15%), var(--c) 60%, color-mix(in srgb, var(--c) 70%, #000 30%)); box-shadow: inset 3px 3px 0 rgba(255,255,255,.3), inset -3px -3px 0 rgba(0,0,0,.25), 0 0 18px color-mix(in srgb, var(--c) 55%, transparent); }
.sn.cap.own { filter: drop-shadow(0 0 12px color-mix(in srgb, var(--c) 55%, transparent)); }
.sn.cap.own::after { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 85%, #fff 15%), var(--c) 60%, color-mix(in srgb, var(--c) 70%, #000 30%)); }
.sn.lock { color: color-mix(in srgb, var(--c) 45%, #6d6a64); border-color: #34363c; }
.sn.lock .sni { opacity: .75; }
.sn:hover, .sn:focus-visible, .sn.sel { transform: translateY(-3px) scale(1.06); outline: none; }
.sn.sel:not(.cap) { border-color: #fff; }
.sn.cap.sel { filter: drop-shadow(0 0 10px rgba(255,255,255,.4)); }
.tr-detail { --c: var(--acc); --cb: color-mix(in srgb, var(--c) 60%, transparent); position: relative; isolation: isolate; display: flex; flex-direction: column; padding: 20px 22px; background: linear-gradient(180deg, rgba(26,28,33,.86), rgba(9,10,12,.9)); border: 1px solid var(--line); border-top: 3px solid var(--c); box-shadow: 0 18px 50px rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tr-detail::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--noise); background-size: 180px; opacity: .05; pointer-events: none; }
.td-tag { font-size: .7rem; font-weight: 700; letter-spacing: .22em; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-hd { min-width: 0; }
@media (max-width: 700px), (max-height: 420px) { .td-nx { display: none; } }
.tr-detail h2 { margin: 6px 0 8px; font-family: var(--head); font-weight: 400; font-size: 2.6rem; letter-spacing: .04em; line-height: .95; color: #fff; }
.tr-detail p { margin: 0 0 16px; font-size: 1.05rem; line-height: 1.35; color: var(--tx2); }
.td-ic { width: 84px; height: 84px; margin-top: 14px; display: flex; align-items: center; justify-content: center; color: var(--c); border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 10%, rgba(0,0,0,.4)); box-shadow: inset 4px 4px 0 rgba(255,255,255,.06), inset -4px -4px 0 rgba(0,0,0,.35), 0 0 24px color-mix(in srgb, var(--c) 30%, transparent); }
.td-ic.own { background: var(--c); color: #120f0a; }
.tdi { width: 44px; height: 44px; }
.td-cost { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.td-cost span { font-size: .7rem; font-weight: 700; letter-spacing: .2em; color: var(--dim); }
.td-cost b { font-family: var(--head); font-weight: 400; font-size: 1.3rem; letter-spacing: .08em; color: var(--acc2); }
.td-st { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .85rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.td-st.own { color: var(--c); } .td-st.can { color: var(--green); }
.td-st .sti { width: 14px; height: 14px; }
.td-buy { margin-top: auto; width: 100%; }
.td-path { list-style: none; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.td-path li { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-size: .9rem; font-weight: 600; letter-spacing: .04em; color: var(--dim); }
.td-path li em { font-style: normal; width: 22px; font-family: var(--head); font-size: .95rem; color: var(--dim2); }
.td-path li.own { color: var(--tx2); } .td-path li.own em { color: var(--c); }
.td-path li.cur { color: #fff; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent), transparent); box-shadow: inset 2px 0 0 var(--c); }
@media (max-height: 520px) { .td-path { display: none; } }
.td-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.td-sum div { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; background: rgba(0,0,0,.35); border-left: 3px solid var(--c); }
.td-sum b { font-family: var(--head); font-weight: 400; font-size: 1.15rem; letter-spacing: .1em; color: var(--c); }
.td-sum span { font-family: var(--head); font-size: 1.1rem; color: #fff; }
.td-pts { margin-top: auto; padding-top: 16px; display: flex; align-items: baseline; gap: 10px; }
.td-pts b { font-family: var(--head); font-weight: 400; font-size: 4rem; line-height: .85; color: var(--acc2); text-shadow: 0 0 24px rgba(232,163,58,.4); }
.td-pts span { font-size: .75rem; font-weight: 700; letter-spacing: .2em; color: var(--dim); }
@media (max-width: 1100px) { .tr-grid { grid-template-columns: minmax(0, 1fr) 300px; } .lane { grid-template-columns: 1fr; gap: 8px; } }
.treebar { flex: none; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.treebar span { flex: 1 1 260px; font-size: .9rem; color: var(--dim); letter-spacing: .04em; }
.treebar .done { margin-top: 0; }

/* ================================================================ SETTINGS */
.setgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px clamp(14px, 3vw, 36px); max-width: 1180px; }
.setcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.setcard { padding: 14px 16px 12px; }
.setgrid h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-family: var(--head); font-weight: 400; font-size: 1.6rem; letter-spacing: .14em; line-height: 1; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.h3i { width: 20px; height: 20px; color: var(--acc); }
label.set { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, 1.4fr) 54px; align-items: center; gap: 12px; min-height: 44px; padding: 4px 10px; margin: 0 -10px; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; transition: background .15s; }
label.set:last-child { border-bottom: 0; }
label.set:hover { background: rgba(232,163,58,.06); }
label.set span { font-size: 1rem; font-weight: 600; letter-spacing: .04em; color: var(--tx2); }
label.set:hover span { color: #fff; }
label.set b { font-family: var(--head); font-size: 1.3rem; letter-spacing: .04em; text-align: right; color: var(--acc2); font-weight: 400; }
label.set input[type=checkbox], label.set select { grid-column: 2 / 4; justify-self: end; }
input[type=range] { --p: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, var(--acc) var(--p), rgba(255,255,255,.14) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; background: rgba(255,255,255,.14); }
input[type=range]::-moz-range-progress { height: 4px; background: var(--acc); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 20px; margin-top: -8px; background: #fff; border: 0; border-radius: 1px; box-shadow: 0 0 0 3px rgba(232,163,58,.35), 0 2px 6px rgba(0,0,0,.6); transition: transform .12s; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { transform: scale(1.15); }
input[type=range]::-moz-range-thumb { width: 12px; height: 20px; background: #fff; border: 0; border-radius: 1px; box-shadow: 0 0 0 3px rgba(232,163,58,.35); }
input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 48px; height: 26px; border-radius: 13px; background: #2a2d33; border: 1px solid rgba(255,255,255,.12); position: relative; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; margin: 0; box-shadow: inset 0 2px 4px rgba(0,0,0,.4); }
input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #8a8f98; box-shadow: 0 1px 3px rgba(0,0,0,.5); transition: left .15s var(--ease), background .15s; }
input[type=checkbox]:hover { border-color: rgba(255,255,255,.28); }
input[type=checkbox]:checked { background: linear-gradient(180deg, var(--acc2), var(--acc)); border-color: var(--acc2); box-shadow: 0 0 12px rgba(232,163,58,.35); }
input[type=checkbox]:checked::after { left: 25px; background: #fff; }
select { -webkit-appearance: none; appearance: none; min-width: 150px; height: 34px; padding: 0 32px 0 12px; background: #121317 linear-gradient(45deg, transparent 50%, var(--acc) 50%) no-repeat calc(100% - 13px) 50% / 7px 7px; border: 1px solid var(--line2); color: var(--tx); font-size: 1rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; border-radius: 2px; outline: none; cursor: pointer; transition: border-color .15s; }
select:hover, select:focus { border-color: var(--acc); }
select option { background: #15161a; color: var(--tx); }
.set-wrap { max-width: 1180px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
/* both columns end on one baseline: the grid stretches, the last card of each column (VIDEO / KEYS) takes the slack,
   and the KEYS rows spread evenly so it never reads as an empty box; the whole stack is centred vertically */
.set-wrap .setgrid { flex: none; align-items: stretch; margin: auto 0; padding-bottom: 16px; width: 100%; }
.set-wrap .topbar { flex: none; }
.set-wrap .setcol { justify-content: flex-start; }
.set-wrap .setcol > .setcard:last-child { flex: 1 1 auto; }
.set-wrap .keys-card { display: flex; flex-direction: column; }
.set-wrap .keys-card .keys { flex: 1 1 auto; align-content: space-evenly; }
/* live graphics-tier preview under the quality switch */
.qprev { margin: 6px 0 4px; padding: 10px 12px; background: linear-gradient(90deg, rgba(232,163,58,.09), rgba(0,0,0,.25)); border-left: 2px solid var(--acc); }
.qp-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qp-h b { font-family: var(--head); font-weight: 400; font-size: 1.25rem; letter-spacing: .12em; line-height: 1; color: var(--acc2); }
.qp-h em { margin-left: auto; font-style: normal; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.qp-lv { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.qp-lv i { width: 4px; background: rgba(255,255,255,.16); }
.qp-lv i:nth-child(1) { height: 6px; } .qp-lv i:nth-child(2) { height: 10px; } .qp-lv i:nth-child(3) { height: 14px; }
.qp-lv i.on { background: var(--acc); box-shadow: 0 0 6px rgba(232,163,58,.6); }
.qp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.qp-chips span { padding: 3px 8px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx2); background: rgba(0,0,0,.4); border: 1px solid var(--line2); }
.aopt.na:hover { transform: none; border-color: var(--line); }
/* segmented control (same language as the CO-OP / SINGLE PLAYER switch) */
.set.seg-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 1.4fr) 54px; align-items: center; gap: 12px; min-height: 48px; padding: 4px 10px; margin: 0 -10px; border-bottom: 1px solid rgba(255,255,255,.04); }
.set.seg-row > span { font-size: 1rem; font-weight: 600; letter-spacing: .04em; color: var(--tx2); }
.seg { grid-column: 2 / 4; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px; gap: 2px; background: rgba(0,0,0,.45); border: 1px solid var(--line); }
.seg button { min-height: 36px; padding: 0 6px; border: 0; background: transparent; color: var(--dim); cursor: pointer; font-family: var(--head); font-size: 1.15rem; letter-spacing: .12em; line-height: 1; transition: background .18s, color .18s, box-shadow .18s; }
.seg button:hover:not(.on) { color: var(--tx); background: rgba(255,255,255,.05); }
.seg button.on { color: #fff; background: linear-gradient(180deg, rgba(232,163,58,.3), rgba(232,163,58,.1)); box-shadow: inset 0 -2px 0 var(--acc), 0 0 14px rgba(232,163,58,.15); }
.seg button:focus-visible { outline-offset: -2px; }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; font-size: .98rem; font-weight: 600; letter-spacing: .03em; color: var(--tx2); padding: 4px 2px; }
.kp { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; min-height: 32px; white-space: nowrap; }
.keys span { justify-self: start; min-width: 44px; padding: 3px 9px 2px; text-align: center; background: linear-gradient(180deg, #2a2b31, #1b1c21); border: 1px solid rgba(255,255,255,.14); border-bottom: 3px solid rgba(0,0,0,.6); border-radius: 3px; font-family: var(--head); font-size: 1.05rem; letter-spacing: .08em; color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.4); }

/* ================================================================ GAME OVER */
#gameover { z-index: 40; overflow: auto; background: radial-gradient(ellipse at 22% 55%, rgba(110,14,8,.55), rgba(5,5,6,.95) 62%), rgba(5,5,6,.88); padding: calc(var(--pad) + var(--sat)) calc(var(--pad) + var(--sar)) calc(var(--pad) + var(--sab)) calc(var(--pad) + var(--sal)); }
/* content block is centred vertically (safe: falls back to top + scroll when it does not fit); report panel top = GAME OVER kicker */
#gameover.on { display: flex; justify-content: center; align-items: safe center; animation: fadeIn .6s ease both; }
.go-wrap { width: 100%; max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 460px); gap: 48px; align-items: start; }
.go-right > .go-tag:first-child { margin-top: -2px; }
/* party perks in the report: small glyph chips, or a quiet NONE */
.gpks { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.gpk { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; font-style: normal; color: var(--acc2); background: rgba(232,163,58,.12); border: 1px solid rgba(232,163,58,.4); }
.gpk > * { width: 16px; height: 16px; font-size: 14px; line-height: 16px; }
.gpk u { position: absolute; right: -4px; bottom: -4px; min-width: 12px; height: 12px; padding: 0 2px; font-size: 9px; line-height: 12px; text-decoration: none; text-align: center; color: #1a1206; background: var(--acc); }
.gnone { font-size: .95rem; letter-spacing: .18em; color: var(--dim2); }
.gf-sil { width: 64px; height: 40px; color: var(--c, var(--acc)); opacity: .85; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)); }
.go-left { min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; }
.go-tag { font-family: var(--head); font-size: clamp(1rem, 2.6vmin, 1.5rem); letter-spacing: .22em; color: var(--tx2); }
/* favourite weapon + personal best */
.go-extra { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; width: min(100%, 560px); margin-top: 8px; animation: miIn .5s var(--ease) both 1s; }
.go-fav { --c: var(--acc); position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; min-width: 0; background: linear-gradient(180deg, rgba(26,28,33,.82), rgba(9,10,12,.88)); border: 1px solid var(--line); border-top: 2px solid var(--c); }
.gf-art { flex: none; width: 116px; height: 58px; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse 60% 50% at 50% 55%, color-mix(in srgb, var(--c) 28%, transparent), transparent 70%), repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 12px), repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 12px); border: 1px solid var(--line); }
.gf-art .wimg { width: 108px; aspect-ratio: 2 / 1; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)); }
.gf-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gf-info small, .go-pb small { font-size: .62rem; font-weight: 700; letter-spacing: .22em; color: var(--dim); }
.gf-info b { font-family: var(--head); font-weight: 400; font-size: 1.6rem; letter-spacing: .05em; line-height: 1; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-info span { font-size: .7rem; font-weight: 700; letter-spacing: .1em; line-height: 1.25; color: var(--c); }
.go-pb { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 10px 14px; min-width: 0; background: linear-gradient(180deg, rgba(26,28,33,.82), rgba(9,10,12,.88)); border: 1px solid var(--line); border-top: 2px solid rgba(255,255,255,.14); }
.go-pb.new { border-top-color: var(--red2); background: linear-gradient(180deg, rgba(150,20,10,.25), rgba(9,10,12,.88) 75%); }
.go-pb.new small { color: var(--red2); }
.gpb-row { display: flex; align-items: center; gap: 10px; }
.gpb-row b { font-family: var(--head); font-weight: 400; font-size: 1.7rem; line-height: 1; color: #fff; }
.gpb-row span { font-family: var(--head); font-size: 1.1rem; color: var(--dim); }
.gpb-row i { flex: 1; height: 4px; background: rgba(255,255,255,.1); }
.gpb-row i u { display: block; height: 100%; background: linear-gradient(90deg, #8e1209, var(--red2)); box-shadow: 0 0 8px rgba(255,60,40,.6); }
.go-pb em { font-style: normal; font-size: .74rem; color: var(--tx2); letter-spacing: .03em; }
.go-lvb { position: relative; width: 40px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; }
.go-lvb svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(232,163,58,.2); stroke: var(--acc2); stroke-width: 2; filter: drop-shadow(0 0 8px rgba(232,163,58,.55)); }
.go-lvb b { position: relative; font-size: 1.35rem !important; color: #fff !important; letter-spacing: 0 !important; }
.go-lv em { margin-left: auto; flex: none; padding: 4px 9px 3px; font-style: normal; font-family: var(--head); font-size: 1.05rem; letter-spacing: .1em; color: #1a1206; background: var(--acc); box-shadow: 0 0 14px rgba(232,163,58,.45); }
.go-left > .go-tag { color: var(--red2); text-shadow: 0 0 18px rgba(255,60,40,.5); font-size: clamp(1.4rem, 3.6vmin, 2.2rem); }
/* hero: painted tally (filter lives in the ROUND MARKER block) with the label sitting on its baseline */
.go-hero { display: flex; align-items: flex-end; gap: clamp(18px, 2.6vw, 36px); margin: 12px 0 0; }
.go-num { flex: none; animation: goIn 1s cubic-bezier(.2,.9,.3,1.15) both .15s; transform-origin: left bottom; }
.go-num .tally { height: clamp(150px, 30vh, 260px); }
.go-num .tally.few { height: clamp(140px, 24vh, 200px); }
.go-num .rdig { font-size: clamp(170px, 34vh, 320px); line-height: .78; margin-left: -.03em; }
@keyframes goIn { from { opacity: 0; transform: scale(1.3); } to { opacity: 1; transform: none; } }
.go-lab { padding-bottom: .02em; font-family: var(--head); font-size: clamp(56px, 6vw, 84px); line-height: .9; letter-spacing: .03em; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.7); animation: miIn .6s var(--ease) both .35s; }
.go-lab small { display: block; margin-bottom: .6em; font-family: var(--body); font-size: 11px; font-weight: 700; letter-spacing: .34em; color: var(--dim); }
.go-lab .gl-a { display: block; font-size: .42em; letter-spacing: .16em; line-height: 1; color: var(--tx2); }
.go-lab .gl-b { display: flex; align-items: baseline; gap: .16em; margin-top: .06em; }
.go-lab .gl-b b { font-weight: 400; font-size: 1.32em; line-height: .8; color: #ff3a22; text-shadow: 0 0 24px rgba(255,40,20,.45), 0 3px 0 #2a0000; }
.go-rule { display: block; width: min(100%, 560px); height: 1px; margin: 16px 0 2px; background: linear-gradient(90deg, rgba(255,70,40,.7), rgba(232,163,58,.35) 45%, transparent); }
/* round 0 = "didn't survive round 1": ghosted single bar */
.go-hero.r0 .go-num { opacity: .38; }
.go-hero.r0 .go-lab { font-size: clamp(44px, 5vw, 68px); }
#gameover.snap { background: radial-gradient(ellipse at 22% 55%, rgba(110,14,8,.5), rgba(5,5,6,.78) 62%), rgba(5,5,6,.45); }
.go-bg { position: fixed; inset: -24px; z-index: -1; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(8px) brightness(.35) saturate(.35); pointer-events: none; }
#gameover { isolation: isolate; }
@media (pointer: fine) { #gameover:not(.snap) { background: radial-gradient(ellipse at 22% 55%, rgba(110,14,8,.5), rgba(5,5,6,.72) 62%), rgba(5,5,6,.35); backdrop-filter: blur(8px) brightness(.45) saturate(.4); -webkit-backdrop-filter: blur(8px) brightness(.45) saturate(.4); } }
#gameover.snap::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 22% 55%, rgba(120,14,8,.45), rgba(5,5,6,.2) 55%, rgba(5,5,6,.75) 100%); }
.go-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; width: min(100%, 480px); }
.go-right li { animation: miIn .45s var(--ease) both; animation-delay: calc(.45s + var(--i, 0) * 60ms); }
.gs { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 16px 8px 12px; background: rgba(0,0,0,.45); border: 1px solid var(--line); border-top: 2px solid rgba(255,255,255,.14); animation: miIn .5s var(--ease) both .5s; }
.gs + .gs { animation-delay: .6s; } .gs + .gs + .gs { animation-delay: .7s; }
.gsi { grid-row: 1 / 3; width: 24px; height: 24px; color: var(--acc); }
.gs b { font-family: var(--head); font-weight: 400; font-size: 1.9rem; line-height: 1; color: #fff; }
.gs span { font-size: .66rem; letter-spacing: .22em; color: var(--dim); font-weight: 700; }
.gs.gold { border-top-color: var(--acc); background: linear-gradient(180deg, rgba(232,163,58,.14), rgba(0,0,0,.45) 70%); } .gs.gold b { color: var(--acc2); text-shadow: 0 0 16px rgba(232,163,58,.35); } .gs.gold .gsi { color: var(--acc2); }
.go-stats, .go-lv { width: min(100%, 560px); }
.go-lv { margin-top: 8px; display: flex; align-items: center; gap: 12px; align-self: flex-start; width: min(100%, 560px); padding: 10px 16px 10px 12px; background: linear-gradient(90deg, rgba(232,163,58,.2), rgba(232,163,58,.04)); border-left: 3px solid var(--acc); animation: miIn .5s var(--ease) both .85s; }
.go-lv b { display: block; font-family: var(--head); font-weight: 400; font-size: 1.5rem; letter-spacing: .1em; color: var(--acc2); line-height: 1; }
.go-lv span { font-size: .9rem; color: var(--tx2); }
.go-right { min-width: 0; padding: 18px 20px; animation: screenIn .6s var(--ease) both .3s; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.go-right li { opacity: 0; animation: rowIn .45s var(--ease) forwards; animation-delay: calc(.5s + var(--i, 0) * 70ms); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-10px); background: rgba(232,163,58,.14); } 60% { background: rgba(232,163,58,.06); } to { opacity: 1; transform: none; background: transparent; } }
.go-right ul { list-style: none; margin: 10px 0 12px; padding: 0; }
.go-right li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-family: var(--head); font-size: 1.2rem; letter-spacing: .08em; color: var(--dim); }
.go-right li span { flex: 1; }
.gli { width: 17px; height: 17px; color: var(--dim2); flex: none; }
.go-right li b { font-weight: 400; color: var(--tx); font-size: 1.35rem; text-align: right; }
.go-party { display: flex; flex-direction: column; gap: 4px; }
.go-party:empty { display: none; }
.go-party div { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; background: linear-gradient(90deg, rgba(232,163,58,.1), rgba(255,255,255,.02)); font-size: .9rem; color: var(--dim); }
.go-party .pav { width: 26px; height: 26px; font-size: 1rem; }
.go-party .gpn { flex: 1; font-family: var(--head); font-size: 1.2rem; letter-spacing: .05em; color: var(--tx); }
.go-party b { font-family: var(--head); font-weight: 400; font-size: 1.25rem; color: #fff; }
.go-party small { font-size: .62rem; letter-spacing: .16em; font-weight: 700; margin-right: 6px; }
.go-wait { margin: 18px 0 10px; padding: 14px; text-align: center; border: 1px dashed var(--line2); font-family: var(--head); font-size: 1.4rem; letter-spacing: .12em; color: var(--dim); }

/* ================================================================ PAUSE */
#pause { z-index: 50; background: radial-gradient(ellipse at center, rgba(10,11,14,.12), rgba(3,3,4,.62)); backdrop-filter: blur(4px) brightness(.55) saturate(.6); -webkit-backdrop-filter: blur(4px) brightness(.55) saturate(.6); overflow: auto; padding: calc(var(--pad) + var(--sat)) calc(var(--pad) + var(--sar)) calc(var(--pad) + var(--sab)) calc(var(--pad) + var(--sal)); }
#pause.on { display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fadeIn .25s ease; }
.pz { width: min(760px, 100%); padding: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); animation: screenIn .35s var(--ease) both; }
.pz-main { display: flex; flex-direction: column; padding: 24px 24px 20px; min-width: 0; }
.pz-info { display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 20px; min-width: 0; background: linear-gradient(180deg, rgba(0,0,0,.32), rgba(0,0,0,.12)); border-left: 1px solid var(--line); }
.pz-info small { display: block; margin-bottom: 6px; font-size: .66rem; font-weight: 700; letter-spacing: .26em; color: var(--dim); }
.pzi-round { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pzi-tally { flex: none; min-width: 48px; }
.pzi-tally .tally { height: 58px; }
.pzi-tally .rdig { font-size: 64px; }
.pzi-tally.wait { filter: none; display: flex; align-items: center; justify-content: center; width: 52px; height: 58px; border: 1px solid var(--line2); background: rgba(0,0,0,.3); }
.pzi-wait { width: 30px; height: 30px; color: var(--acc); opacity: .85; }
.pzi-round b { display: block; font-family: var(--head); font-weight: 400; font-size: 1.9rem; letter-spacing: .06em; line-height: 1; color: #fff; }
.pzi-round span { font-size: .85rem; letter-spacing: .08em; color: var(--tx2); text-transform: uppercase; font-weight: 600; }
.pzi-pts { font-family: var(--head); font-weight: 400; font-size: 2.4rem; line-height: .9; color: var(--acc2); text-shadow: 0 0 18px rgba(232,163,58,.3); }
.pzi-perks { display: flex; flex-wrap: wrap; gap: 6px; }
.pzi-perks .perk { width: 34px; height: 34px; font-size: 16px; }
.pzi-none { font-size: .85rem; color: var(--dim2); letter-spacing: .06em; }
.pzi-m { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; margin-bottom: 3px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.01)); border-left: 2px solid var(--beige); }
.pzi-m.me { border-left-color: var(--acc); background: linear-gradient(90deg, rgba(232,163,58,.13), rgba(232,163,58,.02)); }
.pzi-m .pav { width: 24px; height: 24px; font-size: .95rem; }
.pzn { flex: 1; min-width: 0; font-family: var(--head); font-size: 1.15rem; letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pzi-m em { font-style: normal; font-size: .62rem; font-weight: 700; letter-spacing: .14em; padding: 1px 5px; background: var(--red); color: #fff; }
.pzi-m b { font-family: var(--head); font-weight: 400; font-size: 1.15rem; color: var(--acc2); }
@media (max-width: 640px) { .pz { grid-template-columns: 1fr; } .pz-info { border-left: 0; border-top: 1px solid var(--line); } }
.pz-tag { font-size: .7rem; font-weight: 700; letter-spacing: .36em; color: var(--acc); }
#pause h1 { margin: 2px 0 2px; font-family: var(--head); font-weight: 400; font-size: clamp(3rem, 11vmin, 6rem); line-height: .9; letter-spacing: .04em; }
#pause p { margin: 0 0 16px; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; font-size: .85rem; }
#pause .mi { max-width: none; }
#pause .mi.primary { margin-bottom: 8px; }

/* ================================================================ LOADING */
#loading { z-index: 80; background: radial-gradient(ellipse at 50% 60%, #15100c, var(--bg) 70%); }
#loading.on { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.ld-logo { display: flex; flex-direction: column; align-items: center; line-height: .85; }
.ld-logo span { font-family: var(--head); font-size: clamp(1rem, 2.6vmin, 1.4rem); letter-spacing: .5em; color: var(--tx2); margin-right: -.5em; }
.ld-logo b { font-family: var(--head); font-weight: 400; font-size: clamp(3.4rem, 13vmin, 7rem); color: var(--chalk); filter: url(#chalk) drop-shadow(0 0 20px rgba(200,20,10,.4)); letter-spacing: .03em; }
.spin { display: flex; gap: 6px; }
.spin i { width: 12px; height: 12px; background: var(--acc); box-shadow: inset -3px -3px 0 rgba(0,0,0,.25), 0 0 10px rgba(232,163,58,.5); animation: cube 1s var(--ease) infinite; }
.spin i:nth-child(2) { animation-delay: .15s; background: var(--red); box-shadow: inset -3px -3px 0 rgba(0,0,0,.25), 0 0 10px rgba(208,42,29,.5); }
.spin i:nth-child(3) { animation-delay: .3s; }
@keyframes cube { 0%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-10px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
#loadText { font-family: var(--head); font-size: 1.3rem; letter-spacing: .3em; color: var(--dim); text-align: center; padding: 0 20px; }

/* ================================================================ PERK PICK */
#perkPick { position: fixed; inset: 0; z-index: 45; display: none; flex-direction: column; align-items: center; justify-content: center; gap: clamp(12px, 3vmin, 30px); padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); background: radial-gradient(ellipse at 50% 45%, rgba(8,8,10,.72), rgba(0,0,0,.92)); pointer-events: auto; overflow: auto; }
#perkPick::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 50% 35% at 50% 100%, rgba(160,24,12,.22), transparent 70%); }
#perkPick.on { display: flex; animation: fadeIn .3s ease; }
body.perk-open #announce { opacity: 0 !important; visibility: hidden; animation: none !important; }
body.perk-open #hud { opacity: .35; transition: opacity .3s; }
@media (max-height: 520px), (pointer: coarse) {
  body.perk-open #hud { opacity: .08; }
  body.perk-open #touch { opacity: .1; transition: opacity .3s; }
  #perkPick { background: linear-gradient(180deg, rgba(5,5,6,.94) 0, rgba(5,5,6,.8) 40%, rgba(5,5,6,.66)), radial-gradient(ellipse at 50% 45%, rgba(8,8,10,.4), rgba(0,0,0,.7)); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pp-head { text-align: center; animation: screenIn .5s var(--ease) both; }
.pp-head small { font-family: var(--head); font-size: clamp(1rem, 2.6vmin, 1.4rem); letter-spacing: .4em; color: var(--acc); text-shadow: 0 0 14px rgba(232,163,58,.5); }
.pp-head h2 { margin: 2px 0 4px; font-family: var(--head); font-weight: 400; font-size: clamp(2.2rem, 7vmin, 4.2rem); letter-spacing: .04em; line-height: .95; text-shadow: 0 4px 30px rgba(0,0,0,.8); }
.pp-head p { margin: 0; color: var(--dim); font-size: .95rem; letter-spacing: .06em; }
#ppTimer { color: var(--acc2); font-weight: 700; margin-left: 6px; }
.pp-cards { display: flex; gap: clamp(10px, 2vw, 22px); justify-content: center; flex-wrap: wrap; }
.pp-card {
  --cb: rgba(232,163,58,.65);
  width: clamp(170px, 22vw, 250px); padding: 30px 16px 16px; display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1px solid var(--line2); border-radius: 2px; cursor: pointer; color: var(--tx); overflow: hidden;
  background: linear-gradient(180deg, rgba(40,30,18,.9), rgba(14,13,12,.96) 55%);
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s, opacity .3s;
  animation: cardIn .55s var(--ease) both; animation-delay: calc(.12s + var(--i, 0) * 90ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
.pp-card:hover, .pp-card:focus-visible { transform: translateY(-8px); border-color: rgba(232,163,58,.75); box-shadow: 0 18px 40px rgba(0,0,0,.6), 0 0 30px rgba(232,163,58,.18); outline: none; }
.pp-card kbd { position: absolute; top: 8px; left: 8px; min-width: 24px; height: 24px; padding: 0 6px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #2a2b31, #1b1c21); border: 1px solid var(--line2); border-bottom: 3px solid rgba(0,0,0,.6); border-radius: 3px; font-family: var(--head); font-size: 1rem; color: var(--tx); }
.pp-tag { position: absolute; top: 11px; right: 10px; font-size: .58rem; font-weight: 700; letter-spacing: .22em; color: var(--acc); }
.pp-ic { position: relative; width: 86px; height: 94px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; color: var(--acc2); }
.pp-hex { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(232,163,58,.1); stroke: var(--acc); stroke-width: 2.5; filter: drop-shadow(0 0 12px rgba(232,163,58,.4)); transition: fill .25s; }
.pp-card:hover .pp-hex { fill: rgba(232,163,58,.22); }
.pp-ic .glyph { position: relative; width: 42px; height: 42px; font-size: 2.2rem; filter: drop-shadow(0 0 6px rgba(255,198,107,.5)); }
.pp-ic img { position: relative; width: 60%; height: 60%; object-fit: contain; }
.pp-card h3 { margin: 0 0 6px; font-family: var(--head); font-weight: 400; font-size: 1.7rem; letter-spacing: .05em; line-height: 1; color: #fff; }
.pp-card p { margin: 0 0 12px; font-size: .9rem; line-height: 1.3; color: #bcb7ac; flex: 1; }
.pp-cta { align-self: stretch; padding: 7px 0 6px; font-family: var(--head); font-size: 1.1rem; letter-spacing: .3em; color: var(--acc2); border: 1px solid rgba(232,163,58,.35); background: rgba(232,163,58,.06); transition: background .2s, color .2s; }
.pp-card:hover .pp-cta { background: var(--acc); color: #1a1206; }
.pp-card.picked { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc), 0 0 50px rgba(232,163,58,.5); transform: translateY(-8px) scale(1.04); }
.pp-card.picked .pp-cta { background: var(--acc); color: #1a1206; }
#perkPick:has(.picked) .pp-card:not(.picked) { opacity: .3; transform: scale(.96); }

/* ================================================================ HUD */
#hud { z-index: 10; pointer-events: none; font-family: var(--body); --hs: 1; }
#hud * { pointer-events: none; }
.glyph { display: inline-flex; align-items: center; justify-content: center; line-height: 1; font-style: normal; }
svg.glyph { width: 1em; height: 1em; }
.ic { width: 1em; height: 1em; }

/* hurt: edge-weighted blood, centre half of the screen always clear (no flat red wash); opacity capped at .85 by ui.js */
#vigHurt {
  --sTL: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='3' seed='9'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='34'/%3E%3C/filter%3E%3Cg filter='url(%23r)' fill='%236e0603'%3E%3Ccircle cx='0' cy='0' r='92'/%3E%3Cpath d='M70 20 L150 34 L92 52Z M30 80 L44 168 L64 96Z M96 64 L170 120 L118 74Z'/%3E%3Ccircle cx='132' cy='40' r='9'/%3E%3Ccircle cx='156' cy='64' r='5'/%3E%3Ccircle cx='52' cy='150' r='7'/%3E%3Ccircle cx='112' cy='112' r='6'/%3E%3Ccircle cx='170' cy='22' r='4'/%3E%3C/g%3E%3Ccircle cx='18' cy='16' r='46' fill='%23a10d06' opacity='.55'/%3E%3C/svg%3E");
  --sTR: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.05' numOctaves='3' seed='4'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='30'/%3E%3C/filter%3E%3Cg transform='translate(200 0) scale(-1 1)'%3E%3Cg filter='url(%23r)' fill='%236e0603'%3E%3Ccircle cx='0' cy='0' r='84'/%3E%3Cpath d='M60 24 L156 46 L84 50Z M24 70 L36 150 L56 86Z'/%3E%3Ccircle cx='140' cy='58' r='8'/%3E%3Ccircle cx='44' cy='164' r='6'/%3E%3Ccircle cx='104' cy='92' r='5'/%3E%3C/g%3E%3Ccircle cx='16' cy='14' r='40' fill='%23a10d06' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");
  --sBL: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04' numOctaves='3' seed='13'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='34'/%3E%3C/filter%3E%3Cg transform='translate(0 200) scale(1 -1)'%3E%3Cg filter='url(%23r)' fill='%236e0603'%3E%3Ccircle cx='0' cy='0' r='88'/%3E%3Cpath d='M76 16 L160 26 L96 46Z M30 84 L50 172 L66 94Z'/%3E%3Ccircle cx='126' cy='48' r='8'/%3E%3Ccircle cx='60' cy='140' r='6'/%3E%3Ccircle cx='160' cy='12' r='4'/%3E%3C/g%3E%3Ccircle cx='18' cy='16' r='44' fill='%23a10d06' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");
  --sBR: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='3' seed='21'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='34'/%3E%3C/filter%3E%3Cg transform='translate(200 200) scale(-1 -1)'%3E%3Cg filter='url(%23r)' fill='%236e0603'%3E%3Ccircle cx='0' cy='0' r='92'/%3E%3Cpath d='M70 20 L150 34 L92 52Z M30 80 L44 168 L64 96Z M96 64 L170 120 L118 74Z'/%3E%3Ccircle cx='132' cy='40' r='9'/%3E%3Ccircle cx='52' cy='150' r='7'/%3E%3Ccircle cx='112' cy='112' r='6'/%3E%3C/g%3E%3Ccircle cx='18' cy='16' r='46' fill='%23a10d06' opacity='.55'/%3E%3C/g%3E%3C/svg%3E");
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(120,0,0,.55) 85%, rgba(60,0,0,.85) 100%);
  transition: opacity .2s;
}
/* blood splatter anchored in the four corners, only below 35% HP (.crit) and while down */
#vigHurt::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .5s;
  background:
    var(--sTL) left top / min(22vw, 32vh) no-repeat,
    var(--sTR) right top / min(24vw, 36vh) no-repeat,
    var(--sBL) left bottom / min(26vw, 38vh) no-repeat,
    var(--sBR) right bottom / min(30vw, 42vh) no-repeat;
}
#vigHurt.crit::before, #hud.isdown #vigHurt::before { opacity: .72; }
#vigHurt::after { content: ''; position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 60%, rgba(130,0,0,.6) 100%); }
#vigHurt.crit::after { animation: heartbeat 1.1s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { opacity: .25; } 14% { opacity: 1; } 28% { opacity: .45; } 42% { opacity: .95; } 70% { opacity: .3; } }
#vigSat { position: absolute; inset: 0; opacity: 0; transition: opacity .5s; }
@media (pointer: fine) { #vigSat.on { opacity: 1; backdrop-filter: saturate(.4) contrast(1.05); -webkit-backdrop-filter: saturate(.4) contrast(1.05); } }
#vigFx { position: absolute; inset: 0; opacity: 0; transition: opacity .4s, background .4s; }
/* power-up grab pulse (Time Warp / Shield / Zombie Blood ...): static edge tint in the power-up colour, ui.js drives opacity only */
#vigPu { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(ellipse 80% 75% at 50% 50%, transparent 50%, var(--pu, #8ae8ff) 135%); }
#vigFx.frost { opacity: 1; background: radial-gradient(ellipse at center, rgba(160,210,255,0) 45%, rgba(150,205,255,.28) 75%, rgba(220,240,255,.6) 100%); box-shadow: inset 0 0 120px rgba(180,225,255,.45); }
#vigFx.toxic { opacity: 1; background: radial-gradient(ellipse at center, rgba(80,200,40,0) 45%, rgba(80,190,40,.28) 78%, rgba(60,150,20,.6) 100%); animation: toxic 2.4s ease-in-out infinite; }
#vigFx.burn { opacity: 1; background: radial-gradient(ellipse at center 70%, rgba(255,120,20,0) 40%, rgba(255,110,20,.3) 75%, rgba(220,60,0,.65) 100%); animation: burn .18s steps(2) infinite alternate; }
#vigFx.shock { opacity: 1; background: radial-gradient(ellipse at center, rgba(120,180,255,.05) 30%, rgba(90,150,255,.4) 100%); animation: shock .5s ease-out infinite; }
@keyframes toxic { 50% { filter: hue-rotate(-14deg) brightness(1.15); } }
@keyframes burn { from { opacity: .75; } to { opacity: 1; } }
@keyframes shock { 0% { opacity: 1; background-color: rgba(170,210,255,.2); } 30% { opacity: .55; background-color: rgba(0,0,0,0); } 100% { opacity: .85; } }

/* top-left: painted round counter */
#hTL { position: absolute; left: calc(26px + var(--sal)); top: calc(18px + var(--sat)); display: flex; flex-direction: column; align-items: flex-start; width: min(380px, 36vw); }
/* #hRound (hero painted tally): see the ROUND MARKER block at the end of this file */
#hLeft { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 4px 20px 4px 9px; background: linear-gradient(90deg, rgba(0,0,0,.7), rgba(0,0,0,.38) 70%, rgba(0,0,0,0)); border-left: 3px solid rgba(208,42,29,.9); font-size: clamp(13px, 2vmin, 18px); font-weight: 700; letter-spacing: .2em; color: #c9c3b6; text-transform: uppercase; text-shadow: 0 1px 4px #000; }
#hLeft:empty { display: none; }
#hLeft .hli { width: 18px; height: 18px; color: var(--red2); opacity: .8; }
#hLeft b { font-family: var(--head); font-weight: 400; font-size: 1.55em; letter-spacing: .04em; color: #fff; line-height: 1; }
#hLeft span:not(.gr) { font-size: .78em; color: #a59f93; }
#hLeft .gr { font-size: 14px; letter-spacing: .24em; color: #e8e2d6; animation: grPulse 1.6s ease-in-out infinite; }
#hLeft:has(.gr) .hli { color: var(--acc); opacity: 1; }
@keyframes grPulse { 50% { opacity: .72; } }
#fps { position: absolute; right: calc(10px + var(--sar)); top: calc(6px + var(--sat)); font-size: 11px; font-weight: 700; letter-spacing: .1em; color: rgba(255,255,255,.55); }

/* toasts */
/* notification feed: its own lane in the left column under the round counter (never collides with #announce) */
#toasts { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 14px; max-width: 100%; }
#toasts:empty { display: none; }
.toast { position: relative; max-width: 100%; padding: 6px 14px 6px 12px; background: linear-gradient(90deg, rgba(8,8,10,.78), rgba(8,8,10,.62) 80%, rgba(8,8,10,.3)); border-left: 2px solid var(--acc); box-shadow: 0 6px 16px rgba(0,0,0,.3); font-size: clamp(12px, 1.6vmin, 14px); font-weight: 600; line-height: 1.25; letter-spacing: .08em; text-transform: uppercase; color: var(--tx); text-shadow: 0 1px 3px #000; animation: toast 3.5s ease forwards; }
.toast b { color: #fff; font-weight: 700; }
.toast .gold { color: var(--acc2); }
@keyframes toast { 0% { opacity: 0; transform: translateX(-14px); clip-path: inset(0 100% 0 0); } 7% { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } 84% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(-6px); } }

/* announcement */
/* hero moment: centred at ~32% height, scales/defocuses in, holds, then (round) flies into the top-left tally */
#announce { --ac: var(--acc); --as: 1; --ay: 24vh; --fx: calc(-50vw + 64px + var(--sal)); --fy: calc(-1 * var(--ay) + 55px); --fs: .54; position: absolute; left: 50%; top: calc(var(--ay) + var(--sat)); transform: translate(-50%, -50%) scale(var(--as)); display: flex; flex-direction: column; align-items: center; text-align: center; opacity: 0; white-space: nowrap; pointer-events: none; }
#announce::before { content: ''; position: absolute; left: 50%; top: 50%; width: 170%; height: 150%; transform: translate(-50%, -50%); z-index: -1; background: radial-gradient(ellipse closest-side, rgba(0,0,0,.6), transparent); }
#announce.on { animation: announce 3.25s linear forwards; }
#announce.round.on { animation: announceRound 2.3s linear forwards; }
#announce.round.on em, #announce.round.on small { animation: annSub 2.3s linear forwards; }
@keyframes annSub { 0%, 52% { opacity: 1; } 64%, 100% { opacity: 0; } }
#hud.isdown #announce { visibility: hidden; }
#announce small { display: block; margin-top: 6px; font-family: var(--head); font-size: 24px; letter-spacing: .26em; margin-right: -.26em; color: var(--ac); text-shadow: 0 1px 6px #000, 0 0 18px color-mix(in srgb, var(--ac) 55%, transparent); }
#announce div { font-family: var(--head); font-size: clamp(52px, 10vmin, 112px); line-height: .95; letter-spacing: .04em; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.8), 0 0 40px rgba(0,0,0,.5); }
#announce .aline { display: block; width: 0; height: 2px; margin-top: 8px; background: linear-gradient(90deg, transparent, var(--ac), transparent); animation: aline 3.2s var(--ease) forwards; }
@keyframes aline { 0% { width: 0; } 25%, 80% { width: 100%; } 100% { width: 100%; opacity: 0; } }
/* round banner support text: "ROUND" label + "N ZOMBIES" subline each sit on a dark brush band so they read over lit walls */
#announce.round em, #announce.round small { position: relative; padding: 5px 34px 4px calc(34px + .5em); background: linear-gradient(90deg, transparent, rgba(0,0,0,.62) 18%, rgba(0,0,0,.7) 50%, rgba(0,0,0,.62) 82%, transparent); }
#announce.round em { font-style: normal; font-family: var(--head); font-size: 26px; line-height: 1; letter-spacing: .5em; margin-right: -.5em; color: #e8dccb; text-shadow: 0 2px 6px #000, 0 0 18px rgba(0,0,0,.8); }
#announce.round small b { font-weight: 400; color: var(--acc2); text-shadow: 0 2px 0 #000, 0 0 14px rgba(232,163,58,.45); }
@keyframes announce {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--as) * 1.15)); filter: blur(6px); animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); filter: blur(0); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); animation-timing-function: ease-in; }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 16px)) scale(calc(var(--as) * .97)); }
}
/* paints in big at centre-top, holds ~1.2s, then flies + shrinks into the #hRound slot (which is empty until it lands) */
@keyframes announceRound {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--as) * 1.2)); filter: blur(5px); animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  10% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); filter: blur(0); }
  58% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
  92% { opacity: 1; transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(calc(var(--as) * var(--fs))); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(calc(var(--as) * var(--fs))); }
}

/* teammates */
#hMates { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
#hMates:empty { display: none; }
.mate { display: flex; align-items: center; gap: 10px; min-width: 180px; padding: 4px 10px; background: linear-gradient(90deg, rgba(0,0,0,.6), rgba(0,0,0,0)); border-left: 3px solid var(--beige); font-size: clamp(12px, 1.7vmin, 15px); }
.mate span { flex: 1; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.mate b { font-family: var(--head); font-weight: 400; font-size: 1.3em; letter-spacing: .04em; color: var(--acc2); }
.mate em { font-style: normal; font-size: .72em; font-weight: 700; letter-spacing: .14em; padding: 1px 5px; background: rgba(255,255,255,.1); }
.mate.down { border-left-color: var(--red2); background: linear-gradient(90deg, rgba(120,10,5,.5), rgba(0,0,0,0)); }
.mate.down em { background: var(--red); color: #fff; animation: blink 1s steps(2) infinite; }
.mate.dead { border-left-color: #555; opacity: .55; }
.mate.dead span, .mate.dead b { color: #777; text-decoration: line-through; }

/* crosshair */
#cross { --g: 10px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transition: opacity .12s; }
#cross i { position: absolute; background: rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 0 4px rgba(0,0,0,.5); border-radius: 1px; transition: transform .08s linear; }
#cross i.t, #cross i.b { width: 2px; height: 10px; left: -1px; }
#cross i.l, #cross i.r { width: 10px; height: 2px; top: -1px; }
#cross i.t { top: -10px; transform: translateY(calc(var(--g) * -1)); }
#cross i.b { top: 0; transform: translateY(var(--g)); }
#cross i.l { left: -10px; transform: translateX(calc(var(--g) * -1)); }
#cross i.r { left: 0; transform: translateX(var(--g)); }
#cross::after { content: ''; position: absolute; left: -1.5px; top: -1.5px; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
#cross.hide { opacity: 0; }

/* hitmarker: crisp opaque ticks with a hard 1px black outline, readable on any wall (kill: thicker red, still outlined) */
#hitm { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; --hc: #fff; }
#hitm i { position: absolute; left: -1px; top: -1px; width: 2px; height: 12px; background: var(--hc); box-shadow: 0 0 0 1px #000, 0 0 5px rgba(0,0,0,.5); transform-origin: 1px 1px; }
#hitm i:nth-child(1) { transform: rotate(45deg) translateY(8px); }
#hitm i:nth-child(2) { transform: rotate(135deg) translateY(8px); }
#hitm i:nth-child(3) { transform: rotate(225deg) translateY(8px); }
#hitm i:nth-child(4) { transform: rotate(315deg) translateY(8px); }
#hitm::after { content: ''; position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--hc); opacity: 0; box-shadow: 0 0 0 1px #000, 0 0 10px rgba(255,40,20,.6); }
#hitm.on { animation: hitm .34s linear forwards; }
#hitm.head { --hc: #ffc65a; }
#hitm.head i { box-shadow: 0 0 0 1px #000, 0 0 8px rgba(255,190,90,.7); }
#hitm.kill { --hc: #ff3424; }
#hitm.kill i { width: 3px; height: 15px; left: -1.5px; transform-origin: 1.5px 1.5px; box-shadow: 0 0 0 1px #000, 0 0 0 2px rgba(0,0,0,.35), 0 0 9px rgba(255,40,20,.7); }
#hitm.kill i:nth-child(1) { transform: rotate(45deg) translateY(9px); } #hitm.kill i:nth-child(2) { transform: rotate(135deg) translateY(9px); }
#hitm.kill i:nth-child(3) { transform: rotate(225deg) translateY(9px); } #hitm.kill i:nth-child(4) { transform: rotate(315deg) translateY(9px); }
#hitm.kill::after { animation: ghost .42s cubic-bezier(.2,.8,.2,1) forwards; }
/* 340ms: snaps in at 1.25 -> 1 and holds full opacity for the first ~120ms, then fades */
@keyframes hitm { 0% { opacity: 1; transform: scale(1.25); animation-timing-function: cubic-bezier(.2,.8,.2,1); } 22% { transform: scale(1); } 36% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
@keyframes ghost { 0% { opacity: .85; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.7); } }

/* magnified scope eyepiece (2.5x+ optics): dark housing outside the lens, tinted lens with eye-box shadow + chromatic
   edge, glint, lit bezel ring; reticle is an SVG (ui.js scopeHTML) */
#scope { position: absolute; inset: 0; display: none; pointer-events: none;
  background: radial-gradient(circle at center, transparent 0, transparent 40.6vmin, rgba(6,7,8,.7) 41.2vmin, #030304 42.8vmin); }
#scope.on { display: block; }
#scope .sc-lens, #scope .sc-ret, #scope .sc-glint, #scope .sc-ring { position: absolute; left: 50%; top: 50%; width: 82vmin; height: 82vmin; transform: translate(-50%, -50%); border-radius: 50%; }
#scope .sc-lens { background: radial-gradient(circle at 50% 50%, rgba(40,90,100,.05) 0, rgba(30,70,80,.08) 55%, rgba(0,0,0,.35) 86%, rgba(0,0,0,.85) 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255,120,60,.18), inset 0 0 0 4px rgba(60,140,255,.10), inset 0 0 38px rgba(0,0,0,.9); }
#scope .sc-ret { overflow: visible; }
#scope .sc-ret line, #scope .sc-ret circle { shape-rendering: geometricPrecision; }
#scope .sc-ret .ill { filter: drop-shadow(0 0 1.2px rgba(255,70,40,.9)) drop-shadow(0 0 4px rgba(255,60,30,.45)); }
#scope .sc-ret .bdc { font: 600 5px var(--head, sans-serif); fill: #0a0a0a; }
#scope .sc-glint { background: radial-gradient(ellipse 34% 18% at 32% 22%, rgba(190,220,255,.10), transparent 70%), radial-gradient(ellipse 12% 6% at 70% 80%, rgba(255,200,150,.05), transparent 70%); mix-blend-mode: screen; }
#scope .sc-ring { width: 84.6vmin; height: 84.6vmin; box-shadow: 0 0 0 2px rgba(120,124,130,.35), 0 0 0 5px rgba(20,21,24,.9), 0 -2px 6px 4px rgba(200,200,210,.06); }
/* interaction prompt */
#hPrompt { position: absolute; left: 50%; top: calc(50% + clamp(50px, 9.5vmin, 86px)); transform: translate(-50%, 6px); display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px 10px; max-width: min(92vw, 620px); padding: 8px 46px; background: linear-gradient(90deg, rgba(6,7,9,0), rgba(6,7,9,.72) 18%, rgba(6,7,9,.72) 82%, rgba(6,7,9,0)); font-size: clamp(13px, 1.9vmin, 17px); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--tx); text-align: center; text-shadow: 0 1px 3px #000; opacity: 0; visibility: hidden; transition: opacity .15s, transform .2s var(--ease), visibility 0s .15s; }
#hPrompt.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .15s, transform .2s var(--ease); }
#hPrompt small { font-size: .72em; font-weight: 700; letter-spacing: .2em; color: var(--dim); }
#hPrompt kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; background: linear-gradient(180deg, #fff, #d8d2c4); color: #15140f; border-radius: 3px; box-shadow: 0 3px 0 #77715f, 0 4px 8px rgba(0,0,0,.6); font-family: var(--head); font-size: 1.1em; line-height: 1; text-shadow: none; margin-top: -3px; }
#hPrompt .kic { width: 18px; height: 18px; }
#hPrompt .cost { display: inline-flex; align-items: center; gap: 4px; color: var(--acc2); font-family: var(--head); font-size: 1.3em; letter-spacing: .04em; text-shadow: 0 0 10px rgba(232,163,58,.4), 0 1px 3px #000; }
#hPrompt .cost.no { color: var(--red2); text-shadow: 0 1px 3px #000; }
#hPrompt .cic { width: .8em; height: .8em; }
#hPrompt .pbar { display: block; flex: 1 0 100%; height: 4px; margin-top: 4px; background: rgba(255,255,255,.14); overflow: hidden; border-radius: 2px; }
#hPrompt .pbar b { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); box-shadow: 0 0 8px rgba(232,163,58,.8); }

/* damage direction */
/* curved red arc (~120px) on a 34vmin ring: hot outer edge fading inward; holds 0.3s then a 0.9s fade tail (1.2s total) */
#dmgdirs { position: absolute; left: 50%; top: 50%; width: 68vmin; height: 68vmin; transform: translate(-50%, -50%); }
.dmgdir { position: absolute; inset: 0; }
.dmgdir::before {
  content: ''; position: absolute; left: 50%; top: -6px; width: 128px; height: 46px; margin-left: -64px;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0; border-top: 7px solid rgba(255,64,40,.95);
  background: radial-gradient(ellipse 60% 120% at 50% 0%, rgba(200,16,8,.55), rgba(200,16,8,.15) 55%, transparent 75%);
  filter: drop-shadow(0 0 8px rgba(255,30,10,.75));
  -webkit-mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); mask: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  animation: dmgdir 1.2s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes dmgdir { 0% { opacity: 0; transform: translateY(-10px) scaleX(.8); } 8% { opacity: 1; transform: translateY(-4px) scaleX(1); } 25% { opacity: 1; transform: translateY(-2px); } 100% { opacity: 0; transform: translateY(10px) scaleX(.94); } }

/* bottom-left: chat / perks / popups / points / hp */
#hBL { position: absolute; left: calc(28px + var(--sal)); bottom: calc(24px + var(--sab)); width: 340px; max-width: 42vw; }
#hudChat { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; max-width: 340px; }
#hudChat .cl { font-size: clamp(12px, 1.7vmin, 15px); background: rgba(0,0,0,.42); padding: 2px 8px; align-self: flex-start; animation: clIn .25s ease, hudChatOut 8s linear forwards; }
@keyframes hudChatOut { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
#hPerks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.perk { position: relative; isolation: isolate; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--acc2); animation: perkIn .4s var(--ease) both; }
.perk::before { content: ''; position: absolute; inset: 15%; z-index: -1; transform: rotate(45deg); border: 2px solid rgba(232,163,58,.8); background: radial-gradient(circle at 50% 30%, rgba(80,52,16,.95), rgba(12,10,8,.9)); box-shadow: 0 0 8px rgba(232,163,58,.35), 0 2px 4px rgba(0,0,0,.6); }
.perk.mach { --c: #d02a1d; border-radius: 50%; color: #fff; background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--c) 70%, #fff 30%), var(--c) 45%, color-mix(in srgb, var(--c) 45%, #000 55%)); box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 0 3px color-mix(in srgb, var(--c) 60%, #fff 40%), 0 0 14px color-mix(in srgb, var(--c) 55%, transparent); filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.perk.mach::before { display: none; }
.perk.mach .glyph { filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
@keyframes perkIn { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
.perk img { width: 70%; height: 70%; object-fit: contain; }
.perk b { position: absolute; right: -5px; bottom: -4px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--acc); color: #1a1206; font-size: 10px; display: flex; align-items: center; justify-content: center; }
#popups { position: relative; height: 0; }
/* +points: bright yellow, punchy scale-in, stacked lanes (ui.popup sets --x / --sy). The only .pop rule (phones: see the max-height:520px block) */
.pop { position: absolute; left: 4px; bottom: 12px; font-family: var(--head); font-size: 26px; letter-spacing: .02em; color: #ffd34d; white-space: nowrap; transform: translate(var(--x, 0), var(--sy, 0));
  text-shadow: 0 2px 0 #000, 0 0 2px #000, 0 0 10px rgba(255,180,0,.6); animation: pop2 .95s cubic-bezier(.2, .8, .2, 1) forwards; }
.pop.big { font-size: 30px; color: #ffe27a; }
@keyframes pop2 {
  0% { opacity: 0; transform: translate(var(--x, 0), var(--sy, 0)) scale(1.5); }
  10% { opacity: 1; transform: translate(var(--x, 0), var(--sy, 0)) scale(1.25); }
  26% { transform: translate(var(--x, 0), calc(var(--sy, 0px) - 4px)) scale(1); }
  72% { opacity: 1; transform: translate(var(--x, 0), calc(var(--sy, 0px) - 7px)) scale(1); }
  100% { opacity: 0; transform: translate(calc(var(--x, 0px) + 6px), calc(var(--sy, 0px) - 16px)) scale(.94); }
}
/* points + health on one skewed glass plate (~320x72): points left, HP number directly above a 10-segment bar */
.hpplate { position: relative; isolation: isolate; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; column-gap: 18px; width: 320px; max-width: 100%; min-height: 72px; padding: 10px 16px 12px 16px; transition: opacity .3s; }
.hpplate::before { content: ''; position: absolute; inset: 0; z-index: -1; transform: skewX(-8deg); transform-origin: bottom left; background: linear-gradient(180deg, rgba(12,12,15,.66), rgba(8,8,10,.52)); border-top: 1px solid rgba(232,163,58,.75); box-shadow: 0 12px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04); }
.hpplate::after { content: ''; position: absolute; left: -3px; top: -1px; width: 34px; height: 3px; background: var(--acc); box-shadow: 0 0 10px rgba(232,163,58,.7); transform: skewX(-8deg); }
.pts { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
#hPoints { font-family: var(--head); font-size: 46px; line-height: .86; letter-spacing: .03em; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); }
.plab { font-size: 11px; font-weight: 700; letter-spacing: .3em; color: var(--acc); }
.hpcol { min-width: 0; display: flex; flex-direction: column; gap: 5px; padding-bottom: 2px; }
#hHp { display: flex; align-items: baseline; gap: 5px; font-family: var(--head); font-size: 26px; line-height: .9; color: #fff; white-space: nowrap; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
#hHp .hpi { width: .6em; height: .6em; align-self: center; color: var(--red2); fill: currentColor; stroke: none; filter: drop-shadow(0 0 4px rgba(255,60,30,.6)); }
#hHp .hpi.sk { fill: none; stroke: currentColor; }
#hHp small { font-size: .6em; color: rgba(255,255,255,.55); letter-spacing: .06em; }
#hHp .red { animation: blink .8s steps(2) infinite; letter-spacing: .1em; }
.hp-track { position: relative; height: 8px; background: rgba(255,255,255,.07); box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.5); overflow: hidden; }
.hp-track::after { content: ''; position: absolute; inset: 0; z-index: 2; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(8,8,10,.92) calc(10% - 2px) 10%); }
#hHpTrail { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: rgba(255,190,175,.75); transition: width .6s cubic-bezier(.4,0,.2,1) .25s; }
#hHpTrail.snap { transition: none; }
#hHpBar { position: relative; z-index: 1; width: 100%; height: 100%; background: linear-gradient(180deg, #ff7a5c, #d62d1e 55%, #9a150b); box-shadow: 0 0 10px rgba(255,60,30,.55); transition: width .18s ease-out; }
#hHpBar.low { background: linear-gradient(180deg, #ff9a7a, #ff3a24 55%, #c41a0c); animation: hpLow .8s ease-in-out infinite; }
@keyframes hpLow { 50% { filter: brightness(1.55); box-shadow: 0 0 16px rgba(255,60,30,.95); } }
/* down: HUD recedes so the bleed-out timer owns the screen */
#hud.isdown .hpplate, #hud.isdown #hBR, #hud.isdown #hPerks { opacity: .35; }

/* bottom-center: buffs + down panel */
#hBuffs { position: absolute; left: 50%; bottom: calc(24px + var(--sab)); transform: translateX(-50%); display: flex; gap: 12px; }
.buff { --c: var(--beige); --p: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; animation: perkIn .4s var(--ease) both; }
.buff .bic { width: clamp(40px, 5.8vmin, 54px); height: clamp(40px, 5.8vmin, 54px); padding: 3px; border-radius: 50%; background: conic-gradient(var(--c) var(--p), rgba(255,255,255,.12) 0); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 45%, transparent); }
.buff .glyph, .buff img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle at 50% 35%, rgba(30,30,34,.95), rgba(6,6,8,.95)); color: var(--c); font-size: clamp(18px, 2.7vmin, 25px); object-fit: contain; padding: 22%; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 60%, transparent)); }
.buff b { font-family: var(--head); font-weight: 400; font-size: clamp(15px, 2.1vmin, 19px); color: #fff; text-shadow: 0 1px 4px #000; line-height: 1; }
.buff.blink { animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* down state: bleed-out ring around a skull at centre-bottom, big seconds numeral, revive bar only while reviving */
#downPanel { position: absolute; left: 50%; bottom: calc(9% + var(--sab)); transform: translate(-50%, 12px); width: min(460px, 86vw); display: flex; flex-direction: column; align-items: center; text-align: center; opacity: 0; visibility: hidden; transition: opacity .25s, transform .3s var(--ease), visibility 0s .25s; }
#downPanel.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .25s, transform .3s var(--ease); }
#downPanel::before { content: ''; position: absolute; left: 50%; top: 50%; width: 170%; height: 150%; transform: translate(-50%, -50%); z-index: -1; background: radial-gradient(ellipse closest-side, rgba(0,0,0,.55), transparent); pointer-events: none; }
#dpT { font-family: var(--head); font-size: clamp(30px, 5.4vmin, 50px); line-height: 1; letter-spacing: .12em; margin-right: -.12em; color: #ff5a40; text-shadow: 0 0 22px rgba(255,40,20,.55), 0 2px 4px #000; }
.dp-ring { position: relative; width: clamp(96px, 14vmin, 128px); aspect-ratio: 1; margin: 10px 0 0; }
.dp-ring svg:first-child { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.dp-bg { fill: rgba(10,4,4,.55); stroke: rgba(255,255,255,.12); stroke-width: 6; }
.dp-fg { fill: none; stroke: #ff3a24; stroke-width: 6; stroke-linecap: butt; stroke-dasharray: 100 100; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px rgba(255,40,20,.85)); transition: stroke-dashoffset .25s linear, stroke .2s; }
.dp-skull { position: absolute; left: 50%; top: 50%; width: 48%; height: 48%; transform: translate(-50%, -52%); color: #f2e6dc; filter: drop-shadow(0 0 10px rgba(255,40,20,.6)) drop-shadow(0 2px 2px #000); animation: skullBeat 1.1s ease-in-out infinite; }
@keyframes skullBeat { 0%, 100% { transform: translate(-50%, -52%) scale(1); } 14% { transform: translate(-50%, -52%) scale(1.08); } 28% { transform: translate(-50%, -52%) scale(1); } 42% { transform: translate(-50%, -52%) scale(1.05); } }
#dpN { margin-top: -6px; font-family: var(--head); font-size: clamp(44px, 7.6vmin, 72px); line-height: .9; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.9), 0 0 24px rgba(255,40,20,.4); }
#dpN:empty { display: none; }
#dpN small { margin-left: 4px; font-size: .3em; letter-spacing: .2em; color: rgba(255,255,255,.6); }
#dpS { margin: 6px 0 0; font-size: clamp(12px, 1.8vmin, 16px); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #e1cfc8; text-shadow: 0 1px 4px #000; }
.dp-track { display: none; width: min(320px, 70vw); height: 6px; margin-top: 10px; background: rgba(255,255,255,.12); overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
#downPanel.rev .dp-track { display: block; }
#dpBar { height: 100%; width: 0; background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.8); transition: width .15s linear; }
#downPanel.rev .dp-fg { stroke: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,.7)); }
#downPanel.rev #dpT { color: #fff; text-shadow: 0 0 18px rgba(255,255,255,.35), 0 2px 4px #000; }
#downPanel.rev .dp-skull { animation: none; color: #fff; }
#downPanel.spec .dp-ring { display: none; }
/* desaturated world + heavy red edges only (inner 45% clear) */
#hud.isdown #vigHurt { opacity: .85 !important; background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 50%, rgba(130,6,2,.55) 80%, rgba(60,0,0,.9) 100%); }
#hud.isdown #vigHurt::after { animation: heartbeat 1.1s ease-in-out infinite; }
#hud.isdown #vigSat { opacity: 1; background: radial-gradient(ellipse 80% 75% at 50% 50%, rgba(20,20,24,.12), rgba(20,20,24,.32)); }
/* last stand: you can still crawl + fire the sidearm, so the crosshair stays but recedes and turns red;
   .out (solo bleed-out / spectating) = nothing you can do, so combat UI goes away entirely */
#hud.isdown #cross { opacity: .45; }
#hud.isdown #cross i, #hud.isdown #cross::after { background: #ff6a55; }
#hud.out #cross, #hud.out #hitm, #hud.out #hPrompt { opacity: 0 !important; }
#hud.isdown ~ #touch :is(#tJump, #tSwap, #tKnife, #tUse),
#hud.out ~ #touch .tb:not(#tPause) { opacity: .18; pointer-events: none; filter: grayscale(1); animation: none; }
#hud.out ~ #touch #touchMove::after, #hud.out ~ #touch #stick { opacity: 0; }
@media (pointer: fine) { #hud.isdown #vigSat { background: none; backdrop-filter: saturate(.15) contrast(1.08) brightness(.9); -webkit-backdrop-filter: saturate(.15) contrast(1.08) brightness(.9); } }

/* bottom-right: weapon block on a skewed dark plate with an amber hairline */
/* weapon block: one skewed (-8deg) dark glass plate ~320x150 with an amber top line; weapon art | ammo, slots below */
#hBR { position: absolute; right: calc(28px + var(--sar)); bottom: calc(24px + var(--sab)); width: 324px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "w m" "s s"; align-items: end; column-gap: 12px; padding: 12px 16px 12px 22px; isolation: isolate; transition: opacity .3s; }
#hBR::before { content: ''; position: absolute; z-index: -1; inset: 0; transform: skewX(-8deg); transform-origin: bottom right; background: linear-gradient(180deg, rgba(12,12,15,.66), rgba(8,8,10,.52)); border-top: 1px solid rgba(232,163,58,.75); box-shadow: 0 12px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04); }
#hBR::after { content: ''; position: absolute; right: -3px; top: -1px; width: 34px; height: 3px; background: var(--acc); box-shadow: 0 0 10px rgba(232,163,58,.7); transform: skewX(-8deg); }
#hReload { position: absolute; right: 16px; bottom: calc(100% + 8px); display: flex; align-items: center; gap: 6px; min-height: 1.4em; padding: 3px 10px; font-size: clamp(11px, 1.6vmin, 14px); font-weight: 700; letter-spacing: .24em; color: var(--acc2); white-space: nowrap; text-shadow: 0 1px 4px #000, 0 0 10px rgba(232,163,58,.4); background: linear-gradient(90deg, transparent, rgba(0,0,0,.55) 25%); }
#hReload:empty { display: none; }
#hReload .rli { width: 1.2em; height: 1.2em; }
#hReload .rli.spin { animation: spin .8s linear infinite; }
#hReload kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; background: var(--acc); color: #1a1206; border-radius: 2px; font-family: var(--head); font-size: 1.2em; letter-spacing: 0; text-shadow: none; animation: blink 1s steps(2) infinite; }
#hWeapon { grid-area: w; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
#hWeapon img { width: 150px; max-width: 100%; aspect-ratio: 2 / 1; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)) drop-shadow(0 6px 12px rgba(0,0,0,.6)); }
#hWeapon img.px { opacity: .8; }
#hWeapon .wn { max-width: 100%; margin-top: -2px; font-family: var(--head); font-size: 17px; letter-spacing: .16em; line-height: 1; text-transform: uppercase; color: #ddd6c8; text-shadow: 0 1px 4px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hMag { grid-area: m; display: grid; grid-template-columns: auto auto; align-items: end; justify-items: end; column-gap: 6px; line-height: .84; text-shadow: 0 2px 10px rgba(0,0,0,.75); white-space: nowrap; padding-bottom: 2px; }
#hMag b.kn { display: flex; align-items: center; height: 60px; color: rgba(255,255,255,.85); }
#hMag .kni { width: 42px; height: 42px; }
/* mag pips: real 3x10 bars, 2px gaps, wrap to 2 rows above 24 (column count from --cols) */
#hMag .pips { grid-column: 1 / 3; justify-self: end; display: grid; grid-template-columns: repeat(var(--cols, 12), 3px); grid-auto-rows: 10px; gap: 2px; margin: 8px 0 0; }
#hMag .pips u { display: block; background: #f2e6cf; box-shadow: 0 0 3px rgba(255,240,210,.35); }
#hMag .pips u.o { background: rgba(255,255,255,.12); box-shadow: none; }
#hMag .pips.low u:not(.o) { background: #ff3b2f; box-shadow: 0 0 4px rgba(255,59,47,.8); animation: pipPulse .7s ease-in-out infinite; }
#hMag .pips.red u { background: rgba(255,59,47,.35); animation: pipPulse .7s ease-in-out infinite; }
@keyframes pipPulse { 50% { opacity: .45; } }
#hMag b { font-family: var(--head); font-weight: 400; font-size: 62px; color: #fff; letter-spacing: .02em; text-align: right; }
#hMag b.warn { color: #ff3b2f; text-shadow: 0 0 16px rgba(255,59,47,.45), 0 2px 8px rgba(0,0,0,.8); }
#hMag b.red { color: #ff3b2f; animation: blink .7s steps(2) infinite; }
#hMag b, #hMag small { font-variant-numeric: tabular-nums; }
#hMag small { font-family: var(--head); font-size: 26px; color: #cfc6b8; letter-spacing: .04em; padding-bottom: .2em; }
#hMag small::before { content: '/'; margin-right: 5px; }
#hMag b.kn + small::before { content: none; }
#hSlots { grid-area: s; display: flex; justify-content: flex-end; gap: 4px; margin-top: 10px; }
.slot { position: relative; flex: none; display: flex; align-items: center; justify-content: center; gap: 4px; width: 90px; height: 34px; padding: 0 6px 0 22px; background: linear-gradient(180deg, rgba(10,11,13,.72), rgba(0,0,0,.45)); border: 1px solid rgba(255,255,255,.12); transition: opacity .15s, border-color .15s, background .15s; }
.slot > span { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; font-family: var(--head); font-size: 13px; line-height: 1; color: rgba(255,255,255,.8); background: rgba(255,255,255,.12); border-radius: 1px; }
.slot img { width: 60px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 0 rgba(0,0,0,.7)); opacity: .8; }
.slot:not(.on):not(.empty) img { opacity: .62; }
.slot.empty { background: rgba(0,0,0,.18); border: 1px dashed rgba(255,255,255,.18); }
.slot .sadd { font-style: normal; font-family: var(--body); font-size: 20px; font-weight: 300; line-height: 1; color: rgba(255,255,255,.6); }
.slot.on img { opacity: 1; }
.slot.on { opacity: 1; border-color: var(--acc); background: linear-gradient(180deg, rgba(232,163,58,.42), rgba(150,95,20,.35)); box-shadow: 0 0 14px rgba(232,163,58,.3), inset 0 1px 0 rgba(255,255,255,.2); }
.slot.on span { background: var(--acc); color: #1a1206; }
.slot.on::after { content: ''; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 2px; background: var(--acc2); box-shadow: 0 0 8px rgba(232,163,58,.8); }

/* ================================================================ TOUCH */
#touch { position: fixed; inset: 0; z-index: 20; display: none; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; --ts: 1; }
#hud.on ~ #touch.on { display: block; }
#touchMove, #touchLook { position: absolute; top: 0; bottom: 0; pointer-events: auto; touch-action: none; }
#touchMove { left: 0; width: 45%; }
#touchLook { right: 0; width: 55%; }
#stick { position: absolute; left: 0; top: 0; width: calc(116px * var(--ts)); height: calc(116px * var(--ts)); transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(0,0,0,.04) 40%, rgba(0,0,0,.26)); border: 2px solid rgba(255,255,255,.22); box-shadow: 0 0 20px rgba(0,0,0,.3); pointer-events: none; opacity: 0; transition: opacity .12s; }
#stick::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; border: 1px dashed rgba(255,255,255,.12); }
#stick.on { opacity: 1; }
#knob { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; margin: -21% 0 0 -21%; border-radius: 50%; background: rgba(255,255,255,.4); border: 2px solid rgba(255,255,255,.7); box-shadow: 0 3px 12px rgba(0,0,0,.45), 0 0 14px rgba(232,163,58,.2); }

.tb {
  --k: var(--ts, 1); --s: 56px;
  --R0: calc(22px + var(--sar)); --B0: calc(30px + var(--sab));
  position: absolute; width: calc(var(--s) * var(--k)); height: calc(var(--s) * var(--k));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 0; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.32);
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.14), rgba(12,13,15,.45) 70%); color: #fff; pointer-events: auto; touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.35);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline: none;
  transition: background .08s, transform .08s, border-color .08s, box-shadow .12s;
}
.tb .tg { width: calc(var(--s) * var(--k) * .38); height: calc(var(--s) * var(--k) * .38); flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.tb .tl { font-family: var(--body); font-size: calc(8.5px * var(--k)); font-weight: 700; letter-spacing: .14em; opacity: .85; line-height: 1; text-shadow: 0 1px 2px #000; }
.tb.down { background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.4), rgba(214,205,180,.3)); border-color: #fff; transform: scale(.92); box-shadow: 0 0 18px rgba(255,255,255,.25); }
.tb.active { background: radial-gradient(circle at 50% 30%, rgba(255,198,107,.7), rgba(232,163,58,.45)); border-color: var(--acc2); color: #1a1206; box-shadow: 0 0 18px rgba(232,163,58,.5); }
.tb.active .tg, .tb.active .tl { filter: none; text-shadow: none; }
/* thumb cluster: FIRE 76px; secondaries 52px on a 95px arc around it (JUMP / AIM / RELOAD) plus an outer arc
   (KNIFE / SWAP) so every gap is >= 10px and nothing sits in FIRE's thumb-travel path */
#tFire { --s: 76px; right: var(--R0); bottom: var(--B0); border: 2px solid rgba(255,74,54,.8); background: radial-gradient(circle at 50% 30%, rgba(255,90,60,.35), rgba(80,10,6,.5) 70%); box-shadow: inset 0 0 0 4px rgba(0,0,0,.25), 0 0 22px rgba(208,42,29,.35); }
#tFire .tg { width: calc(var(--s) * var(--k) * .42); height: calc(var(--s) * var(--k) * .42); }
#tFire.down { background: radial-gradient(circle at 50% 30%, rgba(255,120,90,.7), rgba(208,42,29,.6)); box-shadow: 0 0 30px rgba(255,60,30,.6); }
#tJump { --s: 52px; right: calc(var(--R0) + 107px * var(--k)); bottom: calc(var(--B0) + 12px * var(--k)); }
#tAds { --s: 52px; right: calc(var(--R0) + 79px * var(--k)); bottom: calc(var(--B0) + 79px * var(--k)); }
#tReload { --s: 52px; right: calc(var(--R0) + 12px * var(--k)); bottom: calc(var(--B0) + 107px * var(--k)); }
#tKnife { --s: 52px; right: calc(var(--R0) + 160px * var(--k)); bottom: calc(var(--B0) + 73px * var(--k)); }
#tSwap { --s: 52px; right: calc(var(--R0) + 73px * var(--k)); bottom: calc(var(--B0) + 160px * var(--k)); }
#tUse { --s: 72px; right: calc(var(--R0) + 227px * var(--k)); bottom: calc(var(--B0) + 2px * var(--k)); display: none; background: radial-gradient(circle at 50% 30%, rgba(255,198,107,.5), rgba(120,70,10,.45) 70%); border: 2px solid var(--acc2); color: #fff; animation: usePulse 1.2s ease-in-out infinite; }
#tUse.show { display: flex; }
#tUse.down { background: radial-gradient(circle at 50% 30%, var(--acc2), var(--acc)); color: #1a1206; }
@keyframes usePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,163,58,.6); } 50% { box-shadow: 0 0 0 calc(12px * var(--k)) rgba(232,163,58,0); } }
#tPause { --s: 44px; --k: 1 !important; top: calc(8px + var(--sat)); right: calc(10px + var(--sar)); bottom: auto; border-radius: 4px; }
#tPause .tg { width: 18px; height: 18px; }

/* touch-device HUD tweaks: move weapon info out from under the fire cluster */
@media (pointer: coarse) {
  #hBR { top: calc(56px + var(--sat)); bottom: auto; right: calc(16px + var(--sar)); }
  #hBR #hReload { order: 5; }
  #hWeapon img { width: clamp(100px, 16vmin, 160px); }
  #fps { right: calc(64px + var(--sar)); top: calc(18px + var(--sat)); }
  #hPrompt { top: calc(50% + 48px); }
  .party { backdrop-filter: none; -webkit-backdrop-filter: none; }
  #pause { backdrop-filter: none; -webkit-backdrop-filter: none; background: radial-gradient(ellipse at center, rgba(6,6,8,.45), rgba(3,3,4,.78)); }
  .sfoot, .go-right { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ================================================================ ROTATE HINT */
#rotate { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at center, #15100c, var(--bg) 70%); text-align: center; padding: 24px; }
#rotate b { font-family: var(--head); font-weight: 400; font-size: 2.4rem; letter-spacing: .08em; color: var(--tx); }
#rotate span { color: var(--dim); font-size: 1rem; letter-spacing: .06em; }
.rot-ic { width: 46px; height: 78px; border: 4px solid var(--acc); border-radius: 8px; position: relative; animation: rot 2s ease-in-out infinite; box-shadow: 0 0 20px rgba(232,163,58,.3); }
.rot-ic::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 10px; height: 3px; margin-left: -5px; background: var(--acc); border-radius: 2px; }
@keyframes rot { 0%, 25% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (pointer: coarse) and (orientation: portrait) {
  #hud.on ~ #rotate { display: flex; }
}

/* ================================================================ RESPONSIVE */
@media (max-width: 1100px) {
  .lo-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .tile { width: 104px; height: 100px; }
}

@media (max-width: 900px) {
  .setgrid { grid-template-columns: 1fr; }
}

/* narrow / portrait: single column menus */
@media (max-width: 760px) and (orientation: portrait), (max-width: 560px) {
  #menu.on { display: flex; flex-direction: column; gap: 18px; }
  .m-left, .m-right { width: 100%; }
  #menuHeader { order: -1; }
  .mi { max-width: none; }
  .namefield { max-width: none; }
  #chatRow { max-width: none; }
  .lo-grid { grid-template-columns: 1fr; }
  .lo-side { position: static; }
  .setgrid { grid-template-columns: 1fr; }
  .go-wrap { grid-template-columns: 1fr; gap: 20px; }
  .go-num .rdig { font-size: min(34vh, 40vw); } .go-num .tally { height: min(28vh, 34vw); }
  .prof { justify-content: flex-start; }
  .tile { width: calc(33.333% - 6px); min-width: 92px; }
  label.set { grid-template-columns: minmax(100px, 1fr) minmax(100px, 1.3fr) 46px; }
}

/* short landscape (phones) */
@media (max-height: 520px) {
  :root { --pad: 12px; }
  html, body { font-size: 14px; }
  #menu.on { grid-template-columns: minmax(220px, 1fr) minmax(250px, 340px); column-gap: 18px; row-gap: 8px; }
  .m-logo { font-size: .8rem; gap: 8px; }
  .m-logo span { display: none; }
  .m-cube { width: 16px; height: 16px; } .m-cube b { width: 7px; height: 7px; }
  .m-title { font-size: clamp(2.6rem, 15vh, 4.6rem); }
  .m-sub { margin: 2px 0 8px; } .m-sub span { font-size: .9rem; }
  .modesw { margin-bottom: 6px; } .modesw button { font-size: 15px; padding: .32em .6em .3em; }
  .mi { font-size: clamp(1.25rem, 6.6vh, 1.8rem); margin-bottom: 1px; padding-top: .26em; padding-bottom: .2em; }
  .mi.primary { margin-bottom: 4px; }
  .mi small { display: none; }
  .namefield { margin-top: 6px; }
  .namefield input, #joinCode, #chatInput { height: 32px; font-size: 1.1rem; }
  #menuStats { margin-top: 8px; }
  .ms { padding: 4px 10px 4px 7px; } .ms b { font-size: 1.15rem; } .ms .msi { width: 16px; height: 16px; }
  #menuHeader { min-height: 0; }
  .lvbadge { width: 34px; height: 37px; } .lvbadge b { font-size: 1.25rem; }
  .party { padding: 8px 12px 10px; }
  .party-h { padding-bottom: 4px; margin-bottom: 6px; }
  .party-h h3 { font-size: 1.4rem; }
  #partyInfo { font-size: .82rem; margin-bottom: 6px; }
  #partyList { gap: 3px; margin-bottom: 8px; }
  .pm { padding: 3px 8px 3px 3px; } .pm.empty { display: none; }
  .pav { width: 24px; height: 24px; font-size: 1rem; }
  .pm .pn { font-size: 1.1rem; }
  #yourLoadout { padding: 8px 12px 10px; }
  .yl-body img { width: 84px; }
  .yl-w { font-size: 1.2rem; }
  .btn { min-height: 34px; font-size: 1.1rem; padding: 6px 14px; }
  .done { min-height: 44px; font-size: 1.55rem; margin-top: 14px; }
  .topbar { margin-bottom: 10px; padding-bottom: 6px; }
  .topbar h1 { font-size: clamp(2rem, 11vh, 3.2rem); }
  .prof { gap: 10px; }
  .prof .lvlbar { min-width: 110px; }
  .lo-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; }
  .tile { width: 92px; height: 88px; }
  .tile img { height: 40px; }
  .tile svg { width: 34px; height: 34px; }
  .wprev { padding: 10px 12px; }
  .wprev h2 { font-size: 1.8rem; }
  .stat { grid-template-columns: 96px 1fr; margin: 4px 0; }
  .treewrap, .treesvg { min-height: 220px; }
  label.set { min-height: 38px; }
  .setcard { padding: 10px 12px 8px; }
  .setgrid h3 { font-size: 1.3rem; }
  .go-num .rdig { font-size: 36vh; } .go-num .tally { height: 30vh; }
  #gameover.on { padding-top: calc(var(--pad) + var(--sat)); }
  .go-hero { margin: 4px 0 2px; }
  .gs { padding: 5px 8px; grid-template-columns: minmax(0, 1fr); } .gs b { font-size: 1.4rem; } .gs .gsi { display: none; } .gs span { font-size: .55rem; letter-spacing: .14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .go-wrap { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 18px; }
  .go-num .tally.few { height: 25vh; }
  .go-hero { gap: 14px; }
  .go-lab, .go-hero.r0 .go-lab { font-size: 38px; } .go-lab small { display: none; }
  .go-rule { margin: 8px 0 0; }
  .go-stats { gap: 5px; margin-top: 8px; }
  .go-lv { margin-top: 8px; padding: 6px 10px; } .go-lv b { font-size: 1.15rem; } .go-lv span { font-size: .75rem; }
  .go-right { padding: 10px 12px; }
  .go-right ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; margin: 6px 0 8px; }
  .go-right li { font-size: .85rem; padding: 3px 0; gap: 6px; }
  .go-right li b { font-size: .95rem; }
  .gli { width: 13px; height: 13px; }
  .go-party div { padding: 3px 8px 3px 3px; }
  .go-party .pav { width: 20px; height: 20px; font-size: .85rem; }
  .btn.wide { min-height: 32px; }
  .done.big { min-height: 46px; font-size: 1.55rem; margin: 10px 0 8px; }
  .pz { padding: 14px 16px 12px; }
  .pp-card { padding: 22px 10px 10px; width: clamp(150px, 27vw, 210px); }
  .pp-ic { width: 54px; height: 60px; margin-bottom: 6px; }
  .pp-ic .glyph { width: 28px; height: 28px; }
  .pp-card h3 { font-size: 1.3rem; }
  .pp-card p { font-size: .78rem; margin-bottom: 8px; }
  .pp-cta { font-size: .95rem; padding: 5px 0 4px; }
  .pp-tag { display: none; }

  /* HUD shrink */
  #hTL { left: calc(14px + var(--sal)); top: max(14px, calc(6px + var(--sat))); width: min(250px, 38vw); }
  #hLeft { font-size: 12px; margin-top: 6px; padding: 2px 12px 2px 6px; }
  #hLeft .hli { width: 14px; height: 14px; }
  #hLeft .gr { font-size: 11px; }
  .perk { width: 28px; height: 28px; font-size: 13px; }
  #hPerks { gap: 4px; margin-bottom: 6px; }
  #hBL { left: calc(14px + var(--sal)); bottom: calc(12px + var(--sab)); width: 236px; }
  .hpplate { width: 228px; min-height: 52px; padding: 7px 12px 8px; column-gap: 12px; }
  #hPoints { font-size: 32px; }
  .plab { font-size: 9px; }
  #hHp { font-size: 19px; }
  .hp-track { height: 7px; }
  #hudChat { display: none; }
  #toasts { margin-top: 8px; gap: 3px; }
  .toast { padding: 3px 10px 3px 8px; font-size: 10.5px; letter-spacing: .06em; }
  .toast:nth-last-child(n+3) { display: none; }
  #hMates { margin-top: 8px; }
  .mate { min-width: 130px; padding: 2px 8px; font-size: 11px; }
  #hBR { right: calc(14px + var(--sar)); bottom: calc(12px + var(--sab)); width: 250px; padding: 8px 12px 8px 16px; }
  #hWeapon img { width: 108px; }
  #hWeapon .wn { font-size: 13px; }
  #hMag b { font-size: 42px; }
  #hMag small { font-size: 20px; }
  .slot { width: 70px; height: 28px; padding-left: 20px; }
  .slot img { width: 44px; height: 21px; }
  #announce { --as: .42; --ay: calc(56px + 46px); --fx: calc(-50vw + 44px + var(--sal)); --fy: calc(-56px - 46px + 33px); --fs: .82; top: calc(var(--ay) + var(--sat)); max-height: 40vh; }
  #announce div { font-size: 72px; }
  #downPanel { bottom: calc(6% + var(--sab)); width: min(360px, 60vw); }
  .dp-ring { width: 78px; margin-top: 4px; }
  #dpT { font-size: 26px; }
  #dpN { font-size: 38px; }
  #hBuffs { bottom: calc(12px + var(--sab)); }
  .buff .bic { width: 36px; height: 36px; }
  .tb { --k: var(--ts, 1); --R0: calc(16px + var(--sar)); --B0: calc(14px + var(--sab)); }
}
@media (max-height: 520px) {
  .wcards { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .wcard { height: 88px; padding: 6px 8px; } .wcard .wimg { height: 44px; } .wcard .wcn { font-size: 1.1rem; }
  .stc { grid-template-columns: 48px 1fr; } .stc .wimg { width: 48px; height: 24px; } .stc .stn { font-size: 1rem; }
  .ctab { font-size: 1.05rem; padding: 6px 10px 7px; }
  .wp-art { min-height: 110px; } .wp-info h2 { font-size: 1.7rem; }
  .aopt { min-height: 70px; } .aopt .aod { display: none; }
  .tr-grid { flex: none; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; }
  .td-sum { grid-template-columns: 1fr; gap: 3px; } .td-sum b { font-size: 1rem; }
  .lane { grid-template-columns: 1fr; gap: 6px; padding: 6px 10px; }
  .lane-h { grid-template-columns: auto 1fr auto; column-gap: 10px; align-items: baseline; }
  .lane-h b { font-size: 1.3rem; } .lane-h small { grid-column: 2; grid-row: 1; } .lane-p { grid-column: 3; } .lane-bar { grid-column: 1 / 4; }
  .sn { --s: 40px; } .sn.cap { --s: 50px; }
  .sn em { top: calc(100% + 3px); font-size: 9px; }
  .lane-t { gap: 8px; --h: 20px; padding-bottom: 11px; }
  .lane-t::before, .lane-t::after { top: calc(50% - 5.5px); }
  .tr-detail { padding: 12px 14px; } .tr-detail h2 { font-size: 1.7rem; } .tr-detail p { font-size: .9rem; margin-bottom: 8px; }
  .td-ic { width: 54px; height: 54px; margin-top: 8px; } .tdi { width: 30px; height: 30px; } .td-pts b { font-size: 2.6rem; }
  .td-sum div { padding: 4px 8px; }
  #loadout .wcards, #loadout .wcards:has(> :nth-child(6)) { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); grid-auto-rows: 92px; }
  #loadout .wcard { padding: 6px 8px; }
  #loadout .wcard .wcb, #loadout .wcard .wmb { display: none; }
  #loadout .wcard .wcs { display: flex; gap: 8px; margin-top: 2px; }
  #loadout .wcard.spawn::after { top: 5px; right: 6px; }
  #loadout .wcard .wimg, #loadout .wcards:has(> :nth-child(6)) .wcard .wimg { top: 6px; height: calc(100% - 48px); }
  #loadout .wcard::after, #loadout .wcards:has(> :nth-child(6)) .wcard::after { bottom: 40px; }
  #loadout .wcard .wcn, #loadout .wcards:has(> :nth-child(6)) .wcard .wcn { font-size: 1.05rem; }
  #loadout .presets .preset .pd { display: none; }
  .td-top .td-ic { width: 48px; height: 48px; } .td-top { gap: 10px; margin-bottom: 6px; }
  .td-foot { margin-top: 8px; padding-top: 8px; } .td-pts small { display: none; }
  .tr-legend { display: none; }
  .lane { min-height: 0; }
  .qprev { padding: 6px 10px; } .qp-chips span { font-size: .66rem; padding: 2px 6px; }
}
@media (max-height: 430px) {
  .m-sub, #menuStats { display: none; }
  .m-title { margin-bottom: 8px; }
  .namefield { margin-top: 4px; }
  .yl-body img { width: 64px; }
  .yl-info small { display: none; }
  #partyInfo:not(:has(.code)) { display: none; }
  .keys { grid-template-columns: 1fr; }
  .go-extra { display: none; }
  .go-lvb { display: none; } .go-lv em { font-size: .85rem; padding: 2px 6px; }
}
@media (max-height: 520px) and (pointer: coarse) {
  #hBR { top: calc(50px + var(--sat)); bottom: auto; }
  #hBuffs { bottom: auto; top: calc(10px + var(--sat)); }
}
/* move-stick affordance: faint ring where the left thumb rests (hidden while the real stick is shown) */
#touchMove::after { content: ''; position: absolute; left: calc(46px + var(--sal)); bottom: calc(96px + var(--sab)); width: 110px; height: 110px; border-radius: 50%; border: 2px solid rgba(255,255,255,.22); background: radial-gradient(circle, rgba(255,255,255,.4) 0 21px, rgba(255,255,255,.55) 21px 23px, transparent 23.5px), radial-gradient(circle, transparent 60%, rgba(0,0,0,.18)); box-shadow: 0 0 18px rgba(0,0,0,.25); transition: opacity .2s; pointer-events: none; }
#touch:has(#stick.on) #touchMove::after { opacity: 0; }
/* phones in landscape (e.g. iPhone SE 667x375): ammo beside pause, compact slot row above the touch cluster */
@media (max-height: 420px) and (pointer: coarse) {
  /* compact top-right ammo plate beside pause (8px gap), slot strip directly under it; weapon art hidden */
  #hBR { top: calc(8px + var(--sat)); bottom: auto; right: calc(62px + var(--sar)); width: auto; grid-template-columns: auto auto; grid-template-areas: "m w" "s s"; column-gap: 10px; padding: 4px 8px 6px 14px; align-items: center; }
  #hWeapon img { display: none; }
  #hWeapon { align-self: end; align-items: flex-end; padding-bottom: 6px; }
  #hWeapon .wn { margin: 0; font-size: 11px; letter-spacing: .14em; max-width: 92px; }
  #hMag { padding: 0; justify-items: start; }
  #hMag .pips { display: none; }
  #hMag b { font-size: 34px; }
  #hMag small { font-size: 17px; }
  #hReload { right: auto; left: 0; bottom: auto; top: calc(100% + 4px); font-size: 10px; padding: 2px 8px; }
  #hSlots { margin-top: 4px; gap: 3px; justify-content: flex-start; }
  .slot { width: 58px; height: 26px; padding: 0 3px 0 16px; }
  .slot > span { left: 2px; width: 13px; height: 13px; font-size: 10px; }
  .slot img { width: 38px; height: 19px; }
  .slot .sadd { font-size: 17px; }
  #hBuffs { top: calc(8px + var(--sat)); }
  #hBL { width: 210px; }
  .hpplate { width: 206px; min-height: 46px; padding: 6px 10px 7px; }
  #hPoints { font-size: 28px; }
  #hHp { font-size: 17px; }
}
@media (max-height: 360px) {
  .m-title { font-size: 2.4rem; }
  .mi { font-size: 1.2rem; }
  #menuStats, .m-logo { display: none; }
  .go-num .rdig { font-size: 30vh; } .go-num .tally { height: 26vh; }
  .pp-card p { display: none; }
  #hMates { display: none; }
}

@keyframes fadeHold { 0% { opacity: 0; } 6%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fadeOut { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

/* =====================================================================
   ROUND 5 POLISH: phone footers, pause layering, painted tally, HUD rhythm,
   ammo cluster, game-over fixes, perk categories, touch arc, low-tier perf
   ===================================================================== */

/* round-change flourish: a red brush swipe wipes in behind the big tally, then the tally lands */
#announce.round::after { content: ''; position: absolute; left: 50%; top: 77%; z-index: -1; width: 92%; height: 7%; opacity: .9; transform: translate(-50%, -50%) skewX(-14deg) scaleX(0); transform-origin: left center; background: linear-gradient(90deg, rgba(120,8,5,0), rgba(130,10,6,.5) 10%, rgba(160,16,10,.55) 50%, rgba(120,8,5,.45) 90%, rgba(120,8,5,0)); clip-path: polygon(0 22%, 6% 8%, 18% 14%, 31% 2%, 47% 10%, 60% 0, 74% 9%, 88% 3%, 100% 18%, 97% 52%, 100% 84%, 86% 96%, 70% 88%, 55% 100%, 40% 90%, 24% 98%, 10% 88%, 2% 96%, 4% 60%); }
#announce.round.on::after { animation: annSwipe 2.3s var(--ease) forwards; }
@keyframes annSwipe { 0% { transform: translate(-50%, -50%) skewX(-14deg) scaleX(0); opacity: 1; } 16% { transform: translate(-50%, -50%) skewX(-14deg) scaleX(1); opacity: 1; } 52% { opacity: .9; } 64%, 100% { transform: translate(-50%, -50%) skewX(-14deg) scaleX(1); opacity: 0; } }

/* --- HUD top-left: counter tucked 6px under the tally, aligned with its first stroke --- */
#hLeft { margin-top: 4px; margin-left: 2px; gap: 8px; min-height: 34px; padding: 2px 22px 2px 10px; border-left: 3px solid #d02a1d; align-self: flex-start; }
#hLeft b { font-size: 26px; line-height: 1; }
#hLeft span:not(.gr) { font-size: 12px; letter-spacing: .2em; color: #b9b2a5; }
#hLeft .hli { width: 18px; height: 18px; }
#hLeft .gr { font-size: 13px; letter-spacing: .22em; }
#hLeft .cd { font-style: normal; font-family: var(--head); font-size: 22px; letter-spacing: .06em; color: var(--acc2); line-height: 1; padding-left: 8px; margin-left: 2px; border-left: 1px solid rgba(255,255,255,.18); text-shadow: 0 0 10px rgba(232,163,58,.45); }
#hMates { margin-top: 12px; }
#toasts { margin-top: 24px; }

/* --- bottom-right weapon cluster: name baseline-aligned under the mag, visible pips, no stray accent --- */
#hBR::after { left: auto; right: 14px; top: -1px; width: 0; height: 2px; opacity: 0; transition: none; }
#hBR:has(.rli.spin)::after { opacity: 1; animation: reloadBar 1.4s linear infinite; }
@keyframes reloadBar { from { width: 0; } to { width: calc(100% - 28px); } }
#hBR { grid-template-areas: "w m" "w n" "s s"; row-gap: 0; }
#hWeapon { display: contents; }
#hWeapon img { grid-area: w; align-self: center; }
#hWeapon .wn { grid-area: n; justify-self: end; margin: 5px 0 0; font-size: 15px; letter-spacing: .2em; color: color-mix(in srgb, var(--wc, #e8a33a) 62%, #f2ebdd); }
/* weapon class / upgrade accent: 3px edge bar on the panel (purple + glow once pack-upgraded) */
#hBR { --wc: #e8a33a; }
#hBR.up #hWeapon .wn { text-shadow: 0 0 10px color-mix(in srgb, var(--wc) 60%, transparent), 0 1px 4px #000; }
/* max forge tier (Mk XI): name + edge bar pulse red -> hot orange */
#hBR.upmax #hWeapon .wn { animation: upmax 1.5s ease-in-out infinite; }
@keyframes upmax { 0%, 100% { color: #ff3a2a; text-shadow: 0 0 8px #ff2418aa, 0 1px 4px #000; } 50% { color: #ffb070; text-shadow: 0 0 16px #ff6a20, 0 1px 4px #000; } }
@media (max-height: 420px) and (pointer: coarse) {
  #hBR { grid-template-areas: "m n" "s s"; }
  #hWeapon .wn { align-self: end; margin: 0 0 6px; font-size: 11px; }
}
.slot:not(.on):not(.empty) img { opacity: .78; filter: drop-shadow(0 1px 0 rgba(0,0,0,.7)) brightness(1.25); }

/* --- shared menu footer: opaque on phones, faded top edge, compact one-line hint --- */
.sf-short { display: none; }
.sfoot::after { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 16px; pointer-events: none; background: linear-gradient(to top, rgba(6,6,8,.9), transparent); }
@media (max-height: 520px), (pointer: coarse) {
  .sfoot { gap: 10px; flex-wrap: nowrap; padding: 6px var(--pad) calc(6px + var(--sab)); background: linear-gradient(to top, rgba(6,6,8,.98) 70%, rgba(6,6,8,.94)); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sf-hint { display: none; }
  .sf-short { display: inline-flex; align-items: baseline; gap: 6px; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--head); font-size: 1.15rem; letter-spacing: .14em; color: var(--dim); }
  .sf-short b { color: var(--tx); font-weight: 400; font-size: 1.35rem; letter-spacing: .04em; }
  .sf-short b.gold { color: var(--acc2); }
  .sfoot .done { min-height: 44px; height: 44px; min-width: 132px; padding: 0 22px; font-size: 1.45rem; }
  .sfoot .btn { min-height: 44px; }
  .sfoot .btn.rst { width: 44px; height: 44px; padding: 0; }
  .sfoot .btn.rst .bt { display: none; }
  .sfoot .btn.rst .bic { width: 20px; height: 20px; }
  .sf-act { gap: 8px; }
  .tr-grid { margin-bottom: 8px; }
  .tr-detail { position: sticky; top: 0; max-height: calc(100dvh - var(--sat) - var(--sab) - 2 * var(--pad) - 60px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}

/* --- menu sub-screens & game over: kill the bright slab of the lobby scene leaking through the top --- */
#loadout, #tree, #settings { background: linear-gradient(to bottom, rgba(4,4,6,.95), rgba(4,4,6,.55) 18%, transparent 34%), linear-gradient(90deg, rgba(5,6,8,.92), rgba(5,6,8,.8) 55%, rgba(5,6,8,.7)); }
.go-bg { filter: blur(16px) brightness(.32) saturate(.35); -webkit-mask: linear-gradient(to bottom, transparent, #000 22%); mask: linear-gradient(to bottom, transparent, #000 22%); }

/* --- loadout: readable locked starters, one stat size, chunkier bars with values --- */
.stc.locked { opacity: 1; }
.stc.locked .wimg { filter: grayscale(1) brightness(1.1) drop-shadow(0 2px 0 rgba(0,0,0,.6)); opacity: .45; }
.stc.locked .stn { color: var(--tx2); }
.stc.locked .stp { font-size: 10px; color: #b48a4a; }
.stat { grid-template-columns: 112px minmax(0, 1fr) 30px; }
.stat > span { grid-column: 1; grid-row: 1; }
.stat > i { grid-column: 2; grid-row: 1; height: 7px; }
.stat > .sv { grid-column: 3; grid-row: 1; font-style: normal; font-family: var(--head); font-size: 1.05rem; line-height: 1; text-align: right; color: var(--tx); letter-spacing: .04em; }
.stat > .sv.up { color: var(--green); }
.stat > .sv.dn { color: var(--red2); }

/* --- game over: tidy subline, meaningful personal best --- */
.gf-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; letter-spacing: .12em; }
.go-pb small { display: inline-flex; align-items: center; gap: 6px; }
.pbi { width: 14px; height: 14px; }
.gpb-new { display: flex; align-items: center; gap: 12px; }
.gpb-prev { display: flex; flex-direction: column; font-family: var(--head); font-size: 1.6rem; line-height: .95; color: var(--dim); }
.gpb-prev small { font-family: var(--body); font-size: .58rem !important; letter-spacing: .22em; color: var(--dim) !important; }
.gpb-arr { width: 22px; height: 22px; fill: none; stroke: var(--red2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gpb-new b { font-family: var(--head); font-weight: 400; font-size: 2.6rem; line-height: .9; color: #fff; text-shadow: 0 0 18px rgba(255,74,54,.35); }
.gpb-d { font-style: normal; align-self: center; padding: 3px 8px 2px; font-family: var(--head); font-size: 1.15rem !important; letter-spacing: .06em; color: #fff !important; background: linear-gradient(180deg, #e2321f, #a8170e); box-shadow: 0 0 14px rgba(226,50,31,.35); }
@media (max-height: 520px) { .lg-l { display: none; } .go-right li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.lg-l { font-style: normal; }

/* --- perk choice: bigger cards, category colours, glow pulse, key hint row --- */
.pp-card { --pc: var(--acc); --cb: color-mix(in srgb, var(--pc) 70%, transparent); width: clamp(200px, 24vw, 320px); min-height: min(340px, 62vh); padding: 34px 20px 18px; border-top: 3px solid var(--pc); background: radial-gradient(ellipse 90% 45% at 50% 0%, color-mix(in srgb, var(--pc) 16%, transparent), transparent 70%), linear-gradient(180deg, rgba(30,26,22,.92), rgba(12,12,13,.97) 60%); }
.pp-tag { color: var(--pc); }
.pp-ic { width: 104px; height: 114px; color: color-mix(in srgb, var(--pc) 55%, #fff); }
.pp-ic .glyph { width: 50px; height: 50px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--pc) 60%, transparent)); }
.pp-hex { fill: color-mix(in srgb, var(--pc) 12%, transparent); stroke: var(--pc); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--pc) 45%, transparent)); }
.pp-card:hover .pp-hex, .pp-card:focus-visible .pp-hex { fill: color-mix(in srgb, var(--pc) 24%, transparent); }
.pp-card h3 { font-size: 2rem; }
.pp-card p { font-size: 14px; line-height: 1.35; color: #c9c3b6; }
.pp-cta { color: color-mix(in srgb, var(--pc) 60%, #fff); border-color: color-mix(in srgb, var(--pc) 40%, transparent); background: color-mix(in srgb, var(--pc) 7%, transparent); }
.pp-card:hover .pp-cta, .pp-card:focus-visible .pp-cta, .pp-card.picked .pp-cta { background: var(--pc); color: #140d06; }
.pp-card:hover, .pp-card:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--pc) 75%, transparent); border-top-color: var(--pc); animation: cardIn .55s var(--ease) both, ppGlow 2.2s ease-in-out infinite .2s; animation-delay: calc(.12s + var(--i, 0) * 90ms), .2s; }
@keyframes ppGlow { 0%, 100% { box-shadow: 0 18px 40px rgba(0,0,0,.6), inset 0 0 22px color-mix(in srgb, var(--pc) 10%, transparent), 0 0 24px color-mix(in srgb, var(--pc) 14%, transparent); } 50% { box-shadow: 0 18px 40px rgba(0,0,0,.6), inset 0 0 44px color-mix(in srgb, var(--pc) 24%, transparent), 0 0 44px color-mix(in srgb, var(--pc) 26%, transparent); } }
.pp-card.picked { border-color: var(--pc); box-shadow: 0 0 0 2px var(--pc), 0 0 60px color-mix(in srgb, var(--pc) 50%, transparent), 0 0 160px 40px color-mix(in srgb, var(--pc) 18%, transparent); }
.pp-keys { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .26em; color: var(--dim); animation: screenIn .5s var(--ease) both .5s; }
.pp-keys kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; background: linear-gradient(180deg, #2a2b31, #1b1c21); border: 1px solid var(--line2); border-bottom: 3px solid rgba(0,0,0,.6); border-radius: 3px; font-family: var(--head); font-size: 1rem; letter-spacing: 0; color: var(--tx); }
@media (max-height: 520px) {
  .pp-card { width: clamp(160px, 28vw, 220px); min-height: 0; padding: 22px 10px 10px; }
  .pp-ic { width: 58px; height: 64px; } .pp-ic .glyph { width: 30px; height: 30px; }
  .pp-card h3 { font-size: 1.35rem; } .pp-card p { font-size: 12px; }
  .pp-tag { display: block; top: 7px; font-size: .5rem; }
}

/* --- lobby: service record sits under CALLSIGN; one helper-text voice; phone skill chip --- */
#menuStats { margin-top: 24px; }
#partyInfo { font-family: var(--body); font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--tx2); }
.mchip { display: none; }
@media (max-height: 520px) {
  .mchip { display: inline-flex; align-items: center; margin-left: 10px; padding: 3px 7px 2px; font-style: normal; font-family: var(--body); font-size: 10px; font-weight: 700; letter-spacing: .18em; line-height: 1; color: var(--acc2); border: 1px solid rgba(232,163,58,.4); background: rgba(232,163,58,.1); align-self: center; }
  .mi:has(.badge) .mchip { display: none; }
}

/* --- pause: nothing from the HUD or touch layer shows through --- */
#touch, #hud { transition: opacity .2s; }
body.paused #touch, body:has(#pause.on) #touch { opacity: 0; visibility: hidden; }
body.paused #hud, body:has(#pause.on) #hud { opacity: .18; }
@media (max-height: 520px), (pointer: coarse) {
  body.paused #hud, body:has(#pause.on) #hud { opacity: 0; visibility: hidden; }
  #pause { background: rgba(4,4,6,.92); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .pz { background: linear-gradient(180deg, rgba(22,23,27,.98), rgba(9,10,12,.98)); }
}

/* --- touch buttons: sturdier rings, dark fill, readable labels, press feedback --- */
.tb { border: 2px solid rgba(255,255,255,.5); background: radial-gradient(circle at 50% 28%, rgba(255,255,255,.12), rgba(8,8,10,.45) 62%), rgba(8,8,10,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 0 0 1px rgba(255,255,255,.06), inset 0 -6px 12px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.45), 0 4px 14px rgba(0,0,0,.4); }
/* hierarchy: the hot buttons (AIM, RELOAD) are bigger and carry the gold accent ring; KNIFE / SWAP / JUMP step down */
#tAds, #tReload { --s: 58px; border-color: rgba(255,214,140,.7); }
#tKnife, #tSwap, #tJump { --s: 48px; }
.tb .tl { font-size: calc(10px * var(--k)); letter-spacing: .12em; opacity: 1; }
.tb:active, .tb.down { transform: scale(.92); background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.5), rgba(214,205,180,.32)); border-color: #fff; }
/* inner arc r=95 around FIRE: AIM 9 o'clock, JUMP 10:30, RELOAD 12; outer arc r=160: KNIFE, SWAP */
#tAds { right: calc(var(--R0) + 107px * var(--k)); bottom: calc(var(--B0) + 12px * var(--k)); }
#tJump { right: calc(var(--R0) + 79px * var(--k)); bottom: calc(var(--B0) + 79px * var(--k)); }
#tReload { right: calc(var(--R0) + 12px * var(--k)); bottom: calc(var(--B0) + 107px * var(--k)); }
#tKnife { right: calc(var(--R0) + 162px * var(--k)); bottom: calc(var(--B0) + 67px * var(--k)); }
#tSwap { right: calc(var(--R0) + 80px * var(--k)); bottom: calc(var(--B0) + 157px * var(--k)); }

/* --- perf: no backdrop blur on the low tier or touch devices; darker solid fills instead --- */
body.q-low *, body.q-low *::before, body.q-low *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
@media (pointer: coarse) { *, *::before, *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; } }
body.q-low .sfoot { background: rgba(6,6,8,.98); }
body.q-low .party, body.q-low .tr-detail, body.q-low .go-right { background: rgba(12,12,15,.92); }
@media (pointer: coarse) { .party, .tr-detail, .go-right { background: rgba(12,12,15,.9); } }

/* phones: footer pinned to the viewport (not sticky inside the padded scroller) + content reserves its height */
@media (max-height: 520px), (pointer: coarse) {
  #loadout .sfoot, #tree .sfoot, #settings .sfoot { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; margin: 0; min-height: 56px; padding: 6px calc(var(--pad) + var(--sar)) calc(6px + var(--sab)) calc(var(--pad) + var(--sal)); }
  #loadout .sfoot::before, #tree .sfoot::before, #settings .sfoot::before { left: calc(var(--pad) + var(--sal)); }
  #loadout, #tree, #settings { padding-bottom: calc(56px + 12px + var(--sab)); }
  .tr-detail { max-height: calc(100dvh - var(--sat) - var(--sab) - var(--pad) - 56px - 12px); }
}
@media (max-height: 520px), (pointer: coarse) {
  /* opacity-only entrance so no transform matrix turns the screen into the fixed footer's containing block */
  #loadout.on, #tree.on, #settings.on { animation-name: fadeIn; }
  body #loadout .sfoot, body #tree .sfoot, body #settings .sfoot { background: rgb(6,6,8); }
}

/* =====================================================================
   PASS 2: HUD hero moments: painted tally, round slam, power-up banner,
   stacked +points, edge-only hurt vignette, perk cards with depth
   ===================================================================== */

/* --- round transition: big red paint slam over a black brush smear, readable subtitle, ~1.25s hold --- */
#announce::before { width: 190%; height: 170%; background: radial-gradient(ellipse closest-side, rgba(0,0,0,.72), rgba(0,0,0,.35) 60%, transparent); }
#announce.round.on { animation: announceRound 2.6s linear forwards; }
#announce.round.on em, #announce.round.on small { animation: annSub 2.6s linear forwards; }
@keyframes annSub { 0%, 54% { opacity: 1; } 64%, 100% { opacity: 0; } }
@keyframes announceRound {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--as) * 1.35)); filter: blur(4px); animation-timing-function: cubic-bezier(.15, .9, .25, 1); }
  8% { opacity: 1; transform: translate(-50%, -50%) scale(calc(var(--as) * .97)); filter: blur(0); }
  12% { transform: translate(-50%, -50%) scale(var(--as)); }
  58% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
  92% { opacity: 1; transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(calc(var(--as) * var(--fs))); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(calc(var(--as) * var(--fs))); }
}
#announce.round small { margin-top: 2px; padding-left: calc(34px + .3em); font-size: 24px; letter-spacing: .3em; margin-right: -.3em; color: #f0e6d6; text-shadow: 0 2px 0 #000, 0 2px 8px #000, 0 0 16px rgba(0,0,0,.8); }
/* black brush smear behind the tally (contrast on bright walls), wipes in left-to-right */
#announce.round::after { top: 52%; width: 130%; height: 62%; opacity: 1; clip-path: none; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.5) 14%, rgba(0,0,0,.6) 50%, rgba(0,0,0,.48) 86%, rgba(0,0,0,0));
  -webkit-mask: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent); mask: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent); }
#announce.round.on::after { animation: annSwipe 2.6s var(--ease) forwards; }
@keyframes annSwipe { 0% { transform: translate(-50%, -50%) skewX(-12deg) scaleX(0); opacity: 1; } 12% { transform: translate(-50%, -50%) skewX(-12deg) scaleX(1); opacity: 1; } 54% { opacity: 1; } 64%, 100% { transform: translate(-50%, -50%) skewX(-12deg) scaleX(1); opacity: 0; } }

/* --- generic announcements (WAVE CLEARED, POWER ON, machine perks): heavier title, readable subline --- */
#announce:not(.round):not(.pu) div { text-shadow: 0 3px 0 #000, 0 6px 30px rgba(0,0,0,.9), 0 0 36px color-mix(in srgb, var(--ac) 30%, transparent); }
#announce:not(.round):not(.pu) small { color: color-mix(in srgb, var(--ac) 70%, #fff); text-shadow: 0 2px 8px #000, 0 0 3px #000; }

/* --- power-up banner: centred icon medallion + coloured title + duration chip, 220ms slam, out after ~2.4s --- */
#announce.pu { --ay: 23vh; gap: 0; }
#announce.pu.on { animation: annPU 2.75s linear forwards; }
@keyframes annPU {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--as) * 1.15)); animation-timing-function: cubic-bezier(.2, .9, .3, 1); }
  8% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); }
  86% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); animation-timing-function: ease-in; }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 12px)) scale(calc(var(--as) * .98)); }
}
.pu-ic { position: relative; display: flex; align-items: center; justify-content: center; width: 84px; height: 84px; margin-bottom: 10px; color: #fff;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--ac) 55%, #000), color-mix(in srgb, var(--ac) 18%, #000) 72%);
  border: 2px solid var(--ac); box-shadow: 0 0 0 4px rgba(0,0,0,.55), 0 0 34px color-mix(in srgb, var(--ac) 60%, transparent), inset 0 0 18px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.25); transform: rotate(45deg); }
.pu-ic > * { transform: rotate(-45deg); }
.pu-ic::before { content: ''; position: absolute; inset: -22px; z-index: -1; background: radial-gradient(circle, color-mix(in srgb, var(--ac) 40%, transparent), transparent 68%); }
/* glyph ~46% of the medallion; it slams 1.15 -> 1 a beat after the frame, over a 400ms radial light burst */
.pu-ic .glyph, .pu-ic img { width: 58px; height: 58px; font-size: 50px; line-height: 58px; color: #fff; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)) drop-shadow(0 0 8px color-mix(in srgb, var(--ac) 80%, transparent)); }
.pu-ic::after { content: ''; position: absolute; inset: -46px; z-index: -1; border-radius: 50%; opacity: 0; pointer-events: none; background: radial-gradient(circle, color-mix(in srgb, var(--ac) 50%, #fff) 0, color-mix(in srgb, var(--ac) 55%, transparent) 28%, transparent 64%); }
#announce.pu.on .pu-ic::after { animation: puBurst .4s ease-out both; }
#announce.pu.on .pu-ic > * { animation: puGlyph .42s cubic-bezier(.2,.9,.3,1.2) both .06s; }
@keyframes puBurst { 0% { opacity: .95; transform: scale(.35); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes puGlyph { 0% { opacity: 0; transform: rotate(-45deg) scale(1.4); } 40% { opacity: 1; } 100% { opacity: 1; transform: rotate(-45deg) scale(1); } }
.pu-t { display: block; margin-top: 14px; font-family: var(--head); font-size: clamp(54px, 8vmin, 84px); line-height: .9; letter-spacing: .05em; color: var(--ac);
  -webkit-text-stroke: 1.5px rgba(0,0,0,.7); paint-order: stroke fill; text-shadow: 0 3px 0 #000, 0 0 26px color-mix(in srgb, var(--ac) 55%, transparent), 0 8px 30px rgba(0,0,0,.9); }
#announce.pu .aline { height: 1px; margin-top: 10px; }
.pu-s { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 13px; font-weight: 700; letter-spacing: .26em; color: #d8d0c2; text-shadow: 0 1px 4px #000; text-transform: uppercase; }
.pu-s:empty { display: none; }
.pu-s b { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 2px 7px; font-family: var(--head); font-weight: 400; font-size: 20px; letter-spacing: .08em; color: #fff; background: color-mix(in srgb, var(--ac) 28%, rgba(0,0,0,.7)); border: 1px solid color-mix(in srgb, var(--ac) 70%, transparent); }
.pu-hg { width: 15px; height: 15px; color: var(--ac); }
/* iPhone SE landscape: medallion beside the title, sitting in the band between the top-right ammo panel and the crosshair */
@media (max-height: 420px) {
  body #announce.pu { --ay: 114px; display: grid; grid-template-columns: auto auto; grid-template-areas: "i t" "i s"; column-gap: 26px; align-items: center; justify-items: start; }
  #announce.pu .pu-ic { grid-area: i; margin: 0 8px; }
  #announce.pu .pu-t { grid-area: t; margin: 0; font-size: 56px; white-space: nowrap; }
  #announce.pu .pu-s { grid-area: s; margin-top: 6px; }
  #announce.pu .aline { display: none; }
}

/* --- hurt / down: edge vignette + faint dark stain texture kept off the top-left HUD, heartbeat when critical --- */
#vigHurt { --grime: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 240' preserveAspectRatio='none'%3E%3Cfilter id='b' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.014 .022' numOctaves='4' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .3  0 0 0 0 .02  0 0 0 0 .01  0 0 0 -3.4 2.05'/%3E%3C/filter%3E%3Crect width='400' height='240' filter='url(%23b)'/%3E%3C/svg%3E");
  background: radial-gradient(ellipse 80% 75% at 50% 50%, transparent 55%, rgba(120,0,0,.3) 80%, rgba(90,0,0,.6) 100%); }
#vigHurt::before { background: var(--grime) center / 100% 100% no-repeat; opacity: 0;
  -webkit-mask: radial-gradient(ellipse 78% 72% at 50% 50%, transparent 58%, #000 100%), radial-gradient(ellipse 300px 230px at 0 0, transparent 72%, #000 100%); -webkit-mask-composite: source-in;
  mask: radial-gradient(ellipse 78% 72% at 50% 50%, transparent 58%, #000 100%), radial-gradient(ellipse 300px 230px at 0 0, transparent 72%, #000 100%); mask-composite: intersect; }
#vigHurt.crit::before, #hud.isdown #vigHurt::before { opacity: .35; }
#vigHurt::after { background: radial-gradient(ellipse 80% 75% at 50% 50%, transparent 62%, rgba(150,0,0,.5) 100%); transform-origin: 50% 50%; }
#vigHurt.crit::after { animation: heartbeat2 .9s ease-in-out infinite; }
@keyframes heartbeat2 { 0%, 100% { opacity: .2; transform: scale(1.03); } 14% { opacity: .9; transform: scale(1); } 28% { opacity: .4; transform: scale(1.02); } 42% { opacity: .8; transform: scale(1); } 70% { opacity: .25; transform: scale(1.03); } }
#hud.isdown #vigHurt { opacity: .7 !important; background: radial-gradient(ellipse 80% 75% at 50% 50%, transparent 45%, rgba(110,4,2,.42) 75%, rgba(40,0,0,.85) 100%); }
#hud.isdown #vigHurt::after { animation: heartbeat2 .9s ease-in-out infinite; }

/* --- perk cards: compact, stat headline, chips, filled SELECT, lift + accent glow + sheen sweep --- */
.pp-card { min-height: 0; padding: 30px 20px 16px; animation: cardIn .55s var(--ease) backwards; animation-delay: calc(.12s + var(--i, 0) * 90ms);
  box-shadow: 0 16px 36px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.07), inset 0 -40px 60px rgba(0,0,0,.25);
  background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 9%, transparent), transparent 40%), radial-gradient(ellipse 90% 45% at 50% 0%, color-mix(in srgb, var(--pc) 18%, transparent), transparent 70%), linear-gradient(180deg, rgba(32,27,22,.95), rgba(11,11,12,.98) 62%); }
.pp-card:hover, .pp-card:focus-visible { transform: translateY(-6px); animation: cardIn .55s var(--ease) backwards, ppGlow 2.2s ease-in-out infinite .2s; animation-delay: calc(.12s + var(--i, 0) * 90ms), .2s; }
@keyframes ppGlow { 0%, 100% { box-shadow: 0 22px 44px rgba(0,0,0,.6), inset 0 0 22px color-mix(in srgb, var(--pc) 10%, transparent), 0 0 30px color-mix(in srgb, var(--pc) 32%, transparent); } 50% { box-shadow: 0 22px 44px rgba(0,0,0,.6), inset 0 0 40px color-mix(in srgb, var(--pc) 20%, transparent), 0 0 44px color-mix(in srgb, var(--pc) 42%, transparent); } }
.pp-sheen { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(110deg, transparent 32%, rgba(255,255,255,.13) 46%, rgba(255,255,255,.04) 54%, transparent 66%); transform: translateX(-130%); animation: ppSheen 1.1s ease-out backwards; animation-delay: calc(.5s + var(--i, 0) * 120ms); }
.pp-card:hover .pp-sheen, .pp-card:focus-visible .pp-sheen { transform: translateX(130%); transition: transform .6s ease-out; }
@keyframes ppSheen { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
.pp-ic { margin-bottom: 8px; }
.pp-card h3 { margin-bottom: 6px; }
.pp-card p { flex: none; margin: 0 0 12px; font-size: 15px; line-height: 1.35; color: #cfc6b8; }
.pp-stat { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 3px; margin: 0 0 10px; padding: 8px 0 7px; border-top: 1px solid color-mix(in srgb, var(--pc) 28%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--pc) 28%, transparent); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--pc) 12%, transparent), transparent); }
.pp-stat b { font-family: var(--head); font-weight: 400; font-size: 36px; line-height: .95; letter-spacing: .03em; color: color-mix(in srgb, var(--pc) 72%, #fff); text-shadow: 0 2px 0 rgba(0,0,0,.7), 0 0 16px color-mix(in srgb, var(--pc) 45%, transparent); }
.pp-stat b i { font-style: normal; margin: 0 .22em; font-size: .7em; opacity: .65; }
.pp-stat span { font-size: 11px; font-weight: 700; letter-spacing: .24em; color: #a8a194; }
.pp-chips { display: flex; justify-content: center; gap: 6px; margin: 0 0 14px; }
.pp-chips span { padding: 3px 7px 2px; font-size: 10px; font-weight: 700; letter-spacing: .2em; line-height: 1.2; color: #9d968a; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.03); }
.pp-chips .new { color: color-mix(in srgb, var(--pc) 70%, #fff); border-color: color-mix(in srgb, var(--pc) 50%, transparent); background: color-mix(in srgb, var(--pc) 12%, transparent); }
.pp-chips .stk { color: var(--acc2); border-color: rgba(232,163,58,.5); background: rgba(232,163,58,.1); }
.pp-cta { padding: 10px 0 9px; color: #fff; letter-spacing: .32em; background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 34%, #000), color-mix(in srgb, var(--pc) 18%, #000)); border: 1px solid color-mix(in srgb, var(--pc) 60%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -2px 0 rgba(0,0,0,.45); text-shadow: 0 1px 2px #000; }
.pp-card:hover .pp-cta, .pp-card:focus-visible .pp-cta, .pp-card.picked .pp-cta { background: var(--pc); color: #140d06; text-shadow: none; }

/* --- weapon + points plates: grained, bevelled glass instead of a flat tint; numerals with a hard print shadow --- */
#hBR::before, .hpplate::before { background: linear-gradient(180deg, rgba(22,21,24,.8), rgba(6,6,8,.64)), var(--noise) 0 0 / 180px; box-shadow: 0 14px 34px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.07), inset 0 -22px 30px rgba(0,0,0,.35); }
#hMag b:not(.warn):not(.red) { text-shadow: 0 2px 0 rgba(0,0,0,.85), 0 0 18px rgba(255,240,210,.14); }
#hPoints { color: #fff6e2; text-shadow: 0 2px 0 rgba(0,0,0,.85), 0 0 16px rgba(255,210,120,.16); }
#hWeapon img { filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)) drop-shadow(0 0 12px color-mix(in srgb, var(--wc, #e8a33a) 22%, transparent)); }
#hBR::before { box-shadow: 0 14px 34px rgba(0,0,0,.45), inset 3px 0 0 var(--wc), inset 0 1px 0 rgba(255,255,255,.07), inset 0 -22px 30px rgba(0,0,0,.35); }
#hBR.up::before { box-shadow: 0 14px 34px rgba(0,0,0,.45), inset 3px 0 0 var(--wc), inset 14px 0 18px -10px rgba(183,123,255,.35), inset 0 1px 0 rgba(255,255,255,.07), inset 0 -22px 30px rgba(0,0,0,.35); }

/* --- phones / short landscape --- */
@media (max-height: 520px) {
  #announce { --as: .55; }
  #announce.round, #announce.pu { --as: .68; --ay: 86px; max-height: none; }
  #announce.round small { font-size: 22px; }
  .pu-ic { width: 64px; height: 64px; margin-bottom: 4px; } .pu-ic .glyph, .pu-ic img { width: 36px; height: 36px; font-size: 32px; line-height: 36px; }
  .pu-t { font-size: 58px; margin-top: 10px; }
  .pu-s { font-size: 14px; }
  .pop { font-size: 21px; bottom: 6px; } .pop.big { font-size: 24px; }
  .pp-card { padding: 22px 10px 10px; }
  .pp-card p, .pp-chips { display: none; }
  .pp-stat { margin: 0 0 8px; padding: 5px 0 4px; } .pp-stat b { font-size: 26px; } .pp-stat span { font-size: 9px; letter-spacing: .2em; }
  .pp-cta { padding: 7px 0 6px; }
}

/* =====================================================================
   PASS 2 R2: ROUND MARKER, the single source of truth for the painted tally bars,
   the painted numerals and every paint filter. Desktop: #paint displacement for the brush edge.
   Phones (pointer:coarse) and q-low: drop-shadow only, so no feTurbulence runs.
   ===================================================================== */
.tally path { fill-rule: evenodd; }
.tally .tu { fill: #4a0604; transform: translate(2px, 3px); }
.tally .t1 { fill: url(#tgP); }
.tally .t2 { fill: #ff7a5c; opacity: .14; }
.tally .t0, .tally .t3 { display: none; }
/* rounds 1-2: ghosted outlines of the remaining tally slots + strike ("1 of 5") */
.tally .tg { fill: rgba(200,20,10,.035); stroke: rgba(210,30,14,.2); stroke-width: 1; vector-effect: non-scaling-stroke; }
/* painted numerals (round 6+): bright red with a lighter loaded top, hard near-black outline drawn under the fill */
.rdig { display: block; font-family: var(--head); font-weight: 400; line-height: .84; letter-spacing: .01em; color: #d0180c; text-shadow: none;
  background: linear-gradient(180deg, #ff3a22 0%, #e8210f 26%, #d0180c 55%, #a8110a 100%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; -webkit-text-stroke: 2px #1a0000; paint-order: stroke fill; }

/* HUD hero counter */
#hRound { --rh: 112px; position: relative; line-height: 1; min-height: var(--rh); transform-origin: left center; transition: opacity .25s;
  filter: url(#paint) drop-shadow(0 0 8px rgba(200,16,6,.45)) drop-shadow(0 2px 0 rgba(0,0,0,.9)); }
#hRound:empty { min-height: 0; }
#hRound .tally { height: var(--rh); }
#hRound .tally.few { height: calc(var(--rh) * 1.15); }
#hRound .rdig { font-size: calc(var(--rh) * .96); }
#hRound .ghost { opacity: .28; }
#hRound.await { opacity: 0; transition: none; will-change: opacity; }
/* landing flash: transform-only scale on the counter; the glow is a sibling layer outside the filter, animated by opacity */
#hRound.flash { animation: rflash .9s cubic-bezier(.2,.8,.2,1); will-change: transform; }
/* rounds 1-2: a lone stroke must read as paint, not a lit tube: almost no glow, a tight wet edge + hard drop */
#hRound:has(.tally.few) { filter: url(#paint) drop-shadow(0 0 3px rgba(200,16,6,.35)) drop-shadow(0 2px 0 rgba(0,0,0,.9)); }
#announce.round .chalk:has(.tally.few) { filter: url(#paint) drop-shadow(0 0 10px rgba(200,20,0,.35)) drop-shadow(0 3px 0 #000); }
@keyframes rflash { 0% { transform: scale(1.18); } 30%, 100% { transform: none; } }
#hTL::before { content: ''; position: absolute; left: -60px; top: -50px; width: 300px; height: 230px; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(255,50,20,.42), rgba(180,14,6,.14) 58%, transparent); }
#hTL:has(#hRound.flash)::before { animation: rglow 1.5s ease-out; }
@keyframes rglow { 0% { opacity: 1; } 100% { opacity: 0; } }

/* round announcement: label quiet, number slams (scale 1.25 -> 1 in 120ms, then a short shake on the number only) */
/* (#announce.round em: see the round-banner support-text rule next to #announce) */
#announce.round .chalk { margin: 8px 0 10px; filter: url(#paint) drop-shadow(0 0 40px rgba(200,20,0,.6)) drop-shadow(0 3px 0 #000); }
#announce.round .chalk .tally { height: clamp(120px, 18vh, 200px); }
#announce.round .chalk .rdig { font-size: clamp(120px, 18vh, 200px); }
#announce.round.on .chalk { animation: rslam .55s linear both; }
@keyframes rslam {
  0% { transform: scale(1.25); animation-timing-function: cubic-bezier(.3, 0, .6, 1); }
  22% { transform: scale(1); }
  32% { transform: translate(-4px, 2px); } 42% { transform: translate(3px, -2px); } 52% { transform: translate(-2px, 1px); } 62% { transform: translate(1px, 0); }
  100% { transform: none; }
}

/* pause + game over markers */
.pzi-tally { filter: url(#paint) drop-shadow(0 0 6px rgba(200,16,6,.4)) drop-shadow(0 1px 0 #000); }
.go-num { filter: url(#paint) drop-shadow(0 0 28px rgba(200,16,6,.45)) drop-shadow(0 2px 0 rgba(0,0,0,.95)); }

@media (max-height: 520px) {
  #hRound { --rh: 72px; }
  #hTL::before { left: -40px; top: -40px; width: 200px; height: 150px; }
  #announce.round em { font-size: 26px; letter-spacing: .45em; margin-right: -.45em; }
}
/* phones and q-low: no SVG turbulence anywhere on the round marker, lighter glows */
body.q-low #hRound, body.q-low .pzi-tally, body.q-low .go-num { filter: drop-shadow(0 0 5px rgba(200,16,6,.45)) drop-shadow(0 2px 0 rgba(0,0,0,.9)); }
body.q-low #announce.round .chalk { filter: drop-shadow(0 0 16px rgba(200,20,0,.6)) drop-shadow(0 2px 0 #000); }
@media (pointer: coarse) {
  #hRound, .pzi-tally, .go-num { filter: drop-shadow(0 0 5px rgba(200,16,6,.45)) drop-shadow(0 2px 0 rgba(0,0,0,.9)); }
  #announce.round .chalk { filter: drop-shadow(0 0 16px rgba(200,20,0,.6)) drop-shadow(0 2px 0 #000); }
  #hRound:has(.tally.few), #announce.round .chalk:has(.tally.few) { filter: drop-shadow(0 0 3px rgba(200,16,6,.35)) drop-shadow(0 2px 0 rgba(0,0,0,.9)); }
}
body.q-low #hRound:has(.tally.few), body.q-low #announce.round .chalk:has(.tally.few) { filter: drop-shadow(0 0 3px rgba(200,16,6,.35)) drop-shadow(0 2px 0 rgba(0,0,0,.9)); }

/* =====================================================================
   PASS 2 R2: game over / perk offer / armory + settings on phones
   ===================================================================== */
.go-extra:not(:has(.go-fav)) { grid-template-columns: minmax(0, 1fr); }
/* touch: no keyboard badges on the perk cards */
@media (pointer: coarse) { .pp-card kbd, .pp-keys { display: none !important; } }


/* phones: the pinned footer is a solid bar with its own full-width top edge (accent rule sits ON that edge, inside the bar),
   no fade floating over the scrolled content; the scroller reserves footer height + 16px so the last row clears it */
@media (max-height: 520px), (pointer: coarse) {
  #loadout .sfoot, #tree .sfoot, #settings .sfoot { border-top: 1px solid rgba(232,163,58,.28); box-shadow: 0 -1px 0 rgba(0,0,0,.9); }
  #loadout .sfoot::before, #tree .sfoot::before, #settings .sfoot::before { top: -1px; height: 1px; width: 96px; box-shadow: none; background: var(--acc); }
  #loadout .sfoot::after, #tree .sfoot::after, #settings .sfoot::after { display: none; }
  #loadout, #tree, #settings { padding-bottom: calc(56px + 16px + var(--sab)); scroll-padding-bottom: calc(56px + 16px + var(--sab)); }
}
/* iPhone SE landscape: spawn picks in one row, armory as one horizontal strip of compact cards (art left, name + stats right) */
@media (max-height: 420px) {
  #loadout .sech small { display: none; }
  #loadout .starters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  #loadout .stc { grid-template-columns: 40px minmax(0, 1fr); column-gap: 6px; padding: 5px 6px; }
  #loadout .stc .wimg { width: 40px; height: 20px; }
  #loadout .stc .stn { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #loadout .wcards, #loadout .wcards:has(> :nth-child(6)) { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: 2px;
    -webkit-mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 28px), transparent); scrollbar-width: none; }
  #loadout .wcards::-webkit-scrollbar { display: none; }
  #loadout .wcard, #loadout .wcards:has(> :nth-child(6)) .wcard { flex: 0 0 200px; height: 72px; padding: 6px 8px 6px 92px; justify-content: center; gap: 4px; scroll-snap-align: start; }
  #loadout .wcard:last-child { margin-right: 28px; }
  #loadout .wcard .wimg, #loadout .wcards:has(> :nth-child(6)) .wcard .wimg { left: 6px; top: 10px; width: 80px; height: 52px; }
  #loadout .wcard::after, #loadout .wcards:has(> :nth-child(6)) .wcard::after { display: none; }
  #loadout .wcard.spawn::after, #loadout .wcards:has(> :nth-child(6)) .wcard.spawn::after { display: block; content: 'SPAWN'; z-index: 2; left: auto; right: 6px; top: 4px; bottom: auto; padding: 1px 4px; font-size: .5rem; color: #1a1206; background: var(--acc2); }
  #loadout .wcard .wca { top: auto; bottom: 4px; }
  #loadout .wcard .wcn, #loadout .wcards:has(> :nth-child(6)) .wcard .wcn { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #loadout .wcard .wcs { display: flex; flex-wrap: wrap; gap: 0 2px; font-size: .8rem; }
  #loadout .wcard .wcs small { margin: 0 4px 0 1px; }
  #loadout .wcard:hover { transform: none; }
}

/* =====================================================================
   TOUCH UI (body.touch-ui / .phone / .tablet / .portrait set by input.js)
   One dedicated layer for Android / iOS: thumb-arc controls, compact corner HUD that keeps the centre clear,
   contextual USE, 48px+ targets, re-flowed menus. Desktop is untouched (every rule is scoped to body.touch-ui).
   ===================================================================== */
body.touch-ui { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.touch-ui #touch, body.touch-ui #hud, body.touch-ui #c { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
body.touch-ui .menuscreen, body.touch-ui #pause, body.touch-ui #gameover, body.touch-ui #perkPick { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* no hover-lift on touch (a tap leaves :hover stuck on mobile browsers) */
body.touch-ui .mi:hover:not(.primary) { transform: none; }
body.touch-ui .pp-card:hover { transform: none; }

/* --- control layer: opacity setting, never below 48px --- */
body.touch-ui #touch { --to: .85; }
body.touch-ui #touch .tb { opacity: var(--to); }
body.touch-ui #touch .tb.down, body.touch-ui #touch .tb.active, body.touch-ui #touch #tUse { opacity: 1; }
body.touch-ui #touchMove::after { opacity: calc(var(--to) * .9); }
body.touch-ui #touch:has(#stick.on) #touchMove::after { opacity: 0; }
body.touch-ui #stick { width: calc(108px * var(--ts)); height: calc(108px * var(--ts)); border-width: 2px; background: radial-gradient(circle, rgba(0,0,0,.06) 38%, rgba(0,0,0,.32)); }
body.touch-ui #stick.sprint { border-color: var(--acc2); box-shadow: 0 0 0 2px rgba(232,163,58,.25), 0 0 24px rgba(232,163,58,.35); }
body.touch-ui #stick.sprint #knob { background: rgba(255,198,107,.65); border-color: #fff; }
body.touch-ui #stick.sprint::after { content: 'SPRINT'; position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); font: 700 12px/1 var(--body); letter-spacing: .2em; color: var(--acc2); text-shadow: 0 1px 3px #000; }
body.touch-ui #tPause { --s: 48px; width: 48px; height: 48px; top: calc(6px + var(--sat)); right: calc(8px + var(--sar)); opacity: max(.7, var(--to)); }
body.touch-ui #tPause .tg { width: 20px; height: 20px; }
body.touch-ui .tb .tl { font-size: max(11px, calc(10px * var(--k))); }

/* --- phones: thumb arc around FIRE (centres on r=100 and r=170 rings), USE in the gap of the outer ring --- */
body.phone .tb { --R0: calc(14px + var(--sar)); --B0: calc(12px + var(--sab)); }
body.phone #tFire { --s: 80px; right: var(--R0); bottom: var(--B0); }
body.phone #tAds { --s: 60px; right: calc(var(--R0) + 109px * var(--k)); bottom: calc(var(--B0) + 24px * var(--k)); }
body.phone #tJump { --s: 54px; right: calc(var(--R0) + 80px * var(--k)); bottom: calc(var(--B0) + 87px * var(--k)); }
body.phone #tReload { --s: 60px; right: calc(var(--R0) + 13px * var(--k)); bottom: calc(var(--B0) + 110px * var(--k)); }
body.phone #tKnife { --s: 54px; right: calc(var(--R0) + 171px * var(--k)); bottom: calc(var(--B0) + 77px * var(--k)); }
body.phone #tSwap { --s: 54px; right: calc(var(--R0) + 82px * var(--k)); bottom: calc(var(--B0) + 168px * var(--k)); }
body.phone #tUse { --s: 64px; right: calc(var(--R0) + 150px * var(--k)); bottom: calc(var(--B0) + 146px * var(--k)); }
/* the resting move-ring sits where the left thumb naturally lands, above the points plate */
body.phone #touchMove::after { left: calc(40px + var(--sal)); bottom: calc(78px + var(--sab)); width: 96px; height: 96px; }
/* tablets: same arc, a little bigger and further from the edge */
body.tablet .tb { --R0: calc(28px + var(--sar)); --B0: calc(26px + var(--sab)); }
body.tablet #tFire { --s: 92px; }
body.tablet #tAds, body.tablet #tReload { --s: 68px; }
body.tablet #tJump, body.tablet #tKnife, body.tablet #tSwap { --s: 60px; }
body.tablet #tAds { right: calc(var(--R0) + 124px * var(--k)); bottom: calc(var(--B0) + 26px * var(--k)); }
body.tablet #tJump { right: calc(var(--R0) + 92px * var(--k)); bottom: calc(var(--B0) + 100px * var(--k)); }
body.tablet #tReload { right: calc(var(--R0) + 14px * var(--k)); bottom: calc(var(--B0) + 124px * var(--k)); }
body.tablet #tKnife { right: calc(var(--R0) + 196px * var(--k)); bottom: calc(var(--B0) + 88px * var(--k)); }
body.tablet #tSwap { right: calc(var(--R0) + 94px * var(--k)); bottom: calc(var(--B0) + 192px * var(--k)); }
body.tablet #tUse { --s: 74px; right: calc(var(--R0) + 172px * var(--k)); bottom: calc(var(--B0) + 168px * var(--k)); }

/* --- contextual USE: hidden until a prompt is live; pulses; label says what a tap does; hold ring for rebuild / revive --- */
body.touch-ui #tUse { display: flex; visibility: hidden; opacity: 0; transform: scale(.6); pointer-events: none; transition: opacity .14s, transform .18s var(--ease), visibility 0s .14s; }
body.touch-ui #tUse.show { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity .14s, transform .18s var(--ease); }
body.touch-ui #tUse.down { transform: scale(.92); }
body.touch-ui #tUse .tl { font-size: max(12px, calc(11px * var(--k))); letter-spacing: .14em; }
body.touch-ui #tUse::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--acc2) var(--pr, 0%), rgba(255,255,255,.12) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); opacity: 0; }
body.touch-ui #tUse[data-kind="hold"]::after { opacity: 1; }
body.touch-ui #tUse[data-kind="no"] { border-color: rgba(255,90,70,.7); background: radial-gradient(circle at 50% 30%, rgba(120,40,30,.55), rgba(30,8,6,.6) 70%); animation: none; color: #ffb4a6; }
/* the on-screen prompt explains, the button acts: on phones the prompt drops the keycap and sits just under the crosshair */
body.touch-ui #hPrompt kbd { display: none; }
body.phone #hPrompt { top: calc(50% + 40px); padding: 6px 34px; font-size: 13px; max-width: min(64vw, 440px); gap: 2px 8px; }
body.phone #hPrompt .cost { font-size: 1.25em; }

/* --- phone HUD: everything tucked into the corners, the centre stays clear --- */
body.phone #hTL { left: calc(12px + var(--sal)); top: calc(8px + var(--sat)); width: min(230px, 34vw); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; }
body.phone #hTL > :not(#hRound):not(#hLeft) { grid-column: 1 / -1; }
body.phone #hRound { --rh: 50px; }
body.phone #hLeft { margin: 0; align-self: center; min-height: 28px; padding: 2px 12px 2px 8px; gap: 6px; }
body.phone #hLeft b { font-size: 22px; }
body.phone #hLeft span:not(.gr) { font-size: 12px; letter-spacing: .14em; }
body.phone #hLeft .gr { font-size: 12px; letter-spacing: .14em; }
body.phone #hLeft .cd { font-size: 18px; }
body.phone #hMates { margin-top: 6px; }
body.phone .mate { min-width: 0; font-size: 12px; }
body.phone #toasts { margin-top: 8px; }
body.phone .toast { font-size: 12px; }
body.phone #hBL { left: calc(12px + var(--sal)); bottom: calc(8px + var(--sab)); width: 200px; }
body.phone .hpplate { width: 196px; min-height: 42px; padding: 5px 10px 6px; column-gap: 10px; }
body.phone #hPoints { font-size: 26px; }
body.phone .plab { font-size: 11px; letter-spacing: .14em; }
body.phone #hHp { font-size: 16px; }
body.phone .perk { width: 26px; height: 26px; }
body.phone #hBR { top: calc(6px + var(--sat)); right: calc(64px + var(--sar)); }
body.phone #hWeapon .wn { font-size: 12px; }
body.phone #hReload { font-size: 12px; }
body.phone #fps { top: calc(58px + var(--sat)); right: calc(14px + var(--sar)); }
body.phone #hBuffs { top: calc(8px + var(--sat)); bottom: auto; gap: 8px; }
body.phone .buff .bic { width: 32px; height: 32px; }
body.phone #downPanel { bottom: calc(18% + var(--sab)); width: min(320px, 52vw); }
body.phone #dmgdirs { width: 60vmin; height: 60vmin; }
/* round banner: smaller and higher so it never sits on the crosshair */
body.phone #announce.round { --as: .56; --ay: 88px; }
body.phone #announce:not(.round):not(.pu) { --as: .5; --ay: 30vh; }

/* --- portrait: gameplay asks for landscape; menus stay usable --- */
body.touch-ui.portrait:has(#hud.on) #rotate { display: flex; }
body.touch-ui.portrait:has(#hud.on) #touch { visibility: hidden; }
body.touch-ui:has(#pause.on) #rotate, body.touch-ui:has(#gameover.on) #rotate, body.touch-ui:has(#settings.on) #rotate { display: none !important; }
body.touch-ui #rotate b { font-size: clamp(1.8rem, 8vw, 2.4rem); }

/* --- menus on touch: big tap targets, readable text --- */
body.touch-ui .btn { min-height: 44px; }
body.touch-ui .btn.sm { min-height: 40px; }
body.touch-ui .ctab { min-height: 44px; }
body.touch-ui label.set { min-height: 48px; }
body.touch-ui label.set input[type=checkbox] { transform: scale(1.15); }
body.touch-ui input[type=range] { height: 32px; }
body.touch-ui .namefield input, body.touch-ui #joinCode, body.touch-ui #chatInput { min-height: 40px; font-size: 16px; } /* 16px: iOS does not zoom the page on focus */
body.touch-ui .hide-touch { display: none !important; }
body.touch-ui .touch-guide .kp span { min-width: 104px; }
body.phone .mi { min-height: 44px; }
body.phone #pause .mi { min-height: 48px; }
body.phone .pz { max-width: calc(100vw - 2 * var(--pad) - var(--sal) - var(--sar)); }
body.phone .pp-card { min-height: 0; }
body.phone .pp-cta { min-height: 40px; display: flex; align-items: center; justify-content: center; }
body.phone #gameover .btn.wide { min-height: 44px; }
body.phone .gs span { letter-spacing: .06em; }
/* portrait phones (menus only): skill tree stacks, lanes put the header above the nodes, detail panel flows below */
@media (orientation: portrait) and (max-width: 600px) {
  .tr-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tr-detail { position: static !important; max-height: none !important; overflow: visible; }
  .lane { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px 10px; min-height: 0; }
  .lane-h { grid-template-columns: auto 1fr auto; column-gap: 10px; align-items: baseline; }
  .lane-h b { font-size: 1.4rem; } .lane-h small { grid-column: 2; grid-row: 1; } .lane-p { grid-column: 3; } .lane-bar { grid-column: 1 / 4; }
  .lane-t { gap: 4px; --h: 22px; padding-bottom: 16px; }
  .lane-t::before, .lane-t::after { top: calc(50% - 8px); }
  .sn { --s: 44px; } .sn.cap { --s: 52px; }
  .sn em { top: calc(100% + 4px); }
  #loadout .ctabs { overflow-x: auto; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  #loadout .ctabs::-webkit-scrollbar { display: none; }
  #loadout .ctab { flex: none; }
  #loadout .wcards, #loadout .wcards:has(> :nth-child(6)) { align-self: stretch; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; }
  #loadout .wcard, #loadout .wcards:has(> :nth-child(6)) .wcard { height: 150px; }
  body.touch-ui #hBR { visibility: hidden; }
}
/* perk offer on phones: three cards in one row that always fit, centred, scroll if a very short screen needs it */
body.phone #perkPick { justify-content: safe center; gap: 10px; }
body.phone .pp-cards { gap: 10px; max-width: 100%; flex-wrap: nowrap; }
body.phone .pp-card { flex: 0 1 auto; width: min(calc((100vw - 52px - var(--sal) - var(--sar)) / 3), 220px); }
body.phone .pp-sheen { overflow: hidden; }
body.phone .pp-card { overflow: hidden; }

/* =====================================================================
   TOUCH UI R2: 48px menu targets, 12px text floor on the phone HUD, lobby that fits 375 / 360px,
   compact sub-screen header + floating DONE pill, settings tabs, USE in the thumb arc, tappable weapon slots
   ===================================================================== */
/* --- control scale never below 90% (old saves / main.js write --ts unclamped) --- */
body.touch-ui .tb { --k: max(.9, var(--ts, 1)); }

/* --- menus: every tap target >= 48px on touch --- */
body.touch-ui .modesw button { min-height: 48px; }
body.touch-ui .mi { min-height: 48px; }
body.touch-ui .stc, body.touch-ui #loadout .stc { min-height: 48px; }
body.touch-ui .btn.sm, body.touch-ui #loadout .preset .btn.sm { min-height: 44px; min-width: 56px; }
body.touch-ui .lnk { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; margin: -12px -14px -12px 0; }
body.touch-ui .namefield input, body.touch-ui #joinCode { min-height: 44px; }
body.touch-ui #partyActions .btn, body.touch-ui .joinrow .btn { min-height: 48px; }
body.touch-ui .joinrow #joinCode { min-height: 48px; height: 48px; }
body.touch-ui label.set { min-height: 52px; }
body.touch-ui input[type=range] { height: 48px; }
body.touch-ui input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; }
body.touch-ui input[type=range]::-webkit-slider-thumb { width: 24px; height: 28px; margin-top: -11px; border-radius: 3px; }
body.touch-ui input[type=range]::-moz-range-thumb { width: 24px; height: 28px; border-radius: 3px; }
body.touch-ui input[type=range]::-moz-range-track, body.touch-ui input[type=range]::-moz-range-progress { height: 6px; }
body.touch-ui label.set input[type=checkbox] { transform: none; width: 60px; height: 34px; border-radius: 17px; }
body.touch-ui label.set input[type=checkbox]::after { width: 26px; height: 26px; top: 3px; left: 3px; }
body.touch-ui label.set input[type=checkbox]:checked::after { left: 29px; }
body.touch-ui .seg button { min-width: 56px; min-height: 48px; }
body.touch-ui .ctab { min-height: 48px; }
body.touch-ui .aslot { min-height: 48px; }
/* skill nodes: 46px visual + an invisible 6px ring of extra hit area */
body.touch-ui .sn { --s: 46px; }
body.touch-ui .sn.cap { --s: 54px; }
body.touch-ui .sn:not(.cap)::after { content: ''; position: absolute; inset: -6px; }
body.touch-ui .sn em { top: calc(100% + 12px); font-size: 12px; }
body.touch-ui .lane-t { padding-bottom: 26px; }
body.touch-ui .lane-t::before, body.touch-ui .lane-t::after { top: calc(50% - 13px); }

/* --- settings tabs (phones): CONTROLS / VIDEO / AUDIO segmented control under the title --- */
.set-tabs { display: none; }
body.phone .set-tabs { flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 0 0 10px; padding: 3px; background: rgba(0,0,0,.5); border: 1px solid var(--line); }
body.phone .set-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border: 0; background: transparent; color: var(--dim); font-family: var(--head); font-size: 1.3rem; letter-spacing: .14em; line-height: 1; cursor: pointer; }
body.phone .set-tabs button .sti { width: 16px; height: 16px; color: var(--acc); opacity: .7; }
body.phone .set-tabs button.on { color: #fff; background: linear-gradient(180deg, rgba(232,163,58,.3), rgba(232,163,58,.1)); box-shadow: inset 0 -2px 0 var(--acc); }
body.phone .set-tabs button.on .sti { opacity: 1; }
body.phone #settings .setgrid { grid-template-columns: minmax(0, 1fr); margin: 0; }
body.phone #settings .setcol { display: contents; }
body.phone #settings[data-stab="controls"] .setcard:not([data-st="controls"]),
body.phone #settings[data-stab="video"] .setcard:not([data-st="video"]),
body.phone #settings[data-stab="audio"] .setcard:not([data-st="audio"]) { display: none; }
body.phone #settings .setcard > h3 { display: none; }
body.phone #settings .touch-guide > h3 { display: flex; }

/* --- phone landscape sub-screens: one-row header (title + level/bank chip), floating 48px DONE pill instead of a footer bar --- */
@media (orientation: landscape) {
  body.phone :is(#loadout, #tree, #settings) .topbar { flex-wrap: nowrap; align-items: center; gap: 12px; margin-bottom: 8px; padding-bottom: 6px; }
  body.phone :is(#loadout, #tree, #settings) .topbar h1 { font-size: 2rem; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  body.phone :is(#loadout, #tree, #settings) .prof { flex-wrap: nowrap; gap: 8px; }
  body.phone :is(#loadout, #tree, #settings) .prof .lvlbar { display: none; }
  body.phone :is(#loadout, #tree, #settings) .lvbadge { width: 30px; height: 33px; }
  body.phone :is(#loadout, #tree, #settings) .prof .bank { flex-direction: row; align-items: baseline; gap: 6px; padding: 5px 10px 4px; font-size: 1.35rem; }
  body.phone :is(#loadout, #tree, #settings) .prof .bank small { font-size: 12px; }
  body.phone #loadout .sfoot, body.phone #tree .sfoot, body.phone #settings .sfoot {
    left: auto; right: calc(10px + var(--sar)); bottom: calc(8px + var(--sab)); width: auto; min-height: 0; padding: 0; gap: 8px;
    background: none !important; border: 0; box-shadow: none; pointer-events: none; }
  body.phone :is(#loadout, #tree, #settings) .sfoot > * { pointer-events: auto; }
  body.phone :is(#loadout, #tree, #settings) .sfoot::before, body.phone :is(#loadout, #tree, #settings) .sfoot::after,
  body.phone :is(#loadout, #tree, #settings) .sf-keys, body.phone :is(#loadout, #tree, #settings) .sf-short, body.phone :is(#loadout, #tree, #settings) .sf-hint { display: none; }
  body.phone :is(#loadout, #tree, #settings) .sfoot .done { height: 48px; min-height: 48px; min-width: 120px; padding: 0 20px; font-size: 1.4rem; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 8px 22px rgba(0,0,0,.7); }
  body.phone :is(#loadout, #tree, #settings) .sfoot .btn.rst { width: 48px; height: 48px; min-height: 48px; background: rgb(18,19,23); box-shadow: 0 8px 22px rgba(0,0,0,.7); }
  body.phone #loadout, body.phone #tree, body.phone #settings { padding-bottom: calc(68px + var(--sab)); scroll-padding-bottom: calc(68px + var(--sab)); }
  body.phone #tree .tr-detail { max-height: calc(100dvh - var(--sat) - var(--sab) - 2 * var(--pad) - 52px); padding-bottom: 64px; }
}

/* --- lobby on phone landscape: both columns fit 375 - 2 * inset; each column scrolls on its own as a fallback --- */
@media (orientation: landscape) and (max-height: 500px) {
  body.phone #menu.on { grid-template-rows: minmax(0, 1fr) auto; }
  body.phone .m-left, body.phone .m-right { min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  body.phone .m-left::-webkit-scrollbar, body.phone .m-right::-webkit-scrollbar { display: none; }
  /* compact BLOCKBOUND mark sits beside the ZOMBIES wordmark instead of above it */
  body.phone .m-left { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 12px; }
  body.phone .m-left > * { grid-column: 1 / -1; }
  body.phone .m-left > .m-title { grid-column: 1; grid-row: 1; margin: 0 0 4px; padding-top: 2px; font-size: clamp(2.4rem, 12.5vh, 4.6rem); line-height: .9; }
  body.phone .m-left > .m-logo { grid-column: 2; grid-row: 1; align-self: center; margin-bottom: 6px; font-size: 12px; letter-spacing: .3em; }
  body.phone .modesw { margin-bottom: 4px; padding: 0; }
  body.phone .modesw button { padding-top: 0; padding-bottom: 0; display: flex; flex-direction: column; justify-content: center; }
  body.phone .mi { margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
  body.phone .mi.primary { margin-bottom: 4px; }
  body.phone .namefield { margin-top: 4px; }
  body.phone .m-right { gap: 8px; padding-bottom: 2px; }
  body.phone .party { padding: 8px 12px 10px; }
  body.phone .pm { min-height: 28px; padding: 2px 8px 2px 2px; }
  body.phone #partyList { margin-bottom: 8px; }
  body.phone #partyActions { gap: 8px; }
  body.phone #yourLoadout { padding: 6px 12px 6px; }
  body.phone .yl-h { margin-bottom: 0; }
  body.phone .yl-body { min-height: 48px; gap: 10px; }
  body.phone .yl-body img { width: 64px; }
  body.phone .yl-chips:has(.none) { display: none; }
}
/* Android 360px tall: title glyphs stay inside their box, 44px rows, no CALLSIGN caption */
@media (orientation: landscape) and (max-height: 360px) {
  body.phone .m-left > .m-title { font-size: 3rem; line-height: 1.05; padding-top: calc(2px + var(--sat)); }
  body.phone .m-left > .m-logo { display: flex; }
  body.phone .mi { min-height: 44px; font-size: 1.55rem; }
  body.phone .namefield > span { display: none; }
}

/* --- phone HUD text: nothing under 12px --- */
body.touch-ui .plab { font-size: 12px; letter-spacing: .12em; }
body.phone #hHp small { font-size: 12px; }
body.phone .slot > span { font-size: 12px; width: 15px; height: 15px; }
body.touch-ui .tb .tl { font-size: 12px; letter-spacing: .08em; }
body.phone #tKnife .tl, body.phone #tSwap .tl, body.phone #tJump .tl { letter-spacing: .04em; }
body.phone #hWeapon .wn, body.phone #hReload, body.phone .toast, body.phone .mate, body.phone #hLeft span { font-size: 12px; }
body.phone .buff b, body.touch-ui #hPrompt small, body.touch-ui #dpN small { font-size: 12px; }
/* weapon slots are tap targets on touch (input.js pads the hit box to 48px); tap feedback */
body.touch-ui .slot { height: 30px; }
body.touch-ui .slot.tap { border-color: #fff; background: rgba(255,255,255,.3); }

/* --- USE: a fixed slot on the outer thumb arc (45deg, r~170 from FIRE), fades in (no scale-from-small) and pulses 1.0 -> 1.08 --- */
body.phone #tFire { --s: 80px; right: var(--R0); bottom: var(--B0); }
body.phone #tAds { --s: 60px; right: calc(var(--R0) + 110px * var(--k)); bottom: calc(var(--B0) + 10px * var(--k)); }
body.phone #tJump { --s: 54px; right: calc(var(--R0) + 84px * var(--k)); bottom: calc(var(--B0) + 84px * var(--k)); }
body.phone #tReload { --s: 60px; right: calc(var(--R0) + 10px * var(--k)); bottom: calc(var(--B0) + 110px * var(--k)); }
body.phone #tKnife { --s: 54px; right: calc(var(--R0) + 177px * var(--k)); bottom: calc(var(--B0) + 57px * var(--k)); }
body.phone #tSwap { --s: 54px; right: calc(var(--R0) + 57px * var(--k)); bottom: calc(var(--B0) + 177px * var(--k)); }
body.phone #tUse { --s: 64px; right: calc(var(--R0) + 128px * var(--k)); bottom: calc(var(--B0) + 128px * var(--k)); }
body.tablet #tUse { --s: 74px; right: calc(var(--R0) + 146px * var(--k)); bottom: calc(var(--B0) + 146px * var(--k)); }
body.touch-ui #tUse { transform: none; }
body.touch-ui #tUse.show { animation: usePulse 1.2s ease-in-out infinite, useScale 1.2s ease-in-out infinite; }
body.touch-ui #tUse.down { transform: scale(.94); animation: none; }
body.touch-ui #tUse[data-kind="no"] { animation: none; }
@keyframes useScale { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }
body.phone #tUse .tl { font-size: 12px; letter-spacing: .1em; }
/* the prompt explains, the button acts: label sits low, clear of the crosshair, between the two thumbs */
body.phone #hPrompt { top: auto; bottom: calc(28% + var(--sab)); max-width: min(50vw, 360px); }

/* --- tablet: resting stick ring above the points plate --- */
body.tablet #touchMove::after { bottom: calc(150px + var(--sab)); }

/* --- game over + service record: no truncated labels --- */
.gs-acc, .gs-dot { font-style: normal; }
body.tablet .gf-info span, body.tablet .td-tag, body.touch-ui .preset .pd { white-space: normal; overflow: visible; text-overflow: clip; }
body.phone .gs span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
body.phone .gs .gs-acc { display: block; color: var(--tx2); }
body.phone .gs .gs-dot { display: none; }
body.touch-ui .ms span { overflow: visible; text-overflow: clip; letter-spacing: .1em; }
@media (orientation: portrait) {
  body.touch-ui .ms-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.touch-ui .go-extra { grid-template-columns: minmax(0, 1fr); }
  body.touch-ui .m-sub span { white-space: nowrap; }
  body.touch-ui .m-sub em { white-space: normal; }
}

/* =====================================================================
   REDUCED MOTION: the single override block for prefers-reduced-motion (keep it last in the file)
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  /* keep information timing (toasts, announcements, hit feedback fade) but drop movement & decoration */
  *, *::before, *::after { transition-duration: .01ms !important; }
  #grain, .mi.primary::after, .done::after { display: none !important; }
  .menuscreen.on, .mi, .m-right, .m-title, .pm, .pp-head, .pp-card, .gs, .go-lv, .go-right, .go-num, .go-lab, .go-extra, .pz, .perk, .buff,
  .badge, .treesvg g.tn.can circle, #hRound.flash, .spin i, .rot-ic, #tUse, #hLeft .gr, #hReload kbd, #hHpBar.low, .dp-skull, .sfoot .done::after,
  .lane, .sn.can, .sn.next::before, #menuStats, #hMag .pips u, .pp-keys, .pp-sheen, #hBR:has(.rli.spin)::after,
  #announce.round.on em, #announce.round.on small, #announce.round.on .chalk, #hTL:has(#hRound.flash)::before,
  #announce.pu.on .pu-ic::after, #announce.pu.on .pu-ic > * { animation: none !important; }
  .go-right li { animation: none !important; opacity: 1 !important; }
  #vigHurt.crit::after, #hud.isdown #vigHurt::after { animation: none !important; opacity: .6; transform: none; }
  #announce.round.on::after { animation: none !important; opacity: 0; }
  #announce.on, #announce.pu.on, #announce.round.on, .toast { animation-name: fadeHold !important; }
  .toast, .pp-sheen { clip-path: none !important; transition: none !important; }
  .dmgdir::before { animation-name: fadeOut !important; }
  .pop { animation: fadeOut .95s linear forwards !important; }
  #hBR:has(.rli.spin)::after { width: calc(100% - 28px); }
  .stc:hover, .wcard:hover, .wcard:hover .wimg, .aopt:hover, .sn:hover, .sn.sel, .tile:hover, .mi:hover, .tb:active, .tb.down,
  .pp-card:hover, .pp-card:focus-visible, .pp-card.picked { transform: none !important; }
  .pp-card:hover, .pp-card:focus-visible { animation: none !important; }
}

/* ---------- classes: equip button (skills), class card, HUD equipment chip, touch equipment buttons ---------- */
.lane-h { position: relative; }
.lane-eq { margin-top: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: rgba(0,0,0,.35); color: var(--c); font: 700 12px/1 'Oswald', Impact, sans-serif; letter-spacing: .14em; cursor: pointer; border-radius: 2px; transition: background .15s, color .15s; }
.lane-eq:hover, .lane-eq:focus-visible { background: color-mix(in srgb, var(--c) 22%, transparent); color: #fff; }
.lane-eq .bic { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.lane-eq.on { background: var(--c); color: #111; border-color: var(--c); }
.lane-eq .lane-gear { font: 600 10px/1.2 'Barlow Condensed', 'Oswald', sans-serif; letter-spacing: .08em; opacity: .8; text-transform: uppercase; }
.lane.eq { box-shadow: inset 4px 0 0 var(--c), 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.td-cls { margin: 12px 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 8%, rgba(0,0,0,.4)); }
.td-cls.on { border-color: var(--c); }
.td-cls-h { display: flex; justify-content: space-between; align-items: baseline; font: 700 13px 'Oswald', sans-serif; letter-spacing: .12em; color: var(--c); }
.td-cls-h span { font-size: 10px; opacity: .8; color: #ddd; }
.td-cls-g { display: flex; gap: 8px; align-items: center; margin: 6px 0 4px; }
.td-cls-g em { font: 700 16px 'Oswald', sans-serif; font-style: normal; color: #fff; letter-spacing: .06em; text-transform: uppercase; }
.td-cls-g kbd { font: 700 11px monospace; padding: 2px 6px; border: 1px solid #777; border-radius: 3px; color: #ddd; }
.td-cls p { margin: 4px 0; font-size: 13px; line-height: 1.35; }
.td-cls small { display: block; opacity: .7; font-size: 12px; }
.td-cls .td-eq { margin-top: 8px; width: 100%; }

#hEquip { position: absolute; left: max(28px, env(safe-area-inset-left)); bottom: 205px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; z-index: 3; }
#hEquip small { font: 700 10px 'Oswald', sans-serif; letter-spacing: .2em; color: var(--c); opacity: .85; }
#hEquip .eq-row { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; min-width: 190px; padding: 5px 10px; background: rgba(8,8,10,.62);
  border-left: 3px solid #555; font: 700 13px 'Oswald', sans-serif; letter-spacing: .1em; color: #8a8a8a; position: relative; }
#hEquip .eq-row kbd { font: 700 11px monospace; padding: 1px 5px; border: 1px solid currentColor; border-radius: 3px; }
#hEquip .eq-row .eq-v { justify-self: end; font-size: 12px; }
#hEquip .eq-row i { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.08); }
#hEquip .eq-row u { display: block; height: 100%; background: var(--c); opacity: .6; }
#hEquip .eq-row.ready { color: #fff; border-left-color: var(--c); }
#hEquip .eq-row.ready .eq-v { color: var(--c); }
#hEquip .eq-row.act { color: #fff; border-left-color: var(--c); background: color-mix(in srgb, var(--c) 30%, rgba(8,8,10,.7)); animation: eqPulse .8s ease-in-out infinite alternate; }
@keyframes eqPulse { to { box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); } }
body.touch-ui #hEquip { bottom: auto; top: calc(env(safe-area-inset-top) + 92px); left: max(12px, env(safe-area-inset-left)); }
body.touch-ui #hEquip .eq-row { min-width: 132px; padding: 3px 8px; font-size: 11px; }
body.touch-ui #hEquip small { display: none; }

#touch .teq { display: none; }
/* class-ability buttons live on the outer ring of the right thumb arc (phone 64deg / tablet 90deg, r~180 from FIRE);
   the Engineer's SENTRY sits one ring further out. Positions scale with --k like the rest of the arc. */
body.touch-ui #touch #tEquip { display: flex; --s: 54px; --ec: #e0c06a; left: auto; top: auto; right: calc(var(--R0) + 92px * var(--k)); bottom: calc(var(--B0) + 175px * var(--k)); border: 2px solid var(--ec); }
body.touch-ui #touch #tEquip2.show { display: flex; --s: 52px; --ec: #8ae06a; left: auto; top: auto; right: calc(var(--R0) + 175px * var(--k)); bottom: calc(var(--B0) + 205px * var(--k)); border: 2px solid var(--ec); }
body.tablet #touch #tEquip { --s: 60px; right: calc(var(--R0) + 16px * var(--k)); bottom: calc(var(--B0) + 210px * var(--k)); }
body.tablet #touch #tEquip2.show { --s: 56px; right: calc(var(--R0) + 173px * var(--k)); bottom: calc(var(--B0) + 239px * var(--k)); }
body.touch-ui #touch .teq .tl { font-size: 12px; letter-spacing: .04em; white-space: nowrap; max-width: calc(var(--s) * var(--k) - 10px); overflow: hidden; text-overflow: clip; }
body.touch-ui #touch .teq .tg { width: calc(var(--s) * var(--k) * .34); height: calc(var(--s) * var(--k) * .34); }
/* cooldown ring on the button itself (--cd set by ui.touchEquip from the ability's charge) */
body.touch-ui #touch .teq::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--ec) var(--cd, 100%), rgba(255,255,255,.14) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); }
body.touch-ui #touch .teq.ready { box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 0 16px color-mix(in srgb, var(--ec) 55%, transparent); }
body.touch-ui #touch .teq.act { opacity: 1; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--ec) 70%, transparent), rgba(30,24,8,.6) 72%); animation: eqPulse .8s ease-in-out infinite alternate; }
body.touch-ui #touch .teq.cool { opacity: .55 !important; }
body.touch-ui #touch .teq.cool .tg, body.touch-ui #touch .teq.cool .tl { filter: grayscale(1); opacity: .7; }
/* the button carries the state on phones: the text chip would only repeat it */
body.touch-ui.phone #hEquip { display: none; }
body.touch-ui #hEquip { top: calc(var(--sat) + 92px); left: calc(12px + var(--sal)); }
@media (prefers-reduced-motion: reduce) { #hEquip .eq-row.act, body.touch-ui #touch .teq.act { animation: none; } }

/* =====================================================================
   TOUCH UI R3: perk-card arming delay, roomier phone arc (USE / KNIFE / SWAP / ULT >= 20px apart), skill-tree
   bottom sheet, loadout tabs, 48px switches
   ===================================================================== */
/* --- perk offer: cards ignore taps for 600ms after opening (a fill bar shows it) --- */
#perkPick.arming .pp-card { pointer-events: none; }
#perkPick.arming .pp-cards { opacity: .7; transition: opacity .15s; }
#perkPick .pp-head::after { content: ''; display: block; width: 180px; height: 3px; margin: 10px auto 0; background: linear-gradient(var(--acc2), var(--acc2)) no-repeat left / 100% 100%, rgba(255,255,255,.1); opacity: 0; transition: opacity .3s; }
#perkPick.arming .pp-head::after { opacity: 1; animation: ppArm .6s linear both; }
@keyframes ppArm { from { background-size: 0% 100%, auto; } to { background-size: 100% 100%, auto; } }

/* --- phone thumb arc: inner ring r=100 (AIM 0deg, JUMP 45deg, RELOAD 90deg), outer ring r=180
   (KNIFE 8deg, USE 36deg, ULT 64deg, SWAP 90deg); every circle gap >= 23px * k --- */
body.phone #tKnife { right: calc(var(--R0) + 191px * var(--k)); bottom: calc(var(--B0) + 38px * var(--k)); }
body.phone #tUse { right: calc(var(--R0) + 154px * var(--k)); bottom: calc(var(--B0) + 114px * var(--k)); }
body.phone #tSwap { right: calc(var(--R0) + 13px * var(--k)); bottom: calc(var(--B0) + 193px * var(--k)); }
/* tablets: the same two rings, scaled (inner r=115, outer r=205, Engineer SENTRY r=285 / 50deg); gaps >= 24px * k */
body.tablet #tAds { right: calc(var(--R0) + 127px * var(--k)); bottom: calc(var(--B0) + 12px * var(--k)); }
body.tablet #tJump { right: calc(var(--R0) + 97px * var(--k)); bottom: calc(var(--B0) + 97px * var(--k)); }
body.tablet #tReload { right: calc(var(--R0) + 12px * var(--k)); bottom: calc(var(--B0) + 127px * var(--k)); }
body.tablet #tKnife { right: calc(var(--R0) + 219px * var(--k)); bottom: calc(var(--B0) + 44px * var(--k)); }
body.tablet #tUse { right: calc(var(--R0) + 175px * var(--k)); bottom: calc(var(--B0) + 129px * var(--k)); }
body.tablet #tSwap { right: calc(var(--R0) + 16px * var(--k)); bottom: calc(var(--B0) + 221px * var(--k)); }
body.tablet #touch #tEquip { right: calc(var(--R0) + 106px * var(--k)); bottom: calc(var(--B0) + 200px * var(--k)); }
body.tablet #touch #tEquip2.show { right: calc(var(--R0) + 201px * var(--k)); bottom: calc(var(--B0) + 236px * var(--k)); }
/* 375px-tall phones (iPhone SE / X, 360px Android): above ~112% the outer ring would run into the ammo cluster and
   the pause button, so the arc stops growing there (the setting still scales up to 140% on taller screens) */
@media (max-height: 400px) { body.phone .tb:not(#tPause) { --k: clamp(.9, var(--ts, 1), 1.12); } }

/* --- skill tree on phones: lanes take the full width; the detail opens as a bottom sheet on a node tap --- */
.td-close { display: none; }
body.phone #tree .tr-grid { grid-template-columns: minmax(0, 1fr); }
body.phone #tree .tr-detail { position: fixed !important; z-index: 8; left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); top: auto; bottom: 0; margin: 0;
  max-height: min(70vh, 320px) !important; overflow-y: auto; overscroll-behavior: contain; padding: 10px 16px calc(12px + var(--sab)) !important;
  background: rgb(14,15,18); border: 1px solid var(--line); border-bottom: 0; border-top: 2px solid var(--c, var(--acc)); box-shadow: 0 -14px 40px rgba(0,0,0,.85);
  transform: translateY(105%); visibility: hidden; transition: transform .22s var(--ease), visibility 0s .22s; }
body.phone #tree .tr-detail.open { transform: none; visibility: visible; transition: transform .22s var(--ease); }
body.phone #tree .tr-detail :is(.td-foot, .td-path) { display: none; }
body.phone #tree .tr-detail .td-close { display: block; position: sticky; top: -10px; align-self: flex-end; flex: none; z-index: 2; width: 48px; height: 48px; margin: -10px -12px -48px 0; padding: 0; border: 0; background: none; cursor: pointer; }
body.phone #tree .tr-detail .td-close i { position: absolute; inset: 10px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); }
body.phone #tree .tr-detail .td-close i::before, body.phone #tree .tr-detail .td-close i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; margin: -1px 0 0 -7px; background: #fff; transform: rotate(45deg); }
body.phone #tree .tr-detail .td-close i::after { transform: rotate(-45deg); }
body.phone #tree .tr-detail .td-buy { position: sticky; bottom: calc(-12px - var(--sab)); z-index: 2; width: 100%; min-height: 48px; margin-top: 8px; box-shadow: 0 -10px 18px rgb(14,15,18); }
body.phone #tree .tr-detail .td-cls { margin: 8px 0; }

/* --- loadout on phones: WEAPON / MODS / PRESETS tabs (same segmented control as Settings), sticky under the title --- */
.lo-sec { display: contents; }
body.phone #loadout .lo-tabs { position: sticky; top: calc(-1 * var(--pad) - var(--sat)); z-index: 5; margin: 0 0 10px; background: rgb(10,10,12); }
body.phone #loadout .ar-grid { grid-template-columns: minmax(0, 1fr); }
body.phone #loadout[data-ltab="weapon"] .lo-sec:not([data-lt="weapon"]),
body.phone #loadout[data-ltab="attach"] .lo-sec:not([data-lt="attach"]),
body.phone #loadout[data-ltab="presets"] .lo-sec:not([data-lt="presets"]) { display: none; }
body.phone #loadout[data-ltab="attach"] .ar-left, body.phone #loadout:not([data-ltab="attach"]) .ar-right { display: none; }
/* MODS tab in landscape: weapon preview pinned on the left, slots + options on the right (one short scroll) */
@media (orientation: landscape) {
  body.phone #loadout[data-ltab="attach"] .ar-grid { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); column-gap: 12px; align-items: start; }
  body.phone #loadout[data-ltab="attach"] .wprev { grid-column: 1; grid-row: 1 / span 3; grid-template-columns: 1fr; gap: 8px; position: sticky; top: 64px; }
  body.phone #loadout[data-ltab="attach"] .wprev .wp-art { min-height: 96px; }
  body.phone #loadout[data-ltab="attach"] .lo-sec[data-lt="attach"] > :not(.wprev) { grid-column: 2; }
  body.phone #loadout[data-ltab="attach"] .aopts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
/* (narrow desktop single column: the .lo-sec wrappers are display: contents, keep 03 attachments before 04 presets) */
@media (max-width: 860px) {
  .ar-right > .lo-sec > * { order: 1; }
  .lo-sec[data-lt="presets"] > * { order: 2; }
}
/* weapon-class strip: reads as scrollable (fade at the edge, snaps per tab) */
body.touch-ui #loadout .ctabs { overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-right: 40px;
  -webkit-mask: linear-gradient(90deg, #000 85%, transparent); mask: linear-gradient(90deg, #000 85%, transparent); }
body.touch-ui #loadout .ctabs::-webkit-scrollbar { display: none; }
body.touch-ui #loadout .ctab { flex: none; scroll-snap-align: start; }

/* --- settings switches: the whole row toggles; the switch itself gets a 48px hit box --- */
body.touch-ui label.set { cursor: pointer; }
body.touch-ui label.set input[type=checkbox] { position: relative; flex: none; }
body.touch-ui label.set input[type=checkbox]::before { content: ''; position: absolute; inset: -8px -6px; }

/* ---------- integrated-GPU hint banner (main menu) ---------- */
#gpuHint { position: fixed; z-index: 80; left: 50%; top: calc(16px + var(--sat)); transform: translateX(-50%); width: min(560px, 92vw); padding: 14px 18px 16px;
  background: rgba(14,12,10,.96); border: 1px solid #e0a040; border-left: 4px solid #e0a040; box-shadow: 0 12px 40px rgba(0,0,0,.6); color: #ddd; font-size: 14px; line-height: 1.4; }
#gpuHint > b { display: flex; align-items: center; gap: 8px; font: 700 15px 'Oswald', Impact, sans-serif; letter-spacing: .14em; color: #f0b050; }
#gpuHint .gh-i { width: 18px; height: 18px; }
#gpuHint p { margin: 8px 0 6px; } #gpuHint em { font-style: normal; color: #fff; }
#gpuHint ol { margin: 0 0 12px 18px; padding: 0; } #gpuHint li { margin: 3px 0; } #gpuHint li b { color: #fff; }
#gpuHint button { min-height: 40px; padding: 0 22px; background: #e0a040; color: #111; border: 0; font: 700 14px 'Oswald', sans-serif; letter-spacing: .16em; cursor: pointer; }

/* ---------- perf: no SVG paint/chalk filters and no animated blur on in-game HUD text ----------
   url(#paint) / url(#chalk) are feTurbulence + feDisplacementMap filters rendered on the CPU and re-run on every repaint;
   on the round counter / wave announcement they stalled frames 100-330 ms on a kill or a cleared wave. */
#hRound, #hRound:has(.tally.few), .pzi-tally { filter: drop-shadow(0 0 5px rgba(200,16,6,.45)) drop-shadow(0 2px 0 rgba(0,0,0,.9)) !important; }
#announce .chalk, #announce.round .chalk, #announce.round .chalk:has(.tally.few) { filter: drop-shadow(0 0 16px rgba(200,20,0,.6)) drop-shadow(0 2px 0 #000) !important; }
@keyframes announce {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--as) * 1.15)); animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); animation-timing-function: ease-in; }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 16px)) scale(calc(var(--as) * .97)); }
}
@keyframes announceRound {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(calc(var(--as) * 1.35)); animation-timing-function: cubic-bezier(.15, .9, .25, 1); }
  8% { opacity: 1; transform: translate(-50%, -50%) scale(calc(var(--as) * .97)); }
  12% { transform: translate(-50%, -50%) scale(var(--as)); }
  58% { opacity: 1; transform: translate(-50%, -50%) scale(var(--as)); animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
  92% { opacity: 1; transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(calc(var(--as) * var(--fs))); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--fx)), calc(-50% + var(--fy))) scale(calc(var(--as) * var(--fs))); }
}
#announce { will-change: transform, opacity; }

/* ---------- perf: perk-pick overlay (was re-rasterised on the GPU every frame: up to 180 ms per frame on a wave clear) ----------
   no drop-shadow filters inside the cards, no animated box-shadow (glow is a static shadow + an opacity-pulsed pseudo element),
   cards composited once (will-change), arming bar animates transform instead of background-size */
.pp-hex, .pp-ic .glyph { filter: none !important; }
.pp-card { will-change: transform, opacity; contain: layout paint; }
.pp-card:hover, .pp-card:focus-visible { animation: cardIn .55s var(--ease) backwards !important; animation-delay: calc(.12s + var(--i, 0) * 90ms) !important;
  box-shadow: 0 22px 44px rgba(0,0,0,.6), 0 0 34px color-mix(in srgb, var(--pc, #e8a33a) 34%, transparent); }
.pp-sheen { will-change: transform; }
#perkPick .pp-head::after { background: rgba(255,255,255,.1); position: relative; overflow: hidden; }
#perkPick .pp-head { position: relative; }
#perkPick.arming .pp-head::after { animation: none; background: linear-gradient(90deg, var(--acc2) 0 50%, rgba(255,255,255,.1) 50% 100%) 100% 0 / 200% 100% no-repeat; animation: ppArm2 .6s linear both; }
@keyframes ppArm2 { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* perf: perk cards slide + fade in (no scale: a scaled layer is re-rasterised at its final size = 3 GPU raster spikes),
   lighter text glow on the stat number */
@keyframes cardIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.pp-stat b { text-shadow: 0 2px 0 rgba(0,0,0,.7) !important; }
.pp-card.picked { transform: translateY(-8px) !important; }

/* ================= skill tree v2: core chain that forks into two sub-paths per class (ui.js renderTree) ================= */
.lane-tree { --s1: 46px; --s2: 54px; --gap: 10px; --arm: 18px; position: relative; display: flex; align-items: center; min-width: 0; padding: 2px 0; }
.lane-tree .sn { --s: var(--s1); } .lane-tree .sn.cap { --s: var(--s2); }
.lane-tree .sn em { display: none; }
/* core chain */
.lt-core { position: relative; flex: none; display: flex; align-items: center; gap: var(--gap); padding-right: var(--arm); }
.lt-core::before, .lt-core::after, .lt-row::before, .lt-row::after { content: ''; position: absolute; top: 50%; height: 3px; margin-top: -1.5px; pointer-events: none; }
.lt-core::before { left: calc(var(--s1) / 2); right: 0; background: rgba(255,255,255,.1); box-shadow: 0 1px 0 rgba(0,0,0,.5); }
.lt-core::after { left: calc(var(--s1) / 2); width: calc((100% - var(--s1) - var(--arm)) * var(--p, 0)); background: var(--c); box-shadow: 0 0 10px var(--c); }
.lt-core.cdone::after { width: calc(100% - var(--s1) / 2); }
/* fork: a vertical bus joining the two path rows, each row starts with a short arm */
.lt-fork { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-left: var(--arm); }
.lt-fork::before { content: ''; position: absolute; left: 0; width: 3px; margin-left: -1.5px; top: calc(var(--s2) / 2); bottom: calc(var(--s2) / 2); background: rgba(255,255,255,.12); pointer-events: none; }
.lt-fork.cdone::before { background: var(--c); box-shadow: 0 0 8px var(--c); }
.lt-path { position: relative; display: flex; align-items: center; gap: 10px; height: var(--s2); min-width: 0; }
.lt-path::before { content: ''; position: absolute; left: calc(-1 * var(--arm)); width: calc(var(--arm) - 4px); top: 50%; height: 3px; margin-top: -1.5px; background: rgba(255,255,255,.12); pointer-events: none; }
.lt-fork.cdone .lt-path::before { background: var(--c); box-shadow: 0 0 8px var(--c); }
.lt-pn { flex: none; width: 128px; display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); background: rgba(10,11,13,.65); line-height: 1; }
.lt-pn b { font-family: var(--head); font-weight: 400; font-size: .95rem; letter-spacing: .07em; color: color-mix(in srgb, var(--c) 80%, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-pn small { font-size: .62rem; font-weight: 700; letter-spacing: .16em; color: var(--dim); }
.lt-path.on .lt-pn { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, rgba(10,11,13,.8)); }
.lt-path:not(.reach) .lt-pn { opacity: .62; }
.lt-row { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lt-row::before { left: calc(var(--s1) / 2); right: calc(var(--s2) / 2); background: rgba(255,255,255,.1); box-shadow: 0 1px 0 rgba(0,0,0,.5); }
.lt-row::after { left: calc(var(--s1) / 2); width: calc((100% - var(--s1) / 2 - var(--s2) / 2) * var(--p, 0)); background: var(--c); box-shadow: 0 0 10px var(--c); }
/* class-ability upgrade marker: small lit diamond on the node's top-right corner */
.sn.kit::before { content: ''; position: absolute; z-index: 2; right: -5px; top: -5px; width: 9px; height: 9px; transform: rotate(45deg); background: #1a1b20; border: 2px solid color-mix(in srgb, var(--c) 70%, #fff); pointer-events: none; }
.sn.kit.own::before { background: #fff; border-color: var(--c); }
.sn.kit.next::before { inset: auto; right: -5px; top: -5px; width: 9px; height: 9px; border: 2px solid var(--acc); border-radius: 0; animation: none; opacity: 1; }
.sn.cap.kit::before { right: 6px; top: 2px; }
.tr-legend .kit i { width: 10px; height: 10px; transform: rotate(45deg); background: #1a1b20; border: 2px solid var(--acc); }
.lane { min-height: 0; }
/* detail panel extras */
.td-kit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 0; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); font-family: var(--head); font-size: .95rem; letter-spacing: .12em; color: color-mix(in srgb, var(--c) 80%, #fff); }
.td-kit .sti { width: 14px; height: 14px; }
.td-kit small { flex-basis: 100%; font-family: inherit; font-size: .62rem; letter-spacing: .14em; color: var(--dim); }
.td-pd { margin-top: 8px !important; font-size: .82rem !important; color: var(--dim) !important; }
.td-pd b { color: var(--c); font-weight: 700; letter-spacing: .08em; }
.td-path li small { color: var(--dim2); font-weight: 600; margin-left: 4px; }
@media (max-width: 1100px) { .lane-tree { --s1: 44px; --s2: 52px; --gap: 8px; --arm: 16px; } .lt-pn { width: 96px; } }
/* short landscape screens (phones 667x375 and similar): compact nodes, slim path tags; keep >= 40 px tap targets */
@media (max-height: 520px) {
  .lane-tree { --s1: 40px; --s2: 46px; --gap: 6px; --arm: 12px; }
  .lt-fork { gap: 6px; }
  .lt-pn { width: 70px; padding: 3px 6px; } .lt-pn b { font-size: .8rem; letter-spacing: .06em; } .lt-pn small { font-size: .55rem; }
  .lt-row { gap: 4px; }
}
body.touch-ui .lane-tree .sn { --s: var(--s1); } body.touch-ui .lane-tree .sn.cap { --s: var(--s2); }
body.touch-ui .lane-tree .sn:not(.cap)::after { inset: -3px; }
@media (orientation: portrait) and (max-width: 600px) { .lane-tree { --s1: 38px; --s2: 44px; --gap: 5px; --arm: 10px; } .lt-pn { width: 62px; } }
/* b2: node name captions (desktop), short path names + no counters on short screens, armed reset button */
.sn .snl { display: none; }
.lt-pn .pns { display: none; }
@media (min-height: 700px) and (min-width: 1200px) {
  .lane-tree .sn .snl { display: block; position: absolute; z-index: 1; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); width: max-content; max-width: 92px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
    font: 600 9.5px/1.1 'Barlow Condensed', 'Oswald', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: rgba(214,208,196,.62); text-shadow: 0 1px 0 #000; }
  .lane-tree .sn.cap .snl { top: calc(100% + 1px); }
  .lane-tree .sn.own .snl { color: color-mix(in srgb, var(--c) 70%, #fff); }
  .lane-tree .sn.can .snl, .lane-tree .sn.next .snl, .lane-tree .sn.sel .snl { color: #f2ece0; }
  .lane-tree .sn.cap .snl, .lane-tree .sn.kit .snl { font-weight: 700; color: color-mix(in srgb, var(--c) 55%, #e8e2d6); }
  .lane-tree .sn:hover .snl, .lane-tree .sn.sel .snl { transform: translateX(-50%) scale(.95); }
  .lane-tree .lt-fork { gap: 13px; }
  .lane-tree { padding: 0 0 12px; }
  .lanes > .lane { padding-top: 4px; padding-bottom: 4px; }
  .lanes { gap: 8px; }
  .lane-tree .lt-core .sn .snl { max-width: 54px; font-size: 8.5px; letter-spacing: .03em; }
}
@media (max-height: 520px) {
  .lt-pn .pnf { display: none; } .lt-pn .pns { display: inline; }
  .lt-pn small { display: none; }
  .lt-pn { width: 76px; padding: 5px 5px; justify-content: center; } .lt-pn b { font-size: .74rem; letter-spacing: .04em; text-overflow: clip; }
  /* landscape phones: the EQUIP CLASS button moves into the lane's title row (saves ~45 px per lane = ~2 lanes per screen) */
  .lane-h { grid-template-columns: auto 1fr auto auto; column-gap: 10px; align-items: center; }
  .lane-h .lane-eq { grid-column: 4; grid-row: 1; margin-top: 0; padding: 4px 8px; flex-direction: row; align-items: center; font-size: 10px; }
  .lane-h .lane-eq .lane-gear { display: none; }
  .lane-h .lane-bar { grid-column: 1 / 5; }
}
.btn.rst.arm { border-color: #e04a3a; color: #fff; background: color-mix(in srgb, #e04a3a 35%, rgba(10,11,13,.8)); }

/* =====================================================================
   SKILL TREE (graph view): class tabs + pannable left-to-right tree with curved connectors
   ===================================================================== */
.tr-grid.sk { align-items: stretch; }
.sk-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.sk-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.skt { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 10px 12px 12px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, rgba(28,28,32,.9), rgba(12,12,14,.92)); border: 1px solid rgba(255,255,255,.08); border-top: 3px solid color-mix(in srgb, var(--c) 45%, transparent); color: #cfc8bb; font-family: inherit; transition: background .15s, border-color .15s, transform .15s; }
.skt:hover, .skt:focus-visible { border-color: color-mix(in srgb, var(--c) 55%, transparent); transform: translateY(-1px); outline: none; }
.skt.on { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, #16161a), rgba(12,12,14,.95)); border-color: color-mix(in srgb, var(--c) 70%, transparent); border-top-color: var(--c); color: #fff; }
.skt .skt-i { grid-row: 1 / 3; width: 26px; height: 26px; color: var(--c); }
.skt b { font: 400 1.35rem/1 var(--head, 'Oswald'), Impact, sans-serif; letter-spacing: .08em; color: var(--c); }
.skt small { justify-self: end; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: #9d968a; }
.skt em { grid-column: 2 / 4; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .2em; color: var(--c); }
.skt i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.06); }
.skt i u { display: block; height: 100%; background: var(--c); }
.skh { display: flex; align-items: center; gap: 14px; padding: 4px 2px; }
.skh-t { display: flex; flex-direction: column; min-width: 0; }
.skh-t b { font: 400 2rem/1 var(--head, 'Oswald'), Impact, sans-serif; letter-spacing: .06em; color: var(--c); }
.skh-t small { font-size: 12px; letter-spacing: .14em; color: #a8a194; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skh-p { margin-left: auto; font: 700 14px 'Oswald', sans-serif; color: #a8a194; letter-spacing: .1em; }
.skh-p em { font-style: normal; color: #fff; font-size: 20px; }
.skh .lane-eq { margin-top: 0; }
.sk-wrap { position: relative; flex: 1 1 auto; min-height: 340px; height: min(62vh, 640px); overflow: auto; overscroll-behavior: contain; cursor: grab; touch-action: pan-x pan-y;
  background: radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--c) 9%, transparent), transparent 60%), repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 38px), repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 38px), rgba(8,8,10,.72);
  border: 1px solid rgba(255,255,255,.07); scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--c) 50%, #333) transparent; }
.sk-wrap.drag { cursor: grabbing; user-select: none; }
.sk-graph { position: relative; }
.sk-lines { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.skl { fill: none; stroke-width: 3; stroke-linecap: round; }
.skl.lock { stroke: rgba(255,255,255,.12); }
.skl.open { stroke: color-mix(in srgb, var(--c) 75%, #fff); stroke-dasharray: 6 6; opacity: .85; }
.skl.own { stroke: var(--c); stroke-width: 4; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 70%, transparent)); }
.skp { position: absolute; transform: translateX(-50%); display: flex; gap: 6px; align-items: baseline; white-space: nowrap; pointer-events: none; padding: 2px 8px; background: rgba(6,6,8,.75); border-left: 3px solid var(--c); }
.skp b { font: 700 12px 'Oswald', sans-serif; letter-spacing: .2em; color: var(--c); }
.skp small { font-size: 11px; font-weight: 700; color: #9d968a; }
.skn { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; background: none; border: 0; cursor: pointer; font-family: inherit; z-index: 1; }
.skc { display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2a2b31, #121216); border: 2px solid rgba(255,255,255,.14); color: #6f6a62; transition: transform .15s, border-color .15s; }
.skc .sni { width: 24px; height: 24px; }
.skn.cap .skc { width: 62px; height: 62px; border-radius: 10px; transform: rotate(45deg); }
.skn.cap .skc .sni { transform: rotate(-45deg); width: 28px; height: 28px; }
.skn.kit .skc { box-shadow: 0 0 0 3px rgba(6,6,8,.9), 0 0 0 5px color-mix(in srgb, var(--c) 35%, transparent); }
.skn-l { max-width: 104px; font-size: 11px; font-weight: 700; letter-spacing: .06em; line-height: 1.15; text-align: center; color: #8a847a; text-shadow: 0 1px 2px #000; text-transform: uppercase; }
.skn.own .skc { background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 75%, #fff 10%), color-mix(in srgb, var(--c) 45%, #000)); border-color: var(--c); color: #fff; box-shadow: 0 0 16px color-mix(in srgb, var(--c) 55%, transparent); }
.skn.own.kit .skc { box-shadow: 0 0 0 3px rgba(6,6,8,.9), 0 0 0 5px var(--c), 0 0 18px color-mix(in srgb, var(--c) 55%, transparent); }
.skn.own .skn-l { color: #fff; }
.skn.can .skc, .skn.open .skc { border-color: color-mix(in srgb, var(--c) 80%, #fff); color: color-mix(in srgb, var(--c) 70%, #fff); }
.skn.can .skc { animation: sknPulse 1.6s ease-in-out infinite; }
.skn.can .skn-l, .skn.open .skn-l { color: #e8dccb; }
@keyframes sknPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.skn:hover .skc, .skn:focus-visible .skc, .skn.sel .skc { border-color: #fff; outline: none; }
.skn:hover:not(.cap) .skc, .skn.sel:not(.cap) .skc { transform: scale(1.1); }
.skn.cap:hover .skc, .skn.cap.sel .skc { transform: rotate(45deg) scale(1.1); }
.skn:focus-visible { outline: none; }
.tr-legend .lg.hint { margin-left: auto; color: #6f6a62; }
@media (prefers-reduced-motion: reduce) { .skn.can .skc { animation: none; } }
/* phones: tabs as a compact row, tree fills the screen, the detail panel is the existing bottom sheet */
body.phone .sk-tabs { gap: 5px; }
body.phone .skt { grid-template-columns: auto 1fr; padding: 6px 8px 8px; column-gap: 6px; }
body.phone .skt b { font-size: 1rem; }
body.phone .skt small { grid-column: 2; justify-self: start; font-size: 11px; }
body.phone .skt em { display: none; }
body.phone .skt .skt-i { width: 18px; height: 18px; }
body.phone .skh { gap: 8px; } body.phone .skh-t b { font-size: 1.4rem; } body.phone .skh-t small { display: none; }
body.phone .sk-wrap { min-height: 0; height: calc(100dvh - 210px); }
body.phone .skc { width: 46px; height: 46px; } body.phone .skn.cap .skc { width: 54px; height: 54px; }
body.phone .skn-l { max-width: 84px; font-size: 10px; }
body.phone .tr-legend { display: none; }
body.phone .skh { display: none; }
body.phone .sk-main { gap: 6px; }
body.phone .sk-wrap { height: calc(100dvh - 158px); }

/* ---------- skill screen: exact window-height layout at every size (iPhone SE .. 8K). The tree fills the space between the
   tabs and the footer; tree + detail panel scroll inside themselves; the footer is a real row (never floats over the tree) */
#tree.on { display: flex !important; flex-direction: column; overflow: hidden !important; padding-bottom: calc(var(--pad) + var(--sab)) !important; }
#tree .topbar { flex: none; }
#tree .tr-grid.sk { flex: 1 1 0; min-height: 0; margin-bottom: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
#tree .sk-main { min-height: 0; }
#tree .sk-wrap { flex: 1 1 0; height: auto !important; min-height: 0; }
body:not(.phone) #tree .tr-detail { position: relative !important; top: auto !important; max-height: none !important; min-height: 0; overflow-y: auto !important; overscroll-behavior: contain; align-self: stretch; }
#tree .sfoot { position: relative !important; inset: auto !important; flex: none; z-index: 2; margin: 8px calc(-1 * var(--pad)) calc(-1 * (var(--pad) + var(--sab))) !important; }
/* narrow non-phone windows (single column): the tree gets the larger share, the detail panel scrolls below it */
@media (orientation: portrait) and (max-width: 600px) { body:not(.phone) #tree .tr-grid.sk { grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr); } }
/* graph scale (set from JS: --sks), so nodes stay proportional from small laptops to 4K / 8K */
.sk-graph { --sks: 1; }
.skc { width: calc(50px * var(--sks)); height: calc(50px * var(--sks)); }
.skc .sni { width: calc(24px * var(--sks)); height: calc(24px * var(--sks)); }
.skn.cap .skc { width: calc(62px * var(--sks)); height: calc(62px * var(--sks)); }
.skn.cap .skc .sni { width: calc(28px * var(--sks)); height: calc(28px * var(--sks)); }
.skn-l { max-width: calc(104px * var(--sks)); font-size: calc(11px * var(--sks)); }
.skp b { font-size: calc(12px * var(--sks)); } .skp small { font-size: calc(11px * var(--sks)); }
.skl { stroke-width: calc(3px * var(--sks)); } .skl.own { stroke-width: calc(4px * var(--sks)); }
body.phone .skc { width: 46px; height: 46px; } body.phone .skn.cap .skc { width: 54px; height: 54px; }
#tree.on { padding-bottom: var(--sab) !important; }
#tree .sfoot { margin: 8px calc(-1 * var(--pad)) 0 !important; }
/* narrow windows (< 760 px wide, not phone-touch): compact skill screen so the tree keeps most of the height */
@media (max-width: 760px) {
  body:not(.phone) #tree .sk-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  body:not(.phone) #tree .skt { grid-template-columns: auto 1fr auto; padding: 7px 10px 9px; }
  body:not(.phone) #tree .skt b { font-size: 1.05rem; } body:not(.phone) #tree .skt em { display: none; }
  body:not(.phone) #tree .skh-t small, body:not(.phone) #tree .tr-legend, body:not(.phone) #tree .sfoot > :not(:last-child):not(.btn):not(.done) { display: none; }
  body:not(.phone) #tree .skh-t b { font-size: 1.4rem; }
  body:not(.phone) #tree .tr-grid.sk { grid-template-rows: minmax(0, 1.9fr) minmax(0, 1fr); }
  body:not(.phone) #tree .tr-detail { padding: 12px 14px; }
}
/* capstone labels sit below the diamond's lower corner (the rotated square reaches ~41% further down than a circle) */
.skn.cap .skn-l { margin-top: calc(9px * var(--sks)); }
/* big screens: the chrome around the tree (tabs, header, detail panel, footer) scales with the screen like the tree does */
#tree { --uiz: 1; }
@media (min-width: 2400px) and (min-height: 1300px) { #tree { --uiz: 1.33; } }
@media (min-width: 3400px) and (min-height: 1900px) { #tree { --uiz: 2; } }
@media (min-width: 5000px) and (min-height: 2800px) { #tree { --uiz: 2.67; } }
@media (min-width: 7000px) and (min-height: 3900px) { #tree { --uiz: 4; } }
#tree .topbar, #tree .sk-tabs, #tree .skh, #tree .tr-legend, #tree .sfoot, #tree .tr-detail { zoom: var(--uiz); }
#tree .tr-grid.sk { grid-template-columns: minmax(0, 1fr) calc(380px * var(--uiz)); }
body.phone #tree .tr-grid.sk { grid-template-columns: minmax(0, 1fr); }
@media (orientation: portrait) and (max-width: 600px) { #tree .tr-grid.sk { grid-template-columns: minmax(0, 1fr); } }
#tree .sfoot { margin: 8px calc(-1 * var(--pad) / var(--uiz)) 0 !important; }   /* zoom scales margins: keep it edge to edge */

/* use prompt: short main line that never wraps + a smaller detail line underneath (perk effect, forge tier) */
#hPrompt .pt { white-space: nowrap; }
#hPrompt .psub { flex: 1 0 100%; text-align: center; font-size: .66em; font-weight: 600; letter-spacing: .06em; color: var(--dim); white-space: normal; line-height: 1.25; }
body.phone #hPrompt .pt { white-space: normal; }


/* playtest (phone): the secondary combat buttons were as big as the main ones and covered the right half of the view;
   the use prompt ran into the USE button */
body.phone #tJump, body.phone #tKnife { --s: 46px; opacity: .85; }
body.phone #hPrompt { max-width: min(44vw, 320px); }
body.phone :is(#loadout, #tree, #settings) .sfoot .done { height: 40px; min-height: 40px; min-width: 96px; padding: 0 14px; font-size: 1.2rem; }

/* menu weapon art: real lit 3D renders (models.weaponRender) - smooth scaling, soft contact shadow instead of the pixel outline */
.wimg.r3d { image-rendering: auto; filter: drop-shadow(0 6px 8px rgba(0,0,0,.55)); }
.wp-art .wimg.r3d { filter: drop-shadow(0 10px 14px rgba(0,0,0,.6)) drop-shadow(0 0 22px color-mix(in srgb, var(--c, #e8a33a) 28%, transparent)); }
.stc.locked .wimg.r3d { filter: grayscale(1) brightness(.9); opacity: .5; }

/* menu attachment previews: real lit 3D renders (models.attachmentRender) */
.aopt { grid-template-columns: 58px 1fr; }
.aopt img.aimg { grid-row: 1 / 4; width: 58px; height: 58px; object-fit: contain; align-self: center; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); }
.aopt.na img.aimg { filter: grayscale(1) brightness(.7); opacity: .55; }
.aslot img.aimg { width: 46px; height: 40px; margin: -4px 0 -2px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
