:root { --ink: #1a30c0; --red: #d02030; --paper: #f6f3e6; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); font-family: 'Comic Sans MS', 'Marker Felt', 'Segoe Print', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
canvas#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; color: var(--ink); user-select: none; overflow: hidden; }
.hud-tl, .hud-tr, .hud-bl, .hud-br, .crosshair, .grapple-ret, .hitmarker, .dmg-ind, .message, .killfeed { mix-blend-mode: multiply; }
#hud.nogame .hud-tl, #hud.nogame .hud-tr, #hud.nogame .hud-bl, #hud.nogame .hud-br, #hud.nogame .crosshair, #hud.nogame .grapple-ret, #hud.nogame .killfeed { display: none; }
.hud-tl { position: absolute; left: 9%; top: 3%; font-size: 30px; transform: rotate(-1.5deg); }
.hud-tr { position: absolute; right: 4%; top: 3%; text-align: right; font-size: 30px; transform: rotate(1deg); }
.hud-bl { position: absolute; left: 9%; bottom: 5%; }
.hud-br { position: absolute; right: 4%; bottom: 5%; text-align: right; }
.ammo b { font-size: 58px; } .ammo span { font-size: 28px; opacity: .8; } .reloading { font-size: 22px !important; color: var(--red); }
.tally { display: flex; flex-wrap: wrap; width: 240px; gap: 3px; margin-top: -8px; align-items: flex-end; }
.tally i { display: block; width: 4px; height: 20px; background: var(--ink); transform: rotate(4deg); border-radius: 2px; opacity: .9; }
.tally i:nth-child(5n) { width: 4px; margin-right: 10px; transform: rotate(-8deg); }
.health { margin-bottom: 8px; font-size: 26px; display: flex; align-items: center; gap: 10px; }
.bar { width: 210px; height: 16px; border: 2.5px solid var(--ink); border-radius: 6px 8px 5px 7px / 8px 5px 7px 6px; overflow: hidden; transform: rotate(-1deg); }
.fill { height: 100%; width: 100%; background: repeating-linear-gradient(-55deg, var(--ink) 0 2.5px, transparent 2.5px 6px); transition: width .15s; }
.low .bar { border-color: var(--red); } .low .fill { background: repeating-linear-gradient(-55deg, var(--red) 0 2.5px, transparent 2.5px 6px); }
.crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --s: 10px; filter: drop-shadow(0 0 1px rgba(255,255,255,.9)); }
.crosshair i { position: absolute; background: var(--red); border-radius: 2px; transition: top .06s, left .06s; }
.ch-t { width: 3px; height: 12px; left: -1.5px; top: calc(-1 * var(--s) - 12px); }
.ch-b { width: 3px; height: 12px; left: -1.5px; top: var(--s); }
.ch-l { width: 12px; height: 3px; top: -1.5px; left: calc(-1 * var(--s) - 12px); }
.ch-r { width: 12px; height: 3px; top: -1.5px; left: var(--s); }
.ch-dot { width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; }
.crosshair.katana i { background: var(--ink); } .crosshair.katana .ch-t, .crosshair.katana .ch-b { height: 16px; }
.crosshair.katana .ch-l, .crosshair.katana .ch-r { display: none; }
.grapple-ret { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px; border: 2.5px dashed var(--ink); border-radius: 50%; opacity: 0; transition: opacity .1s, transform .12s; transform: scale(1.6) rotate(0deg); }
.grapple-ret.on { opacity: .9; transform: scale(1) rotate(20deg); } .grapple-ret.attached { border-style: solid; transform: scale(.65); }
.hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; }
.hitmarker i { position: absolute; width: 3.5px; height: 36px; background: #e8801a; left: -1.75px; top: -18px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(250,248,238,.85); }
.hitmarker i:first-child { transform: rotate(45deg); } .hitmarker i:last-child { transform: rotate(-45deg); }
.hitmarker.show { animation: hm .24s ease-out; }
.hitmarker.crit i { background: var(--red); width: 4.5px; height: 44px; top: -22px; left: -2.25px; }
.hitmarker.kill i { background: var(--red); width: 5px; height: 50px; top: -25px; left: -2.5px; }
@keyframes hm { 0% { opacity: 1; transform: scale(1.5); } 100% { opacity: 0; transform: scale(1); } }
.message { position: absolute; left: 0; right: 0; top: 24%; text-align: center; }
.msg-main { font-size: 88px; color: var(--ink); transform: rotate(-2deg); opacity: 0; letter-spacing: 3px; line-height: 1; }
.msg-main.show { animation: scribble .55s ease-out forwards; }
@keyframes scribble { 0% { opacity: 0; transform: rotate(-7deg) scale(1.7); filter: blur(3px); } 55% { opacity: 1; transform: rotate(-1deg) scale(.95); filter: blur(0); } 100% { opacity: 1; transform: rotate(-2deg) scale(1); } }
.msg-sub { font-size: 32px; opacity: .85; }
.killfeed { position: absolute; right: 4%; top: 28%; text-align: right; font-size: 27px; }
.killfeed div { animation: kf 1.7s ease-out forwards; } .killfeed .pts { color: var(--red); }
@keyframes kf { 0% { opacity: 0; transform: translateX(30px) rotate(3deg); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
.dmg-ind { position: absolute; left: 50%; top: 50%; }
.dmg-ind i { position: absolute; left: -16px; top: -140px; width: 32px; height: 22px; transform-origin: 16px 140px; background: var(--red); clip-path: polygon(50% 0, 100% 100%, 0 100%); opacity: .9; animation: di 1s linear forwards; }
@keyframes di { to { opacity: 0; } }
.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: auto;
  cursor: pointer;
  background: rgba(10, 14, 23, 0.56);
  backdrop-filter: blur(5px);
}
.screen.show { display: flex; }

.panel {
  text-align: center;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 26px 30px 22px;
  font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #f8fafc;
  background: rgba(17, 22, 34, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.52);
  cursor: default;
  position: relative;
}

.home-visual {
  max-width: 420px;
  margin: 0 auto 14px;
}
.home-visual svg {
  width: 100%;
  height: auto;
  display: block;
}

.panel h1 {
  font-size: 40px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 2px;
  line-height: 1.05;
  color: #ffffff;
}

.panel h1.erased-title {
  font-size: 48px;
  color: #fb7185;
}

.erased-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fda4af;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.panel h2 {
  font-size: 14px;
  margin: 6px 0 18px;
  font-weight: 500;
  color: #94a3b8;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 14px;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-chip span { font-size: 11px; font-weight: 700; color: #94a3b8; }
.stat-chip b { font-size: 24px; font-weight: 800; color: #f8fafc; }
.stat-chip.best { background: rgba(249, 115, 22, 0.12); border-color: rgba(249, 115, 22, 0.4); }
.stat-chip.best b { color: #fb923c; }

.controls-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.ctrl-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 9px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ctrl-pill.hot {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.35);
}
.cp-ico { font-size: 15px; color: #94a3b8; line-height: 1; }
.ctrl-pill.hot .cp-ico { color: #fb923c; }
.ctrl-pill b {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 5px;
}
.ctrl-pill.hot b { background: #f97316; color: #ffffff; }
.ctrl-pill span:last-child { font-size: 11px; color: #94a3b8; }

@media (max-width: 640px) {
  .controls-mini, .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.panel h2 {
  font-size: 18px;
  margin: 6px 0 18px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 1px;
}

.panel .cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  text-align: left;
  font-size: 14px;
  line-height: 1.65;
  margin-top: 16px;
}

.panel .cols > div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
}

.panel .cols b {
  display: inline-block;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 5px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
}

.colhead {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ff7a59;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.panel .go {
  font-size: 16px;
  font-weight: 700;
  color: #00f0ff;
  margin-top: 16px;
  letter-spacing: 0.8px;
  animation: blink 1.4s infinite;
}
@keyframes blink { 50% { opacity: .45; } }

.panel .stats { font-size: 20px; line-height: 1.5; color: #e2e8f0; }
.panel .stats b { color: #ff5f3d; }
.panel .tip { font-size: 15px; color: #94a3b8; margin-top: 8px; }
.weapon { font-size: 36px; } .hint { font-size: 20px; opacity: .8; }
.combo { font-size: 26px; color: var(--red); min-height: 30px; }
.timer { font-size: 24px; color: var(--red); }
@media (max-width: 900px) {
  .panel { padding: 20px; }
  .panel h1 { font-size: 38px; }
  .panel .cols { grid-template-columns: 1fr; gap: 10px; font-size: 13px; }
  .msg-main { font-size: 56px; }
}
/* v2 additions */
.crosshair.ads { opacity: 0; }
.slots { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-bottom: 6px; font-size: 20px; opacity: .85; }
.slot { display: flex; gap: 8px; align-items: baseline; opacity: .55; transform: rotate(1deg); }
.slot.active { opacity: 1; font-size: 24px; border-bottom: 2px solid var(--ink); }
.slot.empty { color: var(--red); }
.slot .num { font-size: 15px; opacity: .8; border: 1.5px solid var(--ink); border-radius: 4px 6px 4px 5px; padding: 0 4px; }
.slot .sammo { font-size: 16px; opacity: .8; min-width: 54px; text-align: right; }
.modifier { font-size: 22px; color: var(--red); min-height: 26px; }
.bossbar { position: absolute; left: 50%; top: 6%; width: 420px; margin-left: -210px; text-align: center; font-size: 26px; display: none; }
.bossbar.show { display: block; mix-blend-mode: multiply; }
.bar.big { width: 420px; height: 20px; margin-top: 4px; }
.fill.red { background: repeating-linear-gradient(-55deg, var(--red) 0 3px, transparent 3px 7px); }
.tip { position: absolute; left: 0; right: 0; bottom: 17%; text-align: center; font-size: 26px; color: var(--ink); opacity: 0; transition: opacity .4s; mix-blend-mode: multiply; }
.tip.show { opacity: .9; }
.tip b { color: var(--red); }
#hud.nogame .tip, #hud.nogame .bossbar { display: none; }
.settings {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}
.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.sens-pill, .toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  cursor: pointer;
}
.sens-pill input[type=range] { width: 125px; accent-color: #00f0ff; cursor: pointer; }
.sens-pill b { color: #00f0ff; min-width: 40px; text-align: right; }
.toggle-pill input[type=checkbox] { width: 15px; height: 15px; accent-color: #ff2a6d; cursor: pointer; }
/* sniper scope */
.scope { position: absolute; inset: 0; opacity: 0; transition: opacity .1s; pointer-events: none; }
.scope.on { opacity: 1; }
.scope .mask { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(246,243,230,0) 0 30vh, var(--paper) 30.6vh 100%); }
.scope .ring { position: absolute; left: 50%; top: 50%; width: 60.5vh; height: 60.5vh; margin: -30.25vh; border: 3.5px solid var(--ink); border-radius: 50%; box-shadow: inset 0 0 0 7px rgba(26,48,192,.12); }
.scope .cx { position: absolute; left: 50%; top: 50%; width: 60vh; height: 2.5px; margin: -1px -30vh; background: repeating-linear-gradient(90deg, var(--ink) 0 14px, transparent 14px 17px); }
.scope .cy { position: absolute; left: 50%; top: 50%; width: 2.5px; height: 60vh; margin: -30vh -1px; background: repeating-linear-gradient(180deg, var(--ink) 0 14px, transparent 14px 17px); }
.scope .dot { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; background: var(--red); border-radius: 50%; }
/* focus-slash target marker */
.focus-mark { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity .1s; }
.focus-mark.on { opacity: 1; animation: fm .5s ease-in-out infinite alternate; }
.focus-mark i { position: absolute; width: 20px; height: 20px; border: 3px solid var(--red); }
.focus-mark i:nth-child(1) { left: -30px; top: -30px; border-right: 0; border-bottom: 0; }
.focus-mark i:nth-child(2) { left: 10px; top: -30px; border-left: 0; border-bottom: 0; }
.focus-mark i:nth-child(3) { left: -30px; top: 10px; border-right: 0; border-top: 0; }
.focus-mark i:nth-child(4) { left: 10px; top: 10px; border-left: 0; border-top: 0; }
@keyframes fm { from { transform: scale(1); } to { transform: scale(1.18); } }
#hud.nogame .scope, #hud.nogame .focus-mark { display: none; }
/* katana focus gauge */
.focus-meter { position: absolute; left: 4.5%; top: 50%; transform: translateY(-50%) rotate(-1.5deg); opacity: 0; transition: opacity .25s; text-align: center; mix-blend-mode: multiply; }
.focus-meter.on { opacity: 1; }
.fm-label { font-size: 17px; letter-spacing: 2px; color: var(--ink); opacity: .8; margin-bottom: 4px; }
.fm-tube { position: relative; width: 26px; height: 168px; border: 3px solid var(--ink); border-radius: 8px 11px 7px 10px / 11px 7px 10px 8px; overflow: hidden; }
.fm-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: repeating-linear-gradient(-52deg, var(--ink) 0 3px, transparent 3px 7px); transition: height .18s; }
.fm-tube i { position: absolute; left: 50%; bottom: 100%; width: 16px; height: 22px; margin-left: -8px; background: var(--red); opacity: 0; clip-path: polygon(50% 0, 78% 42%, 66% 38%, 82% 78%, 50% 100%, 18% 78%, 34% 38%, 22% 42%); }
.focus-meter.ready .fm-tube { border-color: var(--red); box-shadow: 0 0 0 3px rgba(208,32,48,.18); }
.focus-meter.ready .fm-fill { background: repeating-linear-gradient(-52deg, var(--red) 0 3px, transparent 3px 7px); }
.focus-meter.ready .fm-tube i { opacity: 1; animation: flame .42s ease-in-out infinite alternate; }
.focus-meter.ready .fm-f2 { margin-left: -18px; height: 16px; animation-delay: .14s; }
.focus-meter.ready .fm-f3 { margin-left: 3px; height: 18px; animation-delay: .27s; }
@keyframes flame { from { transform: translateY(4px) scaleY(.78) rotate(-5deg); } to { transform: translateY(-3px) scaleY(1.15) rotate(6deg); } }
.fm-ready { font-size: 15px; color: var(--red); letter-spacing: 1px; margin-top: 5px; opacity: 0; }
.focus-meter.ready .fm-ready { opacity: 1; animation: blink 1s infinite; }
#hud.nogame .focus-meter { display: none; }
/* map picker */
.mapsel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}
.mapsel > span { font-size: 14px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
.mapbtn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.25;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.mapbtn i { font-style: normal; font-size: 12px; color: #94a3b8; font-weight: 400; }
.mapbtn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.mapbtn.on {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(59, 130, 246, 0.25));
  border-color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.22);
}
.mapbtn.on i { color: #bae6fd; }

/* grenades */
.nades { display: inline-flex; gap: 3px; margin-left: 12px; vertical-align: middle; }
.nades i { width: 13px; height: 15px; border: 2.5px solid var(--ink); border-radius: 50% 50% 45% 45%; display: inline-block; position: relative; top: -2px; }
.nades i::after { content: ''; position: absolute; left: 3px; top: -6px; width: 3px; height: 5px; background: var(--red); }
/* lobby + modes */
.modes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0 4px; }
.modebtn { font: inherit; font-size: 21px; color: var(--ink); background: transparent; border: 2.5px solid var(--ink); border-radius: 7px 10px 6px 9px / 10px 6px 9px 7px; padding: 6px 14px; cursor: pointer; opacity: .6; display: flex; flex-direction: column; align-items: center; line-height: 1.1; transform: rotate(-.5deg); min-width: 130px; }
.modebtn i { font-style: normal; font-size: 14px; opacity: .8; }
.modebtn:hover { opacity: .9; } .modebtn.on { opacity: 1; color: var(--paper); background: var(--ink); }
.lobby { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 8px; }
.lobby .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.lobby input[type=text] { font: inherit; font-size: 24px; width: 130px; text-align: center; letter-spacing: 4px; text-transform: uppercase; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 6px 9px 6px 8px; background: transparent; padding: 3px 6px; }
.lobby button, .bigbtn { font: inherit; font-size: 21px; color: var(--paper); background: var(--ink); border: 2.5px solid var(--ink); border-radius: 7px 10px 6px 9px / 10px 6px 9px 7px; padding: 5px 16px; cursor: pointer; transform: rotate(-.6deg); }
.lobby button.alt { color: var(--ink); background: transparent; }
.lobby button:disabled { opacity: .4; cursor: default; }
.code { font-size: 44px; letter-spacing: 8px; color: var(--red); border: 3px dashed var(--red); padding: 2px 18px; border-radius: 10px; }
.plist { display: flex; flex-direction: column; gap: 3px; min-width: 300px; font-size: 22px; }
.plist div { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1.5px solid rgba(26,48,192,.25); padding: 2px 8px; }
.plist .t0 { color: var(--ink); } .plist .t1 { color: var(--red); } .plist .host::after { content: ' (host)'; opacity: .6; font-size: 16px; }
.status { font-size: 19px; color: var(--red); min-height: 24px; }
.scoreboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 16px;
  min-width: 360px;
  margin: 12px auto;
}
.scoreboard div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}
.scoreboard .me { background: rgba(56, 189, 248, 0.16); border: 1px solid rgba(56, 189, 248, 0.35); }
.hud-tr .teamscore { font-size: 26px; } .hud-tr .teamscore b { color: var(--red); }

.checkpoints {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  align-items: center;
}
.checkpoints button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.checkpoints button:hover {
  background: #00f0ff;
  border-color: #00f0ff;
  color: #060913;
  transform: translateY(-1px);
}
.namebox {
  font: inherit;
  font-size: 15px;
  width: 160px;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.7);
  padding: 6px 10px;
  outline: none;
}
.namebox:focus { border-color: #38bdf8; }
#hud.pad .kbonly, #hud:not(.pad) .padonly { display: none; }

/* ---- clean simple main menu buttons ---- */
.mainbtns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  margin: 0 0 4px;
}
.mainbtns button {
  font: inherit;
  color: #ffffff;
  background: #f97316;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.28);
  transition: transform 0.14s ease, filter 0.14s ease;
}
.mainbtns .btn-copy { display: flex; flex-direction: column; align-items: center; }
.mainbtns .btn-copy strong { font-size: 17px; font-weight: 800; letter-spacing: 0.6px; }
.mainbtns button i {
  display: block;
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 2px;
}
.mainbtns button:nth-child(2) {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  box-shadow: none;
}
.mainbtns button:hover { transform: translateY(-2px); filter: brightness(1.07); }
.mainbtns button:active { transform: translateY(1px); }
.mainbtns:has(.start) { display: grid; grid-template-columns: 1.2fr 1fr; }
.mainbtns button.start { min-width: 0; padding: 14px 20px; }
.mainbtns button.start:hover { transform: translateY(-2px); }
@media (max-width: 640px) {
  .mainbtns, .mainbtns:has(.start) { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .mainbtns, .mainbtns:has(.start) { grid-template-columns: 1fr; }
}

.online {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.online .sub { font-size: 15px; color: #94a3b8; }
.online .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.online .row.split { gap: 20px; color: #64748b; font-size: 13px; }
.online button, .lobby button, .bigbtn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 18px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}
.online button.alt, .lobby button.alt {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.online button.big {
  font-size: 17px;
  padding: 10px 26px;
  background: linear-gradient(135deg, #ff5f3d, #e11d48);
  border: none;
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.28);
}
.online button:disabled, .lobby button:disabled { opacity: .4; cursor: default; }
.online button:hover:not(:disabled), .lobby button:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.online input[type=text] {
  font: inherit;
  font-size: 18px;
  width: 140px;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  padding: 6px 10px;
  outline: none;
}
.online input[type=text]:focus { border-color: #38bdf8; }
.online input.namebox { letter-spacing: 0; text-transform: none; font-size: 15px; width: 180px; }
.online .radio { display: flex; gap: 14px; font-size: 14px; color: #cbd5e1; }
.online .radio label { display: flex; gap: 5px; align-items: center; cursor: pointer; }
.online .status { min-height: 22px; font-size: 14px; color: #fb7185; }
.online .hint { font-size: 13px; color: #94a3b8; max-width: 520px; text-align: center; }
.online .code {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 8px;
  color: #38bdf8;
  border: 1.5px dashed rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.08);
  padding: 4px 18px;
  border-radius: 12px;
}
.online .plist { min-width: 340px; display: flex; flex-direction: column; gap: 5px; }
.online .plist div {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 15px;
}
.online .plist .host span:first-child::after { content: ' · host'; color: #fbbf24; font-size: 13px; }
.online .plist .me { background: rgba(56, 189, 248, 0.14); border: 1px solid rgba(56, 189, 248, 0.3); }

.board {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 16px 24px;
  min-width: 380px;
  font-size: 16px;
  color: #f1f5f9;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  z-index: 5;
}
.board h3 { margin: 0 0 10px; font-size: 20px; text-align: center; letter-spacing: 2px; color: #38bdf8; }
.board div { display: flex; justify-content: space-between; gap: 24px; padding: 5px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.board div.me { background: rgba(56, 189, 248, 0.16); border-radius: 6px; }
.board .foot { font-size: 13px; color: #94a3b8; justify-content: center; border: 0; margin-top: 8px; }
.feed { color: var(--red); }

/* live mini leaderboard in the corner during online play */
.pvpscore { font-size: 20px; line-height: 1.2; text-align: right; }
.pvpscore .row { display: flex; justify-content: flex-end; gap: 10px; }
.pvpscore .row b { min-width: 28px; text-align: right; }
.pvpscore .row.me { color: var(--red); }
.pvpscore .row .rank { opacity: .6; }
.pvpscore .target { font-size: 15px; opacity: .65; margin-top: 2px; }

/* grapple breath: a sliver under the crosshair, only while it is not full */
.gstam { position: absolute; left: 50%; top: 50%; width: 64px; height: 5px; margin-left: -32px; margin-top: 26px; border: 1.5px solid var(--ink); border-radius: 3px; opacity: .8; mix-blend-mode: multiply; }
.gstam i { display: block; height: 100%; background: var(--ink); }
.gstam.low { border-color: var(--red); } .gstam.low i { background: var(--red); }

/* public lobby list on the online panel */
.lobbylist { display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; max-width: 560px; margin-top: 6px; padding-top: 12px; border-top: 1px dashed rgba(255, 255, 255, 0.16); }
.lobbylist .rows { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.lobbyrow { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 12px; align-items: center; font-size: 15px; padding: 6px 10px; background: rgba(255, 255, 255, 0.04); border-radius: 10px; }
.lobbyrow .code { font-size: 16px; letter-spacing: 3px; padding: 2px 8px; border-width: 1px; }
.lobbyrow button { font-size: 13px; padding: 5px 12px; }

/* ---- mobile touch controls ---- */
.touch-controls { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 4; touch-action: none; }
#hud.touch:not(.nogame) .touch-controls { display: block; }
@media (pointer: coarse) {
  #hud:not(.nogame) .touch-controls { display: block; }
}
.touch-look {
  position: fixed;
  top: 0;
  right: 0;
  width: 55vw;
  height: 100vh;
  pointer-events: auto;
  touch-action: none;
}
.touch-stick {
  position: fixed;
  left: 22px;
  bottom: 24px;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: rgba(11, 15, 25, 0.42);
  border: 2px solid rgba(0, 240, 255, 0.65);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.2);
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.touch-knob {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.85);
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.45);
  pointer-events: none;
}
.touch-actions {
  position: fixed;
  right: 18px;
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(3, 56px);
  gap: 10px;
  align-items: center;
  justify-items: center;
  pointer-events: none;
}
.touch-btn {
  pointer-events: auto;
  touch-action: none;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-weight: 800;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  background: rgba(11, 15, 25, 0.68);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.touch-btn.fire {
  grid-column: 3;
  grid-row: 1 / span 2;
  width: 76px;
  height: 76px;
  font-size: 13px;
  background: linear-gradient(135deg, rgba(255, 42, 109, 0.9), rgba(255, 107, 53, 0.9));
  border-color: #ff2a6d;
  box-shadow: 0 0 20px rgba(255, 42, 109, 0.45);
}
.touch-btn.jump {
  grid-column: 2;
  grid-row: 2;
  width: 60px;
  height: 60px;
  font-size: 12px;
  border-color: #00f0ff;
  color: #00f0ff;
}
.touch-btn.aim {
  grid-column: 2;
  grid-row: 1;
  width: 52px;
  height: 52px;
  font-size: 11px;
}
.touch-btn.small {
  width: 46px;
  height: 46px;
  font-size: 12px;
}
.touch-btn.down {
  transform: scale(0.92);
  filter: brightness(1.25);
}
.touch-pause {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  touch-action: none;
  width: 40px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(11, 15, 25, 0.65);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}
@media (max-width: 760px) {
  .hud-tl, .hud-tr { font-size: 20px; }
  .hud-bl { left: 16px; bottom: 158px; }
  .hud-br { right: 16px; bottom: 174px; }
  .ammo b { font-size: 36px; }
  .bar { width: 140px; height: 12px; }
  .tally, .slots { display: none; }
}
