/* Game screens: the intro, terms, in-match HUD, overlays, touch controls and the pause card.
   Tokens and buttons live in base.css; the lobby bars and panels in menus.css. */

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  background: var(--sky-mid);
}
body.locked, body.locked * { cursor: none !important; }

/* ---------------------------------------------------------------- loading screen (#boot in index.html)

   Pure HTML and CSS, up before any module loads: the logo bouncing in, a candy-striped bar that the inline
   script fills (--p, 0 to 1) and a tip that changes every few seconds. It fades out when main.js marks the
   body ready. */
#boot {
  --p: 0.06;
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  background: radial-gradient(90vmax 70vmax at 50% 120%, #9fdcff, transparent 60%), linear-gradient(170deg, #1f6fff, #49a8ff 60%, #8fd6ff);
  color: #fff;
  font-family: var(--ui);
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
body.ready #boot { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-sky { position: absolute; inset: 0; pointer-events: none; }
.boot-rays {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 180vmax;
  height: 180vmax;
  margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.08) 0 10deg, transparent 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 55%);
  mask: radial-gradient(circle, #000 10%, transparent 55%);
  animation: boot-spin 40s linear infinite;
}
.boot-cloud { position: absolute; width: 34vmax; height: 11vmax; border-radius: 999px; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.55), transparent); }
.boot-cloud-a { left: -8vmax; top: 14%; animation: boot-drift 22s ease-in-out infinite alternate; }
.boot-cloud-b { right: -10vmax; top: 64%; animation: boot-drift 28s ease-in-out -9s infinite alternate-reverse; }
.boot-inner { position: relative; display: grid; justify-items: center; width: min(460px, 100%); }
.boot-logo { position: relative; margin: 0 0 26px; font-size: clamp(84px, 19vw, 150px); line-height: 1; }
.boot-word { display: inline-flex; gap: 0.02em; font-family: var(--display); letter-spacing: 0.02em; text-shadow: 0 5px 0 var(--ink), 0 -5px 0 var(--ink), 5px 0 0 var(--ink), -5px 0 0 var(--ink), 5px 5px 0 var(--ink), -5px 5px 0 var(--ink), 5px -5px 0 var(--ink), -5px -5px 0 var(--ink), 0 13px 0 var(--ink); }
/* The letters bounce in one by one: straight away once the font is in (.fonts), or after a second
   whatever happens, so the logo shows even without the script. */
.boot-word span { display: inline-block; animation: boot-letter 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) calc(1s + var(--i) * 0.08s) both, boot-hop 3.2s ease-in-out calc(2.2s + var(--i) * 0.12s) infinite; }
#boot.fonts .boot-word span { animation-name: boot-letter-now, boot-hop; animation-delay: calc(var(--i) * 0.08s), calc(1.2s + var(--i) * 0.12s); }
.boot-spark { position: absolute; fill: #fff; filter: drop-shadow(0 3px 0 var(--ink)); animation: boot-twinkle 1.8s ease-in-out infinite; }
.boot-spark-a { right: -0.22em; top: -0.16em; width: 0.32em; height: 0.32em; fill: var(--yellow); }
.boot-spark-b { left: -0.14em; bottom: 0.02em; width: 0.18em; height: 0.18em; animation-delay: -0.9s; }
.boot-bar {
  position: relative;
  width: min(340px, 78vw);
  height: 24px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(18, 32, 58, 0.35);
  box-shadow: 0 0 0 3px var(--ink), 0 6px 0 3px var(--ink), inset 0 3px 0 rgba(0, 0, 0, 0.15);
}
.boot-bar i {
  display: block;
  width: calc(var(--p) * 100%);
  min-width: 16px;
  height: 100%;
  border-radius: inherit;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.35) 0 9px, transparent 9px 18px) 0 0 / 25.5px 100%, linear-gradient(180deg, #ffe066, var(--yellow) 55%, #ffb000);
  box-shadow: inset 0 -3px 0 rgba(180, 110, 0, 0.35);
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: boot-stripes 0.6s linear infinite;
}
.boot-label { margin: 16px 0 0; font-weight: 900; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; text-shadow: 0 2px 0 rgba(18, 32, 58, 0.55); font-variant-numeric: tabular-nums; }
.boot-tips { position: relative; width: 100%; min-height: 76px; margin: 26px 0 0; padding: 0; list-style: none; }
/* Ten tips, 3.2 s each, one after another (the script starts at a random one through --t0). */
.boot-tips li {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  box-shadow: 0 0 0 3px var(--ink), 0 5px 0 3px var(--ink);
  opacity: 0;
  animation: boot-tip 32s ease infinite;
  animation-delay: calc(var(--i) * 3.2s - var(--t0, 0s) + 0.6s);
}
.boot-tips b { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-drift { to { transform: translateX(14vmax); } }
@keyframes boot-letter { from { opacity: 0; transform: translateY(0.5em) scale(0.5) rotate(-10deg); } }
@keyframes boot-letter-now { from { opacity: 0; transform: translateY(0.5em) scale(0.5) rotate(-10deg); } }
@keyframes boot-hop { 0%, 12%, 100% { transform: none; } 6% { transform: translateY(-0.1em); } }
@keyframes boot-twinkle { 50% { transform: scale(0.65) rotate(25deg); } }
@keyframes boot-stripes { to { background-position: 25.5px 0, 0 0; } }
@keyframes boot-tip {
  0% { opacity: 0; transform: translateY(8px); }
  1.5%, 8.5% { opacity: 1; transform: none; }
  10%, 100% { opacity: 0; transform: translateY(-6px); }
}
/* Phones held sideways: the logo shrinks so the tip still fits under the bar. */
@media (max-height: 480px) {
  .boot-logo { margin-bottom: 18px; font-size: clamp(60px, 22vh, 96px); }
  .boot-label { margin-top: 10px; }
  .boot-tips { margin-top: 14px; min-height: 60px; }
  .boot-tips li { padding: 7px 14px 7px 8px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #boot *, #boot { animation: none !important; transition: none; }
  .boot-word span { opacity: 1; }
  .boot-tips li { opacity: 0; }
  .boot-tips li:first-child { opacity: 1; }
}
/* A cut to black that fades out whenever a new scene (lobby, match) is built. */
#fade { position: fixed; inset: 0; z-index: 34; background: #0b1020; opacity: 0; pointer-events: none; transition: opacity 0.45s ease; }
#fade.cut { opacity: 1; transition: none; }
/* A load error replaces everything with a readable message (index.html writes it as plain text), under
   the logo. */
#boot.err { align-content: center; gap: 22px; padding: 24px; font-family: var(--ui); font-weight: 800; font-size: 17px; line-height: 1.45; letter-spacing: 0; text-align: center; text-shadow: 0 2px 0 rgba(18, 32, 58, 0.6); overflow-wrap: anywhere; }
#boot.err::before { content: "FUSE"; font-family: var(--display); font-size: 72px; line-height: 1; letter-spacing: 0.02em; text-shadow: var(--outline); }

/* ---------------------------------------------------------------- intro */

#intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: radial-gradient(120vmax 80vmax at 50% 110%, #8fd6ff, transparent 60%), linear-gradient(170deg, #1f6fff, #3aa0ff 55%, #7fd0ff);
  cursor: pointer;
  transition: opacity 0.85s ease;
}
#intro::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.09) 0 10deg, transparent 10deg 20deg);
  opacity: 0;
}
.intro-inner { position: relative; text-align: center; transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1), filter 0.9s ease; }
.intro-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(64px, 13vw, 170px);
  line-height: 0.95;
  color: #fff;
  text-shadow: 0 4px 0 var(--ink), 0 -4px 0 var(--ink), 4px 0 0 var(--ink), -4px 0 0 var(--ink), 4px 4px 0 var(--ink), -4px 4px 0 var(--ink), 4px -4px 0 var(--ink), -4px -4px 0 var(--ink), 0 12px 0 var(--ink);
}
.intro-letters { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 0.3em; }
.intro-word { display: inline-flex; white-space: nowrap; }
.intro-word span { display: inline-block; opacity: 0; transform: translateY(0.6em) scale(0.6) rotate(-8deg); }
.intro-rule {
  display: block;
  width: min(360px, 64vw);
  height: 10px;
  margin: 26px auto 18px;
  border-radius: 99px;
  background: var(--yellow);
  box-shadow: 0 4px 0 var(--ink);
  transform: scaleX(0);
}
.intro-presents {
  margin: 0;
  padding-left: 0.5em;
  color: var(--yellow);
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  text-shadow: var(--outline);
  opacity: 0;
}
#intro.go::before { animation: intro-spin 6s linear forwards, fade-in 1s ease forwards; }
#intro.go .intro-word span {
  animation: intro-letter 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) forwards, intro-bounce 0.5s ease-in-out;
  animation-delay: calc(0.15s + var(--i) * 0.07s), calc(1.7s + var(--i) * 0.05s);
}
#intro.go .intro-rule { animation: intro-rule 0.7s cubic-bezier(0.2, 1.2, 0.4, 1) 1s forwards; }
#intro.go .intro-presents { animation: intro-presents 0.9s cubic-bezier(0.2, 1.2, 0.4, 1) 1.25s forwards; }
@keyframes intro-spin { to { transform: rotate(40deg); } }
@keyframes intro-letter { to { opacity: 1; transform: none; } }
@keyframes intro-bounce { 50% { transform: translateY(-0.12em); color: var(--yellow); } }
@keyframes intro-rule { to { transform: scaleX(1); } }
@keyframes intro-presents { from { letter-spacing: 1em; } to { opacity: 1; letter-spacing: 0.5em; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } }
body.intro-out #intro { opacity: 0; pointer-events: none; }
body.intro-out .intro-inner { transform: scale(1.12); filter: blur(4px); }
body.intro #terms .terms-card { opacity: 0; }
body.intro-out #terms .terms-card { opacity: 1; animation: rise-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both; }
@media (prefers-reduced-motion: reduce) {
  #intro.go .intro-word span { animation: intro-letter 0.3s ease forwards; transform: none; }
  #intro.go .intro-rule, #intro.go .intro-presents { animation-duration: 0.3s; animation-delay: 0s; }
  #intro.go::before { animation: none; }
}

/* ---------------------------------------------------------------- screens and cards */

.screen { position: fixed; inset: 0; z-index: 35; overflow: auto; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.fine { color: var(--muted); font-size: 13px; }
.card {
  width: min(560px, calc(100% - 28px));
  padding: 28px;
  border-radius: 26px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 0 #b9cbe4, var(--shadow);
}
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.card-screen {
  display: grid;
  place-items: center;
  background: rgba(18, 32, 58, 0.45);
  backdrop-filter: blur(6px);
}

#terms {
  display: grid;
  padding: calc(24px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(90vmax 70vmax at 50% 120%, #9fdcff, transparent 60%), linear-gradient(170deg, #1f6fff, #49a8ff 60%, #8fd6ff);
}
#terms .terms-card { margin: auto; width: min(640px, 100%); }
.terms-card .title { font-size: clamp(34px, 6vw, 50px); }
.terms-lead { margin: 14px 0 0; color: var(--ink-2); font-weight: 700; line-height: 1.45; }
.terms-list { counter-reset: term; list-style: none; margin: 20px 0 24px; padding: 0; display: grid; gap: 12px; }
.terms-list li {
  counter-increment: term;
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 8px;
  padding: 16px 16px 16px 12px;
  border-radius: 18px;
  background: var(--paper-2);
  box-shadow: inset 0 0 0 2px var(--line);
}
.terms-list li::before {
  content: counter(term);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--display);
  font-size: 20px;
}
.terms-list h3 { margin: 4px 0 0; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 0.01em; }
.terms-list p { margin: 6px 0 0; color: var(--ink-2); font-weight: 700; line-height: 1.5; }
.terms-card .card-actions .btn { flex: 1 1 160px; }
#terms[data-state="pending"] .terms-declined,
#terms[data-state="declined"] .terms-pending { display: none; }
.terms-declined { animation: fade-in 0.4s ease; }
.terms-declined .eyebrow { color: var(--red); }
.terms-declined .card-actions { margin-top: 22px; }

/* The pause card looks like the menu panels: an ink outline, a blue striped band behind the title, and a
   springy entrance whenever it appears. */
.pause-card {
  position: relative;
  overflow: hidden;
  width: min(460px, calc(100% - 28px));
  padding-top: 22px;
  border-radius: 28px;
  background: var(--paper-2);
  text-align: center;
  box-shadow: 0 0 0 4px var(--ink), 0 12px 0 4px rgba(10, 22, 52, 0.55), 0 30px 70px rgba(8, 20, 48, 0.45);
}
.pause-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 104px;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 0 16px, transparent 16px 32px), linear-gradient(180deg, #4dabff 0%, var(--blue) 100%);
  box-shadow: inset 0 -5px 0 rgba(10, 40, 110, 0.25);
}
.pause-card > * { position: relative; }
.pause-card .eyebrow { margin-bottom: 4px; color: #d6ebff; }
.pause-card .title { font-size: 54px; margin-bottom: 30px; }
.pause-actions { display: grid; gap: 12px; margin-bottom: 14px; }
.pause-card .fine { margin: 0; }
#pause:not([hidden]) .pause-card { animation: pause-in 0.28s cubic-bezier(0.18, 1.3, 0.4, 1) both; }
#pause:not([hidden]) { animation: pause-fade 0.18s ease both; }
@keyframes pause-in { from { opacity: 0; transform: translateY(22px) scale(0.94); } }
@keyframes pause-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #pause:not([hidden]), #pause:not([hidden]) .pause-card { animation: none; } }
/* Landscape phones: two columns of buttons so the card fits without scrolling. */
@media (max-height: 520px) {
  .pause-card { width: min(560px, calc(100% - 28px)); padding: 12px 18px 14px; }
  .pause-card::before { height: 66px; }
  .pause-card .title { font-size: 38px; margin-bottom: 18px; }
  .pause-card .eyebrow { margin-bottom: 2px; font-size: 11px; }
  .pause-actions { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
  .pause-actions .btn-lg { grid-column: 1 / -1; min-height: 50px; font-size: 20px; }
  .pause-actions .btn { min-height: 42px; padding: 6px 12px; font-size: 14px; }
  /* With an odd number of buttons under Resume (Loadout or Admin showing, not both), Leave spans the row. */
  .pause-actions:has(#pause-loadout:not([hidden])):not(:has(#pause-admin:not([hidden]))) #pause-leave,
  .pause-actions:has(#pause-admin:not([hidden])):not(:has(#pause-loadout:not([hidden]))) #pause-leave { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- HUD */

/* Above the touch layer (#touch, 5) so the weapon slots, the only HUD part that takes touches, can be tapped.
   The HUD's look: white type with a chunky ink outline over anything, dark plates for information, white
   plates for what to do next, team colours on the score. */
#hud {
  --plate: rgba(18, 32, 58, 0.68);
  --edge: 0 0 0 2.5px var(--ink), 0 4px 0 2.5px rgba(18, 32, 58, 0.5);
  --text-ink: 0 2px 0 var(--ink), 0 -1.5px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 1.5px 1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px -1.5px 0 var(--ink), 0 3.5px 0 var(--ink);
  --text-soft: 0 2px 0 rgba(18, 32, 58, 0.85), 0 0 8px rgba(18, 32, 58, 0.45);
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  font-family: var(--ui);
  color: #fff;
}
/* (:where keeps this rule weak, so each icon's own size wins.) */
:where(#hud) svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.hud-top {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: calc(18px + env(safe-area-inset-left));
  right: calc(18px + env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.hud-info p { margin: 0; }
.hud-mode {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--plate);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hud-mode:empty { display: none; }
.hud-info .hud-big { margin-top: 3px; font-family: var(--display); font-size: 34px; line-height: 1.04; text-shadow: var(--text-ink); }
.hud-info .hud-small { margin-top: 2px; font-weight: 900; font-size: 14px; text-shadow: var(--text-soft); }
/* A tower's climb: a cell per floor, the ones done green, this one gold. */
.hud-info .hud-floors { display: flex; gap: 3px; margin-top: 7px; }
.hud-floors i { width: 13px; height: 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); box-shadow: 0 0 0 1.5px rgba(18, 32, 58, 0.75); }
.hud-floors i.done { background: var(--green); }
.hud-floors i.now { background: var(--yellow); animation: floor-now 1.1s ease-in-out infinite; }
@keyframes floor-now { 50% { transform: scaleY(1.35); } }

/* The duel score: a tile per team in its colour (its score, a pip per player still standing, its name),
   round the clock. */
.hud-score {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.score-team {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-width: 78px;
  padding: 4px 10px 7px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 58%), var(--team);
  box-shadow: inset 0 -4px 0 rgba(18, 32, 58, 0.25), var(--edge);
}
.score-team b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
  color: #fff;
  text-shadow: var(--text-ink);
}
.score-team em {
  padding: 0 6px;
  border-radius: 6px;
  font-style: normal;
  font-weight: 900;
  font-size: 10.5px;
  line-height: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(18, 32, 58, 0.55);
}
.score-team.mine em { background: #fff; color: var(--ink); text-shadow: none; }
.pips { display: flex; gap: 3px; }
.pips i { width: 8px; height: 11px; border-radius: 4px 4px 3px 3px; background: rgba(18, 32, 58, 0.4); transition: background 0.25s ease, transform 0.25s ease; }
.pips i.on { background: #fff; box-shadow: 0 1.5px 0 rgba(18, 32, 58, 0.35); }
/* A pip that just went out, or a score that just went up, pops (hud.js replays the class). */
.pips i.pop { animation: pip-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
.score-team b.pop { animation: score-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pip-pop { 30% { transform: scale(1.9); background: var(--ink); } }
@keyframes score-pop { 35% { transform: scale(1.45) rotate(-4deg); } }
.score-mid {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  min-width: 82px;
  padding: 5px 12px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 -4px 0 #d6e0ee, var(--edge);
}
.score-mid b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.score-mid span { font-weight: 900; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
/* The last 30 seconds (everyone shows through walls) turn the clock gold; the last ten red and pulsing.
   Match point says so under the clock. */
.hud-score.tense .score-mid b { color: #e59400; }
.hud-score.urgent .score-mid { background: var(--red); color: #fff; box-shadow: inset 0 -4px 0 var(--red-dark), var(--edge); }
.hud-score.urgent .score-mid b { animation: urgent 1s ease-in-out infinite; }
.hud-score.urgent .score-mid span { color: #ffe1e3; }
.hud-score.point .score-mid span { color: var(--red); }
.hud-score.point.urgent .score-mid span { color: #fff; }
@keyframes urgent { 50% { transform: scale(1.14); opacity: 0.8; } }

/* The minimap: a round window with a white rim, an ink edge and a north mark. */
.hud-right { display: grid; justify-items: end; gap: 12px; }
.map-frame {
  position: relative;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: #dce7f4;
  box-shadow: 0 0 0 4px #fff, 0 0 0 6.5px var(--ink), 0 7px 0 6.5px rgba(18, 32, 58, 0.3);
}
#map { display: block; width: 100%; height: 100%; border-radius: 50%; }
.map-frame::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 3px 7px rgba(18, 32, 58, 0.28), inset 0 0 0 1.5px rgba(18, 32, 58, 0.2); }
.map-n {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: -11px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
  font-weight: 400;
  font-size: 11.5px;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

/* The kill feed: killer, a picture of the weapon (gold for a headshot), victim. Your own rows are white;
   new rows slide in, old ones fade on their last second. */
.killfeed { display: grid; gap: 5px; justify-items: end; }
.killfeed p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(18, 32, 58, 0.72);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  animation: kf-in 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
  transition: opacity 0.8s ease;
}
.killfeed p.old { opacity: 0; }
.killfeed b { color: var(--tl, #fff); }
.killfeed p.mine { background: #fff; color: var(--ink); box-shadow: 0 0 0 2px var(--yellow), 0 3px 0 2px rgba(18, 32, 58, 0.4); }
.killfeed p.mine b { color: var(--tc, var(--ink)); }
.kf-gun { display: block; flex: none; width: 46px; height: 22px; padding: 1px 4px; border-radius: 7px; background: rgba(255, 255, 255, 0.94); }
.killfeed p.mine .kf-gun { background: var(--paper-3); }
.kf-head { flex: none; width: 18px; height: 18px; margin-left: -2px; color: var(--yellow); filter: drop-shadow(0 1px 0 rgba(18, 32, 58, 0.7)); }
.kf-act { flex: none; width: 20px; height: 20px; color: #fff; }
.kf-act.is-up { color: var(--green); }
.kf-act.is-down, .kf-act.is-fall { color: #ff7a82; }
.kf-act.is-fire { color: var(--orange); }
.killfeed p.mine .kf-act:not(.is-up):not(.is-down):not(.is-fire) { color: var(--ink); }
.kf-word { font-style: normal; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: #cfe0ff; }
.killfeed p.mine .kf-word { color: var(--muted); }
@keyframes kf-in { from { opacity: 0; transform: translateX(26px) scale(0.9); } }

/* The big banner: FIGHT! slams in, a win bursts with rays, a loss drops in, the end of a match is biggest.
   Its second line sits on an ink ribbon. hud.js adds is-<kind> and replays "play" for each new one. */
.banner {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.banner.on { opacity: 1; visibility: visible; transition: none; }
.banner b {
  position: relative;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 1;
  white-space: nowrap;
  color: var(--accent, #fff);
  text-shadow: 0 4px 0 var(--ink), 0 -3px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink), 0 8px 0 var(--ink), 0 10px 18px rgba(18, 32, 58, 0.35);
}
.banner span {
  position: relative;
  padding: 4px 16px 5px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 0 0 2.5px #fff, 0 4px 0 2.5px rgba(18, 32, 58, 0.4);
}
.banner-rays {
  position: absolute;
  left: 50%;
  top: 0.5em;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 233, 140, 0.55) 0 7deg, transparent 7deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 64%);
  mask: radial-gradient(circle, #000 0 18%, transparent 64%);
  opacity: 0;
  pointer-events: none;
}
.banner.play b { animation: bn-pop 0.42s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.banner.play span { animation: bn-ribbon 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.12s both; }
.banner.is-fight.play b { animation: bn-slam 0.5s cubic-bezier(0.25, 1.4, 0.4, 1) both; }
.banner.is-fight.play .banner-rays, .banner.is-win.play .banner-rays { animation: bn-rays 1.1s ease-out both; }
.banner.is-victory.play b { animation: bn-slam 0.7s cubic-bezier(0.25, 1.4, 0.4, 1) both, bn-glow 1.4s ease-in-out 0.7s infinite; }
.banner.is-victory.play .banner-rays { animation: bn-rays-in 0.6s ease-out both, bn-spin 9s linear infinite; }
.banner.is-lose.play b { animation: bn-drop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.banner.is-point.play span { background: var(--red); animation: bn-ribbon 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) 0.12s both, bn-point 0.7s ease-in-out 0.6s 3; }
@keyframes bn-pop { 0% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: none; } }
@keyframes bn-slam { 0% { opacity: 0; transform: scale(2.6) rotate(-6deg); } 55% { opacity: 1; transform: scale(0.9) rotate(1deg); } 100% { transform: none; } }
@keyframes bn-drop { 0% { opacity: 0; transform: translateY(-40px) rotate(-5deg); } 100% { opacity: 1; transform: none; } }
@keyframes bn-ribbon { 0% { opacity: 0; transform: scaleX(0.3); } 100% { opacity: 1; transform: none; } }
@keyframes bn-rays { 0% { opacity: 0; transform: scale(0.3) rotate(-20deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15) rotate(25deg); } }
@keyframes bn-rays-in { 0% { opacity: 0; transform: scale(0.3); } 100% { opacity: 0.9; transform: scale(1); } }
@keyframes bn-spin { to { rotate: 360deg; } }
@keyframes bn-glow { 50% { filter: brightness(1.18); transform: scale(1.04); } }
@keyframes bn-point { 50% { transform: scale(1.12); } }

/* The countdown before a round: a white badge under the banner, popping in with each second. */
.hud-count { position: absolute; left: 50%; top: 37%; transform: translateX(-50%); }
.hud-count b {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  box-shadow: inset 0 -4px 0 #d6e0ee, 0 0 0 3px var(--ink), 0 5px 0 3px rgba(18, 32, 58, 0.5);
}
.hud-count.tick b { animation: count-tick 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes count-tick { 0% { transform: scale(1.8); opacity: 0; } 45% { transform: scale(0.9); opacity: 1; } 100% { transform: none; } }
body.touch .hud-count b { width: 52px; height: 52px; font-size: 34px; }
/* Phones held sideways have no room between the banner and the crosshair: the clock counts down alone. */
@media (max-height: 520px) { .hud-count { display: none; } }
.score-mid b.tick { animation: count-tick 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }

/* Centred pills. They size to their text (max-content) but never wider than the screen, then wrap.
   White plates say what to do; dark ones tell you what's happening. */
.prompt {
  position: absolute;
  left: 50%;
  bottom: 30%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 9px 18px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  font-size: 16px;
  text-align: center;
  box-shadow: inset 0 -3px 0 #d6e0ee, var(--edge);
  animation: pill-in 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.aimhint, .reloadhint, .lowhp, .between, .spectate {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 8px 16px;
  border-radius: 14px;
  background: var(--plate);
  font-weight: 900;
  font-size: 15px;
  text-align: center;
}
.aimhint { top: calc(50% + 44px); }
.reloadhint { top: calc(50% + 44px); padding: 5px 12px; border-radius: 999px; font-size: 13px; background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); animation: pulse 0.9s ease-in-out infinite; }
.reloadhint kbd { box-shadow: 0 2px 0 #c9a200; }
.lowhp { bottom: 34%; display: flex; align-items: center; gap: 6px; padding: 7px 16px 7px 10px; border-radius: 999px; background: var(--red); box-shadow: 0 0 0 2.5px var(--ink), 0 4px 0 2.5px rgba(18, 32, 58, 0.45); animation: pulse 0.9s ease-in-out infinite; }
.lowhp svg { flex: none; width: 18px; height: 18px; }
.lowhp kbd { margin: 0 2px; }
.between { top: 32%; background: #fff; color: var(--ink); box-shadow: inset 0 -3px 0 #d6e0ee, var(--edge); animation: pill-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
/* A tower's stairs: under the crosshair, clear of the STAIRS sign up high, with an arrow that turns
   (hud.js sets --a, clockwise from straight ahead) to point the way up. */
.between.low { --a: 0rad; top: calc(50% + 74px); background: var(--yellow); box-shadow: inset 0 -3px 0 var(--yellow-dark), var(--edge); }
.between-arrow { display: inline-block; width: 26px; height: 26px; margin: -6px 8px -6px -4px; vertical-align: middle; transform: rotate(var(--a)); }
.between-arrow svg { display: block; width: 100%; height: 100%; overflow: visible; fill: #fff; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.spectate { bottom: 150px; border-radius: 999px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.05); } }
@keyframes pill-in { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.85); } }

/* The crosshair: four arms round a dot, pushed out by the spread (hud.js sets --gap) and for a moment on a
   hit. Its look, colour (--cu) and size (--cs) come from Settings; it turns red on an enemy and grey when
   the gun can't fire. A melee weapon gets a ring. */
.cross {
  --gap: 5px;
  --cs: 1;
  --tap: 1;
  --cc: var(--cu, #fff);
  --len: calc(8px * var(--cs) * var(--tap));
  --th: calc(3px * var(--cs) * var(--tap));
  --off: calc(var(--gap) * var(--tap));
  position: absolute;
  left: 50%;
  top: 50%;
  /* As big as the arms reach, centred on the middle of the screen; the parts hang off its centre. */
  width: calc((var(--off) + var(--len)) * 2);
  height: calc((var(--off) + var(--len)) * 2);
  transform: translate(-50%, -50%);
  transition: opacity 0.12s ease;
}
.cross i, .cross u, .cross s { position: absolute; left: 50%; top: 50%; background: var(--cc); box-shadow: 0 0 0 1.5px rgba(18, 32, 58, 0.78); }
.cross i { border-radius: 2px; transition: transform 0.07s ease-out, background 0.1s ease; }
.cross i:nth-child(1), .cross i:nth-child(2) { width: var(--th); height: var(--len); }
.cross i:nth-child(3), .cross i:nth-child(4) { width: var(--len); height: var(--th); }
.cross i:nth-child(1) { transform: translate(-50%, calc(-100% - var(--off))); }
.cross i:nth-child(2) { transform: translate(-50%, var(--off)); }
.cross i:nth-child(3) { transform: translate(calc(-100% - var(--off)), -50%); }
.cross i:nth-child(4) { transform: translate(var(--off), -50%); }
.cross u { width: var(--th); height: var(--th); border-radius: 50%; transform: translate(-50%, -50%); }
.cross s {
  display: none;
  width: calc(var(--off) * 2 + 14px * var(--cs) * var(--tap));
  height: calc(var(--off) * 2 + 14px * var(--cs) * var(--tap));
  border: calc(2px * var(--cs) * var(--tap)) solid var(--cc);
  border-radius: 50%;
  background: none;
  box-shadow: 0 0 0 1.5px rgba(18, 32, 58, 0.7), inset 0 0 0 1.5px rgba(18, 32, 58, 0.7);
  transform: translate(-50%, -50%);
  transition: width 0.07s ease-out, height 0.07s ease-out;
}
.cross.bump i, .cross.bump s { transition: none; }
.cross.is-dot i, .cross.is-circle i, .cross.is-melee i { display: none; }
.cross.is-dot u { width: calc(var(--th) * 2); height: calc(var(--th) * 2); }
.cross.is-circle s { display: block; }
.cross.is-tee i:nth-child(1) { display: none; }
.cross.is-melee s { display: block; width: calc(22px * var(--cs) * var(--tap)); height: calc(22px * var(--cs) * var(--tap)); border-width: calc(3px * var(--cs) * var(--tap)); }
.cross.hot { --cc: #ff4b55; }
.cross.cant { --cc: #b7c2d4; opacity: 0.55; }
.cross.off { opacity: 0; }

/* The ring round the crosshair: a charge, a cooking grenade or a spin-up fills gold; a reload white. */
.meter-ring {
  --p: 0%;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(var(--yellow) var(--p), rgba(18, 32, 58, 0.45) 0);
  -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 6px), #000 calc(100% - 5.5px) calc(100% - 0.5px), transparent 100%);
  mask: radial-gradient(circle closest-side, transparent calc(100% - 6px), #000 calc(100% - 5.5px) calc(100% - 0.5px), transparent 100%);
}
.meter-ring.is-reload { background: conic-gradient(#fff var(--p), rgba(18, 32, 58, 0.45) 0); }

/* Hit markers: four ticks that snap in on every hit; gold and longer for a headshot; red, thick and with
   a ring bursting out for an elimination. */
.hitmarker { --hm: #fff; --hl: 10px; --hw: 3px; --hr: 7px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
.hitmarker i {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--hw);
  height: var(--hl);
  margin-left: calc(var(--hw) / -2);
  border-radius: 2px;
  background: var(--hm);
  box-shadow: 0 0 0 1.5px rgba(18, 32, 58, 0.78);
  transform-origin: 50% 0;
}
.hitmarker i:nth-child(1) { transform: rotate(45deg) translateY(var(--hr)); }
.hitmarker i:nth-child(2) { transform: rotate(135deg) translateY(var(--hr)); }
.hitmarker i:nth-child(3) { transform: rotate(225deg) translateY(var(--hr)); }
.hitmarker i:nth-child(4) { transform: rotate(315deg) translateY(var(--hr)); }
.hitmarker s { position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid var(--hm); box-shadow: 0 0 0 1.5px rgba(18, 32, 58, 0.6); opacity: 0; }
.hitmarker.head { --hm: #ffd23f; --hl: 13px; --hw: 3.5px; --hr: 8px; }
.hitmarker.kill { --hm: #ff4b55; --hl: 14px; --hw: 4px; --hr: 9px; }
.hitmarker.play { animation: hm-snap 0.3s ease-out forwards; }
.hitmarker.head.play { animation-duration: 0.42s; }
.hitmarker.kill.play { animation: hm-snap 0.55s ease-out forwards; }
.hitmarker.kill.play s { animation: hm-ring 0.5s ease-out forwards; }
@keyframes hm-snap { 0% { opacity: 1; transform: scale(1.6); } 22% { opacity: 1; transform: scale(1); } 65% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); } }
@keyframes hm-ring { 0% { opacity: 1; transform: scale(0.5); } 100% { opacity: 0; transform: scale(3); } }

/* Elimination pop-up under the crosshair: the title slams in over a burst of rays, warming up as the streak
   grows; under it who it was, and a gold tag for a headshot. */
.killpop { position: absolute; left: 50%; top: 57%; display: grid; justify-items: center; gap: 5px; opacity: 0; transform: translateX(-50%); text-align: center; }
.killpop.on { animation: killpop 1.7s ease-out both; }
.killpop b {
  position: relative;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 3px 0 var(--ink), 0 -2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 5px 0 var(--ink);
}
.killpop.on b { animation: kp-title 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.kp-name { position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 5px; border-radius: 999px; background: rgba(18, 32, 58, 0.78); font-weight: 900; font-size: 14px; white-space: nowrap; }
.kp-name em { font-style: normal; }
.kp-ico { width: 18px; height: 18px; color: var(--yellow); }
.kp-head { display: flex; align-items: center; gap: 3px; margin-right: -6px; padding: 1px 8px 1px 4px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-style: normal; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.kp-head svg { width: 13px; height: 13px; }
.kp-rays {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 200px;
  height: 200px;
  margin: -100px 0 0 -100px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 63, 0.6) 0 8deg, transparent 8deg 22.5deg);
  -webkit-mask: radial-gradient(circle, #000 0 16%, transparent 62%);
  mask: radial-gradient(circle, #000 0 16%, transparent 62%);
  opacity: 0;
}
.killpop.on .kp-rays { animation: kp-rays 0.9s ease-out both; }
.killpop[data-tier="1"] .kp-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.45) 0 6deg, transparent 6deg 30deg); }
.killpop[data-tier="2"] b { color: #ffd23f; }
.killpop[data-tier="3"] b { color: #ffa33a; }
.killpop[data-tier="4"] b { color: #ff5a4f; }
.killpop[data-tier="5"] b { color: #d08bff; }
.killpop[data-tier="4"] .kp-rays, .killpop[data-tier="5"] .kp-rays { width: 260px; height: 260px; margin: -130px 0 0 -130px; }
@keyframes killpop {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
  8% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}
@keyframes kp-title { 0% { transform: scale(2.2) rotate(-5deg); } 60% { transform: scale(0.92); } 100% { transform: none; } }
@keyframes kp-rays { 0% { opacity: 0; transform: scale(0.3) rotate(-30deg); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.2) rotate(30deg); } }
@media (prefers-reduced-motion: reduce) { .killpop.on { animation: none; opacity: 1; } .killpop.on b, .killpop.on .kp-rays { animation: none; } }
/* An assist: you softened them up and someone else finished them. */
.assistpop { position: absolute; left: 50%; top: calc(57% + 70px); display: flex; align-items: center; gap: 5px; padding: 3px 12px 3px 6px; border-radius: 999px; background: var(--green); font-weight: 900; font-size: 13px; box-shadow: 0 0 0 2px var(--ink); opacity: 0; transform: translateX(-50%); }
.assistpop svg { width: 15px; height: 15px; }
.assistpop.on { animation: assist 1.4s ease-out both; }
@keyframes assist { 0% { opacity: 0; transform: translateX(-50%) scale(0.6); } 12% { opacity: 1; transform: translateX(-50%) scale(1.1); } 22% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* The sniper's scope: a round window with fine cross hairs and a red dot, under the rest of the HUD (so the
   score and the clock stay readable while you aim). */
.scope { position: absolute; z-index: -1; inset: 0; background: radial-gradient(circle at center, transparent 0 20vmin, rgba(6, 10, 22, 0.55) 20.2vmin, rgba(6, 10, 22, 0.97) 21.4vmin); }
.scope::before, .scope::after { content: ""; position: absolute; left: 50%; top: 50%; background: rgba(6, 10, 22, 0.85); }
.scope::before { width: 40vmin; height: 1.5px; transform: translate(-50%, -50%); }
.scope::after { width: 1.5px; height: 40vmin; transform: translate(-50%, -50%); }
.scope i { position: absolute; z-index: 1; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #ff3b4a; box-shadow: 0 0 0 1px rgba(6, 10, 22, 0.8); }
.scope i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16vmin; height: 16vmin; border: 1.5px solid rgba(6, 10, 22, 0.4); border-radius: 50%; transform: translate(-50%, -50%); }

/* ---------------------------------------------------------------- HUD: the bottom */

.hud-bottom {
  position: absolute;
  left: calc(18px + env(safe-area-inset-left));
  right: calc(18px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

/* Health: a heart badge on a chunky bar in quarters. The fill snaps down when you're hurt and a pale chip of
   what you lost drains after it a beat later (hud.js); healing glows green; low health beats. */
.hp-block { position: relative; width: min(310px, 32vw); }
/* The name stays on one line and leaves room for the streak pill at the right. */
.hp-name { margin: 0 0 6px; padding-right: 64px; font-weight: 900; font-size: 15px; text-shadow: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-streak { position: absolute; top: -3px; right: 0; display: flex; align-items: center; gap: 2px; margin: 0; padding: 1px 10px 1px 6px; border-radius: 999px; background: linear-gradient(180deg, #ffb02e, #ff6a00); color: #fff; font-family: var(--display); font-size: 16px; line-height: 21px; box-shadow: 0 0 0 2px var(--ink), 0 3px 0 2px rgba(18, 32, 58, 0.45); text-shadow: 0 1px 0 rgba(18, 32, 58, 0.45); animation: pill-pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.hp-streak svg { width: 15px; height: 15px; fill: #fff3c4; }
.hp-streak b { font-weight: 400; }
@keyframes pill-pop { from { transform: scale(0.4); } }
.hp-row { position: relative; display: flex; align-items: center; }
.hp-icon {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-right: -12px;
  border-radius: 50%;
  background: #fff;
  color: #ff4b6e;
  box-shadow: inset 0 -3px 0 #d6e0ee, var(--edge);
  transition: color 0.2s ease;
}
.hp-icon svg { width: 25px; height: 25px; }
.hp {
  position: relative;
  flex: 1;
  height: 30px;
  border-radius: 0 12px 12px 0;
  overflow: hidden;
  background: rgba(18, 32, 58, 0.72);
  box-shadow: var(--edge);
}
.hp i { position: absolute; inset: 0; transform-origin: left center; }
.hp-chip { background: #fff4d6; }
.hp-chip.drain { transition: transform 0.45s ease-in 0.45s; }
.hp-fill { background: var(--green); transition: transform 0.06s linear, background 0.2s ease; }
.hp-fill.rise { transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1), background 0.2s ease; }
.hp-fill::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 38%; background: rgba(255, 255, 255, 0.32); }
/* Quarter marks over the fill. */
.hp::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 2px), rgba(18, 32, 58, 0.38) calc(25% - 2px) 25%); pointer-events: none; }
.hp b {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding-left: 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  text-shadow: var(--text-ink);
}
.hp-block.low .hp-icon { animation: heartbeat 0.95s ease-in-out infinite; }
.hp-block.low .hp { box-shadow: 0 0 0 2.5px var(--ink), 0 4px 0 2.5px rgba(18, 32, 58, 0.5), 0 0 16px 4px rgba(255, 60, 70, 0.55); }
.hp-block.healing .hp-icon { color: var(--green); }
.hp-block.healing .hp { box-shadow: 0 0 0 2.5px var(--ink), 0 4px 0 2.5px rgba(18, 32, 58, 0.5), 0 0 16px 4px rgba(74, 222, 128, 0.75); }
.hp-block.dead .hp-icon { color: #9aa6ba; }
@keyframes heartbeat { 0%, 40%, 100% { transform: scale(1); } 12% { transform: scale(1.22); } 26% { transform: scale(1.1); } }
/* Status effects: a coloured chip each, with its picture. */
.status { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; margin-top: 9px; }
.hud-st { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px 0 5px; border-radius: 999px; font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 rgba(18, 32, 58, 0.4); box-shadow: 0 0 0 2px var(--ink); animation: pill-pop 0.3s cubic-bezier(0.2, 1.6, 0.4, 1); }
.hud-st svg { width: 15px; height: 15px; }
.hud-st.is-burn { background: linear-gradient(180deg, #ffa03a, #ff5a1f); }
.hud-st.is-frost { background: linear-gradient(180deg, #7fd6ff, #2f9bff); }
.hud-st.is-speed { background: linear-gradient(180deg, #c084fc, #8b3fe0); }
.hud-st.is-heal { background: linear-gradient(180deg, #4ade80, #16a34a); }
.hud-st.is-shield { background: linear-gradient(180deg, #6aa6ff, #2f6dff); }

/* Weapon slots: the weapon's picture, its key (computers), its ammo and a thin bar of its magazine; the
   utility's recharge sweeps round its picture; the one in hand is white, lifted, and pops as you switch. */
.slots { display: flex; gap: 8px; pointer-events: auto; align-items: flex-end; }
.slot {
  --tier: rgba(255, 255, 255, 0.28);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  width: 118px;
  height: 72px;
  padding: 5px 10px 10px;
  border: 0;
  border-radius: 15px;
  overflow: hidden;
  background: rgba(18, 32, 58, 0.66);
  color: #fff;
  text-align: left;
  box-shadow: inset 0 3px 0 var(--tier), 0 0 0 2px rgba(18, 32, 58, 0.55), 0 4px 0 2px rgba(18, 32, 58, 0.3);
  transition: transform 0.15s cubic-bezier(0.2, 1.4, 0.4, 1), background 0.12s ease, opacity 0.15s ease;
}
.slot.tier-prime { --tier: var(--tier-prime); }
.slot.tier-galaxy { --tier: var(--tier-galaxy); }
/* The owner's weapons (Admin Panel): gold all over. */
.slot.tier-owner { --tier: #ffc23a; }
.slot.tier-owner:not(.active) { background: linear-gradient(120deg, rgba(255, 194, 58, 0.92), rgba(255, 224, 138, 0.92) 45%, rgba(255, 194, 58, 0.92)); color: #3b0764; }
.slot kbd { position: absolute; top: 6px; left: 6px; z-index: 1; min-width: 17px; padding: 0 4px; font-size: 10.5px; line-height: 16px; background: rgba(255, 255, 255, 0.9); box-shadow: none; }
.slot-art { grid-column: 1 / -1; align-self: stretch; display: grid; place-items: center; min-height: 0; }
.slot-art svg { width: auto; height: 100%; max-width: 100%; max-height: 38px; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 0.6px #fff); }
/* A fused gun: its body, with the donor's picture in a little white badge at its corner (as in the menus). */
.slot-art .glyph-fused { display: block; position: relative; width: auto; height: 100%; max-height: 38px; aspect-ratio: 70 / 38; }
.slot-art .glyph-fused svg { width: 100%; height: 100%; }
.slot-art .glyph-donor { position: absolute; right: -10%; bottom: -12%; width: 50%; height: 54%; padding: 1px 2px; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1.5px var(--ink); }
.slot-art .glyph-donor svg { filter: none; }
.slot-name { font-weight: 900; font-size: 12.5px; line-height: 1.15; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.slot-ammo { font-family: var(--display); font-size: 15px; line-height: 1; }
.slot-fill { position: absolute; left: 10px; right: 10px; bottom: 5px; display: none; height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.2); }
.slot.has-fill .slot-fill { display: block; }
.slot-fill u { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); transition: transform 0.1s linear; }
.slot.is-mid .slot-fill u { background: var(--yellow); }
.slot.is-low .slot-fill u { background: #ff5a63; }
.slot.reloading .slot-ammo { opacity: 0.45; }
/* The utility's recharge: a dark sweep over its picture that unwinds as it fills (hud.js sets --p). */
.slot-meter { --p: 100%; position: absolute; left: 50%; top: 2px; display: none; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; background: conic-gradient(transparent var(--p), rgba(10, 18, 36, 0.66) 0); }
.slot.sweeping .slot-meter { display: block; }
.slot.active {
  background: #fff;
  color: var(--ink);
  transform: translateY(-8px);
  box-shadow: inset 0 3px 0 var(--tier), inset 0 -4px 0 #d6e0ee, 0 0 0 3px var(--ink), 0 6px 0 3px rgba(18, 32, 58, 0.45);
}
.slot.active .slot-art svg { filter: none; }
.slot.active .slot-fill { background: rgba(18, 32, 58, 0.14); }
.slot.active .slot-fill u { background: var(--ink); }
.slot.active.is-mid .slot-fill u { background: #f0a500; }
.slot.active.is-low .slot-fill u { background: var(--red); }
.slot.active kbd { background: var(--ink); color: #fff; }
.slot.empty { opacity: 0.55; }
.slot.pick { animation: slot-pick 0.34s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes slot-pick { 0% { transform: translateY(-2px) scale(0.88); } 55% { transform: translateY(-11px) scale(1.07); } 100% { transform: translateY(-8px); } }
/* The medkit slot pulses while the low-health warning is up. */
.slot.pulse { animation: slot-pulse 0.9s ease-in-out infinite; }
@keyframes slot-pulse { 50% { box-shadow: inset 0 3px 0 var(--tier), 0 0 0 2px rgba(18, 32, 58, 0.55), 0 0 0 5px var(--red); } }
.slots.compact { display: none; }

/* The ammo counter: big, gold at half a magazine, red at a quarter, pulsing when empty. Under it a bar of
   rounds (a notch each in small magazines) that becomes the reload's progress, or a gauge for fuel,
   battery and shields. */
.ammo-block { min-width: 170px; text-align: right; }
.ammo { margin: 0; font-family: var(--display); line-height: 0.9; text-shadow: var(--text-ink); }
.ammo b { display: inline-block; font-weight: 400; font-size: 58px; font-variant-numeric: tabular-nums; transition: color 0.15s ease, opacity 0.15s ease; }
.ammo span { margin-left: 5px; font-size: 22px; color: #e3ecfa; }
.ammo.mid b { color: var(--yellow); }
.ammo.low b, .ammo.out b { color: #ff5a63; }
.ammo.out b { animation: ammo-out 0.8s ease-in-out infinite; }
.ammo.reloading b { opacity: 0.45; }
@keyframes ammo-out { 50% { transform: scale(1.12); } }
.ammo-block .bar { --n: 1; position: relative; width: 160px; height: 10px; margin: 8px 0 0 auto; border-radius: 99px; overflow: hidden; background: rgba(18, 32, 58, 0.62); box-shadow: 0 0 0 2px var(--ink); }
.ammo-block .bar i { display: block; height: 100%; background: #fff; transform-origin: left; transition: transform 0.08s linear; }
.ammo.mid + .bar i { background: var(--yellow); }
.ammo.low + .bar i { background: #ff5a63; }
.ammo-block .bar.is-reload i { background: linear-gradient(90deg, #ffe58a, var(--yellow)); transition: none; }
.ammo-block .bar.is-gauge i { background: linear-gradient(90deg, #7fe0ff, #2f9bff); }
.ammo-block .bar.notched::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--n) - 2px), rgba(18, 32, 58, 0.9) calc(100% / var(--n) - 2px) calc(100% / var(--n))); }
.weapon-name { margin: 7px 0 0; font-family: var(--display); font-size: 22px; line-height: 1.05; text-shadow: var(--text-ink); }
.alt-ready { display: inline-block; margin: 6px 0 0; padding: 2px 10px; border-radius: 999px; background: var(--plate); color: #cfe0ff; font-weight: 900; font-size: 12px; }
.alt-ready:empty { display: none; }
.alt-ready.is-ready { background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }

/* Tower squads (hud.js squadPips): a pip per member at the top with their initial and a ring of their
   health, you in gold. A downed squadmate's pip goes grey and fills green while someone revives them; it pops
   as they go down. */
.hud-squad {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 20px;
  background: var(--plate);
  box-shadow: 0 0 0 2px rgba(18, 32, 58, 0.55);
}
.hud-squad i {
  --p: 0%;
  --hp: 100%;
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-style: normal;
  font-size: 17px;
  line-height: 1;
  box-shadow: inset 0 -3px 0 #c3cfe0, 0 0 0 2px var(--ink);
}
.hud-squad i::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--hp), rgba(255, 255, 255, 0.2) 0);
  -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(circle closest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
}
.hud-squad i.hurt::before { background: conic-gradient(var(--red) var(--hp), rgba(255, 255, 255, 0.2) 0); }
.hud-squad i.me { background: var(--yellow); box-shadow: inset 0 -3px 0 var(--yellow-dark), 0 0 0 2px var(--ink); }
.hud-squad i.down { background: conic-gradient(var(--green) var(--p), #59647a 0); color: #fff; text-shadow: 0 1px 0 rgba(18, 32, 58, 0.6); box-shadow: 0 0 0 2px var(--ink); }
.hud-squad i.down::before { background: var(--red); }
.hud-squad i.reviving { animation: revive-pulse 0.6s ease-in-out infinite; }
.hud-squad i.pop { animation: pip-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes revive-pulse { 50% { transform: scale(1.14); } }
/* Standing on a downed squadmate's marker: the revive filling up, just above the crosshair. */
.revive-pill {
  position: absolute;
  left: 50%;
  bottom: calc(50% + 44px);
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 8px 16px 10px;
  border-radius: 14px;
  background: var(--green);
  font-weight: 900;
  font-size: 15px;
  text-shadow: 0 1px 0 rgba(18, 32, 58, 0.45);
  box-shadow: inset 0 -4px 0 var(--green-dark), var(--edge);
}
.revive-bar { display: block; width: 100%; min-width: 150px; height: 9px; overflow: hidden; border-radius: 99px; background: rgba(18, 32, 58, 0.35); box-shadow: 0 0 0 1.5px rgba(18, 32, 58, 0.5); }
.revive-bar u { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) { .hud-squad i.reviving { animation: none; } }

/* The scoreboard (Tab): a block per team in its colour, players by eliminations, you highlighted, the top
   player crowned, anyone out greyed with a cross. */
.board {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 12px;
  width: min(680px, 94vw);
  max-height: 88vh;
  overflow: hidden;
  padding: 14px;
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--ink), 0 8px 0 3px var(--ink), var(--shadow);
}
.board-team { overflow: hidden; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--line); }
.board-head { display: flex; align-items: center; gap: 10px; padding: 7px 14px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 60%), var(--team); color: #fff; }
.board-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; text-shadow: 0 2px 0 rgba(18, 32, 58, 0.4); }
.board-head em { padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--ink); font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.board-head b { margin-left: auto; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; text-shadow: 0 2px 0 rgba(18, 32, 58, 0.4); }
.board table { width: 100%; border-collapse: collapse; font-weight: 800; font-size: 14px; }
.board th { padding: 6px 10px; background: var(--paper-2); color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
.board td { padding: 6px 10px; border-top: 1px solid var(--line); }
.board td:not(:first-child), .board th:not(:first-child) { width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.board tr.me td { background: #fff4c2; }
.board tr.dead td { color: var(--muted); }
.bd-name { display: inline-flex; align-items: center; gap: 6px; }
.bd-mvp { flex: none; width: 18px; height: 18px; color: #f0a500; filter: drop-shadow(0 1px 0 rgba(18, 32, 58, 0.5)); }
.bd-out { flex: none; width: 11px; height: 11px; color: var(--red); }

/* ---------------------------------------------------------------- overlays */

#overlays { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#overlays > div { position: absolute; inset: 0; opacity: 0; transition: opacity 0.2s ease; }
#overlays .vignette { background: radial-gradient(ellipse at center, transparent 48%, rgba(255, 40, 50, 0.72) 100%); transition: none; }
/* Low health: the edges beat red with the heart. */
#overlays .lowpulse { background: radial-gradient(ellipse at center, transparent 52%, rgba(255, 30, 60, 0.6) 100%); transition: opacity 0.3s ease; }
#overlays .lowpulse.on { animation: lowpulse 0.95s ease-in-out infinite; }
@keyframes lowpulse { 0%, 100% { opacity: 0.3; } 12% { opacity: 0.85; } 26% { opacity: 0.45; } 40% { opacity: 0.7; } }
/* A hard hit punches the edges red for an instant. */
#overlays .punch { background: radial-gradient(ellipse at center, transparent 38%, rgba(255, 30, 50, 0.7) 100%); transition: none; }
#overlays .punch.on { animation: punch 0.4s ease-out; }
@keyframes punch { 0% { opacity: 1; } 100% { opacity: 0; } }
#overlays .frost { background: radial-gradient(circle at center, transparent 40%, rgba(190, 235, 255, 0.85) 100%); box-shadow: inset 0 0 80px rgba(255, 255, 255, 0.8); }
#overlays .burn { background: radial-gradient(circle at center, transparent 55%, rgba(255, 120, 20, 0.55) 100%); }
#overlays .heal { background: radial-gradient(circle at center, transparent 50%, rgba(74, 222, 128, 0.5) 100%); transition: none; }
#overlays .blind { background: #fff; transition: none; }
/* Going up a tower's stairs: a fade to black and back, timed by the session in game time. */
#overlays .climb { background: #05030b; transition: none; }
#overlays .paint { opacity: 1; }
#overlays .paint i { position: absolute; transform: translate(-50%, -50%); border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%; filter: blur(0.5px); }
/* Where hits come from: a tapered red arc round the crosshair for each (hud.js turns them). */
#overlays .hurtdir { opacity: 1; }
#overlays .hurtdir i { position: absolute; left: 50%; top: 50%; width: 38vmin; height: 38vmin; margin: -19vmin 0 0 -19vmin; }
#overlays .hurtdir svg { display: block; width: 100%; height: 100%; overflow: visible; }
#overlays .hurtdir .arc-glow { fill: rgba(255, 40, 60, 0.4); }
#overlays .hurtdir .arc-core { fill: #ff3048; }
#overlays .hurtdir i.hard svg { transform: scale(1.06); }
#overlays .hurtdir i.hard .arc-core { fill: #ff1f2f; }
#overlays .hurtdir i.in svg { animation: arc-in 0.28s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes arc-in { from { transform: scale(0.82); } }
body[data-screen="lobby"] #overlays .vignette, body[data-screen="lobby"] #overlays .lowpulse { display: none; }
#hud[data-kind="lobby"] .hud-right { display: none; }
/* The lobby is third person: the "Click to walk around" hint sits above your character's head. */
#hud[data-kind="lobby"] .aimhint { top: 38%; }

/* ---------------------------------------------------------------- touch */

/* Each button wears a picture over its word (the word is the button's text: main.js names them). */
#touch {
  --i-fire: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='6.6' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.6'/%3E%3Ccircle cx='12' cy='12' r='2.3'/%3E%3Cpath d='M12 1.6v4.3M12 18.1v4.3M1.6 12h4.3M18.1 12h4.3' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.8'/%3E%3C/svg%3E");
  --i-kick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.3' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.4'/%3E%3Cpath d='M12 7.3l3.7 2.7-1.4 4.3H9.7L8.3 10z'/%3E%3Cpath d='M12 7.3V3.2M15.7 10l3.9-1.3M14.3 14.3l2.4 3.4M9.7 14.3l-2.4 3.4M8.3 10L4.4 8.7' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='1.8'/%3E%3C/svg%3E");
  --i-aim: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='7.6' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.4'/%3E%3Cpath d='M12 1.8v6.4M12 15.8v6.4M1.8 12h6.4M15.8 12h6.4' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.4'/%3E%3Ccircle cx='12' cy='12' r='1.5'/%3E%3C/svg%3E");
  --i-chip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.6 20.5C5 9 13 4.6 19.6 8.4' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.4' stroke-dasharray='0.1 4.4'/%3E%3Ccircle cx='18.6' cy='15.6' r='4.2'/%3E%3C/svg%3E");
  --i-throw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.6 19.5C5.6 12 10.4 8 17 7.6' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='3'/%3E%3Cpath d='M14.6 2.6l6.8 5-6.8 5z'/%3E%3C/svg%3E");
  --i-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5l7 7-7 7M12.4 5l7 7-7 7' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='3.2'/%3E%3C/svg%3E");
  --i-slam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6v11.2M6.6 9.2l5.4 5.4 5.4-5.4' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='3'/%3E%3Cpath d='M3.4 20.6h17.2' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='3'/%3E%3C/svg%3E");
  --i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l8.4 3.2v6.3c0 5.2-3.5 9.6-8.4 11.2-4.9-1.6-8.4-6-8.4-11.2V5z'/%3E%3C/svg%3E");
  --i-build: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.5 4h9v5h-9zM12.5 4h9v5h-9zM2.5 10h4.5v5H2.5zM8 10h8v5H8zM17 10h4.5v5H17zM2.5 16h9v5h-9zM12.5 16h9v5h-9z'/%3E%3C/svg%3E");
  --i-heal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.4 2.8h5.2v6.6h6.6v5.2h-6.6v6.6H9.4v-6.6H2.8V9.4h6.6z'/%3E%3C/svg%3E");
  --i-boom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5l2.2 5.4 5.2-2.6-2.1 5.4 5.6 1.5-5 3 3.4 4.6-5.7-.6-.2 5.9-3.4-4.7-3.4 4.7-.2-5.9-5.7.6 3.4-4.6-5-3 5.6-1.5-2.1-5.4 5.2 2.6z'/%3E%3C/svg%3E");
  --i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.6l2.8 7.6 7.6 2.8-7.6 2.8L12 22.4l-2.8-7.6L1.6 12l7.6-2.8z'/%3E%3C/svg%3E");
  --i-portal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='12' rx='6.4' ry='9.6' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.6'/%3E%3Cellipse cx='12' cy='12' rx='2.6' ry='5'/%3E%3C/svg%3E");
  --i-jump: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.2l8.4 8.6h-5.3v6.9H8.9v-6.9H3.6z'/%3E%3Crect x='4.5' y='19.4' width='15' height='2.8' rx='1.4'/%3E%3C/svg%3E");
  --i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.8l8.4-8.6h-5.3V6.3H8.9v6.9H3.6z'/%3E%3Crect x='4.5' y='1.8' width='15' height='2.8' rx='1.4'/%3E%3C/svg%3E");
  --i-reload: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.6 12.6a7.6 7.6 0 1 1-2.4-6.1' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.8'/%3E%3Cpath d='M21.2 2.6v7.2h-7.2z'/%3E%3C/svg%3E");
  --i-use: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3.8'/%3E%3Ccircle cx='12' cy='12' r='8.4' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.4' stroke-dasharray='3.4 2.6'/%3E%3C/svg%3E");
  --i-loadout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.6 8h13.6M13.2 3.6L17.6 8l-4.4 4.4M20.4 16H6.8M10.8 11.6L6.4 16l4.4 4.4' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.6'/%3E%3C/svg%3E");
  --i-shop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.6 8.2h14.8l-1.3 13H5.9z'/%3E%3Cpath d='M8.6 10V6.6a3.4 3.4 0 0 1 6.8 0V10' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.4'/%3E%3C/svg%3E");
  --i-enter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.4 3.2h6.8v17.6h-6.8' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.6'/%3E%3Cpath d='M2.8 12h11.4M10.2 7.6l4.4 4.4-4.4 4.4' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' fill='none' stroke-width='2.6'/%3E%3C/svg%3E");
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
body.touch .aimhint { display: none !important; }
/* The open screen: drag to look; in a match a tap fires too (main.js). */
#lookpad { position: absolute; inset: 0; pointer-events: auto; touch-action: none; }
#touch button, #stick { pointer-events: auto; touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; }
.tbtn {
  --ico: var(--i-use);
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(52, 72, 110, 0.78), rgba(18, 32, 58, 0.78) 72%);
  color: #fff;
  font-family: var(--ui);
  font-weight: 900;
  font-size: 11.5px;
  line-height: 1;
  box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, 0.8), 0 4px 0 rgba(18, 32, 58, 0.35);
  transition: transform 0.08s ease, background 0.1s ease, box-shadow 0.1s ease;
}
.tbtn::before { content: ""; display: block; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
/* Held (or switched on): gold, pressed in. */
#touch .held { background: var(--yellow); color: var(--ink); transform: scale(0.92); box-shadow: inset 0 0 0 2.5px #fff, 0 0 0 4px rgba(255, 204, 46, 0.4); }
/* In a match the menu is just a small pause icon in the top-left corner, out of the way of the view
   (44px: the smallest comfortable tap target). */
#touch-pause {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
}
#touch-pause::before { content: none; }
#touch-pause svg { width: 17px; height: 17px; fill: currentColor; }
/* The round / wave label makes room: beside the icon, or under it on tall phone screens. */
body.touch[data-screen="play"] .hud-info { padding-left: 48px; }
/* On phones the prompt and between-round pills can be tapped (hud.js); a thumb needs a bigger crosshair. */
body.touch .prompt, body.touch .between { pointer-events: auto; cursor: pointer; }
body.touch .cross { --tap: 1.23; }
body.touch .assistpop { top: calc(57% + 54px); }
body.touch .spectate { bottom: auto; top: 40%; }
/* The between-round pill sits just above the crosshair: under the kill feed, clear of the round banner. */
body.touch .between { top: calc(50% - 56px); }
body.touch .between.low { top: calc(50% + 24px); }
/* The kill feed moves to the left under the health bar, clear of the ammo counter under the minimap,
   and shows three rows at most. */
body.touch .killfeed { position: fixed; left: calc(16px + env(safe-area-inset-left)); top: calc(200px + env(safe-area-inset-top)); justify-items: start; }
body.touch .killfeed p { height: 25px; padding: 0 8px; font-size: 12px; }
body.touch .kf-gun { width: 40px; height: 19px; }
body.touch .killfeed p:nth-child(n + 4) { display: none; }
/* The stick: a soft well with a ring, and a chunky knob (main.js moves it). */
#stick {
  position: absolute;
  left: calc(20px + env(safe-area-inset-left));
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 32, 58, 0.1) 0 38%, rgba(18, 32, 58, 0.34) 70%, rgba(18, 32, 58, 0.46));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6), 0 0 0 1.5px rgba(18, 32, 58, 0.3);
}
#stick::before { content: ""; position: absolute; inset: 21%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.3); }
.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 34%, #fff 0 45%, #dfe8f5);
  box-shadow: inset 0 -4px 0 #c3cfe0, 0 0 0 2.5px var(--ink), 0 5px 0 2.5px rgba(18, 32, 58, 0.4);
}
.touch-cluster {
  position: absolute;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 64px 64px 96px;
  grid-template-areas:
    "use reload alt"
    ". jump fire";
  gap: 10px;
  align-items: end;
  justify-items: center;
}
#touch-use { --ico: var(--i-use); grid-area: use; width: 64px; height: 64px; background: radial-gradient(circle at 50% 30%, #4ade80, var(--green) 70%); box-shadow: inset 0 0 0 2.5px #fff, 0 4px 0 var(--green-dark); }
#hud[data-use="loadout"] ~ #touch #touch-use { --ico: var(--i-loadout); }
#hud[data-use="shop"] ~ #touch #touch-use { --ico: var(--i-shop); }
#hud[data-use="enter"] ~ #touch #touch-use, #hud[data-use="exit"] ~ #touch #touch-use { --ico: var(--i-enter); }
#touch-reload { --ico: var(--i-reload); grid-area: reload; width: 60px; height: 60px; }
#touch-alt { --ico: var(--i-aim); grid-area: alt; width: 72px; height: 72px; }
#touch-jump { --ico: var(--i-jump); grid-area: jump; width: 72px; height: 72px; }
#touch-fire {
  --ico: var(--i-fire);
  grid-area: fire;
  width: 98px;
  height: 98px;
  background: radial-gradient(circle at 50% 30%, #ff7b83, var(--red) 70%);
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  text-shadow: 0 1.5px 0 rgba(18, 32, 58, 0.45);
  box-shadow: inset 0 0 0 3px #fff, 0 5px 0 var(--red-dark);
}
#touch-fire::before { width: 34px; height: 34px; }
#touch-fire.held { background: radial-gradient(circle at 50% 30%, #ffa0a6, #ff5f68 70%); color: #fff; box-shadow: inset 0 0 0 3px #fff, 0 0 0 5px rgba(255, 75, 85, 0.35); }
body.soccer #touch-fire { --ico: var(--i-kick); }
/* The alternate fire's picture follows what it does (hud.js puts the weapon's alt on #hud). */
#hud[data-alt="chip"] ~ #touch #touch-alt { --ico: var(--i-chip); }
#hud[data-alt="throwKnife"] ~ #touch #touch-alt, #hud[data-alt="throwSpear"] ~ #touch #touch-alt, #hud[data-alt="paintnade"] ~ #touch #touch-alt { --ico: var(--i-throw); }
#hud[data-alt="dash"] ~ #touch #touch-alt, #hud[data-alt="lunge"] ~ #touch #touch-alt { --ico: var(--i-dash); }
#hud[data-alt="leapSlam"] ~ #touch #touch-alt { --ico: var(--i-slam); }
#hud[data-alt="block"] ~ #touch #touch-alt, #hud[data-alt="deflect"] ~ #touch #touch-alt { --ico: var(--i-shield); }
#hud[data-alt="build"] ~ #touch #touch-alt { --ico: var(--i-build); }
#hud[data-alt="slowHeal"] ~ #touch #touch-alt { --ico: var(--i-heal); }
#hud[data-alt="detonate"] ~ #touch #touch-alt { --ico: var(--i-boom); }
#hud[data-alt="portal"] ~ #touch #touch-alt { --ico: var(--i-portal); }
#hud[data-alt="airblast"] ~ #touch #touch-alt, #hud[data-alt="bouncy"] ~ #touch #touch-alt, #hud[data-alt="spin"] ~ #touch #touch-alt, #hud[data-alt="fan"] ~ #touch #touch-alt, #hud[data-alt="rev"] ~ #touch #touch-alt { --ico: var(--i-spark); }
/* Aim is a switch: a light on the button says whether it's on. */
#hud[data-alt="aim"] ~ #touch #touch-alt::after { content: ""; position: absolute; top: 9px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); box-shadow: 0 0 0 1.5px var(--ink); }
#hud[data-alt="aim"] ~ #touch #touch-alt.held::after { background: var(--green); box-shadow: 0 0 0 1.5px var(--ink), 0 0 8px 2px rgba(34, 197, 94, 0.8); }
body.touch .hud-bottom { bottom: calc(160px + env(safe-area-inset-bottom)); }
body.touch .hp-block { position: fixed; left: calc(16px + env(safe-area-inset-left)); top: calc(120px + env(safe-area-inset-top)); width: 180px; }
body.touch .hp-icon { width: 32px; height: 32px; margin-right: -10px; }
body.touch .hp-icon svg { width: 19px; height: 19px; }
body.touch .hp { height: 24px; }
body.touch .hp b { font-size: 18px; }
body.touch .hp-name { margin-bottom: 4px; font-size: 13px; }
/* Phones keep the status chips to their pictures, in one row (the kill feed sits right under them). */
body.touch .status { flex-wrap: nowrap; gap: 4px; margin-top: 6px; }
body.touch .hud-st { width: 24px; height: 24px; padding: 0; justify-content: center; font-size: 0; }
body.touch .hud-st svg { width: 15px; height: 15px; }
body.touch .ammo-block { position: fixed; right: calc(16px + env(safe-area-inset-right)); bottom: calc(196px + env(safe-area-inset-bottom)); min-width: 0; }
body.touch .ammo b { font-size: 38px; }
body.touch .ammo span { font-size: 17px; }
body.touch .weapon-name { margin-top: 5px; font-size: 16px; }
body.touch .alt-ready { display: none; }
body.touch .ammo-block .bar { width: 100px; height: 8px; margin-top: 6px; }
body.touch .hud-bottom { justify-content: center; }
body.touch .slot { width: 92px; height: 56px; padding: 4px 7px 9px; border-radius: 13px; }
body.touch .slot-art svg, body.touch .slot-art .glyph-fused { max-height: 28px; }
body.touch .slot-name { font-size: 11px; }
body.touch .slot-ammo { font-size: 13px; }
body.touch .slot-meter { width: 36px; height: 36px; margin-left: -18px; }
body.touch .slot kbd { display: none; }
body.touch .map-frame { width: 84px; height: 84px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink), 0 5px 0 5px rgba(18, 32, 58, 0.3); }
body.touch .map-n { top: -9px; width: 16px; height: 16px; font-size: 10px; }
body.touch .hud-big { font-size: 24px; }
body.touch .hud-info .hud-big, body.touch .hud-info .hud-small { margin-top: 0; }
/* Touch screens leave the tower's floor cells out: the health bar sits right under the floor lines. */
body.touch .hud-info .hud-floors { display: none; }
body.touch .prompt { bottom: 46%; }

/* Zombie Tower's weapon pick (ui/tower.js, menus.css): just the cards, and the pause icon above them. */
body.picking #hud, body.picking #lookpad, body.picking #stick, body.picking .touch-cluster { display: none; }

/* Lobby on touch: just walk and jump; the lobby bar owns the bottom of the screen. */
body[data-screen="lobby"] #touch-pause,
body[data-screen="lobby"] #touch-fire,
body[data-screen="lobby"] #touch-alt,
body[data-screen="lobby"] #touch-reload { display: none; }
body.touch[data-screen="lobby"] #stick { bottom: calc(196px + env(safe-area-inset-bottom)); width: 116px; height: 116px; }
body.touch[data-screen="lobby"] .touch-cluster { bottom: calc(206px + env(safe-area-inset-bottom)); grid-template-columns: 70px; grid-template-areas: "use" "jump"; }

/* Portrait phones: slots above the thumb controls, ammo under the minimap. */
@media (max-aspect-ratio: 1/1) {
  body.touch .hud-bottom { bottom: calc(212px + env(safe-area-inset-bottom)); }
  body.touch .slots { gap: 6px; }
  body.touch .slot { width: min(80px, calc((100vw - 54px) / 4)); height: 54px; }
  body.touch .slot-name { font-size: 10.5px; }
  /* (The Game Owner's messages, live.css, come in under the health bar and the ammo: from 214 px down.) */
  body.touch .ammo-block { top: calc(132px + env(safe-area-inset-top)); bottom: auto; }
  body.touch .hp-block { top: calc(100px + env(safe-area-inset-top)); width: 150px; }
  body.touch[data-screen="play"] .hud-info { padding: 48px 0 0; }
  body.touch[data-screen="play"] .hud-mode { display: none; }
  body.touch[data-screen="play"] .hud-big { font-size: 21px; }
  body.touch[data-screen="play"] .hp-block { top: calc(104px + env(safe-area-inset-top)); }
  body.touch .banner { top: 23%; }
  /* Tower squads: smaller pips between the pause icon and the minimap; the floor lines get a little room. */
  body.touch .hud-squad { gap: 9px; padding: 6px 8px; }
  body.touch .hud-squad i { width: 24px; height: 24px; font-size: 13px; }
  body.touch .hud-squad i::before { inset: -4px; }
  body.touch.tower[data-screen="play"] .hp-block { top: calc(112px + env(safe-area-inset-top)); }
}

@media (max-width: 900px) {
  .slot { width: 104px; }
  .hud-score { top: 0; }
  .score-team { min-width: 58px; padding: 3px 6px 5px; }
  .score-team b { font-size: 25px; }
  .score-mid { min-width: 58px; padding: 4px 8px; }
  .score-mid b { font-size: 23px; }
  .score-mid span { font-size: 10px; line-height: 1.1; letter-spacing: 0.06em; text-align: center; white-space: normal; }
  .killfeed p { font-size: 12px; }
  .hp-block { width: 200px; }
  .banner-rays { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
}
/* Upright phones: the score box squeezes between the round label and the minimap. */
@media (max-width: 440px) {
  .hud-score { gap: 4px; }
  .score-team { min-width: 52px; padding: 3px 5px 5px; }
  .pips { gap: 2px; }
  .pips i { width: 6px; height: 10px; }
  /* Three teams: four tiles in the same room. */
  .hud-score.trio { gap: 3px; }
  .hud-score.trio .score-team { min-width: 40px; padding: 3px 3px 5px; }
  .hud-score.trio .score-team em { padding: 0 3px; font-size: 8px; letter-spacing: 0.02em; }
  .hud-score.trio .score-mid { min-width: 40px; padding: 4px 5px; }
  .hud-score.trio .score-mid span { display: none; }
}
/* Narrow phones (360 and 375 wide): the score box must clear the minimap and the round label, four slots
   must fit, and the kill feed keeps two rows so the between-round pill fits under it. */
@media (max-width: 380px) {
  body.touch .map-frame { width: 64px; height: 64px; }
  .score-team { min-width: 46px; padding: 3px 3px 5px; }
  .score-team em { padding: 0 3px; font-size: 9.5px; letter-spacing: 0.04em; }
  .score-mid { min-width: 46px; padding: 4px 7px; }
  .score-mid span { display: none; }
  .pips i { width: 5px; height: 9px; }
  body.touch[data-screen="play"] .hud-big { font-size: 18px; }
  body.touch .hp-block { width: 140px; }
  body.touch .banner { top: 29%; }
  body.touch .killfeed p:nth-child(n + 3) { display: none; }
}
@media (max-height: 520px) {
  #stick { width: 104px; height: 104px; }
  .stick-knob { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .touch-cluster { grid-template-columns: 60px 56px 82px; gap: 8px; }
  #touch-fire { width: 82px; height: 82px; font-size: 15px; }
  #touch-fire::before { width: 28px; height: 28px; }
  #touch-alt, #touch-jump { width: 60px; height: 60px; }
  #touch-reload { width: 52px; height: 52px; font-size: 10.5px; }
  #touch-use { width: 58px; height: 58px; font-size: 11px; }
  .tbtn::before { width: 21px; height: 21px; }
  body.touch .hud-bottom { bottom: calc(10px + env(safe-area-inset-bottom)); }
  body.touch .slots { margin-left: 120px; margin-right: 210px; }
  body.touch .slot { height: 50px; }
  body.touch .slot-art svg, body.touch .slot-art .glyph-fused { max-height: 24px; }
  body.touch .hp-block { top: calc(64px + env(safe-area-inset-top)); }
  body.touch .killfeed { top: calc(150px + env(safe-area-inset-top)); }
  body.touch .ammo-block { top: calc(108px + env(safe-area-inset-top)); bottom: auto; }
  body.touch .ammo b { font-size: 30px; }
  body.touch .ammo span { font-size: 15px; }
  /* A tower's stairs: low enough under the crosshair to clear the STAIRS sign in the doorway. */
  body.touch .between.low { top: calc(50% + 44px); }
  body.touch[data-screen="lobby"] #stick { bottom: calc(132px + env(safe-area-inset-bottom)); width: 104px; height: 104px; }
  body.touch[data-screen="lobby"] .touch-cluster { bottom: calc(132px + env(safe-area-inset-bottom)); }
  /* In a tower the floor and monsters-left lines need the room above the health bar, so the tower's name
     goes, as it does on upright phones. */
  body.touch.tower[data-screen="play"] .hud-mode { display: none; }
}
/* Tablets held upright: there is room for bigger slots, health bar and minimap. */
@media (min-width: 700px) and (max-aspect-ratio: 1/1) {
  body.touch .slot { width: 120px; height: 64px; }
  body.touch .slot-art svg, body.touch .slot-art .glyph-fused { max-height: 32px; }
  body.touch .slot-name { font-size: 12.5px; }
  body.touch .hp-block, body.touch[data-screen="play"] .hp-block { width: 240px; }
  body.touch .map-frame { width: 120px; height: 120px; }
  body.touch .ammo-block { top: calc(160px + env(safe-area-inset-top)); }
  body.touch .hud-big, body.touch[data-screen="play"] .hud-big { font-size: 30px; }
  body.touch.tower[data-screen="play"] .hp-block { top: calc(124px + env(safe-area-inset-top)); }
  body.touch .killfeed { top: calc(220px + env(safe-area-inset-top)); }
}
/* Under 400px the lobby bar stacks its buttons three and three (menus.css), so the stick and Jump sit higher. */
@media (max-width: 400px) and (min-height: 501px) {
  body.touch[data-screen="lobby"] #stick { bottom: calc(262px + env(safe-area-inset-bottom)); }
  body.touch[data-screen="lobby"] .touch-cluster { bottom: calc(272px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- the owner's powers (Admin Panel) */

/* Which powers are on, bottom left above the health bar, with the keys for flying (computers; hud.js). */
.hud-powers {
  position: absolute;
  left: calc(18px + env(safe-area-inset-left));
  bottom: calc(126px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  max-width: min(440px, 60vw);
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(59, 7, 100, 0.92), rgba(109, 40, 217, 0.88));
  box-shadow: inset 0 0 0 2px rgba(255, 194, 58, 0.9), 0 3px 0 rgba(18, 32, 58, 0.45);
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
  line-height: 20px;
  pointer-events: none;
}
.hud-powers i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ffc23a; }
.hud-powers i svg { width: 14px; height: 14px; fill: #3b0764; }
.hud-powers span + span::before { content: "·"; margin-right: 6px; color: #ffc23a; }
.hud-powers kbd { min-width: 0; padding: 0 5px; font-size: 11px; line-height: 16px; box-shadow: none; }
/* In the lobby there's no health bar; the pill sits just above the lobby's menu bar. */
#hud[data-kind="lobby"] .hud-powers { bottom: calc(128px + env(safe-area-inset-bottom)); }

/* Phones: while flying, a Down button sits beside Jump (main.js shows it; held Jump goes up). */
#touch-down { --ico: var(--i-down); grid-area: down; width: 60px; height: 60px; background: radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.85), rgba(76, 29, 149, 0.85) 72%); box-shadow: inset 0 0 0 2.5px #ffc23a, 0 4px 0 rgba(18, 32, 58, 0.35); }
.touch-cluster { grid-template-areas: "use reload alt" "down jump fire"; }
body.touch[data-screen="lobby"].flying .touch-cluster { grid-template-columns: 64px 70px; grid-template-areas: ". use" "down jump"; }
@media (max-height: 520px) {
  #touch-down { width: 52px; height: 52px; }
}
/* Upright phones: the cell left of Jump is over the stick, so in a match Down takes the Use button's place
   above it (main.js hides it while Use is up). */
@media (max-aspect-ratio: 1/1) {
  body.touch[data-screen="play"] #touch-down { grid-area: use; }
}
