:root {
  --accent: #ff6a2b;
  --accent-2: #ffb347;
  --text: #f2f0ec;
  --muted: #a7a39b;
  --panel: rgba(14, 15, 18, 0.62);
  --panel-solid: #121317;
  --line: rgba(255, 255, 255, 0.1);
  --danger: #ff3b3b;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0c0e; color: var(--text); font-family: Inter, system-ui, sans-serif; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }
kbd {
  display: inline-block; font: 600 11px/1 Inter, sans-serif; padding: 4px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--text);
}

/* ---------------- menu ---------------- */
#menu {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,106,43,0.18), transparent 60%),
              linear-gradient(180deg, rgba(8,9,11,0.55), rgba(8,9,11,0.88));
  backdrop-filter: blur(3px); z-index: 20; overflow-y: auto;
}
.menu-card {
  position: relative; width: min(760px, 100%); padding: 32px 36px; border-radius: 14px; background: rgba(14,15,18,0.82);
  border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
#info-btn { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; }
/* "how the game works" panel */
#info {
  width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border-radius: 14px;
  background: var(--panel-solid); color: var(--text); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.info-inner { padding: 22px 26px; }
#info::backdrop { background: rgba(8,9,11,0.7); }
.info-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.info-head h2 { margin: 0; font: 700 20px 'Chakra Petch', sans-serif; letter-spacing: 2px; text-transform: uppercase; }
#info-body h3 { margin: 18px 0 6px; color: var(--accent-2); }
#info-body ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
#info-body li { margin-bottom: 3px; }
#info-body b { color: var(--text); }
/* the subtitle hangs off the logo's bottom-left corner */
.logo-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; margin-bottom: 22px; }
.logo { font: 700 64px/1 'Chakra Petch', sans-serif; letter-spacing: 6px; font-style: italic; }
.logo-sub { margin: 2px 0 0 4px; font: 500 italic 13px/1 'Chakra Petch', sans-serif; letter-spacing: 1.5px; color: var(--muted); }
.logo em, .sb-logo em { font-style: italic; color: var(--accent); }

#menu-msg { color: #ffcf8a; padding: 10px 12px; border-radius: 8px; background: rgba(255,150,60,0.1); border: 1px solid rgba(255,150,60,0.3); margin-bottom: 12px; min-height: 0; font-size: 14px; }
#menu-msg:empty { display: none; }
.join-row { display: flex; gap: 10px; margin-bottom: 8px; }
#name-hint { font-size: 12px; color: var(--muted); margin-bottom: 24px; }
#name-hint.error { color: #ff8a6b; }
.join-row input.invalid { border-color: #ff6a4b; }
.join-row input {
  flex: 1; min-width: 0; font: 600 18px Inter, sans-serif; padding: 14px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--text); outline: none;
}
.join-row input:focus { border-color: var(--accent); }
.play-btn {
  font: 700 20px 'Chakra Petch', sans-serif; letter-spacing: 3px; padding: 0 34px; border: 0; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #e8401a); color: #fff; cursor: pointer;
  box-shadow: 0 8px 24px rgba(255,106,43,0.35); transition: transform .1s, filter .1s;
}
.play-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.play-btn:disabled { opacity: .6; cursor: wait; }
#exit {
  font: 700 15px 'Chakra Petch', sans-serif; letter-spacing: 2px; padding: 0 20px; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,0.25); transition: background .1s, border-color .1s;
}
#exit:hover { background: rgba(255,60,40,0.18); border-color: #ff5a3c; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } .logo { font-size: 44px; } }
h3 { font: 600 13px 'Chakra Petch', sans-serif; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.settings label { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; margin-bottom: 12px; font-size: 13px; }
.settings label input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.settings label.row { display: flex; align-items: center; justify-content: space-between; }
.settings label.check { justify-content: flex-start; gap: 8px; cursor: pointer; }
.settings output { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.settings select { background: #1c1d22; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.settings input[type=checkbox] { accent-color: var(--accent); }
.controls > div { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 7px; color: var(--muted); }
.controls span { margin-left: auto; color: var(--text); }
.tip { margin-top: 18px; padding: 12px 14px; border-radius: 8px; background: rgba(255,106,43,0.08); border: 1px solid rgba(255,106,43,0.25); font-size: 13px; color: #e6dccf; line-height: 1.6; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: 'Chakra Petch', sans-serif; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(200,0,0,0.55)); opacity: 0; transition: opacity .25s; }
#dmgdir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#dmgdir .arc {
  position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; border-radius: 50%;
  border: 5px solid transparent; border-top-color: rgba(255,40,40,0.9); filter: drop-shadow(0 0 6px rgba(255,0,0,0.7));
  transition: opacity 1s ease-out;
}
#crosshair { position: absolute; left: 50%; top: 50%; --gap: 6px; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
#crosshair .ch-t, #crosshair .ch-b { width: 2px; height: 8px; left: -1px; }
#crosshair .ch-l, #crosshair .ch-r { width: 8px; height: 2px; top: -1px; }
#crosshair .ch-t { top: calc(-1 * var(--gap) - 8px); }
#crosshair .ch-b { top: var(--gap); }
#crosshair .ch-l { left: calc(-1 * var(--gap) - 8px); }
#crosshair .ch-r { left: var(--gap); }
#crosshair .ch-dot { width: 2px; height: 2px; left: -1px; top: -1px; }
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hitmarker i { position: absolute; width: 11px; height: 2px; background: #fff; box-shadow: 0 0 2px #000; }
#hitmarker i:nth-child(1) { transform: translate(-16px, -12px) rotate(45deg); }
#hitmarker i:nth-child(2) { transform: translate(5px, -12px) rotate(-45deg); }
#hitmarker i:nth-child(3) { transform: translate(-16px, 10px) rotate(-45deg); }
#hitmarker i:nth-child(4) { transform: translate(5px, 10px) rotate(45deg); }
#hitmarker.head i { background: #ff4a3a; }
#hitmarker.kill i { width: 15px; background: #ff4a3a; }
#target { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); font-size: 15px; font-weight: 600; letter-spacing: 1px; }
#killfeed { position: absolute; right: 18px; top: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
#killfeed .kf {
  font: 600 14px 'Chakra Petch', sans-serif; padding: 5px 10px; border-radius: 5px; background: var(--panel);
  display: flex; gap: 8px; align-items: center; transition: opacity .5s;
}
#killfeed .kf.me { border: 1px solid rgba(255,106,43,0.7); }
#killfeed .kf .w { color: var(--muted); font-size: 12px; letter-spacing: 1px; }
#killfeed .kf .hs { color: var(--accent); font-size: 11px; }
#notices { position: absolute; left: 18px; top: 16px; display: flex; flex-direction: column; gap: 4px; font: 500 13px Inter, sans-serif; color: var(--muted); }
#center { position: absolute; left: 50%; top: 28%; transform: translateX(-50%); font-size: 22px; font-weight: 600; letter-spacing: 1px; opacity: 0; transition: opacity .3s; white-space: nowrap; }
#center b { color: var(--accent); }
#protect { position: absolute; left: 50%; top: calc(50% + 60px); transform: translateX(-50%); font-size: 12px; letter-spacing: 3px; color: #8fd3ff; display: none; }
#healing { position: absolute; left: 50%; top: calc(50% + 80px); transform: translateX(-50%); font-size: 12px; letter-spacing: 3px; color: #9bc36b; display: none; }
#bandages { letter-spacing: 4px; color: #e8e8e8; font-size: 14px; }
.hp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
#level { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--accent-2); }
#level .bar { width: 56px; height: 4px; margin: 0; }
#xpbar { height: 100%; width: 0; background: var(--accent-2); transition: width .3s; }
#level.up #lvl { animation: lvlup 1s ease-out; }
@keyframes lvlup { 0% { color: #fff; text-shadow: 0 0 10px var(--accent-2); } 100% { color: var(--accent-2); } }
#hp-box, #ammo-box { position: absolute; bottom: 22px; padding: 10px 16px; border-radius: 10px; background: var(--panel); min-width: 170px; }
#hp-box { left: 22px; }
#hp-box .lbl { font-size: 11px; letter-spacing: 3px; color: var(--muted); }
#hp { font-size: 46px; font-weight: 700; line-height: 1; }
#hp.low { color: var(--danger); }
.bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.12); margin-top: 6px; overflow: hidden; }
#hpbar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .15s; }
#ammo-box { right: 22px; text-align: right; }
#wname { font-size: 12px; letter-spacing: 3px; color: var(--muted); }
.ammo-row { font-weight: 700; line-height: 1; }
#mag { font-size: 46px; }
#mag.empty { color: var(--danger); }
#res { font-size: 20px; color: var(--muted); margin-left: 6px; }
#nades { margin-top: 6px; letter-spacing: 4px; color: #9bc36b; font-size: 14px; }
#slots { position: absolute; right: 22px; bottom: 126px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
#slots div { font-size: 12px; letter-spacing: 2px; padding: 3px 8px; border-radius: 4px; color: var(--muted); background: rgba(14,15,18,0.4); }
#slots div b { margin-right: 6px; color: var(--muted); }
#slots div.active { color: #fff; background: rgba(255,106,43,0.35); }
#slots div.off { opacity: .35; }
#speed { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: #e6e1d8; }
#speed small { font-size: 11px; color: var(--muted); letter-spacing: 2px; margin-left: 4px; }
#netinfo { position: absolute; left: 22px; bottom: 120px; font: 500 11px Inter, sans-serif; color: var(--muted); letter-spacing: .5px; }
#chat { position: absolute; left: 22px; bottom: 150px; width: min(420px, 60vw); }
#chat-log { display: flex; flex-direction: column; gap: 3px; font: 500 14px Inter, sans-serif; }
#chat-log div { transition: opacity 1s; }
#chat-log b { font-weight: 600; }
#chat-input {
  display: none; pointer-events: auto; width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--accent);
  background: rgba(10,10,12,0.85); color: var(--text); font: 14px Inter, sans-serif; outline: none;
}
#chat.open #chat-input { display: block; }
#chat.open #chat-log div { opacity: 1 !important; }
#death { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; }
#death .d1 { font-size: 14px; letter-spacing: 6px; color: var(--muted); }
#killer { font-size: 40px; font-weight: 700; margin: 4px 0; }
#respawn { font-size: 15px; color: var(--muted); letter-spacing: 2px; }
#scoreboard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, 92vw);
  padding: 20px 24px; border-radius: 12px; background: rgba(12,13,16,0.86); border: 1px solid var(--line); text-shadow: none;
}
.sb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.sb-logo { font-size: 26px; font-weight: 700; font-style: italic; letter-spacing: 3px; }
#sb-title { color: var(--muted); font-size: 13px; letter-spacing: 2px; }
#scoreboard table { width: 100%; border-collapse: collapse; font: 500 15px Inter, sans-serif; }
#scoreboard th { text-align: left; font: 600 11px 'Chakra Petch', sans-serif; letter-spacing: 2px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
#scoreboard td { padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }
#scoreboard th:not(:first-child), #scoreboard td:not(:first-child) { text-align: right; width: 70px; }
#scoreboard tr.me td { background: rgba(255,106,43,0.14); }
.bot-tag { font: 600 9px Inter, sans-serif; letter-spacing: 1px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; margin-left: 8px; vertical-align: middle; }
.bot-tag.tier1 { color: #8fd18a; } .bot-tag.tier2 { color: #e8c86a; } .bot-tag.tier3 { color: #ff7a5c; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 8px; }

/* ---------------- menu: play / account / leaderboard ---------------- */
.menu-card { width: 100%; }
@media (min-width: 900px) { .menu-card { width: 75%; } }
/* lifetime stats: one row per stat, label left, number right */
.my-stats { display: flex; flex-direction: column; margin: 4px 0 2px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.my-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 12px; }
.my-stats div:nth-child(odd) { background: rgba(255,255,255,0.04); }
.my-stats b { font: 700 17px 'Chakra Petch', sans-serif; font-variant-numeric: tabular-nums; text-align: right; }
.my-stats span { font: 600 10px 'Chakra Petch', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 760px) { .menu-grid { grid-template-columns: 1fr; } }
.panel { background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.panel-title { font: 600 13px 'Chakra Petch', sans-serif; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: #ff8a6b; min-height: 0; }
.error:empty, #auth-hint:empty { display: none; }
.hidden { display: none !important; }
.menu-card input:not([type=range]):not([type=checkbox]) {
  width: 100%; min-width: 0; font: 600 16px Inter, sans-serif; padding: 11px 13px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--text); outline: none;
}
.menu-card input:focus { border-color: var(--accent); }
.menu-card input.invalid { border-color: #ff6a4b; }
#name-hint { margin: 6px 0 0; }
.join-row { margin: 4px 0 0; }
.play-btn { padding: 14px 0; }
.join-row .play-btn { flex: 1; }
.secondary-btn, .small-btn {
  font: 700 14px 'Chakra Petch', sans-serif; letter-spacing: 2px; padding: 11px 16px; border-radius: 8px; cursor: pointer;
  background: rgba(255,106,43,0.14); color: var(--text); border: 1px solid rgba(255,106,43,0.55);
}
.secondary-btn:hover, .small-btn:hover { background: rgba(255,106,43,0.28); }
.secondary-btn:disabled { opacity: .5; cursor: wait; }
.small-btn { padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.account-head { display: flex; align-items: center; justify-content: space-between; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border-radius: 6px;
  background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: color .1s, border-color .1s, background .1s; }
.icon-btn:hover, .icon-btn:focus-visible { color: var(--accent); border-color: rgba(255,106,43,0.55); background: rgba(255,106,43,0.1); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-2); cursor: pointer; font: 500 13px Inter, sans-serif; text-align: left; text-decoration: underline; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font: 500 13px Inter, sans-serif !important; padding: 8px 10px !important; }
.slider, #host-bots { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 13px; }
.slider input, #host-bots input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.slider output, #host-bots output { color: var(--accent-2); }
#host-bots { margin-top: 10px; }
#user-line { font-size: 15px; }
.reg-badge { color: #7fd36b; font-weight: 700; }
.invite { padding: 10px 12px; border-radius: 8px; background: rgba(80,160,255,0.1); border: 1px solid rgba(80,160,255,0.4); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.invite-title { font: 600 12px 'Chakra Petch', sans-serif; letter-spacing: 2px; text-transform: uppercase; color: #8fc3ff; }
.tabs { display: flex; gap: 4px; }
.tab { flex: 1; background: transparent; border: 0; border-bottom: 2px solid var(--line); color: var(--muted); padding: 8px; cursor: pointer; font: 600 13px Inter, sans-serif; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
#auth-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.lb-title { margin-top: 6px; }
#leaderboard { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
#leaderboard th { text-align: left; font: 600 10px 'Chakra Petch', sans-serif; letter-spacing: 1.5px; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); }
#leaderboard td { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,0.04); }
#leaderboard th:nth-child(n+3), #leaderboard td:nth-child(n+3) { text-align: right; }
#leaderboard td:first-child { color: var(--muted); width: 22px; }
#leaderboard .empty td { color: var(--muted); text-align: left; font-style: italic; }
details.more { border-top: 1px solid var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; color: var(--muted); font: 600 13px 'Chakra Petch', sans-serif; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px; }
#scoreboard .reg-badge { margin-left: 6px; font-size: 12px; }

/* ---------------- touch (phones / tablets) ---------------- */
.touch-only { display: none; }
body.touch .touch-only { display: block; }
body.touch .desktop-only { display: none !important; }
.controls .k { font: 600 11px Inter, sans-serif; padding: 3px 6px; border-radius: 4px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); color: var(--text); margin: 0 !important; }
body.touch { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body.touch #menu { touch-action: pan-y; }
body.touch .menu-card { padding: 20px 18px; }

#touch {
  position: fixed; inset: 0; z-index: 12; touch-action: none; -webkit-user-select: none; user-select: none;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --sb: env(safe-area-inset-bottom, 0px);
}
#stick {
  position: absolute; left: calc(110px + var(--sl)); top: calc(100% - 110px - var(--sb)); width: 120px; height: 120px; margin: -60px 0 0 -60px;
  border-radius: 50%; border: 2px solid rgba(255,255,255,0.18); background: rgba(14,15,18,0.25); opacity: 0; pointer-events: none; transition: opacity .15s; /* only visible while moving */
}
#stick.active { opacity: 1; }
#stick-knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgba(255,255,255,0.35); border: 2px solid rgba(255,255,255,0.5);
}
.tb {
  position: absolute; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%;
  width: var(--s, 54px); height: var(--s, 54px); right: calc(var(--r) + var(--sr)); bottom: calc(var(--b) + var(--sb));
  font: 700 12px 'Chakra Petch', sans-serif; letter-spacing: 1px; color: rgba(255,255,255,0.9);
  background: rgba(14,15,18,0.4); border: 2px solid rgba(255,255,255,0.28); touch-action: none; -webkit-user-select: none; user-select: none;
}
.tb.down, .tb.on { background: rgba(255,106,43,0.5); border-color: var(--accent); }
#t-fire { --s: 88px; --r: 24px; --b: 28px; font-size: 14px; background: rgba(255,106,43,0.22); border-color: rgba(255,106,43,0.7); }
#t-jump { --s: 62px; --r: 126px; --b: 16px; font-size: 11px; }
#t-crouch { --s: 50px; --r: 138px; --b: 92px; font-size: 16px; }
#t-swap { --s: 50px; --r: 43px; --b: 130px; font-size: 20px; }
#t-pause { --s: 40px; border-radius: 10px; font-size: 13px; bottom: auto; right: auto; top: calc(8px + env(safe-area-inset-top, 0px)); }
#t-pause { left: calc(8px + var(--sl)); }

/* HUD rearranged so the thumbs don't cover it */
body.touch #hp-box, body.touch #ammo-box { bottom: auto; top: 8px; min-width: 0; padding: 6px 12px; }
body.touch #hp-box { left: calc(56px + env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 10px; }
body.touch #hp-box .lbl { display: none; }
body.touch #hp { font-size: 26px; }
body.touch #hp-box .bar { width: 70px; margin: 0; }
body.touch #bandages { margin: 0; }
body.touch .hp-foot { margin: 0; }
body.touch #level .bar { width: 36px; }
body.touch #ammo-box { right: calc(8px + env(safe-area-inset-right, 0px)); display: flex; align-items: baseline; gap: 10px; }
body.touch #mag { font-size: 26px; }
body.touch #res { font-size: 14px; }
body.touch #nades { margin: 0; }
body.touch #slots { display: none; }
body.touch #killfeed { top: 56px; right: calc(8px + env(safe-area-inset-right, 0px)); }
body.touch #killfeed .kf { font-size: 11px; padding: 3px 7px; }
body.touch #notices { top: 56px; left: calc(8px + env(safe-area-inset-left, 0px)); font-size: 11px; }
body.touch #netinfo { bottom: calc(4px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); font-size: 9px; opacity: .7; white-space: nowrap; }
body.touch #speed { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); font-size: 13px; }
body.touch #chat { bottom: auto; top: 110px; left: calc(8px + env(safe-area-inset-left, 0px)); }
body.touch #chat-log { font-size: 12px; }
body.touch #center { font-size: 16px; }
body.touch #killer { font-size: 28px; }
@media (max-height: 420px) {
  body.touch #death { top: 14%; }
}

#rotate { display: none; }
@media (orientation: portrait) {
  body.touch #rotate {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; position: fixed; inset: 0; z-index: 15;
    background: rgba(8,9,11,0.92); font: 600 18px 'Chakra Petch', sans-serif; letter-spacing: 1px; text-align: center; padding: 24px;
  }
  body.touch #rotate div { font-size: 54px; color: var(--accent); }
}
/* short screens (phones in landscape): let the menu scroll from the top instead of clipping the logo */
#menu { align-items: flex-start; }
.menu-card { margin: auto 0; }
@media (max-height: 500px) {
  .logo { font-size: 40px; }
  .logo-wrap { margin-bottom: 12px; }
}
#account-in { display: flex; flex-direction: column; gap: 8px; }

/* map pickers (open game + private game) */
.map-pick { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.map-pick select {
  flex: 1; min-width: 0; font: 600 15px Inter, sans-serif; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  background: #1c1d22; color: var(--text); border: 1px solid var(--line); outline: none;
}
.map-pick select:focus { border-color: var(--accent); }

/* announcer text: HEADSHOT / DOUBLE KILL / RAMPAGE ... */
#announce {
  position: absolute; left: 50%; top: 19%; transform: translateX(-50%); white-space: nowrap; opacity: 0;
  font: italic 700 34px 'Chakra Petch', sans-serif; letter-spacing: 3px; color: var(--accent);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 0 18px rgba(255,106,43,0.45);
}
#announce.show { animation: announce 1.8s ease-out forwards; }
@keyframes announce {
  0% { opacity: 0; transform: translateX(-50%) scale(1.6); }
  12% { opacity: 1; transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(0.96); }
}
body.touch #announce { font-size: 24px; top: 24%; }

/* open game map choice: radio cards (the radio itself is hidden) */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.map-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.map-card {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line); transition: border-color .1s, background .1s;
}
.map-card:hover { background: rgba(255,255,255,0.06); }
.map-card.selected { border-color: var(--accent); background: rgba(255,106,43,0.12); }
.map-card:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.mc-name { font: 700 14px 'Chakra Petch', sans-serif; letter-spacing: 1px; }
.mc-count { font-size: 12px; color: var(--muted); }
.map-card.busy .mc-count { color: #7fd36b; }
.map-card.full .mc-count { color: #ff8a6b; }

/* bot mix picker: - n + per difficulty */
.bot-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bp-row { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border-radius: 8px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.bp-name { font: 600 11px 'Chakra Petch', sans-serif; letter-spacing: 1.5px; text-transform: uppercase; }
.bp-hard .bp-name { color: #ff7a5c; } .bp-medium .bp-name { color: #e8c86a; } .bp-easy .bp-name { color: #8fd18a; }
.bp-ctl { display: flex; align-items: center; gap: 8px; }
.bp-ctl output { min-width: 18px; text-align: center; font: 700 18px 'Chakra Petch', sans-serif; font-variant-numeric: tabular-nums; }
.bp-ctl button {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,0.06);
  color: var(--text); font: 700 16px Inter, sans-serif; cursor: pointer; line-height: 1;
}
.bp-ctl button:hover:not(:disabled) { border-color: var(--accent); }
.bp-ctl button:disabled { opacity: .3; cursor: default; }
.bp-total { color: var(--accent-2); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* sniper scope: dark outside a circle, thin cross */
#scope {
  position: absolute; inset: 0; display: none;
  background: radial-gradient(circle at center, transparent 0, transparent min(34vh, 34vw), rgba(0,0,0,0.96) calc(min(34vh, 34vw) + 2px));
}
#scope.on { display: block; }
#scope i { position: absolute; background: rgba(0,0,0,0.85); }
#scope .sc-h { left: 0; right: 0; top: 50%; height: 1px; }
#scope .sc-v { top: 0; bottom: 0; left: 50%; width: 1px; }
.weapon-cards { margin-bottom: 4px; }
.weapon-cards .mc-count { color: var(--muted) !important; }
/* mobile: aim / scope button while holding a gun */
#t-zoom { --s: 50px; --r: 43px; --b: 192px; font-size: 20px; display: none; }
#touch.scoped-weapon #t-zoom { display: flex; }

#server-outdated { color: #ffb4a6; padding: 10px 12px; border-radius: 8px; background: rgba(255,70,50,0.12); border: 1px solid rgba(255,90,60,0.45); margin-bottom: 12px; font-size: 14px; }
#server-outdated code { font-size: 12px; background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 4px; }

/* loading screen while the game code downloads (instead of a half-built menu) */
#boot { display: none; }
body.booting #boot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  position: fixed; inset: 0; z-index: 30; background: #0b0c0e;
}
body.booting #menu, body.booting #hud { visibility: hidden; }
.boot-spin {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--accent);
  animation: boot-spin .8s linear infinite;
}
.boot-text { font: 600 13px 'Chakra Petch', sans-serif; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
@keyframes boot-spin { to { transform: rotate(360deg); } }

/* menu blocks: open game / invited game / create private game / paused in a game */
.block { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 10px; background: rgba(255,255,255,0.025); border: 1px solid var(--line); }
.block .field-label { margin-bottom: -4px; }
#invite-box { background: rgba(80,160,255,0.07); border-color: rgba(80,160,255,0.45); }
#invite-box .link-btn { align-self: flex-start; }
#invite-text { font-size: 14px; }
.map-card.disabled { opacity: .35; cursor: not-allowed; }
