:root {
  --ink: #121a1f;
  --ink-2: #0a0f12;
  --bone: #f0e6d2;
  --orange: #e8622a;
  --amber: #f5b93b;
  --teal: #2e7e8c;
  --red: #8c2b2b;
  --pad: clamp(8px, 1.15vw, 18px);
  --wave-w: clamp(145px, 18vw, 270px);
  --wave-h: calc(var(--wave-w) / 3);
  --display: "Big Shoulders", "Archivo", sans-serif;
  --text: "Archivo", sans-serif;
  --mono: "Chivo Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink-2);
  color: var(--bone);
  font-family: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: none;
}

button { font: inherit; color: inherit; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--ink-2);
}

#app::before {
  content: "";
  position: absolute;
  inset: -60px;
  background-image: url("assets/scene/arena_floor.webp");
  background-position: center;
  background-size: cover;
  filter: blur(26px) brightness(.34) saturate(.9);
  transform: scale(1.12);
  pointer-events: none;
}

#app::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(10,15,18,0) 38%, rgba(10,15,18,.72) 100%),
    linear-gradient(to bottom, rgba(10,15,18,.35), rgba(10,15,18,0) 30%, rgba(10,15,18,0) 68%, rgba(10,15,18,.55));
  pointer-events: none;
}

#stage-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background:
    radial-gradient(rgba(232,98,42,.16) 28%, transparent 31%) 0 0 / 7px 7px,
    radial-gradient(ellipse at 50% 50%, #1d2a31 0%, #121a1f 55%, #0a0f12 100%);
}

#stage {
  width: 100%;
  height: 100%;
}

#stage canvas {
  display: block;
}

#stage-wrap canvas { cursor: default; }
#app.running #stage-wrap canvas { cursor: none; }

#dimmer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(58% 62% at 50% 48%, rgba(6,10,14,.05) 0%, rgba(6,10,14,.55) 62%, rgba(6,10,14,.9) 100%),
    linear-gradient(rgba(20,30,40,.28), rgba(8,12,18,.62));
  transition: opacity .6s linear;
}

#vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 16vmin rgba(4,8,10,.8);
  background: radial-gradient(120% 110% at 50% 50%, rgba(0,0,0,0) 58%, rgba(0,0,0,.55) 100%);
}

#grain {
  position: absolute;
  inset: -60px;
  z-index: 6;
  pointer-events: none;
  background-image: url("assets/grain.png");
  background-size: 256px 256px;
  opacity: .6;
  mix-blend-mode: overlay;
  animation: grainShift .45s steps(3) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-18px, 12px); }
  66% { transform: translate(14px, -16px); }
  100% { transform: translate(0, 0); }
}

#hurt-flash {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(105% 90% at 50% 50%, rgba(140,43,43,0) 38%, rgba(140,43,43,.8) 82%, rgba(232,98,42,.9) 100%);
  transition: opacity .32s ease-out;
}

#hurt-flash.on { opacity: 1; transition: opacity .04s linear; }

#app.lowhp #vignette {
  animation: lowPulse 1.15s steps(2, end) infinite;
  box-shadow: inset 0 0 24vmin rgba(140,43,43,.55);
}

@keyframes lowPulse {
  0%, 100% { opacity: .62; }
  50% { opacity: 1; }
}

/* ---------- brand ---------- */

#brand {
  position: absolute;
  top: max(6px, 1.2vh);
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  pointer-events: none;
  width: min(52vw, 780px);
  transition: width .36s cubic-bezier(.66, 0, .34, 1), top .36s cubic-bezier(.66, 0, .34, 1);
}

#brand img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 5px 0 rgba(6,10,13,.35));
}

#app.running #brand { display: none; }
.title-mode #hud-bottom { display: none; }

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

#hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.plate { position: absolute; }

.chyron, .health-plate, .roster, .wave-plate, .score-plate, .live-plate {
  transition: opacity .16s linear;
}

#app.hud-fade .chyron,
#app.hud-fade .health-plate,
#app.hud-fade .roster,
#app.hud-fade .wave-plate,
#app.hud-fade .score-plate,
#app.hud-fade .live-plate {
  opacity: .18;
}

.plate-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.wave-plate {
  top: var(--pad);
  left: var(--pad);
  width: var(--wave-w);
}

.wave-copy {
  position: absolute;
  left: 44%;
  right: 8%;
  top: 24%;
  bottom: 28%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: .6em;
  color: var(--ink);
}

.wave-kicker {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(7px, .7vw, 10px);
  letter-spacing: .14em;
  line-height: 1;
}

.wave-num {
  font-family: var(--mono);
  font-weight: 800;
  font-size: calc(var(--wave-w) * .115);
  line-height: 1;
  letter-spacing: .01em;
  text-shadow: 1px 1px 0 rgba(232,98,42,.5);
}

.score-plate {
  top: calc(var(--pad) + var(--wave-h) + clamp(5px, .8vh, 10px));
  left: var(--pad);
  width: clamp(118px, 14vw, 212px);
}

.score-label {
  position: absolute;
  left: 12.5%;
  top: 19%;
  bottom: 19%;
  width: 31.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(7px, .78vw, 11px);
  letter-spacing: .04em;
  color: var(--ink);
}

.score-value {
  position: absolute;
  left: 52.5%;
  right: 16%;
  top: 19%;
  bottom: 19%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(7px, .9vw, 13px);
  line-height: 1;
  letter-spacing: 0;
}

.digit {
  display: inline-block;
  width: .64em;
  height: 1em;
  overflow: hidden;
  position: relative;
}

.digit .strip {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  transition: transform .2s steps(3, end);
}

.digit .strip span {
  display: block;
  height: 1em;
  line-height: 1em;
  text-align: center;
}

.live-plate {
  top: var(--pad);
  right: var(--pad);
  width: clamp(92px, 11.5vw, 174px);
}

.live-dot {
  position: absolute;
  left: 8.6%;
  top: 31%;
  width: 15.5%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 2px rgba(18,26,31,.55), 0 0 14px rgba(232,98,42,.8);
  animation: liveBlink 2.4s step-end infinite;
}

@keyframes liveBlink {
  0%, 68% { opacity: 1; }
  69%, 100% { opacity: .12; }
}

.live-word {
  position: absolute;
  left: 33%;
  right: 5%;
  top: 20%;
  bottom: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(12px, 1.55vw, 24px);
  letter-spacing: .1em;
  color: var(--ink);
}

#hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(8px, 1.3vw, 20px);
  padding: 0 var(--pad) var(--pad);
}

.hud-bottom-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(5px, .9vh, 12px);
  min-width: 0;
  flex: 1 1 auto;
  max-width: 900px;
}

.health-plate {
  position: relative;
  width: clamp(185px, 24vw, 330px);
  transition: transform .1s linear;
}

.health-plate.hit { transform: translateX(3px) rotate(-.4deg); }

.health-kicker {
  position: absolute;
  left: 1.2%;
  top: 6%;
  bottom: 6%;
  width: 19%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(6px, .62vw, 9px);
  letter-spacing: .1em;
  color: var(--ink);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.health-blocks {
  position: absolute;
  left: 22%;
  right: 4%;
  top: 24%;
  bottom: 24%;
  display: flex;
  gap: clamp(1px, .16vw, 3px);
}

.health-block {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid rgba(18,26,31,.85);
  background: rgba(18,26,31,.9);
  position: relative;
  transition: background .12s linear, transform .12s linear;
}

.health-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(10,15,18,.22) 30%, transparent 32%);
  background-size: 3px 3px;
  opacity: .55;
}

.health-block.full {
  background: var(--orange);
  box-shadow: inset 0 2px 0 rgba(245,185,59,.6);
}

.health-block.full.low { background: var(--amber); }
.health-block.dropping { transform: scaleY(.25); background: var(--bone); }

.chyron {
  position: relative;
  width: 100%;
  max-width: 840px;
  height: clamp(86px, 10.6vw, 158px);
}

.chyron-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  -webkit-user-drag: none;
}

.chyron-copy {
  position: absolute;
  left: 31%;
  right: 10%;
  top: 14%;
  bottom: 15%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  color: var(--ink);
}

.chyron-kicker {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(7px, .82vw, 12px);
  letter-spacing: .14em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: .35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chyron-main {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 2.65vw, 40px);
  line-height: .88;
  letter-spacing: .01em;
  text-transform: uppercase;
  overflow: hidden;
}

.chyron.stamp .chyron-main { animation: stampIn .22s steps(2, end); }

@keyframes stampIn {
  0% { transform: translateY(-.18em) scale(1.06); opacity: .2; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.chyron-timer {
  position: absolute;
  right: 3.4%;
  top: 17%;
  bottom: 17%;
  width: 9%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(16px, 2.1vw, 32px);
  color: var(--ink);
}

.roster {
  display: flex;
  gap: clamp(4px, .55vw, 9px);
  flex: 0 0 auto;
  align-items: flex-end;
}

.ccard {
  position: relative;
  width: clamp(64px, 8.1vw, 128px);
  aspect-ratio: 449 / 224;
  overflow: hidden;
  box-shadow: 3px 3px 0 rgba(8,12,16,.55);
}

.ccard-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  -webkit-user-drag: none;
}

.ccard-portrait {
  position: absolute;
  left: 8.2%;
  top: 21%;
  width: 33%;
  height: 65%;
  overflow: hidden;
  background: #d95a26;
}

.ccard-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 8%;
  transform: scale(1.35);
  transform-origin: 50% 22%;
}

.ccard-tag {
  position: absolute;
  left: 45.5%;
  top: 7%;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(6px, .68vw, 10px);
  letter-spacing: .06em;
  color: var(--ink);
}

.ccard-name {
  position: absolute;
  left: 45.5%;
  top: 27%;
  width: 48%;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(9px, 1.15vw, 18px);
  line-height: 1;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ccard-num {
  position: absolute;
  left: 45.5%;
  top: 51%;
  width: 48%;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(5px, .55vw, 8px);
  letter-spacing: .02em;
  color: rgba(18,26,31,.72);
  white-space: nowrap;
  overflow: hidden;
}

.ccard-lives {
  position: absolute;
  left: 44.5%;
  bottom: 1.5%;
  display: flex;
  align-items: center;
  gap: .18em;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(9px, 1.12vw, 18px);
  line-height: 1;
  color: var(--bone);
}

.ccard-lives .heart { color: var(--orange); text-shadow: 1px 1px 0 rgba(18,26,31,.5); }

.ccard.open .ccard-bg { opacity: .32; filter: grayscale(.55) contrast(.9); }
.ccard.open::after {
  content: "";
  position: absolute;
  inset: 7%;
  border: 2px dashed rgba(240,230,210,.5);
}

.open-word {
  position: absolute;
  left: 40%;
  right: 4%;
  top: 30%;
  bottom: 26%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(9px, 1.1vw, 18px);
  letter-spacing: .08em;
  color: var(--bone);
  text-shadow: 1px 1px 0 rgba(8,12,16,.85);
}

/* ---------- in-game buttons ---------- */

.in-game-btn, .icon-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  -webkit-user-drag: none;
}

#pause-btn {
  position: absolute;
  top: var(--pad);
  right: calc(var(--pad) + clamp(92px, 11.5vw, 174px) + clamp(6px, .9vw, 14px));
  width: clamp(34px, 3.5vw, 52px);
  z-index: 14;
  display: none;
  filter: drop-shadow(2px 3px 0 rgba(8,12,16,.6));
  transition: transform .1s linear;
}

#pause-btn:active { transform: translateY(2px); }
#app.running #pause-btn { display: block; }
#app.running.paused #pause-btn, #app.running.dead #pause-btn { display: none; }

#pause-btn img { width: 100%; height: auto; display: block; }

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

#touch-layer {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

#app.touch-enabled.running #touch-layer { pointer-events: auto; }

.stick {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(92px, 13vw, 136px);
  height: clamp(92px, 13vw, 136px);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .18s linear;
  pointer-events: none;
}

.stick.active { opacity: .92; }

.stick-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(240,230,210,.7);
  box-shadow: 0 0 0 4px rgba(18,26,31,.55), inset 0 0 0 2px rgba(18,26,31,.5);
  background: radial-gradient(circle, rgba(240,230,210,.08), rgba(240,230,210,.02) 66%, rgba(240,230,210,0));
}

.stick-nub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  height: 44%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--orange);
  border: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(245,185,59,.55);
}

.stick-word {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--bone);
  white-space: nowrap;
  text-shadow: 0 1px 0 var(--ink);
}

/* ---------- reticle ---------- */

#reticle {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  z-index: 11;
  pointer-events: none;
  display: none;
  opacity: .95;
}

#app.running #reticle { display: block; }
#app.touch-enabled #reticle { display: none; }

.ret-ring {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 2px solid var(--bone);
  box-shadow: 0 0 0 1px var(--ink), 0 0 10px rgba(232,98,42,.55);
}

.ret-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--orange);
  box-shadow: 0 0 0 1px var(--ink);
}

.ret-line {
  position: absolute;
  background: var(--bone);
  box-shadow: 0 0 0 1px var(--ink);
}

.ret-line.h { left: 0; top: 50%; width: 7px; height: 2px; margin-top: -1px; }
.ret-line.h::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 0;
  width: 7px;
  height: 2px;
  background: var(--bone);
  box-shadow: 0 0 0 1px var(--ink);
}
.ret-line.v { top: 0; left: 50%; width: 2px; height: 7px; margin-left: -1px; }
.ret-line.v::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 0;
  width: 2px;
  height: 7px;
  background: var(--bone);
  box-shadow: 0 0 0 1px var(--ink);
}

/* ---------- screens ---------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(12px, 4vh, 54px) 12px clamp(12px, 5vh, 64px);
  pointer-events: none;
}

.screen > * { pointer-events: auto; }

#title-screen {
  background:
    linear-gradient(to bottom, rgba(8,12,16,.18), rgba(8,12,16,0) 34%, rgba(8,12,16,.28) 62%, rgba(8,12,16,.72) 100%);
}

.title-plate, .pause-plate, .gameover-plate {
  position: relative;
  width: min(660px, 94vw);
  background-color: var(--bone);
  background-image:
    radial-gradient(rgba(18,26,31,.12) 1px, transparent 1.3px),
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(18,26,31,.06));
  background-size: 5px 5px, 100% 100%;
  border: 3px solid var(--ink);
  box-shadow: 9px 9px 0 var(--orange), 12px 12px 0 rgba(8,12,16,.5);
  color: var(--ink);
  padding: clamp(12px, 2.6vh, 26px) clamp(14px, 3vw, 34px);
  text-align: center;
}

.title-kicker, .pause-kicker, .go-kicker {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(8px, .82vw, 11px);
  letter-spacing: .18em;
  color: #9c3a17;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8em;
}

.tick {
  display: inline-block;
  width: 1.8em;
  height: 3px;
  background: var(--orange);
}

.title-sub {
  margin-top: .55em;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(14px, 2.1vw, 30px);
  line-height: .95;
  letter-spacing: .03em;
}

.mode-row {
  display: flex;
  gap: 6px;
  margin: clamp(8px, 1.6vh, 16px) auto 0;
  width: min(430px, 100%);
}

.mode-btn {
  flex: 1 1 0;
  min-height: 36px;
  border: 3px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(13px, 1.5vw, 21px);
  letter-spacing: .06em;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 3px 3px 0 rgba(18,26,31,.25);
  transition: background .08s linear, color .08s linear, transform .08s linear;
}

.mode-btn.selected { background: var(--orange); box-shadow: 3px 3px 0 var(--ink); }
.mode-btn:active { transform: translate(2px, 2px); box-shadow: none; }

.mode-note {
  margin-top: .55em;
  font-family: var(--text);
  font-weight: 600;
  font-size: clamp(8px, .86vw, 11px);
  letter-spacing: .02em;
  color: rgba(18,26,31,.75);
}

.big-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  width: 100%;
  min-height: clamp(46px, 6.4vh, 64px);
  margin-top: clamp(8px, 1.5vh, 15px);
  border: 3px solid var(--ink);
  background: var(--ink);
  color: var(--bone);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(19px, 2.5vw, 34px);
  letter-spacing: .05em;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 5px 5px 0 var(--orange);
  transition: transform .08s linear, box-shadow .08s linear, background .08s linear;
}

.big-btn img { width: 1.15em; height: auto; filter: drop-shadow(0 0 0 transparent); }
.big-btn:hover { background: var(--teal); }
.big-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--orange); }

.controls-hint {
  margin-top: .8em;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(7px, .76vw, 10px);
  letter-spacing: .04em;
  color: rgba(18,26,31,.78);
  line-height: 1.35;
}

.title-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8em;
  margin-top: .65em;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(8px, .82vw, 11px);
  letter-spacing: .08em;
  color: var(--ink);
}

.title-foot b { color: #9c3a17; }
.foot-sep { width: 1px; height: 1.1em; background: rgba(18,26,31,.4); }

.sound-btn {
  position: absolute;
  right: clamp(10px, 2.5vw, 26px);
  bottom: clamp(10px, 2.5vw, 26px);
  width: clamp(38px, 3.6vw, 54px);
  filter: drop-shadow(2px 3px 0 rgba(8,12,16,.5));
  z-index: 2;
}

.sound-btn img { width: 100%; height: auto; display: block; }

/* pause */

#pause-screen {
  align-items: center;
  background: rgba(6,10,13,.55);
  backdrop-filter: blur(2px);
}

.pause-plate { width: min(460px, 92vw); }

.pause-title {
  margin: .1em 0 .05em;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 8vw, 96px);
  line-height: .8;
  letter-spacing: .02em;
  text-shadow: 4px 4px 0 var(--orange);
}

.pause-note {
  margin: .6em 0 1.1em;
  font-family: var(--text);
  font-weight: 600;
  font-size: clamp(10px, 1vw, 13px);
  color: rgba(18,26,31,.75);
}

.pause-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.pause-controls {
  margin: .9em 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(8px, .8vw, 11px);
  letter-spacing: .04em;
  color: rgba(18,26,31,.72);
  line-height: 1.4;
}

.pause-row .icon-btn { width: 44px; flex: 0 0 auto; }
.pause-row .icon-btn img { width: 100%; display: block; }

.text-btn {
  min-height: 38px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(9px, .9vw, 12px);
  letter-spacing: .06em;
  cursor: pointer;
  border-radius: 2px;
}

.text-btn:hover { background: var(--ink); color: var(--bone); }

/* game over */

#gameover-screen {
  align-items: center;
  background:
    linear-gradient(to bottom, rgba(10,18,24,.35), rgba(10,18,24,.72));
}

#app.dead #stage canvas {
  filter: grayscale(.55) saturate(.55) contrast(1.08) brightness(.78) hue-rotate(-8deg);
}

#app.dead #hud { opacity: .72; filter: saturate(.65); }

.gameover-plate {
  width: min(560px, 93vw);
  animation: plateUp .34s cubic-bezier(.2,.9,.3,1) both;
}

@keyframes plateUp {
  0% { transform: translateY(58%) rotate(-.6deg); opacity: 0; }
  100% { transform: translateY(0) rotate(0); opacity: 1; }
}

.go-title {
  margin: .05em 0 .08em;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(52px, 9vw, 104px);
  line-height: .78;
  letter-spacing: .01em;
  text-shadow: 5px 4px 0 var(--orange);
}

.go-name {
  display: inline-block;
  margin-top: .5em;
  padding: .25em .7em;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(9px, .95vw, 12px);
  letter-spacing: .12em;
  transform: rotate(-1deg);
}

.go-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: clamp(10px, 1.8vh, 18px) 0 0;
  text-align: left;
}

.stat {
  border: 2px solid var(--ink);
  padding: 5px 9px 6px;
  background: rgba(240,230,210,.5);
}

.stat-k {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(6px, .68vw, 9px);
  letter-spacing: .08em;
  color: #8f3a1a;
}

.stat-v {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(22px, 3.2vw, 40px);
  line-height: .9;
  color: var(--ink);
}

.go-best {
  margin-top: .8em;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(8px, .84vw, 11px);
  letter-spacing: .08em;
  color: var(--ink);
}

.go-best.new { color: #9c3a17; font-size: clamp(10px, 1vw, 13px); }

#again-btn { margin-top: 10px; }
#title-btn { margin-top: 10px; }

/* wipe */

#wipe {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: none;
  overflow: hidden;
}

#wipe.show { display: block; }

.wipe-panel {
  position: absolute;
  left: 50%; width: min(46vw, 440px); margin-left: calc(min(46vw, 440px) / -2);
  top: auto; bottom: calc(var(--pad) + 2px); height: clamp(54px, 15vh, 130px);
  border: 3px solid var(--bone);
  box-shadow: 6px 6px 0 var(--orange);
  background: var(--ink);
  transform: translateX(-102%);
  transition: transform .22s cubic-bezier(.7, 0, .3, 1);
}

.wipe-stripe {
  position: absolute;
  top: auto;
  bottom: 0;
  height: clamp(54px, 15vh, 130px);
  right: -8%;
  display: none;
  width: 16%;
  background: var(--orange);
  transform: translateX(-102%);
  transition: transform .22s cubic-bezier(.7, 0, .3, 1);
  clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%);
}

#wipe.in .wipe-panel, #wipe.in .wipe-stripe { transform: translateX(0); }
#wipe.out .wipe-panel { transform: translateX(103%); }
#wipe.out .wipe-stripe { transform: translateX(103%); }

.wipe-copy {
  position: absolute;
  left: 50%; width: min(46vw, 440px); margin-left: calc(min(46vw, 440px) / -2);
  top: auto; bottom: calc(var(--pad) + 2px); height: clamp(54px, 15vh, 130px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: scale(1.12);
  transition: opacity .1s linear .16s, transform .18s cubic-bezier(.2,.9,.3,1) .14s;
}

#wipe.in .wipe-copy { opacity: 1; transform: scale(1); }

.wipe-kicker {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(9px, 1.2vw, 15px);
  letter-spacing: .3em;
  color: var(--orange);
  margin-bottom: .45em;
}

.wipe-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, min(6vw, 8.5vh), 84px);
  line-height: .78;
  letter-spacing: .01em;
  color: var(--bone);
  text-shadow: .04em .035em 0 var(--orange), -.012em 0 0 rgba(240,230,210,.35);
}

.wipe-sub {
  margin-top: .4em;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(13px, 2.2vw, 32px);
  letter-spacing: .06em;
  color: var(--bone);
}

.wipe-sub em { color: var(--amber); font-style: normal; }

.load-error {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 10px 16px;
  background: var(--red);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 12px;
  border: 2px solid var(--ink);
}

.hidden { display: none !important; }

/* ---------- portrait / narrow ---------- */

@media (max-aspect-ratio: 1/1) {
  :root {
    --pad: clamp(7px, 2.2vw, 14px);
    --wave-w: clamp(118px, 32vw, 154px);
    --chy-h: clamp(48px, 12.5vw, 58px);
  }

  .title-mode #hud { display: none; }

  #brand { width: min(82vw, 390px); top: max(4px, .8vh); }
  #app.running #brand { display: none; }

  .live-plate { width: clamp(88px, 23vw, 116px); }
  .score-plate { width: clamp(102px, 27vw, 138px); }

  .health-plate {
    position: fixed;
    top: calc(var(--pad) + var(--wave-h) + clamp(24px, 6.2vw, 30px));
    left: var(--pad);
    width: clamp(186px, 52vw, 240px);
    z-index: 10;
  }

  #hud-bottom {
    align-items: flex-end;
    padding-bottom: var(--pad);
  }

  .hud-bottom-left { width: 100%; max-width: none; gap: 0; }

  .roster {
    position: fixed;
    right: var(--pad);
    bottom: calc(var(--pad) + var(--chy-h) + 5px);
    top: auto;
    gap: 3px;
    z-index: 10;
  }

  .ccard { width: clamp(54px, 20vw, 78px); }
  .ccard-name, .ccard-num { display: none; }
  .ccard-tag { font-size: 8px; left: 45%; top: 10%; }
  .ccard-lives { font-size: 10px; left: 44%; }
  .open-word { font-size: 10px; }

  .chyron { height: var(--chy-h); max-width: none; }
  .chyron-copy {
    left: 17%;
    right: 12%;
    top: 5%;
    bottom: 5%;
    flex-direction: row;
    align-items: center;
  }
  .chyron-kicker { display: none; }
  .chyron-main {
    font-size: clamp(13px, 3.7vw, 17px);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .chyron-timer {
    top: 8%;
    bottom: 8%;
    right: 2.5%;
    width: 10%;
    font-size: clamp(14px, 4vw, 18px);
  }

  #pause-btn {
    right: calc(var(--pad) + clamp(88px, 23vw, 116px) + 6px);
    width: clamp(30px, 8vw, 40px);
  }

  #title-sound { display: none; }

  .screen { align-items: flex-end; padding-bottom: clamp(10px, 3vh, 26px); }
  .title-plate { width: min(700px, 95vw); }
  .mode-note { display: none; }
  .controls-hint { font-size: 8px; line-height: 1.3; }
  .gameover-plate { width: min(560px, 94vw); }
}

@media (max-height: 560px) {
  .title-plate { padding: 8px 14px; }
  .title-sub { display: none; }
  .mode-row { margin-top: 6px; }
  .mode-btn { min-height: 28px; font-size: 13px; }
  .big-btn { min-height: 42px; margin-top: 7px; font-size: 20px; }
  .controls-hint { margin-top: .45em; }
  .title-foot { margin-top: .4em; }
  .sound-btn { width: 34px; right: 10px; bottom: 10px; }
  .pause-title { font-size: 52px; }
  .go-title { font-size: 56px; }
  .go-stats { gap: 5px; margin-top: 8px; }
  .stat { padding: 3px 7px; }
  .stat-v { font-size: 24px; }
  .gameover-plate { padding-top: 8px; padding-bottom: 10px; }
  .go-best { margin-top: .5em; }
  #again-btn { margin-top: 7px; min-height: 40px; }
  #title-btn { margin-top: 7px; min-height: 32px; }
}

@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  #app.running #brand { display: none; }
  .chyron { height: clamp(56px, 17vh, 86px); max-width: 560px; }
  .chyron-main { font-size: clamp(16px, 5.2vh, 26px); }
  .wipe-sub { margin-top: .3em; font-size: clamp(12px, 4.2vh, 24px); }
}

@media (max-height: 460px) and (min-aspect-ratio: 1/1) {
  .title-kicker { font-size: 8px; }
  .title-plate { width: min(520px, 82vw); }
}

@media (pointer: coarse) {
  #sensitivity-note { display: none; }
}

.wipe-sub:empty { display: none; }

/* weapon plate */
.weapon-plate {
  position: absolute;
  top: calc(var(--pad) + clamp(30px, 3.9vw, 58px));
  right: var(--pad);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 4px 10px 5px 14px;
  background: var(--ink);
  border: 2px solid var(--bone);
  box-shadow: 3px 3px 0 var(--orange);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);
  color: var(--bone);
  line-height: 1;
  pointer-events: none;
  transition: opacity .16s linear;
}
.title-mode .weapon-plate { display: none; }
#app.hud-fade .weapon-plate { opacity: .18; }
.weapon-kicker { font-family: var(--mono); font-weight: 700; font-size: clamp(6px, .6vw, 9px); letter-spacing: .14em; color: var(--orange); }
.weapon-name { font-family: var(--display); font-weight: 800; font-size: clamp(13px, 1.5vw, 22px); letter-spacing: .04em; margin-top: 2px; }
.weapon-mods { font-family: var(--mono); font-weight: 700; font-size: clamp(7px, .7vw, 11px); color: var(--amber); margin-top: 2px; }

/* upgrade offers */
#offers {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -54%);
  z-index: 26;
  width: min(760px, 92vw);
  padding: clamp(8px, 1.4vw, 16px);
  background: rgba(18,26,31,.94);
  border: 3px solid var(--bone);
  box-shadow: 6px 6px 0 var(--orange);
  color: var(--bone);
  pointer-events: auto;
}
#offers.hidden { display: none; }
#offers.in { animation: stampIn .2s steps(2, end); }
.offers-head { display: flex; align-items: baseline; gap: 10px; }
.offers-kicker { font-family: var(--mono); font-weight: 700; font-size: clamp(8px, .9vw, 12px); letter-spacing: .2em; color: var(--orange); }
.offers-title { font-family: var(--display); font-weight: 800; font-size: clamp(20px, 2.8vw, 40px); letter-spacing: .03em; flex: 1; }
.offers-timer { font-family: var(--mono); font-weight: 800; font-size: clamp(18px, 2.4vw, 34px); color: var(--amber); }
.offer-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1vw, 14px); margin-top: clamp(6px, 1vh, 12px); }
.offer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 3px;
  min-height: 44px;
  padding: clamp(8px, 1.1vw, 14px) clamp(8px, 1vw, 12px);
  background: var(--bone);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}
.offer:active, .offer:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.offer.weapon { background: var(--orange); }
.offer-key { position: absolute; right: 7px; top: 5px; font-family: var(--mono); font-weight: 800; font-size: clamp(10px, 1vw, 14px); opacity: .6; }
.offer-tag { font-family: var(--mono); font-weight: 700; font-size: clamp(7px, .75vw, 11px); letter-spacing: .16em; color: #a33f19; }
.offer.weapon .offer-tag { color: var(--ink); }
.offer-title { font-family: var(--display); font-weight: 800; font-size: clamp(16px, 2vw, 30px); line-height: .95; letter-spacing: .02em; }
.offer-line { font-family: var(--text); font-weight: 600; font-size: clamp(9px, 1vw, 14px); line-height: 1.15; }
.offers-foot { margin-top: clamp(6px, 1vh, 10px); font-family: var(--mono); font-size: clamp(7px, .75vw, 11px); letter-spacing: .06em; opacity: .75; }
@media (max-height: 460px) {
  #offers { top: 46%; }
  .offers-foot { display: none; }
}

@media (max-width: 700px) and (min-aspect-ratio: 1/1) {
  .wipe-panel, .wipe-copy { top: auto; bottom: calc(var(--pad) + 2px); width: 52vw; margin-left: -26vw; height: clamp(48px, 15vh, 70px); }
  .wipe-title { font-size: clamp(22px, 9vh, 40px); }
  .wipe-kicker { font-size: 8px; margin-bottom: .35em; }
  .chyron-copy { left: 30%; right: 6%; }
  .chyron-kicker { display: none; }
  .chyron-main { white-space: nowrap; text-overflow: ellipsis; font-size: clamp(11px, 4vh, 16px); line-height: 1; }
  .ccard.open { width: 42px; aspect-ratio: auto; height: 32px; }
  .ccard.open .open-word { font-size: 8px; letter-spacing: .06em; left: 0; right: 0; text-align: center; }
  #hud-bottom { gap: 6px; }
}

@media (max-aspect-ratio: 1/1) {
  .wipe-panel, .wipe-copy { height: clamp(50px, 9vh, 76px); width: 60vw; margin-left: -30vw; }
  .wipe-title { font-size: clamp(24px, 5vh, 40px); }
}
#app.wiping .chyron { opacity: 0; }

/* ================= first person ================= */

#stage-wrap { background: #06090c; }
#stage canvas { display: block; width: 100% !important; height: 100% !important; }
#app::before, #app::after { display: none; }
#vignette { box-shadow: inset 0 0 12vmin rgba(4,8,10,.7); background: radial-gradient(130% 120% at 50% 50%, rgba(0,0,0,0) 62%, rgba(0,0,0,.5) 100%); }
#grain { opacity: .38; }
#app.dead #stage canvas { filter: grayscale(1) contrast(1.25) brightness(.8); transition: filter .35s steps(3); }
#hurt-flash { background: radial-gradient(ellipse at center, rgba(160,20,14,0) 40%, rgba(170,18,12,.62) 100%); }
#hurt-flash.orange { background: radial-gradient(ellipse at center, rgba(255,120,30,.45) 0%, rgba(232,98,42,.75) 100%); opacity: 1; }
#reticle { display: none !important; }

/* crosshair: four ticks whose gap is the real spread cone, an orange aim tick at the centre */
#crosshair {
  --gap: 8px;
  position: absolute; left: 0; top: 0; z-index: 12; width: 0; height: 0;
  pointer-events: none; display: none;
}
#app.running #crosshair { display: block; }
#app.paused #crosshair, #app.dead #crosshair, #app.scoped #crosshair { display: none; }
.ch-line { position: absolute; background: var(--bone); box-shadow: 0 0 0 1px rgba(10,15,18,.75); transition: transform .05s linear; }
.ch-line.l, .ch-line.r { width: 11px; height: 2px; top: -1px; }
.ch-line.t, .ch-line.b { width: 2px; height: 11px; left: -1px; }
.ch-line.l { right: var(--gap); }
.ch-line.r { left: var(--gap); }
.ch-line.t { bottom: var(--gap); }
.ch-line.b { top: var(--gap); }
.ch-dot { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; background: var(--orange); box-shadow: 0 0 0 1.5px var(--ink); }
#crosshair.on-target .ch-line { background: var(--orange); }
#crosshair.on-target .ch-dot { background: var(--amber); transform: scale(1.25); }
#crosshair.reloading .ch-line { opacity: .35; }
#app.ads #crosshair .ch-line { opacity: .55; }
.ch-hit { position: absolute; left: 0; top: 0; opacity: 0; }
.ch-hit i { position: absolute; width: 10px; height: 2.5px; background: #fff; box-shadow: 0 0 0 1px rgba(10,15,18,.7); }
.ch-hit i:nth-child(1) { transform: translate(-15px, -13px) rotate(45deg); }
.ch-hit i:nth-child(2) { transform: translate(5px, -13px) rotate(-45deg); }
.ch-hit i:nth-child(3) { transform: translate(-15px, 11px) rotate(-45deg); }
.ch-hit i:nth-child(4) { transform: translate(5px, 11px) rotate(45deg); }
#crosshair.hit .ch-hit { opacity: 1; }
#crosshair.head .ch-hit i { background: var(--amber); }
#crosshair.kill .ch-hit i { background: #ff4a2a; width: 14px; }

/* sniper scope */
#scope { position: absolute; inset: 0; z-index: 11; pointer-events: none; display: none; }
#app.scoped #scope { display: block; }
.scope-ring {
  position: absolute; left: 50%; top: 50%; width: min(86vh, 86vw); height: min(86vh, 86vw); transform: translate(-50%, -50%);
  border-radius: 50%; box-shadow: 0 0 0 200vmax #050708, inset 0 0 40px 10px rgba(0,0,0,.85);
  background:
    linear-gradient(var(--orange), var(--orange)) center / 2px 100% no-repeat,
    linear-gradient(var(--orange), var(--orange)) center / 100% 2px no-repeat;
}
.scope-ring::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--amber); border: 1.5px solid var(--ink); }

/* hit direction arcs */
#dmg-dirs { position: absolute; left: 50%; top: 50%; z-index: 12; pointer-events: none; }
.dmg-dir {
  position: absolute; left: 0; top: 0; width: 28vmin; height: 28vmin;
  border-radius: 50%; border-top: 6px solid rgba(200,28,18,.9);
  animation: dmgFade .9s linear forwards;
}
@keyframes dmgFade { 0% { opacity: 1; } 70% { opacity: .8; } 100% { opacity: 0; } }

/* kill floater */
#floater {
  position: absolute; left: 50%; top: calc(50% + 34px); z-index: 13; transform: translateX(-50%);
  font-family: var(--mono); font-weight: 800; font-size: clamp(11px, 1.4vw, 16px); letter-spacing: .12em;
  color: var(--bone); text-shadow: 1px 1px 0 var(--ink), -1px -1px 0 var(--ink);
  opacity: 0; pointer-events: none; white-space: nowrap;
}
#floater.on { opacity: 1; animation: floatUp .7s steps(6) forwards; }
#floater.head { color: var(--amber); }
#floater.warn { color: #ff7050; }
@keyframes floatUp { 0% { transform: translate(-50%, 6px); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -10px); opacity: 0; } }

/* minimap */
#minimap {
  position: absolute; z-index: 9; left: 50%; top: var(--pad); transform: translateX(-50%);
  width: clamp(120px, 13vw, 170px); height: auto; aspect-ratio: 160 / 104;
  border: 2px solid var(--bone); box-shadow: 3px 3px 0 var(--orange);
  pointer-events: none; display: none; image-rendering: auto;
}
#app.running #minimap { display: block; }

/* ammo + prize money */
#ammo-plate {
  position: absolute; z-index: 9; right: var(--pad);
  top: calc(var(--pad) + clamp(30px, 3.9vw, 58px) + clamp(44px, 4.6vw, 64px));
  padding: 3px 10px 4px; background: var(--ink); border: 2px solid var(--bone); box-shadow: 3px 3px 0 var(--orange);
  font-family: var(--mono); font-weight: 800; color: var(--bone); line-height: 1; display: none; text-align: right; pointer-events: none;
}
#app.running #ammo-plate { display: block; }
.ammo-mag { font-size: clamp(20px, 2.4vw, 34px); }
.ammo-sep, .ammo-max { font-size: clamp(11px, 1.1vw, 16px); opacity: .7; }
.ammo-state { display: block; font-size: clamp(7px, .7vw, 10px); letter-spacing: .16em; color: var(--amber); min-height: 1em; margin-top: 2px; }
#ammo-plate.low .ammo-mag { color: #ff7050; }

#cash-plate {
  position: absolute; z-index: 9; left: var(--pad);
  top: calc(var(--pad) + var(--wave-h) + clamp(5px, .8vh, 10px) + clamp(19px, 2.24vw, 34px) + 6px);
  padding: 3px 10px 4px; background: var(--bone); color: var(--ink); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--orange);
  display: none; line-height: 1; pointer-events: none;
}
#app.running #cash-plate { display: block; }
.cash-k { display: block; font-family: var(--mono); font-weight: 700; font-size: clamp(6px, .6vw, 9px); letter-spacing: .16em; color: #9c3a17; }
.cash-v { display: block; font-family: var(--mono); font-weight: 800; font-size: clamp(14px, 1.6vw, 24px); margin-top: 2px; }
#cash-plate.pop { animation: stampIn .25s steps(2, end); }

.health-block.armor { background: transparent; border-color: #8fb7c2; }
.health-block.armor.full { background: #8fb7c2; }

#lock-hint { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); z-index: 14; font-family: var(--mono); font-weight: 800; font-size: 13px; letter-spacing: .2em; color: var(--bone); background: var(--ink); padding: 6px 12px; border: 2px solid var(--bone); pointer-events: none; }

/* touch: move stick on the left, slide-to-look and buttons on the right */
.tbtn {
  position: absolute; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(18,26,31,.55); border: 3px solid rgba(240,230,210,.85);
  box-shadow: 3px 3px 0 rgba(232,98,42,.85);
  font-family: var(--display); font-weight: 800; color: var(--bone); letter-spacing: .06em;
  pointer-events: none;
}
#app.touch-enabled.running .tbtn { display: flex; }
#btn-fire { width: 84px; height: 84px; right: calc(var(--pad) + 14px + env(safe-area-inset-right)); bottom: calc(var(--pad) + 18px + env(safe-area-inset-bottom)); font-size: 20px; background: rgba(232,98,42,.55); }
#btn-fire.on { background: rgba(232,98,42,.92); transform: scale(.94); }
.tbtn.small { width: 54px; height: 54px; font-size: 12px; }
#btn-ads { right: calc(var(--pad) + 112px + env(safe-area-inset-right)); bottom: calc(var(--pad) + 44px + env(safe-area-inset-bottom)); }
#btn-ads.on { background: rgba(245,185,59,.85); color: var(--ink); }
#btn-reload { right: calc(var(--pad) + 8px + env(safe-area-inset-right)); bottom: calc(var(--pad) + 118px + env(safe-area-inset-bottom)); }
#btn-swap { right: calc(var(--pad) + 74px + env(safe-area-inset-right)); bottom: calc(var(--pad) + 108px + env(safe-area-inset-bottom)); }
.tbtn.press { background: rgba(240,230,210,.8); color: var(--ink); }
#look-hint {
  position: absolute; right: 22%; top: 46%; font-family: var(--mono); font-weight: 800; font-size: 11px; letter-spacing: .2em;
  color: var(--bone); opacity: .7; pointer-events: none; display: none; text-shadow: 1px 1px 0 var(--ink);
}
#app.touch-enabled.running #look-hint { display: block; }
#look-hint.gone { display: none !important; }
.tbtn { display: none; }

/* touch layout moves the hud cards out from under the thumbs */
#app.touch-enabled .roster { position: fixed; left: var(--pad); right: auto; bottom: auto; top: calc(var(--pad) + var(--wave-h) + clamp(5px, .8vh, 10px) + clamp(19px, 2.24vw, 34px) + 50px); gap: 3px; z-index: 10; }
#app.touch-enabled .ccard { width: clamp(54px, 7vw, 78px); }
#app.touch-enabled .ccard-name, #app.touch-enabled .ccard-num { display: none; }
#app.touch-enabled .ccard.open { width: 40px; aspect-ratio: auto; height: 30px; }
#app.touch-enabled .ccard.open .open-word { font-size: 8px; letter-spacing: .06em; left: 0; right: 0; text-align: center; }
#app.touch-enabled #hud-bottom { right: auto; }
#app.touch-enabled .hud-bottom-left { max-width: min(56vw, 520px); }

/* prize shop */
#offers { width: min(860px, 94vw); max-height: 92vh; overflow-y: auto; }
.offers-head { flex-wrap: wrap; }
.offers-cash { font-family: var(--mono); font-weight: 800; font-size: clamp(16px, 2vw, 28px); color: var(--bone); background: var(--orange); padding: 2px 8px; border: 2px solid var(--bone); }
.offer-list { grid-template-columns: repeat(3, 1fr); }
.offer-price { margin-top: auto; padding-top: 4px; font-family: var(--mono); font-weight: 800; font-size: clamp(12px, 1.3vw, 18px); color: var(--ink); }
.offer.armour { background: #cfe0e3; }
.offer.sold { opacity: .45; cursor: default; transform: none; box-shadow: 2px 2px 0 var(--ink); }
.offer.sold .offer-price { color: #2e7e8c; }
.offer.poor .offer-price { color: #a3301c; text-decoration: line-through; }
.offer.poor { filter: saturate(.5); }
.offers-bottom { display: flex; align-items: center; gap: 12px; margin-top: clamp(6px, 1vh, 10px); }
.offers-bottom .offers-foot { flex: 1; margin-top: 0; }
.big-btn.small { min-height: 40px; margin-top: 0; font-size: clamp(16px, 1.8vw, 24px); padding: 0 18px; width: auto; }

@media (max-height: 460px) {
  .offer { padding: 5px 7px; min-height: 0; }
  .offer-line { font-size: 9px; }
  .offer-title { font-size: 15px; }
  .offers-title { font-size: 18px; }
  #offers { top: 50%; transform: translate(-50%, -50%); padding: 7px 9px; }
  .offers-bottom .offers-foot { display: block; font-size: 7px; }
  #minimap { width: 104px; }
  #btn-fire { width: 74px; height: 74px; }
  .tbtn.small { width: 48px; height: 48px; font-size: 11px; }
  #btn-ads { right: calc(var(--pad) + 100px + env(safe-area-inset-right)); bottom: calc(var(--pad) + 30px); }
  #btn-reload { bottom: calc(var(--pad) + 100px); }
  #btn-swap { right: calc(var(--pad) + 64px + env(safe-area-inset-right)); bottom: calc(var(--pad) + 92px); }
}

@media (max-aspect-ratio: 1/1) {
  .offer-list { grid-template-columns: repeat(2, 1fr); }
  #minimap { left: auto; right: var(--pad); transform: none; top: calc(var(--pad) + clamp(30px, 8vw, 40px) + 54px); width: 104px; }
  #ammo-plate { top: auto; bottom: calc(var(--pad) + 150px); right: var(--pad); }
  #app.touch-enabled .hud-bottom-left { max-width: none; }
  #btn-fire { bottom: calc(var(--pad) + 84px + env(safe-area-inset-bottom)); }
  #btn-ads { bottom: calc(var(--pad) + 104px + env(safe-area-inset-bottom)); }
  #btn-reload { bottom: calc(var(--pad) + 186px + env(safe-area-inset-bottom)); }
  #btn-swap { bottom: calc(var(--pad) + 176px + env(safe-area-inset-bottom)); }
  #ammo-plate { bottom: calc(var(--pad) + 250px + env(safe-area-inset-bottom)); }
  .weapon-plate { top: calc(var(--pad) + clamp(30px, 8vw, 40px)); }
  #cash-plate { top: calc(var(--pad) + var(--wave-h) + clamp(24px, 6.2vw, 30px) + 54px); }
  #app.touch-enabled .roster { top: calc(var(--pad) + var(--wave-h) + clamp(24px, 6.2vw, 30px) + 96px); }
}
@media (max-aspect-ratio: 1/1) {
  #app.touch-enabled #hud-bottom { right: 0; }
  #app.touch-enabled .hud-bottom-left { width: 100%; max-width: none; }
}
