:root {
  --bg: #0a0a0c;
  --ink: #f1f0e8;
  --hot: #ff2ea6;
  --cyan: #00f0ff;
  --lime: #7cff00;
  --amber: #ffb300;
  --blood: #ff2030;
  --grime: #1a1a20;
  --panel: rgba(8, 8, 12, 0.82);
  --panel-line: rgba(255, 179, 0, 0.45);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  background: #050505;
  color: var(--ink);
  font-family: 'Courier New', ui-monospace, monospace;
  overflow: hidden;
  letter-spacing: 0.04em;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  display: block;
}

/* ---------- Live concurrent-player badge ---------- */
#liveCount {
  position: fixed; top: 14px; right: 16px;
  z-index: 12;
  display: flex; align-items: center; gap: 7px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.25em;
  color: var(--ink); font-size: 13px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(124, 255, 0, 0.45);
  padding: 6px 12px;
  box-shadow: 0 0 16px rgba(124, 255, 0, 0.2);
  pointer-events: none;
}
#liveCount .liveDot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: livePulse 1.4s ease-in-out infinite alternate;
}
#liveCount #liveNum { color: var(--lime); font-size: 18px; line-height: 1; }
#liveCount .liveLbl { color: rgba(255,255,255,0.7); }
@keyframes livePulse { from { opacity: 0.4; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
#liveCount.hidden { display: none !important; }

/* ---------- Side banner slots (currently hidden via inline style) ---------- */
.adSlot {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 160px; height: 600px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 11;
  overflow: hidden;
}
#adLeft  { left: 16px; }
#adRight { right: 16px; }
.adSlot.hidden { display: none !important; }
/* Always hide on narrow viewports — banners only have room ≥1280px wide. */
@media (max-width: 1279px) {
  .adSlot { display: none !important; }
}

.hidden { display: none !important; }

/* ---------- Menu ---------- */
#menu {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start;
  padding: 16px 16px 32px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 179, 0, 0.10), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(255, 46, 166, 0.08), transparent 60%),
    repeating-linear-gradient(45deg, #0a0a0a 0 14px, #0d0d0d 14px 28px);
  z-index: 10;
}
.bgGraffiti {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(255, 46, 166, 0.18), transparent 40%),
    radial-gradient(ellipse at 85% 70%, rgba(0, 240, 255, 0.14), transparent 40%),
    radial-gradient(ellipse at 50% 90%, rgba(124, 255, 0, 0.12), transparent 40%);
  mix-blend-mode: screen;
}
#logoWrap {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 4px;
}
.logoCrown {
  font-size: 32px;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 179, 0, 0.85), 0 0 28px rgba(255, 179, 0, 0.55);
  line-height: 1;
  margin-bottom: -4px;
}
#menu h1 {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 96px; margin: 0; line-height: 1;
  color: var(--ink);
  letter-spacing: 0.05em;
  /* layered shadows for chrome / depth */
  text-shadow:
    /* inner glow */
    0 0 4px rgba(255, 179, 0, 0.45),
    0 0 14px rgba(255, 179, 0, 0.32),
    /* extruded chrome */
    1px 1px 0 #c08800,
    2px 2px 0 #a06800,
    3px 3px 0 #804800,
    4px 4px 0 #602800,
    /* drop */
    7px 8px 0 rgba(0,0,0,0.85),
    10px 12px 22px rgba(0,0,0,0.7);
  transform: skewX(-6deg);
  display: flex; align-items: baseline;
}
.logoIo {
  font-size: 36px;
  color: var(--cyan);
  margin-left: 6px;
  letter-spacing: 0.05em;
  text-shadow:
    0 0 6px rgba(0, 240, 255, 0.7),
    2px 2px 0 #006670,
    4px 5px 0 rgba(0,0,0,0.7);
}
.logoUnderline {
  margin-top: 10px;
  width: 360px; height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--hot) 18%,
    var(--amber) 50%,
    var(--cyan) 82%,
    transparent 100%);
  box-shadow: 0 0 14px rgba(255, 179, 0, 0.6), 0 0 28px rgba(255, 46, 166, 0.3);
}
#menu .tag {
  margin: 12px 0 24px 0; color: #c0b896; opacity: 0.85;
  text-transform: uppercase; letter-spacing: 0.32em; font-size: 11px;
}

.menuPanel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  padding: 22px 28px;
  width: 520px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 179, 0, 0.1) inset;
}
#levelBadge {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.18em;
  margin: -6px 0 16px 0; padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 179, 0, 0.3);
  color: var(--ink); font-size: 14px;
}
.lvLabel { color: var(--amber); }
#lvNum {
  font-size: 28px;
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 179, 0, 0.6);
  line-height: 1;
}
.lvSep { color: rgba(255, 255, 255, 0.25); }
#lvKills { color: var(--ink); }
#lvNext { color: rgba(255, 255, 255, 0.45); font-size: 12px; }
.menuLabel {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px; letter-spacing: 0.3em;
  color: var(--amber);
  margin: 22px 0 10px 0;
}
.menuLabel:first-of-type { margin-top: 0; }
#nameIn {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 179, 0, 0.35);
  color: var(--ink); font-family: 'Russo One', sans-serif; font-size: 20px; letter-spacing: 0.1em;
  text-align: center; padding: 12px 16px; width: 100%;
  outline: none;
  transition: border-color .1s;
}
#nameIn:focus { border-color: var(--amber); }

#modePick {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin: 8px 0 22px 0;
}
.mode {
  cursor: pointer;
  padding: 12px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.08);
  transition: all .12s;
}
.mode:hover { background: rgba(0,0,0,0.6); transform: translateY(-2px); }
.mode.sel { border-color: var(--amber); box-shadow: 0 0 12px rgba(255, 179, 0, 0.55); }
.modeName {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 0.25em;
  color: var(--amber);
  margin-bottom: 2px;
}
.modeDesc {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

#gangPick {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 10px 0 20px 0;
}
.gang {
  cursor: pointer;
  padding: 12px 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--ink);
  transition: all .12s;
}
.gang:hover { background: rgba(0,0,0,0.6); transform: translateY(-2px); }
.gang .badge {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  margin: 0 auto 6px auto;
  box-shadow: 0 0 12px currentColor;
}
.gang.sel { border-color: currentColor; box-shadow: 0 0 14px currentColor; }

/* Old in-line car picker is gone — handled in the Garage overlay. */
#carPick { display: none; }

.rideRow {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 0 22px 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 179, 0, 0.3);
}
.ridePreview {
  width: 80px; height: 44px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  flex-shrink: 0;
}
.rideText { flex: 1; min-width: 0; }
.rideLabel {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 12px; letter-spacing: 0.3em; color: var(--amber);
}
.rideName {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 0.22em; color: var(--ink);
}
#openGarage {
  background: transparent;
  border: 2px solid var(--amber);
  color: var(--amber);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px; letter-spacing: 0.32em;
  padding: 10px 18px;
  cursor: pointer;
  transition: all .12s;
}
#openGarage:hover { background: rgba(255, 179, 0, 0.15); transform: translateY(-1px); }

/* Garage overlay */
#garage {
  position: fixed; inset: 0; z-index: 11;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 179, 0, 0.10), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(0, 240, 255, 0.08), transparent 60%),
    repeating-linear-gradient(45deg, #060608 0 14px, #0a0a0d 14px 28px);
  overflow-y: auto;
  padding: 32px 24px 64px 24px;
}
.garageInner {
  max-width: 980px; margin: 0 auto;
}
.garageHeader {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 26px;
}
.garageHeader h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 56px; margin: 0; line-height: 1;
  color: var(--amber); letter-spacing: 0.12em;
  text-shadow: 0 0 14px rgba(255, 179, 0, 0.6), 4px 4px 0 #1a0d00;
}
.garageHeader .garageSub {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px; letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.5);
  align-self: end;
  padding-bottom: 6px;
}
#garageBack {
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid var(--amber);
  color: var(--amber);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px; letter-spacing: 0.3em;
  padding: 10px 22px; cursor: pointer;
  transition: all .12s;
}
#garageBack:hover { background: rgba(255, 179, 0, 0.15); transform: translateY(-1px); }

#garageGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.gcard {
  background: var(--panel);
  border: 2px solid rgba(255, 255, 255, 0.08);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all .12s;
  position: relative;
}
.gcard:hover:not(.glocked) {
  border-color: var(--amber);
  transform: translateY(-3px);
  box-shadow: 0 0 18px rgba(255, 179, 0, 0.35);
}
.gcard.gsel {
  border-color: var(--amber);
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.7) inset, 0 0 22px rgba(255, 179, 0, 0.35);
}
.gcard.glocked { opacity: 0.4; cursor: not-allowed; filter: grayscale(60%); }
.gcard .gimg {
  width: 140px; height: 80px;
  margin: 0 auto 12px auto;
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
.gcard .gname {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; letter-spacing: 0.22em; color: var(--ink);
  margin-bottom: 4px;
}
.gcard .gdesc {
  font-size: 11px; color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em; line-height: 1.4;
  min-height: 28px;
}
.gcard .glock {
  display: none;
  margin-top: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px; letter-spacing: 0.28em;
  color: var(--amber);
}
.gcard.glocked .glock { display: block; }
.gcard .gpicked {
  display: none;
  position: absolute; top: 8px; right: 10px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 12px; letter-spacing: 0.25em;
  color: var(--amber);
}
.gcard.gsel .gpicked { display: block; }
.car {
  cursor: pointer;
  padding: 8px 4px 10px 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--ink);
  transition: all .12s;
  position: relative;
}
.car:hover:not(.locked) { background: rgba(0,0,0,0.6); transform: translateY(-2px); }
.car .carIcon {
  display: block;
  width: 56px; height: 32px;
  margin: 0 auto 6px auto;
  border-radius: 4px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
.car.sel { border-color: var(--amber); box-shadow: 0 0 12px rgba(255, 179, 0, 0.55); }
.car.locked { opacity: 0.45; cursor: not-allowed; }
.car.locked .lockText {
  display: block;
  font-size: 10px; color: var(--amber);
  margin-top: 4px;
  letter-spacing: 0.25em;
}
.car .lockText { display: none; }

#playBtn, #respawnBtn {
  width: 100%;
  background: linear-gradient(180deg, var(--amber), #b97400);
  border: none; color: #1a0d00; font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; letter-spacing: 0.35em;
  padding: 14px 56px; cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 179, 0, 0.6), 0 4px 0 #6b4200;
  transition: transform 0.08s ease;
}
#playBtn:hover, #respawnBtn:hover { transform: translateY(-2px); box-shadow: 0 0 18px rgba(255, 179, 0, 0.8), 0 6px 0 #6b4200; }
#playBtn:active, #respawnBtn:active { transform: translateY(2px); box-shadow: 0 0 8px rgba(255, 179, 0, 0.4), 0 2px 0 #6b4200; }

.controls {
  margin-top: 12px;
  font-size: 11px; opacity: 0.55;
  text-align: center; line-height: 1.7;
}
.controls b { color: var(--amber); font-family: 'Russo One', sans-serif; }
.controls .moreLinks { margin-top: 6px; }
.controls .moreLinks a {
  color: var(--cyan); text-decoration: none;
  border-bottom: 1px dashed rgba(0, 240, 255, 0.4);
  padding-bottom: 1px;
}
.controls .moreLinks a:hover { color: var(--amber); border-bottom-color: var(--amber); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#leaderboard {
  position: absolute; top: 16px; right: 16px;
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
  padding: 10px 12px;
  font-size: 12px;
}
.lbHeader {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--amber); letter-spacing: 0.36em; font-size: 16px;
  margin-bottom: 6px;
}
#lbList { list-style: none; margin: 0; padding: 0; font-family: 'Russo One', monospace; }
#lbList li {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
}
#lbList li:last-child { border-bottom: none; }
#lbList .dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 6px currentColor; flex-shrink: 0; }
#lbList .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lbList .pc { color: var(--amber); font-size: 11px; }
#lbList li.you { background: rgba(255, 179, 0, 0.13); }
#lbList .crown { color: var(--amber); margin-right: 2px; }

#minimap {
  position: absolute; top: 240px; right: 16px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--panel-line);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.7);
}

#stats {
  position: absolute; bottom: 16px; left: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  padding: 10px 14px;
  min-width: 180px;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.6);
  font-family: 'Russo One', monospace;
}
.statRow { display: flex; justify-content: space-between; gap: 18px; padding: 3px 0; font-size: 14px; }
#stats .k { font-family: 'Bebas Neue', sans-serif; color: var(--amber); letter-spacing: 0.3em; font-size: 14px; }
#stats #statTurf, #stats #statKills, #stats #statScore, #stats #statGun, #stats #statDrive { color: var(--ink); }
#stats .statRow.flash span:last-child { color: var(--blood); text-shadow: 0 0 8px var(--blood); transition: color .2s, text-shadow .2s; }
#hitmarker {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.35));
  z-index: 7;
}
#hitmarker.show { animation: hitMark 0.6s cubic-bezier(.2,.9,.3,1); }
@keyframes hitMark {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(2.4) rotate(-8deg); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1.0) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}
#hitname {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 0.22em;
  color: #ffffff;
  text-shadow: 0 0 4px #000, 0 0 10px rgba(0,0,0,0.9), 2px 2px 0 #000;
}
#boostFill.flash { box-shadow: 0 0 22px var(--amber), 0 0 36px rgba(255, 179, 0, 0.7); }

#boostBar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: 320px; height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-line);
  overflow: hidden;
}
#boostFill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--amber), var(--blood));
  transition: width 0.1s linear;
  box-shadow: 0 0 14px var(--amber);
}
.boostLabel {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif; font-size: 13px; letter-spacing: 0.5em;
  color: white; text-shadow: 0 0 4px black;
}

#buffs {
  position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px;
}
.buff {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px; letter-spacing: 0.3em;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--amber);
  color: var(--amber);
  text-shadow: 0 0 6px var(--amber);
  animation: buffPulse 0.8s ease-in-out infinite alternate;
}
#buffShield { color: var(--cyan); border-color: var(--cyan); text-shadow: 0 0 6px var(--cyan); }
@keyframes buffPulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

#killfeed {
  position: absolute; top: 16px; left: 16px;
  display: flex; flex-direction: column; gap: 4px;
  font-family: 'Russo One', monospace;
  font-size: 12px;
  pointer-events: none;
  max-width: 360px;
}
.kfLine {
  background: var(--panel);
  border-left: 3px solid var(--amber);
  padding: 5px 10px;
  letter-spacing: 0.05em;
  opacity: 1;
  animation: kfIn 0.2s ease-out, kfOut 0.4s ease-in 4.2s forwards;
}
.kfLine .who { font-weight: bold; }
.kfLine .v { color: var(--amber); }
.kfLine .arr { color: #888; margin: 0 6px; }
@keyframes kfIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes kfOut {
  to { transform: translateX(-30px); opacity: 0; }
}

#toast {
  position: absolute;
  top: 28%; left: 50%; transform: translate(-50%, -50%);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px; letter-spacing: 0.18em;
  color: var(--amber);
  text-shadow: 0 0 10px var(--amber), 3px 3px 0 #1a0d00, 6px 6px 18px rgba(0,0,0,0.8);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  max-width: 92vw;
}
.toastIn { animation: toastBoom 1.8s ease-out forwards; }
@keyframes toastBoom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  35% { transform: translate(-50%, -50%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.0); }
}

/* ---------- Death (WASTED) ---------- */
#death {
  position: fixed; inset: 0; z-index: 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(120, 0, 0, 0.55), rgba(0, 0, 0, 0.92) 60%);
  backdrop-filter: blur(6px);
}
#wastedText {
  font-family: 'Bebas Neue', 'Impact', serif;
  font-size: 180px; margin: 0;
  color: var(--blood);
  letter-spacing: 0.06em;
  text-shadow:
    0 0 20px rgba(255, 32, 48, 0.7),
    6px 6px 0 #200000,
    12px 12px 32px rgba(0, 0, 0, 0.85);
  transform: scale(0.5) skewX(-6deg);
  opacity: 0;
  animation: wastedIn 0.9s cubic-bezier(.2,.9,.3,1) forwards;
}
@keyframes wastedIn {
  0% { transform: scale(2.4) skewX(-6deg); opacity: 0; filter: blur(20px); }
  60% { transform: scale(0.94) skewX(-6deg); opacity: 1; filter: blur(0); }
  100% { transform: scale(1) skewX(-6deg); opacity: 1; }
}
#death p { color: #f0c0c0; opacity: 0.85; letter-spacing: 0.2em; margin: 14px 0 6px 0; font-size: 13px; }
#death p span { color: var(--amber); }
#deathTip {
  color: rgba(255, 220, 200, 0.7) !important;
  font-family: 'Russo One', monospace;
  font-size: 12px !important;
  letter-spacing: 0.06em !important;
  text-transform: none;
  text-align: center;
  margin: 4px 0 24px 0 !important;
  max-width: 480px;
  line-height: 1.55;
  padding: 0 18px;
}
#deathStats {
  display: flex; gap: 22px; margin-bottom: 32px;
  background: var(--panel); border: 1px solid var(--panel-line);
  padding: 16px 26px;
  font-family: 'Russo One', monospace;
}
#deathStats > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#deathStats .k { font-family: 'Bebas Neue', sans-serif; color: var(--amber); letter-spacing: 0.3em; font-size: 12px; }
#deathStats > div > span:last-child { color: var(--ink); font-size: 24px; }

#respawnBtn { width: auto; padding: 14px 56px; }

/* ============================================================ */
/* Touch controls — virtual joystick + fire/boost buttons.      */
/* Visible only on touch devices, only during gameplay (toggled */
/* from JS via the `.hidden` class).                            */
/* ============================================================ */
#touchControls {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 6;
}
#touchControls.hidden { display: none !important; }
#joystick {
  position: absolute;
  bottom: 70px; left: 40px;
  width: 140px; height: 140px;
  background: rgba(0,0,0,0.45);
  border: 2px solid rgba(255,179,0,0.45);
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#joystickInner {
  position: absolute;
  left: 50%; top: 50%;
  width: 60px; height: 60px;
  margin-left: -30px; margin-top: -30px;
  background: linear-gradient(180deg, var(--amber), #b97400);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255,179,0,0.65);
  transition: transform 0.04s linear;
  pointer-events: none;
}
.touchBtn {
  position: absolute;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.22em;
  color: white;
  text-shadow: 0 0 4px black;
  transition: transform 0.06s ease, background 0.06s ease;
}
.touchBtn:active { transform: scale(0.92); }
#fireBtn {
  bottom: 80px; right: 40px;
  width: 100px; height: 100px;
  background: rgba(255,46,166,0.32);
  border: 3px solid var(--hot);
  font-size: 22px;
  box-shadow: 0 0 22px rgba(255,46,166,0.55), 0 0 40px rgba(255,46,166,0.25);
}
#fireBtn.pressed {
  background: rgba(255,46,166,0.65);
  box-shadow: 0 0 28px var(--hot), 0 0 60px rgba(255,46,166,0.5);
}
#boostBtn {
  bottom: 200px; right: 60px;
  width: 76px; height: 76px;
  background: rgba(255,179,0,0.28);
  border: 3px solid var(--amber);
  font-size: 15px;
  box-shadow: 0 0 18px rgba(255,179,0,0.55);
}
#boostBtn.pressed {
  background: rgba(255,179,0,0.55);
  box-shadow: 0 0 26px var(--amber);
}

/* ============================================================ */
/* Mobile / narrow-viewport responsive overrides.               */
/* ============================================================ */
@media (max-width: 720px) {
  /* Landing page */
  #menu { padding: 12px 12px 18px 12px; }
  #menu h1 { font-size: 56px; }
  .logoCrown { font-size: 20px; margin-bottom: -2px; }
  .logoIo { font-size: 22px; }
  .logoUnderline { width: 230px; height: 3px; margin-top: 6px; }
  #menu .tag { margin: 6px 0 12px 0; font-size: 10px; letter-spacing: 0.22em; }

  .menuPanel { width: 100%; max-width: 460px; padding: 14px 16px 16px 16px; }

  #levelBadge { margin: -2px 0 10px 0; font-size: 12px; gap: 6px; }
  #lvNum { font-size: 22px; }

  .menuLabel { font-size: 12px; margin: 14px 0 6px 0; letter-spacing: 0.25em; }

  #nameIn { font-size: 16px; padding: 9px 12px; }

  #modePick { gap: 6px; margin: 6px 0 0 0; }
  .mode { padding: 8px 8px; }
  .modeName { font-size: 18px; letter-spacing: 0.2em; }
  .modeDesc { font-size: 9px; }

  #gangPick { gap: 5px; margin: 6px 0 0 0; }
  .gang { padding: 8px 4px; font-size: 13px; }
  .gang .badge { width: 16px; height: 16px; margin-bottom: 4px; }

  .rideRow { margin: 6px 0 12px 0; padding: 6px 8px; gap: 8px; }
  .ridePreview { width: 60px; height: 34px; }
  .rideLabel { font-size: 10px; }
  .rideName { font-size: 16px; }
  #openGarage { font-size: 12px; padding: 7px 12px; }

  #playBtn, #respawnBtn {
    font-size: 22px; padding: 11px 32px; letter-spacing: 0.25em;
  }

  .controls { font-size: 10px; line-height: 1.55; margin-top: 10px; }

  /* WASTED death overlay */
  #wastedText { font-size: 96px; }
  #death p { font-size: 11px; }
  #deathStats { gap: 14px; padding: 12px 16px; margin-bottom: 22px; }
  #deathStats > div > span:last-child { font-size: 18px; }
  .deathBtns { flex-direction: column; gap: 10px; width: 80%; max-width: 320px; }
  #respawnBtn, #backBtn { width: 100%; padding: 12px 24px; font-size: 18px; }

  /* HUD shrinks + repositions to leave room for joystick + fire button */
  #leaderboard { width: 140px; top: 4px; right: 4px; padding: 4px 6px; font-size: 9px; }
  .lbHeader { font-size: 11px; letter-spacing: 0.22em; margin-bottom: 3px; }
  #lbList li { padding: 1px 0; font-size: 10px; }
  /* Only show top 3 on phones — saves vertical space for the minimap. */
  #lbList li:nth-child(n+4) { display: none; }
  #minimap { width: 92px; height: 92px; top: 95px; right: 4px; }
  #stats { top: 4px; left: 4px; bottom: auto; min-width: 96px; padding: 4px 8px; }
  .statRow { font-size: 10px; padding: 1px 0; gap: 12px; }
  #stats .k { font-size: 10px; letter-spacing: 0.2em; }
  /* Hide GUN/DRIVE breakdown on phones — TURF/TOTAL/SCORE are enough. */
  #stats .statRow:nth-child(2),
  #stats .statRow:nth-child(3) { display: none; }
  #boostBar { width: 150px; height: 12px; bottom: auto; top: 4px;
              left: 50%; transform: translateX(-50%); }
  .boostLabel { font-size: 8px; letter-spacing: 0.35em; }
  #buffs { top: 18px; bottom: auto; }
  .buff { font-size: 10px; padding: 2px 6px; letter-spacing: 0.2em; }
  #killfeed { display: none; }  /* too cramped on phone; rely on toast instead */
  #kingpinBadge { top: 42px; padding: 4px 10px; font-size: 11px; }
  #kingpinBadge .crownIcon { font-size: 16px; }
  #kingpinBadge .mult { font-size: 9px; padding-left: 4px; }

  /* Toast / hit marker smaller */
  #toast { font-size: 26px; }
  #hitname { font-size: 18px; }
}

/* Hide ad slots on touch devices regardless (no real estate). */
@media (hover: none) and (pointer: coarse) {
  .adSlot { display: none !important; }
}

.deathBtns {
  display: flex; gap: 12px;
}
#backBtn {
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--amber);
  color: var(--amber);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 0.32em;
  padding: 14px 44px;
  cursor: pointer;
  transition: all .12s;
}
#backBtn:hover { background: rgba(255, 179, 0, 0.15); transform: translateY(-2px); }
#backBtn:active { transform: translateY(2px); }

/* KINGPIN HUD badge */
#kingpinBadge {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #4a3a00, #1a0d00);
  border: 2px solid var(--amber);
  padding: 8px 18px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.3em;
  color: var(--amber);
  box-shadow: 0 0 18px rgba(255, 179, 0, 0.8), 0 0 36px rgba(255, 179, 0, 0.4);
  animation: kingpinPulse 1.4s ease-in-out infinite alternate;
}
#kingpinBadge .crownIcon { font-size: 26px; line-height: 1; }
#kingpinBadge .mult { color: var(--ink); font-size: 12px; padding-left: 8px; border-left: 1px solid rgba(255,179,0,0.5); }
@keyframes kingpinPulse {
  from { box-shadow: 0 0 14px rgba(255, 179, 0, 0.6), 0 0 28px rgba(255, 179, 0, 0.3); }
  to   { box-shadow: 0 0 22px rgba(255, 179, 0, 1.0), 0 0 50px rgba(255, 179, 0, 0.6); }
}

#perkBanner {
  position: absolute;
  top: 38%; left: 50%; transform: translate(-50%, -50%);
  background: linear-gradient(180deg, rgba(20,12,30,0.95), rgba(8,4,16,0.92));
  border-left: 4px solid var(--amber);
  border-right: 4px solid var(--amber);
  padding: 18px 56px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 32px rgba(255, 179, 0, 0.45), 0 12px 40px rgba(0, 0, 0, 0.7);
  font-family: 'Bebas Neue', sans-serif;
}
#perkBanner .pbHead {
  font-size: 14px; letter-spacing: 0.4em;
  color: var(--amber);
  margin-bottom: 4px;
  text-shadow: 0 0 8px rgba(255, 179, 0, 0.6);
}
#perkBanner .pbName {
  font-size: 44px; letter-spacing: 0.18em;
  color: var(--ink);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3), 3px 3px 0 #1a0d00;
}
#perkBanner .pbPerk {
  font-size: 16px; letter-spacing: 0.28em;
  color: var(--cyan);
  margin-top: 4px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}
.pbIn { animation: pbAnim 2.6s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes pbAnim {
  0%   { opacity: 0; transform: translate(-150%, -50%) skewX(-12deg); }
  18%  { opacity: 1; transform: translate(-50%, -50%) skewX(-2deg); }
  78%  { opacity: 1; transform: translate(-50%, -50%) skewX(0); }
  100% { opacity: 0; transform: translate(50%, -50%) skewX(8deg); }
}
