/* ОРДА — comic-book "crazy action" look: thick ink outlines, hard offset shadows, halftone dots,
   slanted panels, starbursts. Fonts: Dela Gothic One (titles, numbers), Shantell Sans (lettering). */
:root {
  --k: #15111a;              /* ink */
  --paper: #fff4d6;
  --paper-2: #ffe9b0;
  --yellow: #ffd23f;
  --orange: #ff8a1f;
  --red: #ff3b2f;
  --red-dk: #c81d14;
  --cyan: #2ec5ff;
  --green: #4fd65a;
  --purple: #a24dff;
  --pink: #ff4fa3;
  --bone: #fff4d6;
  --accent: #ff5a1f;
  --accent-2: #ffb21f;
  /* (the game's fonts have no Korean or Arabic letters: those come from the system's bold fonts after them;
     Japanese is in Dela Gothic One) */
  --font-comic: 'Dela Gothic One', 'Russo One', 'Arial Black', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Yu Gothic', 'Hiragino Sans', 'Segoe UI', Tahoma, sans-serif;
  --font-hand: 'Shantell Sans', 'Rubik', 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Yu Gothic', 'Hiragino Sans', Tahoma, sans-serif;
  --font-ui: 'Rubik', 'Segoe UI', Arial, 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Yu Gothic', 'Hiragino Sans', Tahoma, sans-serif;
  --dots: radial-gradient(circle, rgba(0, 0, 0, 0.16) 1.5px, transparent 1.9px) 0 0 / 7px 7px;
  --dots-w: radial-gradient(circle, rgba(255, 255, 255, 0.3) 1.5px, transparent 1.9px) 0 0 / 7px 7px;
  --rays: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0.055) 0deg 3deg, transparent 3deg 11deg);
  --burst: polygon(50.0% 2.5%, 57.4% 12.7%, 69.5% 3.0%, 71.1% 18.4%, 84.2% 15.8%, 81.6% 28.9%, 97.7% 30.2%, 87.3% 42.6%, 99.2% 50.0%, 87.3% 57.4%, 98.5% 70.1%, 81.6% 71.1%, 85.4% 85.4%, 71.1% 81.6%, 68.2% 93.9%, 57.4% 87.3%, 50.0% 100.8%, 42.6% 87.3%, 31.5% 94.7%, 28.9% 81.6%, 13.5% 86.5%, 18.4% 71.1%, 4.6% 68.8%, 12.7% 57.4%, -2.5% 50.0%, 12.7% 42.6%, 3.8% 30.9%, 18.4% 28.9%, 16.4% 16.4%, 28.9% 18.4%, 30.5% 3.0%, 42.6% 12.7%);
  --outline: drop-shadow(3px 0 0 var(--k)) drop-shadow(-3px 0 0 var(--k)) drop-shadow(0 3px 0 var(--k)) drop-shadow(0 -3px 0 var(--k));
}

* { box-sizing: border-box; }
/* nothing of the browser's own in the game: no text selected (nor Copy offered for it), no long-press callout
   on a picture (iOS: Save / Copy), no grey flash on a tapped button, no zoom on a quick double tap; the
   browser's right-click menu and dragged pictures: input.js */
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: #0b0806; color: var(--bone);
  font-family: var(--font-ui); user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
img { -webkit-user-drag: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#screenfx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.hidden { display: none !important; }
/* lettering: bouncy marker */
.ht-label, .slot .k, #ann-sub, #hint, .up-sub, .up-desc, .howto-goal, .controls, .tips, .set-row, .stats div,
.ms-none, .ms-stats span, .ms-rec span, #load-text, .up-foot, .btn em, .up-lvl {
  font-family: var(--font-hand); font-weight: 800; font-variation-settings: 'BNCE' 40, 'INFM' 70;
}

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 3; }

#lowhp {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(150,0,0,.55) 85%, rgba(90,0,0,.85) 100%);
  transition: opacity .3s;
}
#lowhp.pulse { animation: lowpulse 1s infinite; }
@keyframes lowpulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.6); } }
#dmgflash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(255,0,0,0) 30%, rgba(255,20,10,.55) 100%); }
#healflash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(0,255,90,0) 40%, rgba(60,255,120,.35) 100%); }

/* crosshair */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 10px; transition: opacity .12s; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 0 1.5px var(--k); border-radius: 1px; }
#crosshair .ch-l, #crosshair .ch-r { width: 9px; height: 2px; top: -1px; }
#crosshair .ch-t, #crosshair .ch-b { width: 2px; height: 9px; left: -1px; }
#crosshair .ch-l { right: var(--gap); }
#crosshair .ch-r { left: var(--gap); }
#crosshair .ch-t { bottom: var(--gap); }
#crosshair .ch-b { top: var(--gap); }
#crosshair .ch-dot { width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; }
#crosshair .ch-ring { position: absolute; width: calc(var(--gap) * 2 + 8px); height: calc(var(--gap) * 2 + 8px); left: calc(-1 * (var(--gap) + 4px)); top: calc(-1 * (var(--gap) + 4px)); display: none; overflow: visible; }
#crosshair .ch-ring circle { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 2.4; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 1px #000); }
#crosshair.ring .ch-ring { display: block; }
#crosshair.ring .ch-l, #crosshair.ring .ch-r, #crosshair.ring .ch-t, #crosshair.ring .ch-b { display: none; }
#crosshair.ads { opacity: .35; }
#crosshair.optic { opacity: 0; }

/* hitmarker */
#hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; --c: #fff; --s: 1; --len: 15px; --th: 3.5px; --gap: 8px; }
#hitmarker i { position: absolute; left: 0; top: 0; width: var(--len); height: var(--th); margin-top: calc(var(--th) / -2); transform-origin: 0 50%;
  background: var(--c); border-radius: 1px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.95)); }
#hitmarker i:nth-child(1) { transform: rotate(45deg) translateX(calc(var(--gap) * var(--s))); }
#hitmarker i:nth-child(2) { transform: rotate(135deg) translateX(calc(var(--gap) * var(--s))); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateX(calc(var(--gap) * var(--s))); }
#hitmarker i:nth-child(4) { transform: rotate(315deg) translateX(calc(var(--gap) * var(--s))); }
#hitmarker.crit { --len: 18px; --th: 4px; }
#hitmarker.kill { --len: 24px; --th: 5.5px; --gap: 10px; }
#hitmarker.kill i { filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1px #000) drop-shadow(0 0 8px rgba(255, 30, 20, 0.85)); }

#reload-ring { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; transform: rotate(-90deg); opacity: 0; transition: opacity .15s; }
#reload-ring circle { fill: none; stroke-width: 6; }
#reload-ring .bg { stroke: rgba(21, 17, 26, .55); }
#reload-ring .fg { stroke: var(--yellow); stroke-linecap: round; stroke-dasharray: 251.3; stroke-dashoffset: 251.3; filter: drop-shadow(1.5px 1.5px 0 var(--k)); }
#reload-ring.on { opacity: 1; }

#dash-pips { position: absolute; left: 50%; top: calc(50% + 44px); width: 50px; height: 8px; margin-left: -25px; background: rgba(21,17,26,.55); border: 2px solid var(--k); border-radius: 3px; overflow: hidden; opacity: 0; transition: opacity .25s; }
#dash-pips i { display: block; height: 100%; width: 100%; background: var(--cyan); transform-origin: left; }
#dash-pips.on { opacity: 1; }

/* damage direction */
#dmg-indicators { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dmg-ind { position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; pointer-events: none; }
.dmg-ind::before { content: ''; position: absolute; left: 50%; top: -6px; width: 70px; height: 22px; margin-left: -35px;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,40,20,.95), rgba(255,0,0,0) 70%);
  border-top: 3px solid rgba(255,60,40,.95); border-radius: 50% 50% 0 0 / 100% 100% 0 0; filter: drop-shadow(0 0 6px rgba(255,0,0,.8)); }

/* comic panels: ink frame, hard shadow, halftone, slanted (the contents are set straight again) */
.hb-panel { position: relative; display: flex; align-items: center; gap: 12px; height: 76px; padding: 0 22px 0 18px;
  background: var(--panel, var(--paper)); border: 4px solid var(--k); border-radius: 6px;
  box-shadow: 6px 6px 0 var(--k); transform: skewX(-8deg); }
.hb-panel::after { content: ''; position: absolute; inset: 0; border-radius: 2px; background: var(--dots); pointer-events: none; }
.hb-panel > * { position: relative; z-index: 1; transform: skewX(8deg); }
.hb-num b, .ht-col b { font-family: var(--font-comic); font-weight: 400; color: #fff;
  -webkit-text-stroke: 2.5px var(--k); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--k); }

/* top cluster: minimap (left) | wave (centre) | kills & score (right) */
.ht-label { font-size: 16px; letter-spacing: 1px; color: var(--k); line-height: 1; white-space: nowrap; text-transform: uppercase; }
.ht-col { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ht-col b { font-size: 42px; line-height: 0.95; font-variant-numeric: tabular-nums; }
.ht-div { width: 4px; align-self: stretch; margin: 10px 2px; background: var(--k); border-radius: 2px; }

#wave-panel { position: absolute; top: 16px; left: 50%; --panel: linear-gradient(180deg, #ffe36b, #ffc21f); height: 82px; padding: 0 30px 0 24px; gap: 14px;
  transform: translateX(-50%) scale(var(--hs, 1)) skewX(-8deg); transform-origin: top center; }
#wave-n { color: var(--red) !important; min-width: 1.2ch; font-size: 52px !important; }
.ht-enemies { min-width: 150px; }
.ht-enemies b { font-size: 32px; }
.ht-enemies .hb-bar { margin-top: 3px; height: 11px; }
.ht-horns svg { fill: var(--red); stroke: var(--k); stroke-width: 1.4; paint-order: stroke; stroke-linejoin: round; filter: drop-shadow(2px 2px 0 var(--k)); }
.ht-horns svg .eye { fill: var(--yellow); }
#wave-panel.rest #enemies-left { color: var(--green) !important; }
#wave-panel.rest .hb-bar .fill { background: var(--green); }

#score-panel { position: absolute; top: 16px; right: 24px; --panel: var(--paper); height: 76px; padding: 0 26px 0 20px; gap: 14px;
  transform: scale(var(--hs, 1)) skewX(-8deg); transform-origin: top right; }
.ht-stat { display: flex; align-items: center; gap: 10px; }
.ht-stat .hb-icon { width: 34px; height: 34px; }
.ht-stat b { font-size: 34px; }
#score { min-width: 3.4ch; color: var(--yellow) !important; }
.ht-skull svg { fill: #fff; stroke: var(--k); stroke-width: 1.4; paint-order: stroke; filter: drop-shadow(2px 2px 0 var(--k)); }
.ht-star svg { fill: var(--yellow); stroke: var(--k); stroke-width: 1.4; paint-order: stroke; stroke-linejoin: round; filter: drop-shadow(2px 2px 0 var(--k)); }
#score-mul { font-style: normal; font-family: var(--font-comic); font-size: 15px; color: var(--red); margin-left: 4px; }
#score-panel.bump #score { animation: scorebump 0.3s ease-out; }
@keyframes scorebump { 0% { transform: scale(1.25) rotate(-4deg); } 100% { transform: none; } }

#minimap-panel { position: absolute; top: 18px; left: 20px; width: 210px; height: 210px; padding: 0; border-radius: 50%; overflow: hidden;
  --panel: var(--paper); border: 5px solid var(--k); box-shadow: 0 0 0 4px var(--yellow), 6px 7px 0 4px var(--k);
  transform: scale(var(--hs, 1)); transform-origin: top left; }
#minimap-panel::after { display: none; }
#minimap-panel > * { transform: none; }
#minimap { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }

/* boss: one solid bar that sweeps in; the lost chunk lingers white, then drains */
#boss-bar { position: absolute; top: calc(116px * var(--hs, 1)); left: 50%; width: 640px;
  transform: translateX(-50%) scale(var(--hs, 1)); transform-origin: top center; }
.bb-head { display: flex; align-items: center; gap: 10px; margin: 0 6px 7px 16px; }
.bb-skull { width: 30px; height: 30px; }
.bb-skull svg { width: 100%; height: 100%; fill: var(--purple); stroke: var(--k); stroke-width: 1.5; paint-order: stroke; filter: drop-shadow(2px 2px 0 var(--k)); }
#boss-name { flex: 1; font-family: var(--font-comic); font-size: 25px; letter-spacing: 2px; color: #fff;
  -webkit-text-stroke: 2px var(--k); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--purple), 5px 5px 0 var(--k); }
#boss-hp { font-family: var(--font-comic); font-size: 20px; color: var(--yellow); -webkit-text-stroke: 1.5px var(--k); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--k); font-variant-numeric: tabular-nums; }
.bb-track { position: relative; height: 28px; background: #2a1339; border: 4px solid var(--k); border-radius: 5px; box-shadow: 6px 6px 0 var(--k); transform: skewX(-12deg); overflow: hidden; }
.bb-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; }
.bb-lag { background: #fff; }
.bb-fill { background: linear-gradient(180deg, #dc9bff 0 30%, #a24dff 30% 70%, #7a1fd6 70%); border-right: 3px solid var(--k); }
.bb-fill::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(0, 0, 0, 0.22) 1.2px, transparent 1.5px) 0 0 / 5px 5px; }
.bb-gloss { height: 5px; bottom: auto !important; background: rgba(255, 255, 255, 0.35); }
#boss-bar.hit .bb-fill { animation: bbhit 0.2s ease-out; }
#boss-bar.hit #boss-name { animation: bosshit 0.25s; }
@keyframes bbhit { 0% { filter: brightness(2.4); } 100% { filter: none; } }
@keyframes bosshit { 50% { transform: scale(1.08) rotate(-2deg); } }

/* L96 scope: a black mask with a round lens, thin cross with heavy posts and a red dot */
#scope { position: absolute; inset: 0; --r: min(44vh, 44vw); }
#scope .sc-glass { position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0 calc(var(--r) * 0.8), rgba(0, 0, 0, 0.35) calc(var(--r) - 8px), #000 var(--r)),
    radial-gradient(circle at 50% 50%, rgba(110, 160, 255, 0.07) 0, transparent var(--r)); }
#scope .sc-h, #scope .sc-v { position: absolute; left: 50%; top: 50%; background: rgba(0, 0, 0, 0.85); }
#scope .sc-h { width: calc(var(--r) * 2); height: 2px; margin: -1px 0 0 calc(var(--r) * -1); }
#scope .sc-v { height: calc(var(--r) * 2); width: 2px; margin: calc(var(--r) * -1) 0 0 -1px; }
#scope .sc-h::before, #scope .sc-h::after, #scope .sc-v::before, #scope .sc-v::after { content: ''; position: absolute; background: #000; }
#scope .sc-h::before, #scope .sc-h::after { top: -3px; height: 8px; width: 34%; }
#scope .sc-h::before { left: 0; } #scope .sc-h::after { right: 0; }
#scope .sc-v::before, #scope .sc-v::after { left: -3px; width: 8px; height: 34%; }
#scope .sc-v::after { bottom: 0; } #scope .sc-v::before { top: 34%; height: 0; }
#scope .sc-dot { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #ff2a1a; box-shadow: 0 0 6px #ff2a1a; }
#hud.scoped #crosshair { display: none; }

/* comic kill callouts, to the right of the weapon */
#combo-layer { position: absolute; right: 10%; top: 54%; width: 0; height: 0; transform: scale(var(--hs, 1)); transform-origin: right top; }
.cx { position: absolute; right: 0; top: calc(var(--slot, 0) * -94px); width: 360px; height: 150px; margin-top: -75px;
  transition: top 0.22s cubic-bezier(.3, 1.4, .5, 1), opacity 0.2s;
  filter: drop-shadow(3px 0 0 #120a06) drop-shadow(-3px 0 0 #120a06) drop-shadow(0 3px 0 #120a06) drop-shadow(0 -3px 0 #120a06) drop-shadow(6px 7px 0 rgba(0, 0, 0, 0.45)); }
.cx.big { width: 440px; height: 180px; margin-top: -90px; }
.cx.old { opacity: 0.82; }
.cx.pop { animation: cxin 0.42s cubic-bezier(.2, 1.6, .4, 1); }
.cx.out { animation: cxout 0.35s ease-in forwards; }
@keyframes cxin { 0% { transform: scale(0.15) rotate(-28deg); opacity: 0; } 60% { transform: scale(1.16) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes cxout { to { transform: translate(60px, -40px) scale(0.55) rotate(14deg); opacity: 0; } }
.cx-burst { position: absolute; inset: 0;
  background: radial-gradient(rgba(0, 0, 0, 0.2) 22%, transparent 25%) 0 0 / 9px 9px, radial-gradient(ellipse at 50% 50%, var(--c2) 0%, var(--c1) 58%);
  animation: cxspin 1.8s ease-out; }
@keyframes cxspin { 0% { transform: rotate(-10deg) scale(0.9); } 15% { transform: rotate(3deg) scale(1.05); } 100% { transform: rotate(6deg) scale(1); } }
.cx-lines { position: absolute; inset: -34px -50px; border-radius: 50%; opacity: 0.85;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.95) 0deg 2.2deg, transparent 2.2deg 14deg);
  -webkit-mask: radial-gradient(closest-side, transparent 58%, #000 66%, transparent 100%); mask: radial-gradient(closest-side, transparent 58%, #000 66%, transparent 100%);
  animation: cxlines 0.5s ease-out forwards; }
@keyframes cxlines { 0% { transform: scale(0.6) rotate(0); opacity: 1; } 100% { transform: scale(1.12) rotate(10deg); opacity: 0; } }
.cx-text { position: absolute; left: 0; right: 0; top: 50%; text-align: center; white-space: nowrap;
  font-family: var(--font-comic); font-size: 40px; line-height: 1; color: var(--ink);
  transform: translateY(-58%) rotate(var(--tilt)) skewX(-7deg);
  -webkit-text-stroke: 2px #120a06; paint-order: stroke fill; text-shadow: 3px 4px 0 #120a06; }
.cx.pop .cx-text { animation: cxshake 0.28s steps(2) 2; }
@keyframes cxshake { 0% { translate: 3px -2px; } 50% { translate: -3px 2px; } 100% { translate: 0 0; } }
.cx-sub { position: absolute; right: 30px; top: 10px; transform: rotate(calc(8deg - var(--tilt) * 0.3));
  padding: 3px 10px 4px; background: #120a06; color: #fff; font-family: var(--font-hand); font-weight: 800; font-size: 17px;
  letter-spacing: 1px; white-space: nowrap; }
.cx-sub:empty { display: none; }
.cx.big .cx-sub { font-size: 20px; }

/* berserk (js/berserk.js): a red rush from the screen's edges, beating at the music's 136 bpm; it flickers in
   its last three seconds. The rage meter hangs right of the armour panel: a ring round the eye, grey while it
   fills; full, it throbs and sends out rings with its key showing (press me); let loose, it burns and counts
   the seconds down */
#berserk { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.5s;
  background: radial-gradient(ellipse at center, rgba(255, 70, 20, 0) 42%, rgba(255, 50, 10, 0.2) 70%, rgba(150, 0, 0, 0.55) 100%); }
body.berserk #berserk { opacity: 1; animation: rageBeat 0.441s ease-out infinite; }
body.berserk #berserk.fading { animation: rageFade 0.3s steps(2) infinite; }
@keyframes rageBeat { 0% { opacity: 1; } 100% { opacity: 0.68; } }
@keyframes rageFade { 0% { opacity: 0.95; } 50% { opacity: 0.2; } }
body.berserk #crosshair i { background: #ff4a2a; }
.hb-armor { position: relative; }
.hb-rage { position: absolute; left: calc(100% + 20px); top: 50%; width: 76px; height: 76px; margin-top: -38px; }
.hb-rage::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 3px solid #ffd23f; opacity: 0; pointer-events: none; }
.hb-rage svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.hb-rage circle { fill: none; stroke-width: 7; }
.hb-rage .rg-bg { stroke: rgba(21, 17, 26, 0.6); }
.hb-rage .rg-fill { stroke: #ff7a1f; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 0.25s; }
.hb-rage i { position: absolute; inset: 9px; border-radius: 50%; background: url(../assets/ui/berserk.webp) center / cover;
  filter: grayscale(0.85) brightness(0.55); transition: filter 0.3s; }
.hb-rage b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-comic); font-weight: 400; font-size: 30px;
  color: #fff; -webkit-text-stroke: 2.5px var(--k); paint-order: stroke fill; }
.hb-rage kbd { position: absolute; right: -12px; bottom: -4px; display: none; }
.hb-rage.ready { animation: ragePress 0.8s ease-in-out infinite; }
.hb-rage.ready::after { animation: ragePing 1.6s ease-out infinite; }
.hb-rage.ready i { filter: none; animation: rageReady 0.8s ease-in-out infinite; }
.hb-rage.ready .rg-fill { stroke: #ffd23f; }
.hb-rage.ready kbd { display: block; }
.hb-rage.on i { filter: brightness(0.75) saturate(1.3); }
.hb-rage.on .rg-fill { stroke: #ff3b1f; }
@keyframes rageReady { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 120, 30, 0.9); } 50% { box-shadow: 0 0 18px 6px rgba(255, 120, 30, 0.75); } }
@keyframes ragePress { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes ragePing { 0% { opacity: 0.95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.75); } }
/* the lesson and the tips (js/tutorial.js): a paper card under the wave panel. A step's number in a yellow tag,
   its keys (on a phone the icons of its buttons, and those buttons pulse on the screen); a two-part step's keys
   go green one by one; ticked off, the card goes green with a check. In a lesson: how to skip it */
#tutor { position: fixed; left: 0; right: 0; top: calc(16px + 98px * var(--hs, 1)); z-index: 6; display: flex; justify-content: center; pointer-events: none; }
.tu-card { zoom: var(--hs, 1); position: relative; min-width: 340px; max-width: 640px; padding: 12px 24px 14px; text-align: center; color: var(--k);
  background: var(--paper); border: 4px solid var(--k); border-radius: 8px; box-shadow: 6px 6px 0 var(--k); transform: rotate(-1deg); transition: background 0.2s; }
#tutor.in .tu-card { animation: tuIn 0.35s cubic-bezier(0.2, 1.5, 0.4, 1); }
#tutor.done .tu-card { background: #d6ffcc; }
@keyframes tuIn { from { opacity: 0; transform: translateY(-16px) scale(0.8) rotate(-4deg); } }
.tu-head { display: flex; align-items: center; justify-content: center; gap: 12px; }
.tu-n { padding: 2px 9px 3px; font-family: var(--font-comic); font-weight: 400; font-size: 18px; background: var(--yellow); border: 3px solid var(--k); border-radius: 5px; transform: rotate(-4deg); }
.tu-n:empty { display: none; }
.tu-title { font-family: var(--font-comic); font-size: 28px; letter-spacing: 1px; }
#tutor.done .tu-title::after { content: ' \2713'; color: #1f9a2c; }   /* (a check mark, escaped: see tools/pack.js) */
.tu-text { margin-top: 4px; font-family: var(--font-hand); font-weight: 800; font-size: 18px; line-height: 1.25; }
.tu-keys { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 10px; }
.tu-keys:empty { display: none; }
.tu-keys kbd { min-width: 34px; font-size: 15px; transition: background 0.2s; }
.tu-keys kbd.done, #tutor.done .tu-keys kbd { background: #7be36b; }
.tu-btn { display: block; width: 52px; height: 52px; border-radius: 50%; background: #2a2330 center / cover no-repeat; box-shadow: 2px 3px 0 var(--k); }
.tu-btn.done, #tutor.done .tu-btn { box-shadow: 0 0 0 4px #7be36b, 2px 3px 0 var(--k); }
.tu-skip { display: none; margin-top: 10px; font-family: var(--font-hand); font-weight: 800; font-size: 14px; color: #6a5a4a; }
#tutor.lesson .tu-skip { display: block; }
#tutor .tu-skip-btn { pointer-events: auto; display: inline-block; width: auto; min-width: 0; margin: 0 auto; padding: 5px 16px 6px; font-size: 15px; box-shadow: 3px 3px 0 var(--k); }
html.mobile .tu-skip-pc, html.desktop .tu-skip-btn { display: none; }
html:is(.mobile, .compact) #tutor { top: calc(12px + 98px * var(--hs, 1)); }
html:is(.mobile, .compact) .tu-card { zoom: var(--hs, 1); }
/* the how-to's ОБУЧЕНИЕ button: once pressed, it says the lesson comes with the next run */
#btn-tutorial .tb-b, #btn-tutorial.asked .tb-a { display: none; }
#btn-tutorial.asked .tb-b { display: inline; }
/* bottom cluster: health | armour + weapon slots | ammo */
#hud-bottom { position: absolute; left: 50%; bottom: 20px; display: flex; align-items: flex-end; gap: 18px;
  transform: translateX(-50%) scale(var(--hs, 1)); transform-origin: bottom center; }
.hb-left { --panel: linear-gradient(180deg, #ff6d52, #e3271c); min-width: 236px; margin-bottom: 4px; }
.hb-mid { --panel: linear-gradient(180deg, #4fd4ff, #1d93db); min-width: 222px; justify-content: center; height: 80px; }
.hb-right { --panel: linear-gradient(180deg, #ffe36b, #ffb21f); min-width: 236px; margin-bottom: 4px; }
.hb-center { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hb-body { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.hb-num { line-height: 1; white-space: nowrap; }
.hb-num b { font-size: 44px; letter-spacing: 1px; }
.hb-icon { width: 44px; height: 44px; flex: none; }
.hb-icon svg { width: 100%; height: 100%; fill: #fff; stroke: var(--k); stroke-width: 1.6; paint-order: stroke; stroke-linejoin: round; filter: drop-shadow(2px 2px 0 var(--k)); overflow: visible; }
.hb-shield svg path.hl { fill: rgba(21, 17, 26, 0.18); stroke: none; }
.hb-ammo { width: 52px; }
.am-sep { font-family: var(--font-comic); font-size: 24px; color: var(--k); margin: 0 6px 0 8px; }
#reserve { font-family: var(--font-comic); font-size: 24px; color: var(--k); }
.hb-bar { position: relative; height: 12px; width: 100%; background: rgba(21, 17, 26, 0.5); border: 2.5px solid var(--k); border-radius: 3px; overflow: hidden; }
.hb-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; }
.hb-bar .lag { background: var(--yellow); transition: width 0.6s ease-out 0.15s; }
.hb-bar .fill { background: #fff; transition: width 0.12s; }
.hb-bar .fill::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(0, 0, 0, 0.16) 1px, transparent 1.3px) 0 0 / 4px 4px; }
.hb-bar.seg3 { -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(33.333% - 4px), transparent calc(33.333% - 4px) 33.333%); mask: repeating-linear-gradient(90deg, #000 0 calc(33.333% - 4px), transparent calc(33.333% - 4px) 33.333%); }
.hb-bar.seg5 { -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(20% - 4px), transparent calc(20% - 4px) 20%); mask: repeating-linear-gradient(90deg, #000 0 calc(20% - 4px), transparent calc(20% - 4px) 20%); }
.hb-bar.seg10 { -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(10% - 3px), transparent calc(10% - 3px) 10%); mask: repeating-linear-gradient(90deg, #000 0 calc(10% - 3px), transparent calc(10% - 3px) 10%); }
#health-panel.low { animation: lowpanel 0.5s steps(2) infinite; }
#health-panel.low .hb-num b { color: var(--yellow); }
@keyframes lowpanel { 50% { filter: brightness(1.35) saturate(1.3); } }
#armor-panel.flash .hb-shield { animation: armorpop 0.45s ease-out; }
@keyframes armorpop { 0% { transform: skewX(8deg) scale(1.35); filter: brightness(2); } 100% { transform: skewX(8deg); } }
#mag.empty { color: var(--red) !important; }

/* weapon slots under the armour panel */
#weapon-slots { display: flex; gap: 9px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; transition: opacity 0.2s; }
.slot .box { width: 66px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--paper); border: 3px solid var(--k); border-radius: 4px; box-shadow: 3px 3px 0 var(--k);
  transform: skewX(-8deg); transition: background 0.15s, transform 0.15s, box-shadow 0.15s; }
.slot .ico { width: 58px; height: 24px; background: var(--k); transform: skewX(8deg); -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.slot .k { font-size: 14px; color: #fff; -webkit-text-stroke: 3px var(--k); paint-order: stroke fill; }
.slot.active .box { background: var(--yellow); transform: skewX(-8deg) translateY(-3px); box-shadow: 4px 5px 0 var(--red); }
.slot.active .k { color: var(--yellow); }
.slot.locked { opacity: 0.3; }
.slot.flash .box { animation: slotflash 0.6s 2; }
@keyframes slotflash { 50% { background: #fff; transform: skewX(-8deg) scale(1.15); } }
.slot.nade .box { gap: 3px; padding: 0 6px; }
.slot.nade svg { width: 22px; height: 22px; fill: #7d9f2c; color: var(--k); stroke: var(--k); stroke-width: 1.2; transform: skewX(8deg); }
.slot.nade b { font-family: var(--font-comic); font-weight: 400; font-size: 18px; color: var(--k); transform: skewX(8deg); }
.slot.nade.empty { opacity: 0.4; }
#wpn-toast { position: absolute; left: 50%; bottom: calc(200px * var(--hs, 1)); transform: translateX(-50%) rotate(-2deg); opacity: 0; transition: opacity 0.25s;
  font-family: var(--font-comic); font-size: calc(22px * var(--hs, 1)); letter-spacing: 2px; color: var(--yellow);
  -webkit-text-stroke: 2px var(--k); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--k); }
#wpn-toast.on { opacity: 1; }

/* announcements: fat yellow letters with a red/ink extrusion, the subline in a white caption box */
#announce { position: absolute; top: 20%; left: 0; right: 0; text-align: center; opacity: 0; zoom: var(--hs, 1); }
#ann-title { display: inline-block; max-width: 94%; white-space: nowrap; font-family: var(--font-comic); font-size: 76px; letter-spacing: 3px; color: var(--yellow);
  -webkit-text-stroke: 3px var(--k); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--red), 9px 9px 0 var(--k); transform: rotate(-3deg); }
#ann-sub { display: block; width: fit-content; max-width: 92%; margin: 12px auto 0; padding: 5px 16px 7px; font-size: 22px; color: var(--k);
  background: #fff; border: 3px solid var(--k); border-radius: 5px; box-shadow: 4px 4px 0 var(--k); transform: rotate(1.5deg); }
#ann-sub:empty { display: none; }
#announce.show { animation: annin 0.45s cubic-bezier(.2, 1.5, .4, 1) forwards; }
#announce.hide { animation: annout 0.35s ease-in forwards; }
@keyframes annin { 0% { opacity: 0; transform: scale(2.2) rotate(8deg); } 60% { opacity: 1; transform: scale(0.94) rotate(-2deg); } 100% { opacity: 1; transform: none; } }
@keyframes annout { 0% { opacity: 1; } 100% { opacity: 0; transform: translateY(-24px) scale(0.85); } }
#hint { position: absolute; bottom: calc(236px * var(--hs, 1)); left: 50%; padding: 5px 14px 7px; white-space: nowrap;
  background: #fff; border: 3px solid var(--k); border-radius: 6px; box-shadow: 4px 4px 0 var(--k);
  font-size: 18px; color: var(--k); opacity: 0; transition: opacity 0.25s;
  transform: translateX(-50%) scale(var(--hs, 1)) rotate(-1deg); transform-origin: bottom center; }
#hint:empty { display: none; }
#hint.on { opacity: 1; }

/* ---------------- screens ---------------- */
.screen { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#loading { flex-direction: column; gap: 26px; background: var(--rays), radial-gradient(ellipse at 50% 45%, #43161c 0%, #120a10 72%); }
.load-bar { width: 380px; height: 28px; padding: 3px; background: #fff; border: 4px solid var(--k); border-radius: 5px; box-shadow: 6px 6px 0 var(--k); transform: skewX(-12deg); }
#load-fill { height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--orange) 12px 24px); transition: width 0.2s; }
#load-text { font-size: 20px; color: #fff; text-shadow: 2px 2px 0 var(--k); text-transform: uppercase; }
/* the studio splash: 2.2 s from the page opening (js/main.js waits for it before the menu) */
#studio { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #0b0809; pointer-events: none;
  animation: studioOut 0.5s ease 1.7s both; }
#studio img { width: min(260px, 44vmin); height: auto; animation: studioLogo 1.9s ease both; }
@keyframes studioOut { to { opacity: 0; visibility: hidden; } }
@keyframes studioLogo { 0% { opacity: 0; transform: scale(0.92); } 30%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(1.02); } }

/* the logo: fat comic letters, gradient fill, ink outline, extruded shadow */
.logo { display: inline-block; font-family: var(--font-comic); font-size: 112px; line-height: 1; letter-spacing: 4px; color: var(--yellow);
  background: linear-gradient(180deg, #fff6b0 0%, #ffd23f 45%, #ff8a1f 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 4px var(--k); filter: drop-shadow(5px 5px 0 var(--red)) drop-shadow(4px 4px 0 var(--k)); transform: rotate(-4deg); }
.logo.small { font-size: 72px; }
.logo.mid { font-size: 66px; letter-spacing: 3px; }
.logo.red { background: linear-gradient(180deg, #ffd8cf 0%, #ff4a35 50%, #a3120b 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(5px 5px 0 var(--k)); }
.tagline { display: inline-block; margin: 16px 0 24px; padding: 6px 16px 8px; font-family: var(--font-comic); font-size: 18px; letter-spacing: 2px; color: #fff;
  background: var(--red); border: 3px solid var(--k); box-shadow: 4px 4px 0 var(--k); transform: rotate(-2deg); }

/* buttons: white or yellow boxes, slanted, ink frame; they jump at you on hover */
.btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin: 12px 0; padding: 13px 20px 14px;
  font-family: var(--font-comic); font-size: 22px; letter-spacing: 1px; color: var(--k); cursor: pointer;
  background: #fff; border: 4px solid var(--k); border-radius: 6px; box-shadow: 5px 5px 0 var(--k);
  transform: skewX(-8deg); transition: transform 0.08s, box-shadow 0.08s, background 0.12s; }
.btn::after { content: ''; position: absolute; inset: 0; background: var(--dots); opacity: 0.45; pointer-events: none; }
.btn:hover { background: var(--paper-2); transform: skewX(-8deg) translate(-2px, -2px); box-shadow: 7px 7px 0 var(--k); }
.btn:active { transform: skewX(-8deg) translate(3px, 3px); box-shadow: 2px 2px 0 var(--k); }
.btn.primary { background: var(--yellow); font-size: 26px; }
.btn.primary:hover { background: #ffe066; }
.btn .bi { width: 26px; height: 26px; fill: var(--k); flex: none; }
.btn em { font-style: normal; font-size: 13px; color: #fff; margin-left: auto; padding: 2px 8px 3px; background: var(--red); border: 2.5px solid var(--k); border-radius: 4px; white-space: nowrap; }
.btn.big { justify-content: flex-start; padding: 16px 18px 17px; font-size: 24px; }
.btn[disabled] { filter: grayscale(1) brightness(0.75); cursor: default; }
.btn-row { display: flex; gap: 12px; margin: 12px 0; }
.btn-row .btn { margin: 0; flex: 1; font-size: 18px; }
#menu-dead .btn-row .btn { min-width: 0; }   /* (equal halves: a revive for an ad and the way on without it) */
/* an ad blocker took the ad offers away (js/ads.js): a quiet line, never a popup */
/* the first run's guns still coming (js/main.js startGame): the menu waits a moment */
#menu-start.busy { cursor: progress; }
#menu-start.busy .ms-nav { opacity: 0.6; pointer-events: none; }
.adblock-note { margin: 10px 0 0; font-size: 14px; line-height: 1.3; text-align: center; color: var(--bone); opacity: 0.75; }
.ibtn { width: 60px; height: 60px; padding: 12px; border: 4px solid var(--k); border-radius: 50%; background: #fff; box-shadow: 4px 4px 0 var(--k);
  cursor: pointer; color: var(--k); transition: transform 0.08s, box-shadow 0.08s, background 0.12s; }
.ibtn svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.ibtn:hover { background: var(--yellow); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--k); }
.ibtn .slash { display: none; }
.ibtn.off { background: #ffd0c8; color: var(--red-dk); }
.ibtn.off .slash { display: block; }
.ibtn.off .wave { display: none; }

/* start menu: a dark comic page on the left (logo, buttons), the last run pinned bottom right */
#menu-start { justify-content: flex-start; align-items: stretch; background: radial-gradient(ellipse at 72% 45%, transparent 30%, rgba(10, 6, 12, 0.72) 100%); }
.ms-side { position: relative; flex: none; width: calc(470px * var(--ms, 1)); height: 100%; padding: calc(54px * var(--ms, 1)) calc(42px * var(--ms, 1)) calc(34px * var(--ms, 1));
  display: flex; flex-direction: column;
  background: radial-gradient(circle, rgba(255, 59, 47, 0.32) 1.7px, transparent 2.1px) 0 0 / 9px 9px, linear-gradient(180deg, #2c1426 0%, #160b17 100%);
  border-right: 6px solid var(--k); box-shadow: 8px 0 0 var(--yellow), 14px 0 0 var(--k); }
.ms-brand { zoom: var(--ms, 1); text-align: center; }
html.desktop:not(.compact) .ms-brand .logo { font-size: 88px; }   /* (HORDE: five letters, within the side panel) */
.ms-nav { zoom: var(--ms, 1); margin: auto 0; padding-right: 8px; }
.ms-icons { zoom: var(--ms, 1); display: flex; gap: 14px; }
.ms-info { position: absolute; right: calc(46px * var(--ms, 1)); bottom: calc(46px * var(--ms, 1)); zoom: var(--ms, 1); }
.ms-card { position: relative; width: 430px; padding: 30px 24px 20px; background: var(--paper); border: 4px solid var(--k); border-radius: 6px;
  box-shadow: 7px 7px 0 var(--k); transform: rotate(1.2deg); }
.ms-card::after { content: ''; position: absolute; inset: 0; background: var(--dots); opacity: 0.6; pointer-events: none; }
.ms-card > * { position: relative; z-index: 1; }
.ms-card .ms-h { position: absolute; top: -21px; left: 18px; padding: 4px 14px 6px; font-family: var(--font-comic); font-size: 17px; letter-spacing: 1px; color: #fff;
  background: var(--red); border: 3px solid var(--k); box-shadow: 3px 3px 0 var(--k); transform: rotate(-2deg); z-index: 2; }
.ms-none { font-size: 17px; color: var(--k); padding: 6px 0 2px; }
.ms-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ms-stats div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; background: #fff; border: 3px solid var(--k); border-radius: 4px; box-shadow: 3px 3px 0 var(--k); }
.ms-stats b { font-family: var(--font-comic); font-weight: 400; font-size: 24px; color: var(--k); }
.ms-stats span { font-size: 12px; color: #6a5a4a; letter-spacing: 1px; }
.ms-rec { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 3px dashed rgba(21, 17, 26, 0.35); }
.ms-rec div { display: flex; align-items: baseline; gap: 8px; }
.ms-rec span { font-size: 14px; color: #6a5a4a; letter-spacing: 1px; }
.ms-rec b { font-family: var(--font-comic); font-weight: 400; font-size: 22px; color: var(--red); -webkit-text-stroke: 1px var(--k); }

/* location picker (start menu): arrows either side of a tag in the location's colour; locked ones grey with a padlock */
.loc-pick { display: flex; align-items: stretch; gap: 8px; margin: 14px 0 4px; }
.lp-arrow { flex: none; width: 46px; padding: 0; display: grid; place-items: center; cursor: pointer; color: var(--k);
  background: #fff; border: 4px solid var(--k); border-radius: 6px; box-shadow: 4px 4px 0 var(--k); transform: skewX(-8deg);
  transition: transform 0.08s, box-shadow 0.08s, background 0.12s; }
.lp-arrow svg { width: 24px; height: 24px; fill: currentColor; }
.lp-arrow:hover { background: var(--yellow); transform: skewX(-8deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--k); }
.lp-arrow:active { transform: skewX(-8deg) translate(3px, 3px); box-shadow: 1px 1px 0 var(--k); }
.lp-card { position: relative; flex: 1; min-width: 0; padding: 7px 8px 9px; text-align: center; color: var(--k);
  background: var(--lc, var(--green)); border: 4px solid var(--k); border-radius: 6px; box-shadow: 5px 5px 0 var(--k); transform: skewX(-8deg); overflow: hidden;
  transition: background 0.2s; }
.lp-card::after { content: ''; position: absolute; inset: 0; background: var(--dots); opacity: 0.5; pointer-events: none; }
.lp-card > * { position: relative; z-index: 1; transform: skewX(8deg); }
.lp-num { font-family: var(--font-comic); font-size: 11px; letter-spacing: 2px; }
.lp-name { font-family: var(--font-comic); font-size: 17px; line-height: 1.3; letter-spacing: 0.3px; color: #fff; -webkit-text-stroke: 1.2px var(--k);
  text-shadow: 2px 2px 0 var(--k); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-sub { font-family: var(--font-hand); font-weight: 800; font-size: 13px; line-height: 1.2; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-dots { display: flex; justify-content: center; gap: 7px; margin-top: 5px; }
.lp-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--c); border: 2.5px solid var(--k); }
.lp-dots i.lock { background: #8d8494; }
.lp-dots i.on { transform: scale(1.35); box-shadow: 0 0 0 2px #fff; }
.lp-lock { position: absolute !important; right: 9px; top: 8px; width: 22px; height: 22px; fill: var(--k); display: none; }
.loc-pick.locked .lp-card { background: #b6aebb; }
.loc-pick.locked .lp-name { color: #e9e4ec; }
.loc-pick.locked .lp-lock { display: block; }
html.mobile .lp-arrow:hover { background: #fff; transform: skewX(-8deg); box-shadow: 4px 4px 0 var(--k); }

/* the location under the pause title */
.loc-tag { display: inline-block; margin: 6px 0 6px; padding: 4px 14px 6px; font-family: var(--font-comic); font-size: 16px; letter-spacing: 1px; color: var(--k);
  background: var(--lc, var(--green)); border: 3px solid var(--k); box-shadow: 3px 3px 0 var(--k); transform: rotate(-1.5deg); }

/* the menu backdrop blinks dark while it changes location (under the menu, over the 3D view) */
#loc-fade { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity 0.18s; background: #120a10; }
/* the start menu's backdrop video: the whole screen (cropped to fill it), over the 3D scene and under the menu */
#menu-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 9; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0s 0.4s; background: #120a10; }
#menu-video.on { opacity: 1; visibility: visible; transition: opacity 0.6s; }
#loc-fade.on { opacity: 1; }

/* on to the next location: a splash page in its colour, the title panel slams in */
#loc-screen { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.5s;
  background: var(--rays), radial-gradient(circle, rgba(0, 0, 0, 0.2) 1.7px, transparent 2.1px) 0 0 / 10px 10px, #2a1420;
  background: var(--rays), radial-gradient(circle, rgba(0, 0, 0, 0.2) 1.7px, transparent 2.1px) 0 0 / 10px 10px,
    radial-gradient(ellipse at 50% 50%, var(--lc, #4fd65a) 0%, color-mix(in srgb, var(--lc, #4fd65a) 40%, #120a10) 85%); }
#loc-screen.show { opacity: 1; }
.ls-panel { zoom: var(--ms, 1); position: relative; padding: 26px 48px 24px; text-align: center; color: var(--k);
  background: var(--paper); border: 6px solid var(--k); border-radius: 8px; box-shadow: 10px 10px 0 var(--k); opacity: 0; transform: rotate(-3deg) scale(0.4); }
.ls-panel::after { content: ''; position: absolute; inset: 0; border-radius: 3px; background: var(--dots); opacity: 0.55; pointer-events: none; }
.ls-panel > * { position: relative; z-index: 1; }
#loc-screen.show .ls-panel { animation: lsSlam 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) 0.12s forwards; }
@keyframes lsSlam { from { opacity: 0; transform: rotate(-14deg) scale(0.3); } to { opacity: 1; transform: rotate(-3deg) scale(1); } }
.ls-num { display: inline-block; padding: 4px 16px 6px; font-family: var(--font-comic); font-size: 18px; letter-spacing: 3px; color: #fff;
  background: var(--red); border: 3px solid var(--k); box-shadow: 3px 3px 0 var(--k); transform: rotate(2deg); }
.ls-name { margin: 14px 0 8px; font-family: var(--font-comic); font-size: 60px; line-height: 1; letter-spacing: 2px; color: var(--lc, var(--green));
  -webkit-text-stroke: 3px var(--k); filter: drop-shadow(5px 5px 0 var(--k)); white-space: nowrap; }
.ls-sub { font-family: var(--font-hand); font-weight: 800; font-size: 21px; font-variation-settings: 'BNCE' 40, 'INFM' 70; }
html:is(.mobile, .compact) .ls-panel { zoom: calc(var(--ms, 1) * 0.8); }

/* pause / death cards and the modals: paper pages with an ink frame */
#menu-pause, #menu-dead { background: var(--rays), radial-gradient(ellipse at center, rgba(20, 10, 22, 0.55) 0%, rgba(8, 4, 10, 0.88) 75%); }
#menu-dead { background: var(--rays), radial-gradient(ellipse at center, rgba(90, 0, 0, 0.5) 0%, rgba(26, 0, 0, 0.9) 75%); }
.menu-card, .modal-card { position: relative; zoom: var(--ms, 1); width: 540px; padding: 34px 36px 28px; text-align: center; color: var(--k);
  background: var(--paper); border: 5px solid var(--k); border-radius: 8px; box-shadow: 9px 9px 0 var(--k); }
.menu-card::after, .modal-card::after { content: ''; position: absolute; inset: 0; border-radius: 3px; background: var(--dots); opacity: 0.55; pointer-events: none; }
.menu-card > *, .modal-card > * { position: relative; z-index: 1; }
.menu-card .logo.mid { max-width: 100%; margin: -84px 0 6px; white-space: nowrap; }
.menu-card.dead { background: #ffe1d6; }
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(8, 4, 10, 0.62); }
.modal-card { width: 640px; padding-top: 44px; }
.modal-card.small { width: 460px; }
.modal-card.wide { width: 760px; }
#modal-howto .modal-card { width: 700px; }   /* (two columns of controls with room for long words) */
.modal-card .mc-h { position: absolute; top: -28px; left: 50%; transform: translateX(-50%) rotate(-2deg); padding: 6px 22px 8px; white-space: nowrap;
  font-family: var(--font-comic); font-size: 28px; letter-spacing: 2px; color: var(--k);
  background: var(--yellow); border: 4px solid var(--k); box-shadow: 5px 5px 0 var(--k); }
.howto-goal { margin: 6px 0 18px; font-size: 18px; line-height: 1.4; color: var(--k); }
.howto-goal b { color: var(--red-dk); }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 26px; margin: 0 0 18px; font-size: 17px; color: var(--k); text-align: left; }
/* (a long description wraps under itself; the keys keep their column) */
.controls div { display: flex; align-items: center; gap: 12px; line-height: 1.15; }
.controls .keys { flex: none; min-width: 150px; display: flex; gap: 3px; justify-content: flex-end; }
.tips { margin: 0 0 18px; padding: 12px 16px 12px 34px; background: #fff; border: 3px solid var(--k); border-radius: 6px; box-shadow: 4px 4px 0 var(--k);
  font-size: 15px; line-height: 1.55; color: var(--k); text-align: left; transform: rotate(-0.6deg); }
.tips li::marker { color: var(--red); }
kbd { display: inline-block; min-width: 28px; padding: 3px 7px 4px; margin: 0 2px; font-family: var(--font-comic); font-size: 13px; text-align: center; color: var(--k);
  background: #fff; border: 2.5px solid var(--k); border-radius: 5px; box-shadow: 2px 3px 0 var(--k); }
/* the settings: two columns of rows, all in view. A slider row: its name and value on one line, the slider
   under them across the column; a list or a switch sits on the name's line */
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin: 6px 0 10px; }
.set-col { display: grid; gap: 14px; align-content: start; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; min-height: 36px; font-size: 15px;
  text-transform: uppercase; color: var(--k); text-align: left; }
.set-row > span { grid-row: 1; grid-column: 1; line-height: 1.15; }
.set-row > output { grid-row: 1; grid-column: 2; }
.set-row > input[type=range] { grid-row: 2; grid-column: 1 / -1; }
.set-row output { text-align: right; color: var(--red-dk); font-family: var(--font-comic); font-size: 16px; }
.set-row input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; background: #fff; border: 3px solid var(--k); border-radius: 6px; outline: none; cursor: pointer; }
.set-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--k); box-shadow: 2px 2px 0 var(--k); cursor: pointer; }
.set-row input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--k); cursor: pointer; }
.set-row select { background: #fff; color: var(--k); border: 3px solid var(--k); border-radius: 5px; padding: 5px 8px; font-family: var(--font-hand); font-weight: 800; font-size: 15px; max-width: 190px; box-shadow: 3px 3px 0 var(--k); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; margin: 6px 0 22px; text-align: left; }
.stats div { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 12px; background: #fff; border: 3px solid var(--k); border-radius: 5px;
  box-shadow: 3px 3px 0 var(--k); font-size: 15px; text-transform: uppercase; color: #6a5a4a; }
.stats b { font-family: var(--font-comic); font-weight: 400; font-size: 21px; color: var(--k); }
#click-to-play { background: rgba(0, 0, 0, 0.4); cursor: pointer; }
.ctp { font-family: var(--font-comic); font-size: 28px; letter-spacing: 1px; color: var(--k); padding: 18px 32px 20px; background: var(--yellow);
  border: 5px solid var(--k); border-radius: 8px; box-shadow: 8px 8px 0 var(--k); transform: rotate(-2deg); }

/* ---------------- upgrade cards between waves ---------------- */
#upgrade-screen { z-index: 12; flex-direction: column; gap: calc(30px * var(--ms, 1));
  background: var(--rays), radial-gradient(ellipse at 50% 48%, rgba(40, 14, 34, 0.6), rgba(8, 4, 10, 0.92) 75%); }
#upgrade-screen.hidden { display: none !important; }
.up-head { zoom: var(--ms, 1); text-align: center; animation: upbanner 0.5s cubic-bezier(.2, 1.5, .4, 1) backwards; }
@keyframes upbanner { from { transform: scale(2) rotate(10deg); opacity: 0; } }
.up-banner { display: inline-block; filter: var(--outline) drop-shadow(7px 7px 0 var(--k)); }
.up-banner span { display: block; padding: 30px 92px 34px; clip-path: var(--burst); white-space: nowrap;
  font-family: var(--font-comic); font-size: 44px; letter-spacing: 2px; color: #fff; -webkit-text-stroke: 2.5px var(--k); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--k);
  background: var(--dots-w), linear-gradient(180deg, #78ec78, #2fae52); }
.up-sub { display: table; margin: 4px auto 0; padding: 5px 16px 7px; font-size: 22px; color: var(--k); background: #fff;
  border: 3px solid var(--k); border-radius: 6px; box-shadow: 4px 4px 0 var(--k); transform: rotate(-1.5deg); }
#up-cards { zoom: var(--ms, 1); display: flex; gap: 32px; }
.up-slot { --rc: var(--cyan); --rv: var(--yellow); transition: transform 0.18s cubic-bezier(.3, 1.5, .5, 1), opacity 0.25s, filter 0.25s;
  animation: upin 0.55s cubic-bezier(.2, 1.3, .4, 1) backwards; animation-delay: calc(var(--i) * 0.09s + 0.12s); }
.up-slot:nth-child(1) { transform: rotate(-2deg); }
.up-slot:nth-child(2) { transform: translateY(-8px); }
.up-slot:nth-child(3) { transform: rotate(2deg); }
@keyframes upin { from { transform: translateY(90px) scale(0.7) rotate(calc((var(--i) - 1) * 12deg)); opacity: 0; } }
.up-slot:has(.rare) { --rc: var(--green); --rv: #8dff8d; }
.up-slot:has(.epic) { --rc: var(--purple); --rv: #ffa6f5; }
.up-slot:hover { transform: translateY(-14px) scale(1.03); }
.up-card { position: relative; width: 272px; height: 408px; padding: 52px 18px 18px; display: flex; flex-direction: column; align-items: center; overflow: hidden;
  background: var(--paper); border: 5px solid var(--k); border-radius: 10px; box-shadow: 8px 8px 0 var(--k); transition: box-shadow 0.15s, background 0.15s; }
.up-card::after { content: ''; position: absolute; inset: 0; background: var(--dots); opacity: 0.5; pointer-events: none; }
.up-card > * { position: relative; z-index: 1; }
.up-slot:hover .up-card { box-shadow: 10px 10px 0 var(--red); }
.up-card .up-rar { position: absolute; top: 0; left: 0; right: 0; padding: 10px 0 11px; text-align: center; z-index: 2;
  font-family: var(--font-comic); font-size: 16px; letter-spacing: 2px; color: #fff; -webkit-text-stroke: 1.5px var(--k); paint-order: stroke fill;
  background: var(--rc); border-bottom: 4px solid var(--k); }
.up-card .up-key { position: absolute; top: 7px; left: 9px; width: 28px; height: 28px; z-index: 3; border-radius: 50%; background: #fff; border: 3px solid var(--k);
  font-family: var(--font-comic); font-size: 14px; line-height: 21px; text-align: center; color: var(--k); }
.up-card .up-lvl { position: absolute; top: 8px; right: 10px; z-index: 3; padding: 1px 7px 2px; font-size: 13px; color: var(--k); background: var(--yellow); border: 2.5px solid var(--k); border-radius: 4px; }
.up-card.ad .up-lvl { right: auto; left: 44px; }
.up-card .up-bonus { position: absolute; top: 20px; right: -40px; width: 156px; padding: 4px 0 5px; transform: rotate(40deg); text-align: center; z-index: 3;
  font-family: var(--font-comic); font-size: 13px; letter-spacing: 2px; color: var(--k); background: var(--yellow); border-top: 3px solid var(--k); border-bottom: 3px solid var(--k); }
.up-art { width: 100%; height: 150px; margin: 4px 0 6px; display: flex; align-items: center; justify-content: center; }
.up-art::before { content: ''; position: absolute; left: 50%; top: 50%; width: 156px; height: 156px; transform: translate(-50%, -50%) rotate(8deg);
  background: var(--dots-w), var(--rc); clip-path: var(--burst); }
.up-ico { position: relative; width: 120px; height: 120px; filter: drop-shadow(3px 3px 0 var(--k)); animation: upfloat 2.4s ease-in-out infinite; }
.up-gun { position: relative; width: 244px; filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(4px 4px 0 var(--k)); animation: upfloat 2.4s ease-in-out infinite; }
@keyframes upfloat { 50% { transform: translateY(-6px) rotate(-2deg); } }
.up-title { font-family: var(--font-comic); font-size: 22px; letter-spacing: 1px; color: var(--k); text-align: center; white-space: nowrap; }
.up-title.long { font-size: 17px; letter-spacing: 0; }
.up-val { font-family: var(--font-comic); font-size: 42px; line-height: 1.1; color: var(--rv); -webkit-text-stroke: 2.5px var(--k); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--k); }
.up-card:has(.up-gun) .up-val { font-size: 20px; letter-spacing: 1px; margin: 6px 0 4px; }
.up-desc { font-size: 15px; line-height: 1.3; color: #3a2f28; text-align: center; min-height: 40px; margin-top: 6px; }
.up-btn { margin-top: auto; width: 100%; padding: 11px 10px 12px; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  font-family: var(--font-comic); font-size: 21px; letter-spacing: 1px; color: var(--k);
  background: var(--yellow); border: 4px solid var(--k); border-radius: 6px; box-shadow: 4px 4px 0 var(--k);
  transform: skewX(-8deg); transition: transform 0.08s, box-shadow 0.08s; }
.up-btn:hover { transform: skewX(-8deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--k); }
.up-btn:active { transform: skewX(-8deg) translate(2px, 2px); box-shadow: 2px 2px 0 var(--k); }
.up-btn.watch { background: var(--green); color: #fff; -webkit-text-stroke: 1.5px var(--k); paint-order: stroke fill; }
.up-btn[disabled] { filter: grayscale(1) brightness(0.7); cursor: default; }
.up-btn .ad-ico { width: 30px; height: 21px; flex: none; color: var(--k); }
.up-btn.watch .ad-ico { color: #fff; filter: drop-shadow(1.5px 1.5px 0 var(--k)); }
.up-slot.picked { transform: translateY(-18px) scale(1.07) rotate(-1deg); }
.up-slot.picked .up-card { background: #fff3a8; box-shadow: 11px 11px 0 var(--red); }
.up-slot.dim { opacity: 0.3; transform: scale(0.92); filter: grayscale(0.8); }
.up-slot.loading .up-btn { pointer-events: none; animation: adwait 0.5s steps(2) infinite; }
@keyframes adwait { 50% { filter: brightness(0.7); } }
.up-foot { zoom: var(--ms, 1); font-size: 16px; color: #fff; text-shadow: 2px 2px 0 var(--k); }

/* settings gear by the minimap (desktop: the X key opens it too) */
#btn-gear { position: absolute; top: 20px; left: calc(30px + 222px * var(--hs, 1)); width: 54px; height: 54px; padding: 9px; pointer-events: auto; cursor: pointer;
  border-radius: 50%; background: #fff; border: 4px solid var(--k); box-shadow: 4px 4px 0 var(--k); color: var(--k);
  transform: scale(var(--hs, 1)); transform-origin: top left; }
#btn-gear svg { width: 100%; height: 100%; fill: currentColor; display: block; }
#btn-gear:hover { background: var(--yellow); }
#btn-gear .gear-key { position: absolute; right: -12px; bottom: -10px; min-width: 24px; padding: 1px 5px 2px; font-size: 13px; background: var(--yellow); }

/* invulnerable after a revive: a pulsing cyan frame and a countdown */
#invuln { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.3s;
  box-shadow: inset 0 0 0 6px rgba(46, 197, 255, 0.9), inset 0 0 80px 12px rgba(46, 197, 255, 0.5); }
#invuln.on { opacity: 1; animation: invpulse 0.45s ease-in-out infinite alternate; }
@keyframes invpulse { to { box-shadow: inset 0 0 0 3px rgba(46, 197, 255, 0.6), inset 0 0 40px 4px rgba(46, 197, 255, 0.3); } }
#invuln span { position: absolute; top: 30%; left: 50%; padding: 5px 16px 7px; white-space: nowrap;
  font-family: var(--font-comic); font-size: 24px; letter-spacing: 2px; color: var(--k);
  background: var(--cyan); border: 3px solid var(--k); box-shadow: 4px 4px 0 var(--k);
  transform: translateX(-50%) scale(var(--hs, 1)) rotate(-2deg); }

/* on / off switch in the settings */
.tog { position: relative; width: 66px; height: 32px; padding: 0; cursor: pointer; border: 3px solid var(--k); border-radius: 18px; background: #fff; box-shadow: 2px 2px 0 var(--k); }
.tog i { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--k); transition: left 0.15s, background 0.15s; }
.tog.on { background: var(--green); }
.tog.on i { left: 37px; background: #fff; box-shadow: 0 0 0 2.5px var(--k); }

/* speed lines: radial streaks round the edge of the screen with a cold wind tint (the dash; a cinematic's
   camera whips). The layer is oversized so its scale-in never shows an edge */
#speedlines { position: fixed; inset: -10%; z-index: 2; pointer-events: none; opacity: 0;
  background:
    repeating-conic-gradient(from 3deg at 50% 50%, transparent 0deg 5deg, rgba(225, 248, 255, 0.8) 5deg 5.4deg, transparent 5.4deg 11deg),
    repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg 7deg, rgba(255, 255, 255, 0.6) 7deg 7.3deg, transparent 7.3deg 13deg);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 34%, #000 78%);
  mask-image: radial-gradient(ellipse at center, transparent 34%, #000 78%); }
#speedlines::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 180px 50px rgba(140, 225, 255, 0.4); }
#speedlines.dash { animation: speedDash 0.42s ease-out; }
#speedlines.rage { animation: speedDash 0.8s ease-out; filter: sepia(1) saturate(7) hue-rotate(-28deg); }
#speedlines.rage::after { box-shadow: inset 0 0 220px 80px rgba(255, 60, 15, 0.6); }
#speedlines.whip { animation: speedWhip 0.55s ease-in-out; }
@keyframes speedDash { 0% { opacity: 0; transform: scale(1.2); } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(1) rotate(2deg); } }
@keyframes speedWhip { 0% { opacity: 0; transform: scale(1.3); } 45% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }

/* the titan's entrance: letterbox bars slide in, its name slams in when it roars */
#cine { position: fixed; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.cine-bar { position: absolute; left: 0; right: 0; height: 12vh; background: #0b0809; transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1); }
.cine-bar.top { top: 0; transform: translateY(-105%); border-bottom: 5px solid var(--yellow); box-shadow: 0 5px 0 var(--k); }
.cine-bar.bot { bottom: 0; transform: translateY(105%); border-top: 5px solid var(--yellow); box-shadow: 0 -5px 0 var(--k); }
#cine.on .cine-bar { transform: none; }
.cine-name { position: absolute; left: 6vw; bottom: calc(12vh + 3vh); max-width: 88vw; display: flex; flex-direction: column; align-items: flex-start; opacity: 0;
  transform: translateX(-60px) skewX(-8deg); transition: opacity 0.3s; }
#cine.roar .cine-name { animation: cineName 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) forwards; }
#cine.out .cine-name { animation: none; opacity: 0; transform: skewX(-8deg); }
.cine-name span { padding: 3px 14px 5px; font-family: var(--font-comic); font-size: calc(19px * var(--hs, 1)); letter-spacing: 3px; color: #fff;
  background: var(--red); border: 3px solid var(--k); box-shadow: 3px 3px 0 var(--k); transform: rotate(-2deg); }
.cine-name b { max-width: 100%; margin-top: 4px; white-space: nowrap; font-family: var(--font-comic); font-weight: 400; font-size: calc(104px * var(--hs, 1)); line-height: 1; letter-spacing: 4px;
  color: var(--purple); -webkit-text-stroke: calc(4px * var(--hs, 1)) var(--k); filter: drop-shadow(6px 6px 0 var(--k)); }
@keyframes cineName { from { opacity: 0; transform: translateX(-80px) scale(1.35) skewX(-8deg); } to { opacity: 1; transform: skewX(-8deg); } }
html:is(.mobile, .compact) .cine-name b { font-size: calc(80px * var(--hs, 1)); }

/* "Показывать FPS": a small ink tab hanging from the top edge, above the wave panel (over the HUD and the
   touch buttons, under the menus and cards) */
#fps { position: fixed; top: 0; left: 50%; z-index: 6; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  padding: 1px 9px 2px; font-family: var(--font-ui); font-weight: 700; font-size: 11px; line-height: 13px; color: var(--paper);
  background: rgba(21, 17, 26, 0.85); border-radius: 0 0 6px 6px; font-variant-numeric: tabular-nums; }
#fps b { margin-right: 6px; font-weight: 900; }
#fps .ok { color: var(--green); }
#fps .meh { color: var(--yellow); }
#fps .bad { color: var(--red); }
/* Debug3D.overlay (?debug): the scene's numbers under the FPS line */
#d3-stats { position: fixed; top: 16px; left: 50%; z-index: 6; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  padding: 1px 9px 2px; font-family: var(--font-ui); font-weight: 700; font-size: 11px; line-height: 13px; color: var(--paper);
  background: rgba(21, 17, 26, 0.85); border-radius: 0 0 6px 6px; font-variant-numeric: tabular-nums; }

/* "turn the phone" (portrait on a phone) */
#rotate { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center;
  background: var(--rays), radial-gradient(ellipse at 50% 45%, #43161c 0%, #120a10 72%); }
.rot-card { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 320px; margin: 16px; padding: 24px 26px 22px; text-align: center; color: var(--k);
  background: var(--paper); border: 5px solid var(--k); border-radius: 10px; box-shadow: 8px 8px 0 var(--k); }
.rot-card svg { width: 96px; height: 96px; animation: rotphone 2.2s ease-in-out infinite; }
@keyframes rotphone { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
.rot-card b { font-family: var(--font-comic); font-weight: 400; font-size: 24px; }
.rot-card span { font-family: var(--font-hand); font-weight: 800; font-size: 16px; }

/* ---------------- touch controls (phones) ---------------- */
#touch { position: fixed; inset: 0; z-index: 4; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#touch .tc-zone { position: absolute; left: 0; right: 0; top: 18%; bottom: 0; pointer-events: auto; touch-action: none; }
.tc-stick { position: absolute; left: calc(84px * var(--ts, 1)); top: calc(100% - 100px * var(--ts, 1)); width: calc(120px * var(--ts, 1)); height: calc(120px * var(--ts, 1));
  transform: translate(-50%, -50%); border-radius: 50%; border: 4px solid rgba(21, 17, 26, 0.8); pointer-events: none;
  background: radial-gradient(circle, rgba(255, 244, 214, 0.06), rgba(255, 244, 214, 0.24)); box-shadow: 4px 4px 0 rgba(21, 17, 26, 0.45); opacity: 0.55; transition: opacity 0.15s; }
.tc-stick.on { opacity: 1; }
.tc-stick i { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; margin: -21% 0 0 -21%; border-radius: 50%;
  background: var(--yellow); border: 4px solid var(--k); box-shadow: 3px 3px 0 var(--k); }
.tc-btn { position: absolute; width: calc(44px * var(--ts, 1)); height: calc(44px * var(--ts, 1)); padding: 0; display: grid; place-items: center;
  pointer-events: auto; touch-action: none; cursor: pointer; border: 0; border-radius: 50%;
  background: transparent center / 100% 100% no-repeat; transition: transform 0.08s, filter 0.08s; }
.tc-btn.on { transform: scale(0.92); filter: brightness(1.3); }
/* the scope while it is on */
.tc-btn.lit { filter: brightness(1.3) drop-shadow(0 0 calc(7px * var(--ts, 1)) rgba(255, 214, 90, 0.95)); }
/* the player's own layout (tried on a 6-inch phone, October 2026: moving all the time, the thumbs should not
   travel): fire big on the right, a little in from the edge; aim and jump down the edge itself, dash under
   fire; swap, grenade and reload in a row to its left, above the ammo; a second fire button above the stick
   for the left thumb (fire only: it does not turn the view). The right thumb has the screen above them to turn the camera.
   The round see-through icons come from tools/cut_buttons.py */
.tc-fire { width: calc(76px * var(--ts, 1)); height: calc(76px * var(--ts, 1)); right: calc(87px * var(--ts, 1)); bottom: calc(70px * var(--ts, 1)); background-image: url(../assets/ui/tc_fire.webp); }
.tc-fire.on { filter: brightness(1.2) drop-shadow(0 0 calc(9px * var(--ts, 1)) rgba(255, 59, 47, 0.95)); }
.tc-fire-l { width: calc(56px * var(--ts, 1)); height: calc(56px * var(--ts, 1)); right: auto; left: calc(110px * var(--ts, 1)); bottom: calc(154px * var(--ts, 1)); }
.tc-jump { right: calc(18px * var(--ts, 1)); bottom: calc(112px * var(--ts, 1)); background-image: url(../assets/ui/tc_jump.webp); }
.tc-reload { right: calc(184px * var(--ts, 1)); bottom: calc(49px * var(--ts, 1)); background-image: url(../assets/ui/tc_reload.webp); }
.tc-nade { right: calc(234px * var(--ts, 1)); bottom: calc(49px * var(--ts, 1)); background-image: url(../assets/ui/tc_nade.webp); }
.tc-nade b { position: absolute; right: -6px; top: -6px; min-width: 22px; height: 22px; padding: 0 4px; line-height: 18px; border-radius: 11px;
  font-family: var(--font-comic); font-weight: 400; font-size: 12px; color: #fff; background: rgba(40, 40, 44, 0.82); border: 2px solid rgba(214, 214, 214, 0.9); }
.tc-nade.empty { opacity: 0.4; }
.tc-ads { right: calc(18px * var(--ts, 1)); bottom: calc(163px * var(--ts, 1)); background-image: url(../assets/ui/tc_ads.webp); }
/* dash a size up, under fire and a little to the right of it, a thumb's nudge away (15 px between them) */
.tc-dash { width: calc(50px * var(--ts, 1)); height: calc(50px * var(--ts, 1)); right: calc(45px * var(--ts, 1)); bottom: calc(28px * var(--ts, 1)); background-image: url(../assets/ui/tc_dash.webp); }
.tc-swap { right: calc(284px * var(--ts, 1)); bottom: calc(49px * var(--ts, 1)); background-image: url(../assets/ui/tc_swap.webp); }
/* berserk: only there when the rage is full, above fire, left of the aim button */
.tc-rage { display: none; width: calc(54px * var(--ts, 1)); height: calc(54px * var(--ts, 1)); right: calc(88px * var(--ts, 1)); bottom: calc(160px * var(--ts, 1));
  border-radius: 50%; background-image: url(../assets/ui/berserk.webp); animation: ragePress 0.8s ease-in-out infinite, rageReady 0.8s ease-in-out infinite; }
.tc-rage::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: calc(3px * var(--ts, 1)) solid #ffd23f; animation: ragePing 1.6s ease-out infinite; pointer-events: none; }
.tc-rage.ready { display: grid; }
/* a touch button the lesson (or a tip) is about */
.tc-btn.teach::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: calc(3px * var(--ts, 1)) solid #ffd23f; animation: ragePing 1.4s ease-out infinite; pointer-events: none; }
html.mobile .hb-rage kbd { display: none !important; }

/* ---------------- phone layout ---------------- */
html.desktop .only-mobile, html.mobile .only-desktop { display: none !important; }
html.mobile .gear-key, html.mobile .slot .k, html.mobile .up-card .up-key, html.mobile .up-foot { display: none; }
/* the HUD at 70% of its scale on a phone, the top cluster closer in to the edges (on a 6-inch screen the
   minimap took a third of the height): the view stays clear, the numbers big enough to read at a glance */
html.mobile #hud-bottom { left: 46%; bottom: 6px; transform: translateX(-50%) scale(calc(var(--hs, 1) * 0.7)); }
html.mobile #minimap-panel { top: 10px; left: 12px; transform: scale(calc(var(--hs, 1) * 0.7)); }
html.mobile #btn-gear { top: 10px; left: calc(20px + 158px * var(--hs, 1)); transform: scale(calc(var(--hs, 1) * 0.78)); }
html.mobile #wave-panel { top: 12px; transform: translateX(-50%) scale(calc(var(--hs, 1) * 0.7)) skewX(-8deg); }
html.mobile #score-panel { top: 12px; right: 14px; transform: scale(calc(var(--hs, 1) * 0.7)) skewX(-8deg); }
/* (their small words a size up, about 9 px on the screen: scaled with the panels they came out under 7) */
html.mobile .ht-label { font-size: 21px; }
html.mobile #boss-bar { top: calc(14px + 64px * var(--hs, 1)); transform: translateX(-50%) scale(calc(var(--hs, 1) * 0.8)); }
html.mobile #tutor { top: calc(14px + 66px * var(--hs, 1)); }
html.mobile #combo-layer { right: 32%; top: 30%; transform: scale(calc(var(--hs, 1) * 0.8)); }
html.mobile #wpn-toast { bottom: calc(140px * var(--hs, 1)); }
html.mobile #hint { bottom: calc(154px * var(--hs, 1)); }
/* start menu: the monsters of the backdrop video on the left; logo, location and big buttons on the right, over
   the video's dark side; sound and full screen in the top left corner, the record in the bottom left one */
html:is(.mobile, .compact) #menu-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 4vw; padding: 2.5vh 4vw;
  background: linear-gradient(90deg, rgba(22, 11, 23, 0.12) 0%, rgba(22, 11, 23, 0.12) 40%, rgba(22, 11, 23, 0.62) 100%); }
html:is(.mobile, .compact) .ms-side { display: contents; }
html:is(.mobile, .compact) .ms-brand { grid-column: 2; grid-row: 1; align-self: start; zoom: calc(var(--ms, 1) * 0.76); }
html:is(.mobile, .compact) .ms-brand .tagline { margin: 8px 0 6px; }
html:is(.mobile, .compact) .ms-nav { grid-column: 2; grid-row: 2 / 4; align-self: center; margin: 0; padding: 0; zoom: calc(var(--ms, 1) * 0.9); }
html:is(.mobile, .compact) .ms-nav .btn { margin: 9px 0; }
/* a saved run adds "continue": the logo loses its line and the buttons close up */
html:is(.mobile, .compact) #menu-start.saved .ms-brand .tagline { display: none; }
html:is(.mobile, .compact) #menu-start.saved .ms-nav { zoom: calc(var(--ms, 1) * 0.86); }
html:is(.mobile, .compact) #menu-start.saved .ms-nav .btn { margin: 7px 0; }
html:is(.mobile, .compact) .ms-icons { grid-column: 1; grid-row: 1; justify-self: start; align-self: start; }
html:is(.mobile, .compact) .ms-info { position: static; grid-column: 1; grid-row: 3; align-self: end; justify-self: start; }
/* the last run: only the record line */
html:is(.mobile, .compact) .ms-card { width: auto; padding: 8px 16px 9px; transform: none; }
html:is(.mobile, .compact) .ms-card .ms-h, html:is(.mobile, .compact) .ms-none, html:is(.mobile, .compact) .ms-stats { display: none; }
html:is(.mobile, .compact) .ms-rec { margin: 0; padding: 0; border: 0; gap: 22px; }
html.mobile .btn:hover { background: #fff; transform: skewX(-8deg); box-shadow: 5px 5px 0 var(--k); }
html.mobile .btn.primary:hover { background: var(--yellow); }
html:is(.mobile, .compact) .up-head { zoom: calc(var(--ms, 1) * 0.72); }
html:is(.mobile, .compact) #up-cards { zoom: calc(var(--ms, 1) * 0.8); }
html:is(.mobile, .compact) #upgrade-screen { gap: 10px; }
/* "how to play" holds the most text: smaller and tighter on a phone, so the longer languages fit its height */
html:is(.mobile, .compact) #modal-howto .modal-card { zoom: calc(var(--ms, 1) * 0.82); width: 820px; padding-top: 38px; padding-bottom: 20px; }
html:is(.mobile, .compact) .howto-goal { margin: 0 0 10px; }
html:is(.mobile, .compact) .controls { gap: 7px 26px; margin-bottom: 10px; }
html:is(.mobile, .compact) .controls .keys { min-width: 136px; }
html:is(.mobile, .compact) .tips { margin-bottom: 14px; padding-top: 8px; padding-bottom: 8px; }
html:is(.mobile, .compact) .stats { grid-template-columns: repeat(4, 1fr); gap: 7px; }
html:is(.mobile, .compact) .stats div { flex-direction: column; align-items: center; padding: 6px 4px; font-size: 12px; text-align: center; }
@media (orientation: portrait) { html.mobile #rotate { display: flex; } }

/* narrow or portrait windows: the menu column takes the whole width, the last-run card hides */
@media (max-width: 640px), (max-aspect-ratio: 5/4) {
  .settings { grid-template-columns: 1fr; gap: 14px; }
  .modal-card.wide { width: 520px; }
  .ms-info { display: none; }
  .ms-side { width: 100%; box-shadow: none; border-right: 0; }
  #up-cards { gap: 12px; }
  .up-card { width: 220px; height: 384px; }
}
@media (max-width: 720px) {
  .logo { font-size: 76px; }
  .controls { grid-template-columns: 1fr; }
  #score-panel { display: none; }
}

/* ---------------- coins ---------------- */
/* a gold disc with an ink rim (sized by the font) */
.coin { display: inline-block; flex: none; width: 1em; height: 1em; margin-right: 0.28em; vertical-align: -0.14em; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff8c4 0 16%, #ffd23f 40%, #f09a14 100%); border: 0.12em solid var(--k); box-shadow: 0.07em 0.07em 0 var(--k); }
.btn em.coins { display: flex; align-items: center; gap: 2px; font-family: var(--font-comic); font-size: 15px; color: var(--yellow); background: var(--k); border-color: var(--k); }
/* the death screen: the run's pay and "x2 for an ad" */
.dead-coins { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; padding: 8px 10px 8px 14px; background: #fff; border: 3px solid var(--k); border-radius: 6px;
  box-shadow: 4px 4px 0 var(--k); transform: rotate(-0.8deg); }
.dead-coins span { font-family: var(--font-hand); font-weight: 800; font-size: 15px; letter-spacing: 1px; color: #6a5a4a; }
.dead-coins .coin { font-size: 26px; margin: 0 0 0 4px; }
.dead-coins b { font-family: var(--font-comic); font-weight: 400; font-size: 28px; color: var(--k); }
#btn-coins2 { width: auto; margin: 0 0 0 auto; padding: 6px 14px 7px; gap: 8px; font-size: 19px; color: #fff; background: var(--green); -webkit-text-stroke: 1.2px var(--k); paint-order: stroke fill; }
#btn-coins2 .bi { width: 26px; height: 18px; fill: #fff; filter: drop-shadow(1.5px 1.5px 0 var(--k)); }

/* ---------------- arsenal ---------------- */
/* laid out at a fixed design height (js scales .ar-root to the window); the 3D gun shows through the stage */
#arsenal { z-index: 11; display: block; }
.ar-root { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: flex; flex-direction: column; gap: 12px; padding: 18px 26px 22px; }
.ar-top { flex: none; display: flex; align-items: center; gap: 22px; height: 62px; }
.ar-back { width: auto; margin: 0; padding: 10px 18px 11px; font-size: 19px; }
.ar-back .bi { width: 22px; height: 22px; }
.ar-title { font-family: var(--font-comic); font-size: 46px; letter-spacing: 3px; color: var(--yellow); -webkit-text-stroke: 3px var(--k); paint-order: stroke fill;
  text-shadow: 4px 4px 0 var(--red), 7px 7px 0 var(--k); transform: rotate(-2deg); }
.ar-wallet { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.ar-coins { display: flex; align-items: center; padding: 7px 16px 8px; font-family: var(--font-comic); font-size: 27px; color: var(--k);
  background: var(--yellow); border: 4px solid var(--k); border-radius: 6px; box-shadow: 5px 5px 0 var(--k); transform: rotate(-1deg); }
.ar-ad { width: auto; margin: 0; padding: 9px 14px 10px; gap: 8px; font-size: 19px; color: #fff; background: var(--green); -webkit-text-stroke: 1.3px var(--k); paint-order: stroke fill; }
.ar-ad .ad-ico { width: 28px; height: 20px; flex: none; color: #fff; filter: drop-shadow(1.5px 1.5px 0 var(--k)); }
.ar-ad:hover { background: #6fe57a; }
.ar-ad[disabled] { background: #b6aebb; filter: none; }
/* the wallet's "+": the coin shop, where the site sells packs (js/shop.js) */
.ar-plus { width: 50px; height: 50px; margin: 0 0 0 -6px; padding: 0 0 4px; font-size: 34px; line-height: 1; color: #fff; background: var(--green);
  -webkit-text-stroke: 2px var(--k); paint-order: stroke fill; }
.ar-plus:hover { background: #6fe57a; }

/* the coin shop: a paper card over the arsenal, six packs (a pile of coins, how many, the name, the site's price) */
.ar-shop { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(8, 4, 10, 0.72); }
.ar-shop-card { position: relative; width: 820px; padding: 50px 30px 20px; color: var(--k); background: var(--paper); border: 5px solid var(--k); border-radius: 8px;
  box-shadow: 9px 9px 0 var(--k); animation: shopin 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
.ar-shop-card::after { content: ''; position: absolute; inset: 0; border-radius: 3px; background: var(--dots); opacity: 0.5; pointer-events: none; }
.ar-shop-card > * { position: relative; z-index: 1; }
.ar-shop-card .mc-h { position: absolute; top: -31px; left: 50%; transform: translateX(-50%) rotate(-2deg); padding: 6px 28px 8px; white-space: nowrap;
  font-family: var(--font-comic); font-size: 32px; letter-spacing: 2px; color: var(--k); background: var(--yellow); border: 4px solid var(--k); box-shadow: 5px 5px 0 var(--k); }
.ar-shop-x { position: absolute; top: 10px; right: 12px; width: 46px; height: 46px; margin: 0; padding: 0; }
.ar-shop-x .bi { width: 20px; height: 20px; }
.ar-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 22px; }
.ar-packs-wait { grid-column: 1 / -1; padding: 150px 0; text-align: center; font-family: var(--font-comic); font-size: 24px; letter-spacing: 2px; color: #8d8494; }
.pk { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 12px 10px 0; cursor: pointer; font: inherit; color: var(--k);
  background: #fff; border: 4px solid var(--k); border-radius: 8px; box-shadow: 5px 5px 0 var(--k); transition: transform 0.1s, box-shadow 0.1s; }
.pk:hover { transform: translateY(-4px) rotate(-0.6deg); box-shadow: 6px 9px 0 var(--red); }
.pk[disabled] { cursor: default; transform: none; box-shadow: 5px 5px 0 var(--k); }
.pk[disabled]:not(.busy) { opacity: 0.55; }
.pk-art { position: relative; width: 100%; height: 96px; }
.pk-art::before { content: ''; position: absolute; left: 50%; bottom: -10px; width: 170px; height: 120px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse at 50% 62%, rgba(255, 196, 40, var(--glow, 0.3)), transparent 68%); }
.pk-art .coin { position: absolute; margin: 0; }
.pk-n { display: flex; align-items: center; margin-top: 4px; font-family: var(--font-comic); font-weight: 400; font-size: 30px; letter-spacing: 1px; }
.pk-n .coin { font-size: 24px; }
.pk-name { display: block; width: 100%; white-space: nowrap; text-align: center; font-family: var(--font-hand); font-weight: 800; font-size: 15px; letter-spacing: 1px; color: #6a5a4a; }
.pk-price { align-self: stretch; margin: 10px -10px 0; padding: 8px 8px 10px; font-family: var(--font-comic); font-size: 25px; color: #fff; background: var(--green);
  border-top: 4px solid var(--k); border-radius: 0 0 4px 4px; -webkit-text-stroke: 1.5px var(--k); paint-order: stroke fill; }
.pk:hover .pk-price { background: #6fe57a; }
.pk-bonus, .pk-best { position: absolute; top: -15px; right: -11px; z-index: 2; padding: 3px 10px 4px; font-style: normal; font-family: var(--font-comic); font-size: 17px; color: #fff;
  background: var(--red); border: 3px solid var(--k); border-radius: 5px; box-shadow: 2px 2px 0 var(--k); transform: rotate(5deg); -webkit-text-stroke: 1px var(--k); paint-order: stroke fill; }
.pk-best { right: auto; left: 50%; max-width: 94%; white-space: nowrap; font-size: 14px; background: #8a4dff; transform: translateX(-50%) rotate(-2deg); }
.ar-shop-foot { margin-top: 18px; text-align: center; font-family: var(--font-hand); font-weight: 800; font-size: 14px; color: #6a5a4a; }
@keyframes shopin { from { transform: scale(0.85) rotate(-2deg); opacity: 0; } }
/* "no ads": a strip across the top of the shop; bought, it says so */
.pk-noads { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; min-width: 0; padding: 10px 12px 10px 14px; cursor: pointer; font: inherit; color: var(--k);
  text-align: left; background: #f1e6ff; border: 4px solid var(--k); border-radius: 8px; box-shadow: 5px 5px 0 var(--k); transition: transform 0.1s, box-shadow 0.1s; }
.pk-noads:hover { transform: translateY(-3px); box-shadow: 6px 8px 0 #8a4dff; }
.pk-noads[disabled] { cursor: default; transform: none; box-shadow: 5px 5px 0 var(--k); }
.pk-noads[disabled]:not(.busy):not(.own) { opacity: 0.55; }
.pk-noads .na-ico { flex: none; width: 56px; height: 56px; }
.na-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.na-t b { display: block; max-width: 100%; white-space: nowrap; font-family: var(--font-comic); font-weight: 400; font-size: 23px; letter-spacing: 1px; }
.na-t small { font-family: var(--font-hand); font-weight: 800; font-size: 14px; line-height: 1.2; color: #5b4a6e; }
.na-price { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 20px 10px; font-family: var(--font-comic); font-size: 25px; color: #fff; background: var(--green);
  border: 3px solid var(--k); border-radius: 6px; box-shadow: 3px 3px 0 var(--k); -webkit-text-stroke: 1.5px var(--k); paint-order: stroke fill; }
.pk-noads:hover .na-price { background: #6fe57a; }
.pk-noads.own { background: #e6f9e4; }
.pk-noads.own .na-price { font-size: 17px; color: #1f9a2c; background: #fff; -webkit-text-stroke: 0; }
.pk-noads.own .na-price svg { width: 20px; height: 20px; fill: currentColor; }

.ar-slots { flex: none; display: flex; gap: 12px; }
.ar-slot { position: relative; flex: 1; min-width: 0; height: 74px; padding: 7px 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  cursor: pointer; color: var(--k); background: var(--paper); border: 4px solid var(--k); border-radius: 6px; box-shadow: 4px 4px 0 var(--k);
  transform: skewX(-8deg); transition: transform 0.08s, box-shadow 0.08s, background 0.12s; }
.ar-slot > * { transform: skewX(8deg); }
.ar-slot .ico { width: 92%; height: 34px; background: var(--k); -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.ar-slot span { display: flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; overflow: hidden; font-family: var(--font-comic);
  font-size: 13px; line-height: 1.05; letter-spacing: 0.4px; text-align: center; }
.ar-slot kbd { flex: none; min-width: 0; margin: 0; padding: 0 5px 1px; font-size: 11px; box-shadow: 1px 2px 0 var(--k); }
.ar-slot:hover { background: var(--paper-2); }
.ar-slot.on { background: var(--yellow); transform: skewX(-8deg) translateY(-3px); box-shadow: 5px 6px 0 var(--red); }

.ar-main { flex: 1; min-height: 0; display: flex; gap: 24px; }
.ar-stage { position: relative; flex: 1; min-width: 0; cursor: grab; touch-action: none; }
.ar-stage:active { cursor: grabbing; }
.ar-name { position: absolute; left: 8px; top: 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }
.ar-name b { font-family: var(--font-comic); font-weight: 400; font-size: 52px; line-height: 1; letter-spacing: 2px; color: #fff;
  -webkit-text-stroke: 3px var(--k); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--k); transform: rotate(-2deg); }
.ar-name span { padding: 3px 12px 5px; font-family: var(--font-hand); font-weight: 800; font-size: 17px; color: var(--k);
  background: #fff; border: 3px solid var(--k); box-shadow: 3px 3px 0 var(--k); transform: rotate(1deg); }
.ar-hint { position: absolute; right: 10px; top: 12px; display: flex; align-items: center; gap: 6px; pointer-events: none; transition: opacity 0.4s;
  font-family: var(--font-hand); font-weight: 800; font-size: 15px; color: rgba(255, 244, 214, 0.75); }
.ar-hint svg { width: 28px; height: 28px; fill: currentColor; }
.ar-hint.gone { opacity: 0; }
.ar-wait { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: opacity 0.2s;
  font-family: var(--font-comic); font-size: 22px; letter-spacing: 2px; color: var(--paper); text-shadow: 2px 2px 0 var(--k); }
.ar-wait.on { opacity: 1; }
.ar-guns { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 16px; }
.ar-gun { position: relative; width: 196px; padding: 6px 8px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--k);
  background: var(--paper); border: 4px solid var(--k); border-radius: 8px; box-shadow: 5px 5px 0 var(--k); transition: transform 0.1s, box-shadow 0.1s, background 0.12s; }
.ar-gun img { width: 100%; height: 78px; object-fit: contain; filter: drop-shadow(2px 2px 0 rgba(21, 17, 26, 0.35)); pointer-events: none; }
.ar-gun b { max-width: 100%; white-space: nowrap; font-family: var(--font-comic); font-weight: 400; font-size: 17px; letter-spacing: 0.5px; }
.ar-gun em { position: absolute; top: -13px; right: -9px; display: flex; align-items: center; gap: 4px; padding: 2px 8px 3px; font-style: normal;
  font-family: var(--font-comic); font-size: 13px; border: 3px solid var(--k); border-radius: 5px; box-shadow: 2px 2px 0 var(--k); transform: rotate(4deg); }
.ar-gun em svg { width: 14px; height: 14px; fill: currentColor; }
.ar-gun em.in { color: #fff; background: var(--green); -webkit-text-stroke: 1px var(--k); paint-order: stroke fill; }
.ar-gun em.own { background: #fff; }
.ar-gun em.price { background: var(--yellow); }
.ar-gun:hover { background: var(--paper-2); }
.ar-gun.on { background: #fff3a8; transform: translateY(-6px); box-shadow: 6px 8px 0 var(--red); }
.ar-gun.locked img { filter: brightness(0.55) saturate(0.5) drop-shadow(2px 2px 0 rgba(21, 17, 26, 0.35)); }

.ar-panel { position: relative; flex: none; width: 470px; display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px; color: var(--k);
  background: var(--paper); border: 5px solid var(--k); border-radius: 8px; box-shadow: 8px 8px 0 var(--k); }
.ar-panel::after { content: ''; position: absolute; inset: 0; border-radius: 3px; background: var(--dots); opacity: 0.45; pointer-events: none; }
.ar-panel > * { position: relative; z-index: 1; }
/* stats, tabs and the list; on phones they scroll as one, the tabs sticking at the top */
.ar-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.ar-stats { flex: none; display: grid; gap: 6px; }
.ar-stat { display: grid; grid-template-columns: 98px 1fr 78px; align-items: center; gap: 10px; }
.ar-stat span { font-family: var(--font-hand); font-weight: 800; font-size: 14px; letter-spacing: 1px; }
.ar-stat .bar { position: relative; height: 13px; background: rgba(21, 17, 26, 0.16); border: 2.5px solid var(--k); border-radius: 3px; overflow: hidden; transform: skewX(-12deg); }
.ar-stat .bar i, .ar-stat .bar em { position: absolute; left: 0; top: 0; bottom: 0; }
.ar-stat .bar i { background: var(--k); }
.ar-stat .bar em.up { background: var(--green); }
.ar-stat .bar em.down { background: var(--red); }
.ar-stat b { font-family: var(--font-comic); font-weight: 400; font-size: 15px; text-align: right; white-space: nowrap; }
.ar-stat b small { font-size: 0.7em; }
.ar-stat b.up { color: #1f9a2c; }
.ar-stat b.down { color: var(--red-dk); }
.ar-tabs { flex: none; display: flex; gap: 6px; }
.ar-tab { position: relative; flex: 1 1 auto; min-width: 0; padding: 8px 7px 9px; cursor: pointer; white-space: nowrap; font-family: var(--font-comic); font-size: 12.5px; letter-spacing: 0; color: var(--k);
  background: #fff; border: 3px solid var(--k); border-radius: 5px; box-shadow: 3px 3px 0 var(--k); transform: skewX(-8deg); transition: background 0.12s; }
.ar-tab:hover { background: var(--paper-2); }
.ar-tab.on { color: var(--yellow); background: var(--k); box-shadow: 3px 3px 0 var(--red); }
.ar-tab.soon { flex: 0 0 auto; padding: 4px 10px 3px; color: #8d8494; }
.ar-tab .br { width: 20px; height: 20px; fill: currentColor; display: block; transform: skewX(8deg); }
.ar-tab em { position: absolute; top: -11px; right: -6px; padding: 1px 5px 2px; font-style: normal; font-family: var(--font-hand); font-weight: 800; font-size: 10px; color: #fff;
  background: var(--purple); border: 2px solid var(--k); border-radius: 4px; transform: skewX(8deg) rotate(6deg); }
.ar-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 8px 6px 2px; margin-right: -8px; scrollbar-width: thin; scrollbar-color: var(--k) transparent; }
.ar-note { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-family: var(--font-hand); font-weight: 800; font-size: 14px; color: var(--red-dk); }
.ar-note .lk { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ar-up { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 12px; margin-bottom: 10px;
  background: #fff; border: 3px solid var(--k); border-radius: 6px; box-shadow: 3px 3px 0 var(--k); }
.ar-up-h { display: flex; align-items: baseline; gap: 10px; }
.ar-up-h b { font-family: var(--font-comic); font-weight: 400; font-size: 17px; }
.ar-up-h span { font-family: var(--font-comic); font-size: 15px; color: #1f9a2c; }
.ar-pips { grid-column: 1; display: flex; gap: 6px; }
.ar-pips i { width: 32px; height: 11px; background: rgba(21, 17, 26, 0.14); border: 2.5px solid var(--k); transform: skewX(-14deg); }
.ar-pips i.on { background: var(--yellow); }
.ar-up .ar-buy, .ar-up .ar-max { grid-column: 2; grid-row: 1 / 3; }
.ar-buy { width: auto; margin: 0; padding: 8px 12px 9px; gap: 4px; font-size: 16px; }
.ar-buy.poor, .btn.poor em { color: var(--red-dk) !important; }
.ar-max { font-family: var(--font-comic); font-size: 16px; color: #1f9a2c; padding: 0 8px; }
.ar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.ar-att { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 70px; padding: 6px 9px 6px 6px; cursor: pointer;
  color: var(--k); text-align: left; background: #fff; border: 3px solid var(--k); border-radius: 6px; box-shadow: 3px 3px 0 var(--k);
  transition: transform 0.08s, box-shadow 0.08s, background 0.12s; }
.ar-att .ai { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 5px;
  background: radial-gradient(circle at 50% 42%, #fffaf0 0 45%, #efe2c6 100%); border: 2px solid rgba(21, 17, 26, 0.25); }
.ar-att .ai img { width: 50px; height: 50px; object-fit: contain; }
.ar-att .ai svg.no { width: 30px; height: 30px; fill: #c2b59c; }
.ar-att .at { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ar-att b { max-width: 100%; font-family: var(--font-comic); font-weight: 400; font-size: 13px; line-height: 1.12;
  -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }   /* (a long German word breaks with a hyphen) */
.ar-att b.long { font-size: 11px; letter-spacing: -0.2px; }
.ar-att small { font-family: var(--font-hand); font-weight: 800; font-size: 11.5px; line-height: 1.2; color: #6a5a4a; }
.ar-att em { display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; padding: 1px 6px 2px; font-style: normal;
  font-family: var(--font-comic); font-size: 11.5px; border: 2px solid var(--k); border-radius: 4px; white-space: nowrap; }
.ar-att em:empty { display: none; }
.ar-att em.price { background: var(--yellow); }
.ar-att em.own { background: #fff; color: #6a5a4a; border-color: rgba(21, 17, 26, 0.35); }
.ar-att em.in { color: #fff; background: var(--green); -webkit-text-stroke: 0.6px var(--k); paint-order: stroke fill; }
.ar-att em.in svg { width: 12px; height: 12px; fill: #fff; }
.ar-att:hover { background: var(--paper-2); }
.ar-att.on { background: #fff3a8; box-shadow: 4px 4px 0 var(--red); transform: translateY(-2px); }
.ar-att.locked .ai img { filter: saturate(0.75); }
.ar-act { flex: none; }
/* the exclusives (js/arsenal.js AD_UNLOCK): a violet frame, the videos' count in the tag, the two ways of a size */
.ar-gun.excl, .ar-att.excl { box-shadow: 0 0 0 3px #b06cff, 4px 4px 0 3px var(--k); }
.ar-gun em.adv, .ar-att em.adv { color: #fff; background: #8a4dff; -webkit-text-stroke: 0.8px var(--k); paint-order: stroke fill; }
.ar-gun em.adv .ad-ico, .ar-att em.adv .ad-ico { width: 18px; height: 13px; margin-right: 2px; color: #fff; }
.ar-excl { margin: 0 0 6px; font-size: 13px; font-weight: 700; text-align: center; color: #8a4dff; }
.ar-two { display: grid; gap: 8px; }
.ar-two .btn { width: 100%; min-width: 0; }
.ar-act .ar-advbtn { justify-content: center; gap: 8px; color: #fff; background: #8a4dff; -webkit-text-stroke: 1px var(--k); paint-order: stroke fill; }
.ar-act .ar-advbtn .ad-ico { width: 26px; height: 18px; flex: none; color: #fff; }
.ar-act .ar-advbtn[disabled] { background: #b6aebb; filter: none; }
.ar-act .btn { margin: 0; justify-content: space-between; font-size: 21px; }
.ar-act .btn em { display: flex; align-items: center; margin-left: 10px; font-family: var(--font-comic); font-size: 18px; color: var(--k); background: #fff; }
.ar-inuse { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 12px; font-family: var(--font-comic); font-size: 19px; color: #1f9a2c;
  border: 3px dashed rgba(21, 17, 26, 0.35); border-radius: 6px; }
.ar-inuse .ck { width: 24px; height: 24px; fill: currentColor; }
.ar-toast { position: absolute; z-index: 6; left: 50%; bottom: 150px; padding: 8px 18px 10px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  font-family: var(--font-hand); font-weight: 800; font-size: 18px; color: var(--k); background: #fff; border: 3px solid var(--k); border-radius: 6px; box-shadow: 4px 4px 0 var(--k);
  transform: translateX(-50%) rotate(-1deg); }
.ar-toast.on { opacity: 1; animation: artoast 0.35s cubic-bezier(0.2, 1.5, 0.4, 1); }
.ar-toast.bad { background: #ffd0c8; }
@keyframes artoast { from { transform: translateX(-50%) scale(0.6) rotate(-6deg); } }
html:is(.mobile, .compact) .menu-card.dead { zoom: calc(var(--ms, 1) * 0.84); padding-top: 22px; padding-bottom: 16px; }
html:is(.mobile, .compact) .menu-card.dead .logo.mid { margin-top: -70px; }
html:is(.mobile, .compact) .menu-card.dead .stats { margin-bottom: 12px; }
html:is(.mobile, .compact) .dead-coins { margin: -4px 0 6px; padding: 4px 8px 4px 12px; }
html:is(.mobile, .compact) .dead-coins b { font-size: 22px; }
html:is(.mobile, .compact) .dead-coins .coin { font-size: 21px; }
html:is(.mobile, .compact) #btn-coins2 { padding: 4px 12px 5px; font-size: 17px; }
html:is(.mobile, .compact) .menu-card.dead .btn.big { padding: 11px 16px 12px; margin: 8px 0; }
html:is(.mobile, .compact) .menu-card.dead .btn-row { margin: 8px 0 0; }
html:is(.mobile, .compact) .ar-root { gap: 8px; padding: 10px 18px 12px; }
html:is(.mobile, .compact) .ar-top { height: 48px; }
html:is(.mobile, .compact) .ar-title { font-size: 34px; }
html:is(.mobile, .compact) .ar-slot { height: 58px; }
html:is(.mobile, .compact) .ar-slot .ico { height: 25px; }
html:is(.mobile, .compact) .ar-main { gap: 16px; }
html:is(.mobile, .compact) .ar-name b { font-size: 38px; }
html:is(.mobile, .compact) .ar-name span { font-size: 15px; }
html:is(.mobile, .compact) .ar-gun { width: 200px; }
html:is(.mobile, .compact) .ar-gun img { height: 56px; }
html:is(.mobile, .compact) .ar-panel { width: 430px; gap: 8px; padding: 12px 14px 12px; }
html:is(.mobile, .compact) .ar-att { min-height: 60px; gap: 7px; padding: 5px 7px 5px 5px; }
html:is(.mobile, .compact) .ar-att .ai { width: 46px; height: 46px; }
html:is(.mobile, .compact) .ar-att .ai img { width: 42px; height: 42px; }
html:is(.mobile, .compact) .ar-att small { font-size: 10.5px; }
html:is(.mobile, .compact) .ar-att b.long { font-size: 10px; }
html:is(.mobile, .compact) .ar-scroll { overflow-y: auto; overscroll-behavior: contain; gap: 8px; scrollbar-width: thin; scrollbar-color: var(--k) transparent; }
html:is(.mobile, .compact) .ar-body { flex: none; overflow: visible; padding-right: 4px; margin-right: 0; }
html:is(.mobile, .compact) .ar-tabs { position: sticky; top: 0; z-index: 3; padding: 8px 4px 6px 0; background: var(--paper); }
html:is(.mobile, .compact) .ar-tab em { top: -8px; right: -4px; }   /* ("soon" stays inside the scrolling panel) */
html:is(.mobile, .compact) .ar-slots { gap: 7px; }
html:is(.mobile, .compact) .ar-slot { height: 52px; padding: 4px 3px 3px; }
/* (no keys on a phone; a name in one line, shrunk to the slot's width) */
html.mobile .ar-slot kbd { display: none; }
html:is(.mobile, .compact) .ar-slot span { overflow: visible; white-space: nowrap; letter-spacing: 0; }
html:is(.mobile, .compact) .ar-inuse { padding: 6px 10px; font-size: 15px; }
html:is(.mobile, .compact) .ar-stats { grid-template-columns: 1fr 1fr; gap: 3px 16px; }
html:is(.mobile, .compact) .ar-stat { grid-template-columns: 68px 1fr 52px; gap: 6px; }
html:is(.mobile, .compact) .ar-stat span { font-size: 11px; letter-spacing: 0; }
html:is(.mobile, .compact) .ar-stat b { font-size: 12px; }
html:is(.mobile, .compact) .ar-stat .bar { height: 10px; }
html:is(.mobile, .compact) .ar-tab { padding: 7px 5px 8px; font-size: 12px; }
html:is(.mobile, .compact) .ar-up { gap: 3px 10px; padding: 6px 10px 7px; margin-bottom: 7px; }
html:is(.mobile, .compact) .ar-buy { padding: 6px 10px 7px; font-size: 15px; }
html:is(.mobile, .compact) .ar-act .btn { padding: 9px 14px 10px; font-size: 18px; }
html:is(.mobile, .compact) .ar-inuse { padding: 8px 10px; font-size: 16px; }
html:is(.mobile, .compact) .ar-hint { display: none; }
html:is(.mobile, .compact) .ar-toast { bottom: 100px; }
html.mobile .ar-ad:hover { background: var(--green); }
html:is(.mobile, .compact) .ar-plus { width: 40px; height: 40px; font-size: 28px; }
html:is(.mobile, .compact) .ar-shop-card { width: 740px; padding: 30px 22px 8px; }
html:is(.mobile, .compact) .ar-shop-card .mc-h { top: -25px; padding: 4px 22px 6px; font-size: 24px; }
html:is(.mobile, .compact) .ar-shop-x { top: 6px; right: 8px; width: 38px; height: 38px; }
html:is(.mobile, .compact) .ar-packs { gap: 15px 16px; }
html:is(.mobile, .compact) .ar-packs-wait { padding: 100px 0; }
html:is(.mobile, .compact) .pk { padding-top: 4px; }
/* (the pile as on desktop, smaller) */
html:is(.mobile, .compact) .pk-art { margin-top: -36px; transform: scale(0.62); transform-origin: 50% 100%; }
html:is(.mobile, .compact) .pk-noads { gap: 10px; padding: 5px 10px 5px 8px; }
html:is(.mobile, .compact) .pk-noads .na-ico { width: 40px; height: 40px; }
html:is(.mobile, .compact) .na-t b { font-size: 17px; }
html:is(.mobile, .compact) .na-t small { font-size: 11px; }
html:is(.mobile, .compact) .na-price { padding: 5px 14px 6px; font-size: 19px; }
html:is(.mobile, .compact) .pk-noads.own .na-price { font-size: 14px; }
html.mobile .pk-noads:hover { transform: none; box-shadow: 5px 5px 0 var(--k); }
html.mobile .pk-noads:hover .na-price { background: var(--green); }
html:is(.mobile, .compact) .pk-n { margin-top: 2px; font-size: 22px; }
html:is(.mobile, .compact) .pk-n .coin { font-size: 18px; }
html:is(.mobile, .compact) .pk-name { font-size: 12px; }
html:is(.mobile, .compact) .pk-price { margin-top: 6px; padding: 5px 6px 7px; font-size: 19px; }
html:is(.mobile, .compact) .pk-bonus { top: -12px; padding: 2px 8px 3px; font-size: 14px; }
html:is(.mobile, .compact) .pk-best { top: -12px; font-size: 12px; }
html:is(.mobile, .compact) .ar-shop-foot { margin-top: 10px; font-size: 12px; }
html.mobile .ar-plus:hover { background: var(--green); }
html.mobile .pk:hover { transform: none; box-shadow: 5px 5px 0 var(--k); }
html.mobile .pk:hover .pk-price { background: var(--green); }

/* Arabic: each text runs right to left inside its box (the screen's layout stays as it is), its letters
   joined (letter spacing would break them apart) */
html[lang="ar"] body * { unicode-bidi: plaintext; letter-spacing: 0 !important; }
