/* 對決吧！ — chunky, bright and outlined, like the games homepage */
/* the zh-TW round font is 來釣魚吧！'s, next door (/fish/ behind the homepage, the root on a bare Node server) */
@font-face { font-family: 'LetsFish Round'; src: url('../../fish/fonts/letsfish-round.woff2') format('woff2'), url('../../fonts/letsfish-round.woff2') format('woff2'); font-display: swap; }

:root {
  --ink: #22163a; --ink2: #4b3b68; --cream: #fff7e6; --cream2: #ffeccb;
  --sun: #ffd23f; --coral: #ff5d8f; --sea: #3fa7ff; --mint: #5bd96a; --grape: #8c5cff;
  --red: #ff4d5e; --red-d: #b3203a; --blue: #3d8bff; --blue-d: #1d4fb8;
  --title: 'Lilita One', 'LetsFish Round', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  --font: 'LetsFish Round', 'Fredoka', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif;
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --gw: 100vw; --gh: 100vh; /* the match's frame (set by the game; turned on an upright phone) */
}
/* a phone held upright in a match: the stage is drawn turned a quarter, so
   its left is the screen's top (and the notch moves round with it) */
html.turned { --safe-l: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-left, 0px); }
html.turned #stage { position: fixed; left: 0; top: 0; width: var(--gw); height: var(--gh); transform-origin: 0 0; transform: translateX(var(--gh)) rotate(90deg); z-index: 5; }
/* a game, not a page: on a phone nothing gets selected, pinched or
   double-tapped bigger, dragged, pulled to refresh, or long-pressed into a
   menu (only pans scroll; the match's own layers take every touch, and
   common/mobile.js also stops Safari's native zoom gestures) */
* { box-sizing: border-box; touch-action: pan-x pan-y; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: #2a1d4a; color: var(--ink); font-family: var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
img { -webkit-user-drag: none; user-drag: none; }
input[type="range"] { touch-action: none; }
#room, .tabpane, .modal-body, .chat-log { overscroll-behavior: contain; }
@media (pointer: coarse) { .chatbox .chat-log { user-select: none; -webkit-user-select: none; } }
[hidden] { display: none !important; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: none; }
input, button { font: inherit; }
input { user-select: text; -webkit-user-select: text; }
.team0 { color: var(--red); } .team1 { color: var(--blue); }

/* ------------------------------------------------------------ bits */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); font: 600 16px var(--font); cursor: pointer; box-shadow: 0 4px 0 var(--ink); transition: transform .06s, box-shadow .06s; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--coral); color: #fff; text-shadow: 0 2px 0 var(--ink); font: 400 19px var(--title); letter-spacing: .5px; }
.btn.danger { background: #ff6b6b; color: #fff; }
.btn.ghost { background: rgba(255, 255, 255, .85); }
.btn.big { padding: 12px 26px; font-size: 24px; width: 100%; }
.btn.small { padding: 5px 12px; font-size: 14px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink); }
.btn.tiny { padding: 1px 8px; font-size: 14px; border-radius: 9px; box-shadow: 0 2px 0 var(--ink); }
.panel { background: var(--cream); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); }
.card { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 12px 14px; margin-top: 12px; box-shadow: 0 4px 0 rgba(34, 22, 58, .25); }
.card h2 { margin: 0 0 8px; font: 400 22px var(--title); letter-spacing: .5px; }
.card h2 small { font: 600 13px var(--font); color: var(--ink2); margin-left: 6px; }
.row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.row .label { width: 40px; flex: none; font-weight: 700; font-size: 15px; color: var(--ink2); }
.seg { display: inline-flex; flex-wrap: wrap; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-right: 2px solid var(--ink); background: transparent; padding: 5px 11px; font-weight: 700; font-size: 15px; cursor: pointer; color: var(--ink); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--sun); }
.seg.locked button { cursor: default; }
.seg.locked button:not(.on) { color: #a99cb8; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--coral); }
.field { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.field input, .join input, #chat-in { flex: 1; min-width: 0; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font-size: 17px; color: var(--ink); outline: none; }
.field input:focus, .join input:focus, #chat-in:focus { border-color: var(--coral); }
.badge { display: inline-block; padding: 1px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--mint); font-size: 13px; font-weight: 700; }
.badge.private { background: #ddd3ee; }

/* ------------------------------------------------------------ the menu */
.screen { position: fixed; inset: 0; z-index: 2; overflow: hidden; }
#menu .home { position: absolute; left: calc(14px + var(--safe-l)); top: calc(12px + var(--safe-t)); z-index: 3; }
.logo { position: absolute; left: calc(28px + var(--safe-l)); top: calc(64px + var(--safe-t)); pointer-events: none; }
.logo h1 { margin: 0; font: 400 clamp(54px, 8vw, 104px)/1 var(--title); color: var(--sun); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink); transform: rotate(-4deg); letter-spacing: 3px; animation: wobble 3.2s ease-in-out infinite; }
.logo p { margin: 14px 0 0 6px; font-weight: 700; font-size: 18px; color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 10px rgba(0, 0, 0, .4); }
@keyframes wobble { 50% { transform: rotate(-1deg) scale(1.03); } }
.menu-panel { position: absolute; right: calc(20px + var(--safe-r)); top: calc(20px + var(--safe-t)); bottom: calc(20px + var(--safe-b)); width: min(470px, calc(100vw - 40px)); display: flex; flex-direction: column; padding: 12px 14px 14px; }
.tabs { display: flex; gap: 6px; flex: none; }
.tab { flex: 1; padding: 8px 6px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font: 400 18px var(--title); letter-spacing: .5px; color: var(--ink2); cursor: pointer; }
.tab.on { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.tabpane { flex: 1; overflow-y: auto; padding: 4px 2px 6px; margin-top: 8px; scrollbar-width: thin; }
.name-field { margin-top: 4px; }
.solo .seg button { min-width: 52px; }
.online .buttons { justify-content: space-between; }
.join { display: inline-flex; gap: 6px; flex: 1; justify-content: flex-end; }
.join input { max-width: 96px; text-transform: uppercase; text-align: center; letter-spacing: 3px; font-weight: 700; }
.rooms-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-weight: 700; color: var(--ink2); font-size: 14px; }
.rooms { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.rooms .empty { margin: 6px 0; color: var(--ink2); font-size: 14px; }
.room-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 3px solid var(--ink); border-radius: 13px; background: var(--cream); cursor: pointer; }
.room-item:hover { background: #fff3c4; }
.room-item .ri-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .ri-name small { display: block; font-weight: 500; color: var(--ink2); font-size: 12.5px; }
.room-item .ri-n { font-weight: 700; }
.room-item .ri-st { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--mint); }
.room-item .ri-st.playing { background: var(--sun); }

/* the character customiser: the bodies as pictures, then one icon per part
   (showing what you have on) that opens a little picker under the row */
.looks h4, .modal-body h4 { margin: 12px 0 6px; font: 400 18px var(--title); letter-spacing: .5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 11px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.chip.body { width: 82px; padding: 3px; display: flex; flex-direction: column; align-items: center; font-size: 13px; }
.chip.body img, .chip.body .ph { width: 72px; height: 88px; object-fit: contain; display: block; }
.chip.body .ph { display: grid; place-items: center; font-size: 30px; }
.look-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.look-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 6px 0 4px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--ink); color: var(--ink); cursor: pointer; transition: transform .08s, box-shadow .08s; }
.look-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.look-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.look-btn.open { background: var(--sun); }
.look-btn small { font-weight: 700; font-size: 12px; white-space: nowrap; }
.look-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--ink); background: var(--cream2); font-size: 26px; font-style: normal; line-height: 1; }
.look-ic.emoji { border: 0; background: none; }
.look-pop { position: relative; margin-top: 12px; padding: 8px 10px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); animation: lp-in .14s ease-out; }
.look-pop::before { content: ''; position: absolute; top: -11px; left: calc(var(--ax, 30px) - 10px); border: 10px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
.look-pop::after { content: ''; position: absolute; top: -7px; left: calc(var(--ax, 30px) - 7px); border: 7px solid transparent; border-top: 0; border-bottom-color: #fff; }
@keyframes lp-in { from { opacity: 0; transform: translateY(-6px); } }
.lp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.lp-head b { font: 400 17px var(--title); letter-spacing: .5px; }
.lp-cur { font-size: 13px; font-weight: 700; color: var(--ink2); }
.lp-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.lp-opt { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 4px 2px 3px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; transition: transform .08s; }
.lp-opt:hover { transform: translateY(-2px); }
.lp-opt.on { background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.lp-opt b { font-size: 24px; line-height: 1.15; font-weight: 400; }
.lp-opt span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.lp-colors { display: flex; flex-wrap: wrap; }
.lp-colors .lp-opt { padding: 3px; border-radius: 50%; }
.lp-colors .lp-opt.on { box-shadow: 0 3px 0 var(--ink); }
.lp-opt .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); }

/* the loadout */
.gear h4 { margin: 12px 0 6px; font: 400 18px var(--title); letter-spacing: .5px; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 7px; }
.wcard { border: 3px solid var(--ink); border-radius: 14px; background: #fff; padding: 4px 6px 6px; cursor: pointer; text-align: center; }
.wcard.on { background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.wcard img, .wcard .ph { width: 100%; height: 56px; object-fit: contain; display: block; }
.wcard .ph { display: grid; place-items: center; font-size: 26px; }
.wcard b { display: block; font-size: 15px; }
.wcard small { display: block; font-size: 11.5px; color: var(--ink2); line-height: 1.3; min-height: 2.6em; }

/* ------------------------------------------------------------ the room */
#room { background: linear-gradient(180deg, rgba(42, 29, 74, .55), rgba(42, 29, 74, .85)); overflow-y: auto; }
.room-wrap { max-width: 1180px; margin: 0 auto; padding: calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) calc(18px + var(--safe-b)) calc(14px + var(--safe-l)); min-height: 100%; display: flex; flex-direction: column; gap: 14px; }
.room-head { display: flex; align-items: center; gap: 14px; padding: 10px 14px; flex-wrap: wrap; }
.room-title { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 10px; }
.room-title h2 { margin: 0; font: 400 26px var(--title); letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; color: var(--ink2); }
.room-code b { font: 400 30px var(--title); letter-spacing: 4px; color: var(--coral); -webkit-text-stroke: 1.5px var(--ink); }
.room-main { display: grid; grid-template-columns: 1fr 380px; gap: 14px; flex: 1; min-height: 0; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-content: start; }
.team-col { background: rgba(255, 247, 230, .95); border: 4px solid var(--ink); border-radius: 22px; padding: 10px; box-shadow: 0 8px 0 var(--ink); display: flex; flex-direction: column; gap: 8px; }
.team-col h3 { margin: 0; text-align: center; font: 400 28px var(--title); -webkit-text-stroke: 1.5px var(--ink); letter-spacing: 2px; }
.team-col .slots { display: flex; flex-direction: column; gap: 8px; }
.vs { align-self: center; font: 400 44px var(--title); color: var(--sun); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); }
.seat { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 3px solid var(--ink); border-radius: 15px; background: #fff; min-height: 76px; position: relative; }
.team0 .seat { box-shadow: inset 6px 0 0 var(--red); }
.team1 .seat { box-shadow: inset 6px 0 0 var(--blue); }
.seat img, .seat .ph { width: 54px; height: 66px; object-fit: contain; flex: none; }
.seat .ph { display: grid; place-items: center; font-size: 30px; }
.seat .who { flex: 1; min-width: 0; }
.seat .who b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .who small { color: var(--ink2); font-size: 12.5px; font-weight: 600; }
.seat.bot { background: #f1ecf7; color: var(--ink2); }
.seat.empty { background: transparent; border-style: dashed; color: #8b7fa0; justify-content: center; font-weight: 700; }
.seat.me { background: #fff8d6; }
.seat .kick { position: absolute; right: 6px; top: 6px; }
/* the account's avatar left of a name (common/player-avatar.js), inked like the rest; sized here, not by --player-avatar-size, over `.seat img` */
/* (a column may be narrower than a name and its avatar: the name ends in … instead of pushing the room off an upright phone) */
.team-col { min-width: 0; }
.seat .who .player-avatar { width: 1.3em; height: 1.3em; margin-right: .3em; border: 2px solid var(--ink); box-shadow: none; vertical-align: middle; object-fit: cover; }
.watchers { grid-column: 1 / -1; color: #fff; font-weight: 600; text-shadow: 0 2px 0 var(--ink); }
.watchers button { margin-left: 8px; }
.watchers .watcher { white-space: nowrap; }
.watchers .player-avatar { width: 1.3em; height: 1.3em; margin-right: .25em; border: 2px solid var(--ink); box-shadow: none; vertical-align: middle; text-shadow: none; }
.room-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.settings { padding: 12px 14px 14px; }
.settings h3 { margin: 0 0 6px; font: 400 22px var(--title); letter-spacing: .5px; }
.settings h3 small { font: 600 13px var(--font); color: var(--ink2); }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.mapcard { position: relative; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; cursor: pointer; background: #ddd; aspect-ratio: 16 / 10; }
.mapcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mapcard span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; background: rgba(34, 22, 58, .75); color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.mapcard.on { outline: 4px solid var(--sun); outline-offset: -1px; }
.mapcard.random { background: linear-gradient(135deg, #ff7eb6, #ffd23f 35%, #5cc8ff 70%, #8c5cff); }
.mapcard.random span { top: 0; display: grid; place-items: center; background: rgba(34, 22, 58, .35); font-size: 16px; }
.mapcard.on::after { content: '✔'; position: absolute; right: 4px; top: 2px; color: var(--sun); font-size: 18px; -webkit-text-stroke: 1px var(--ink); }
.settings.locked .mapcard { cursor: default; }
.wait { margin: 10px 0 0; text-align: center; font-weight: 700; color: var(--ink2); }
.chatbox { flex: 1; min-height: 220px; display: flex; flex-direction: column; padding: 10px; }
.chatbox .chat-log { flex: 1; overflow-y: auto; font-size: 15px; line-height: 1.45; padding: 2px 4px; min-height: 120px; max-height: 40vh; user-select: text; -webkit-user-select: text; }
.chatbox .line.sys { color: #8b7fa0; font-size: 13.5px; }
.chatbox .chat-log .player-avatar { width: 1.35em; height: 1.35em; margin-right: .3em; border: 1.5px solid var(--ink); box-shadow: none; vertical-align: middle; }
.chatbox form { display: flex; gap: 6px; margin-top: 6px; }
.modal { position: fixed; inset: 0; z-index: 8; background: rgba(34, 22, 58, .6); display: grid; place-items: center; padding: 16px; }
.modal-box { width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; padding: 12px 14px; }
.modal-box .tabs { align-items: center; }
.modal-box .close { flex: none; }
.modal-body { overflow-y: auto; margin-top: 8px; }

/* ------------------------------------------------------------ loading and toasts */
.loading { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 14px; background: #2a1d4a; color: #fff; font-weight: 700; font-size: 18px; transition: opacity .3s; }
.loading.gone { opacity: 0; pointer-events: none; }
.spin { width: 56px; height: 56px; border: 7px solid rgba(255, 255, 255, .2); border-top-color: var(--sun); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; left: 50%; top: calc(16px + var(--safe-t)); transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 9px 18px; border: 3px solid var(--ink); border-radius: 14px; background: var(--cream); font-weight: 700; box-shadow: 0 4px 0 var(--ink); animation: toast 3.4s forwards; }
.toast.bad { background: #ffd6dc; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ------------------------------------------------------------ the match */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; color: #fff; font-family: var(--font); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
#hud .team0 { color: #ff7a87; } #hud .team1 { color: #76aaff; }
.tags, .nums { position: absolute; inset: 0; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; font-size: 15px; white-space: nowrap; transform-origin: 50% 100%; will-change: transform; }
.tag-name { padding: 0 6px; border-radius: 8px; background: rgba(34, 22, 58, .55); }
.tag.enemy .tag-name { color: #ff8a95; }
.tag.ally .tag-name { color: #9fc2ff; }
.tag-hp { width: 56px; height: 6px; border-radius: 4px; background: rgba(0, 0, 0, .5); overflow: hidden; border: 1px solid rgba(0, 0, 0, .6); }
.tag-hp i { display: block; height: 100%; background: #6ee36e; }
.tag.enemy .tag-hp i { background: #ff5d6c; }
.num { position: absolute; left: 0; top: 0; font: 400 26px var(--title); color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; will-change: transform; }
.num.head { color: var(--sun); font-size: 32px; }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(220, 20, 40, .55) 100%); opacity: 0; transition: opacity .3s; }
.hurt { position: absolute; inset: 0; opacity: 0; }
.hurt.on { animation: hurt .6s ease-out; }
.hurt:not(.dir) { background: radial-gradient(ellipse at center, transparent 50%, rgba(255, 30, 50, .5) 100%); }
.hurt.dir::before { content: ''; position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px; border-radius: 50%; border: 10px solid transparent; border-top-color: rgba(255, 40, 60, .85); transform: rotate(var(--a)); filter: blur(1px); }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
/* the sniper's scope: a duplex reticle, thick posts from the rim that thin
   to hairlines round a small dot in the crosshair's colour, so the middle
   never hides a head */
.scope { position: absolute; inset: 0; display: none; --R: calc(min(var(--gw), var(--gh)) * .38); --in: calc(var(--R) * .42);
  background: radial-gradient(circle at center, transparent 0, transparent var(--R), #000 calc(var(--R) + 2px)); }
.scope.on { display: block; }
.scope::before, .scope::after { content: ''; position: absolute; background: rgba(0, 0, 0, .9); }
.scope::before { left: 0; right: 0; top: 50%; height: 1px; }
.scope::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.scope .post { position: absolute; }
.scope .post.h { left: 0; right: 0; top: 50%; height: 5px; margin-top: -2px; background: linear-gradient(90deg, #000 calc(50% - var(--in)), transparent 0 calc(50% + var(--in)), #000 0); }
.scope .post.v { top: 0; bottom: 0; left: 50%; width: 5px; margin-left: -2px; background: linear-gradient(#000 calc(50% - var(--in)), transparent 0 calc(50% + var(--in)), #000 0); }
.scope-ring { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--xh); box-shadow: 0 0 0 1px rgba(0, 0, 0, .75); }

.hud-top { position: absolute; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; }
.pips { display: flex; gap: 5px; min-width: 40px; }
.pips.p0 { justify-content: flex-end; }
.pip { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 14px; border: 3px solid var(--ink); text-shadow: none; color: #fff; }
.pip.team0 { background: var(--red); } .pip.team1 { background: var(--blue); }
#hud .pip.team0, #hud .pip.team1 { color: #fff; }
.pip.me { outline: 3px solid var(--sun); }
.pip.down { background: #5b5368 !important; color: #a99fb6 !important; position: relative; }
.pip.down::after { content: '✕'; position: absolute; font-size: 22px; color: #ff6b7a; }
.scorebox { display: flex; align-items: center; gap: 10px; padding: 4px 14px; border: 3px solid var(--ink); border-radius: 18px; background: rgba(34, 22, 58, .78); }
.scorebox b { font: 400 38px/1 var(--title); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; min-width: 28px; text-align: center; }
.scorebox .mid { text-align: center; }
.timer { font: 400 24px/1 var(--title); letter-spacing: 1px; }
.timer.hurry { color: #ff6b7a; animation: pulse .5s ease-in-out infinite alternate; }
.rnd { font-size: 11.5px; font-weight: 600; opacity: .85; white-space: nowrap; }
@keyframes pulse { to { transform: scale(1.12); } }

.feed { position: absolute; right: calc(14px + var(--safe-r)); top: calc(12px + var(--safe-t)); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kill { display: flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 10px; background: rgba(34, 22, 58, .72); font-weight: 700; font-size: 15px; transition: opacity .6s; }
.kill.mine { background: rgba(255, 210, 63, .35); border: 2px solid var(--sun); }
.kill.old { opacity: 0; }
.kill img { height: 22px; width: 44px; object-fit: contain; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .6)); }
.kill .wname { font-size: 12px; opacity: .8; }
.kill .oops { font-size: 13px; opacity: .85; }
.kill .bs { padding: 0 6px; border: 2px solid var(--ink); border-radius: 7px; background: #ff9f1c; color: #fff; font-size: 12.5px; text-shadow: 0 1px 0 var(--ink); }

/* the crosshair: thin lines that open with the spread round a dot, in the
   colour picked in the menu (--xh) with a dark edge so it reads on any wall.
   Aiming leaves the lines faint; down the sights they go and the dot
   shrinks to a see-through pin, so the sight does the aiming */
#hud { --xh: #fff; }
.crosshair { position: absolute; left: 50%; top: 50%; --gap: 8px; --len: 8px; }
.crosshair .ch { position: absolute; background: var(--xh); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); border-radius: 1px; transition: opacity .12s; }
.crosshair .t, .crosshair .b { width: 2px; height: var(--len); left: -1px; }
.crosshair .l, .crosshair .r { height: 2px; width: var(--len); top: -1px; }
.crosshair .t { top: calc(-1 * var(--gap) - var(--len)); } .crosshair .b { top: var(--gap); }
.crosshair .l { left: calc(-1 * var(--gap) - var(--len)); } .crosshair .r { left: var(--gap); }
.crosshair .dot { position: absolute; width: 4px; height: 4px; left: -2px; top: -2px; border-radius: 50%; background: var(--xh); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); transition: opacity .12s; }
.crosshair.ads .ch { opacity: .6; }
.crosshair.ads .dot { width: 2px; height: 2px; left: -1px; top: -1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); opacity: .75; }
.crosshair.sights .ch { opacity: 0; }
.hitmark { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px; opacity: 0; }
.hitmark::before, .hitmark::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: linear-gradient(#fff 0 35%, transparent 35% 65%, #fff 65%); }
.hitmark::before { transform: rotate(45deg); } .hitmark::after { transform: rotate(-45deg); }
.hitmark.head::before, .hitmark.head::after { background: linear-gradient(var(--sun) 0 35%, transparent 35% 65%, var(--sun) 65%); }
.hitmark.kill::before, .hitmark.kill::after { background: linear-gradient(#ff3b4e 0 38%, transparent 38% 62%, #ff3b4e 62%); width: 4px; }
.hitmark.on { animation: hitm .28s ease-out; }
.hitmark.kill.on { animation: hitm .5s ease-out; }
@keyframes hitm { 0% { opacity: 1; transform: scale(1.4); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

.announce { position: absolute; left: 0; right: 0; top: 22%; text-align: center; opacity: 0; transform: scale(.7); transition: opacity .25s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.announce.on { opacity: 1; transform: none; }
.announce .big { font: 400 clamp(40px, calc(var(--gw) * .07), 76px)/1.05 var(--title); color: var(--sun); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); letter-spacing: 2px; }
.announce .small { margin-top: 8px; font-weight: 700; font-size: 20px; }
.announce.win .big, .announce.go .big { color: #7cf07c; }
.announce.lose .big { color: #ff7a87; }
.announce.team0 .big { color: #ff7a87; } .announce.team1 .big { color: #76aaff; }
.count { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 400 110px var(--title); color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; opacity: 0; }
.count.on { animation: count 1s ease-out; }
@keyframes count { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1.6); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; } }
.banner { position: absolute; left: 50%; top: 60%; transform: translateX(-50%); font: 400 30px var(--title); letter-spacing: 1px; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; opacity: 0; white-space: nowrap; }
.banner .hs { color: var(--sun); margin-right: 8px; }
.banner .bs { color: #ff9f1c; margin-right: 8px; }
.banner .multi { display: block; text-align: center; font-size: 46px; color: #ff9f1c; animation: wobble .8s ease-in-out infinite; }
.versus { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 22px; opacity: 0; pointer-events: none; }
.versus.on { animation: versus 3.4s ease-out forwards; }
.vs-side { display: flex; flex-direction: column; gap: 6px; min-width: 170px; padding: 12px 16px; border: 4px solid var(--ink); border-radius: 20px; background: rgba(34, 22, 58, .82); }
.vs-side.team0 { align-items: flex-end; border-color: var(--red); } .vs-side.team1 { align-items: flex-start; border-color: var(--blue); }
.vs-side h4 { margin: 0 0 2px; font: 400 30px var(--title); letter-spacing: 2px; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.vs-side b { font-size: 18px; color: #fff; white-space: nowrap; }
.vs-side b.me { color: var(--sun); }
.vs-mid { font: 400 72px var(--title); color: var(--sun); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
@keyframes versus { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } 10%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.95); } }
.banner.on { animation: banner 1.8s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) scale(1.8); } 12% { opacity: 1; transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.death { position: absolute; left: 50%; bottom: 24%; transform: translateX(-50%); text-align: center; padding: 10px 22px; border: 3px solid var(--ink); border-radius: 18px; background: rgba(34, 22, 58, .8); opacity: 0; transition: opacity .3s; }
.death.on { opacity: 1; }
.death .big { font: 400 26px var(--title); letter-spacing: .5px; }
.death .small { font-weight: 600; font-size: 15px; opacity: .85; margin-top: 2px; }
.death .respawn { margin-top: 6px; font: 400 22px var(--title); color: var(--sun); letter-spacing: 1px; }

/* 奪旗戰: the flags' state under the score, the carrier's note, the markers */
.flagbar { position: absolute; top: calc(66px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.fchip { display: flex; align-items: center; gap: 4px; padding: 2px 10px 2px 6px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.fchip.team0 { background: rgba(179, 32, 58, .85); } .fchip.team1 { background: rgba(29, 79, 184, .85); }
.fchip b { font-weight: 400; font-size: 15px; }
.fchip.carried, .fchip.dropped { animation: pulse .45s ease-in-out infinite alternate; }
.carry { position: absolute; left: 50%; top: 68%; transform: translateX(-50%); padding: 5px 16px; border: 3px solid var(--ink); border-radius: 14px; background: rgba(255, 210, 63, .92); color: var(--ink); text-shadow: none; font-weight: 700; font-size: 17px; white-space: nowrap; opacity: 0; transition: opacity .25s; }
.carry.on { opacity: 1; }
.fmark { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 13px; white-space: nowrap; will-change: transform; transition: opacity .2s; }
.fmark b { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 3px solid var(--ink); border-radius: 50%; font-weight: 400; font-size: 17px; line-height: 1; }
.fmark b::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.fmark.team0 b { background: var(--red); } .fmark.team1 b { background: var(--blue); }
.fmark span { margin-top: 7px; padding: 0 6px; border-radius: 8px; background: rgba(34, 22, 58, .65); }
.fmark.edge { opacity: .8; }
.kill.flagline .fl { font-size: 15px; }
.kill.flagline .cap { color: #7cf07c; }
.kill.flagline .team0 { color: #ff8a95; } .kill.flagline .team1 { color: #9fc2ff; }
.spec { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); padding: 6px 16px; border-radius: 14px; background: rgba(34, 22, 58, .75); font-weight: 700; font-size: 18px; opacity: 0; }
.spec.on { opacity: 1; }
.spec small { margin-left: 10px; font-size: 13px; opacity: .75; }
#hud.watching .vitals, #hud.watching .arms, #hud.watching .crosshair, #hud.spectator .vitals, #hud.spectator .arms { display: none; }

.vitals { position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(16px + var(--safe-b)); }
.hp { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 16px; background: rgba(34, 22, 58, .72); }
.hp-bar { width: 220px; height: 18px; border-radius: 10px; background: rgba(0, 0, 0, .5); overflow: hidden; border: 2px solid rgba(0, 0, 0, .5); }
.hp-bar i { display: block; height: 100%; transition: width .15s; }
.hp-bar i.ok { background: linear-gradient(#8ff58f, #3fc84c); } .hp-bar i.mid { background: linear-gradient(#ffe27a, #f2b632); } .hp-bar i.low { background: linear-gradient(#ff8a95, #e8364b); }
.hp-num { font: 400 30px/1 var(--title); min-width: 52px; text-align: right; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.arms { position: absolute; right: calc(18px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ammo { display: flex; align-items: baseline; gap: 6px; }
.ammo .mag { font: 400 50px/1 var(--title); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.ammo .mag.low { color: #ff7a87; }
.ammo .max { font: 400 22px var(--title); opacity: .85; }
.ammo .note { font-style: normal; font-weight: 700; font-size: 14px; color: var(--sun); margin-left: 6px; }
.ammo .rl { display: none; }
.slots { display: flex; gap: 6px; pointer-events: auto; }
.slot { position: relative; width: 104px; padding: 3px 5px 4px; border: 3px solid var(--ink); border-radius: 14px; background: rgba(34, 22, 58, .65); text-align: center; cursor: pointer; opacity: .75; }
.slot.on { background: rgba(255, 210, 63, .32); border-color: var(--sun); opacity: 1; transform: translateY(-4px); }
.slot.empty { opacity: .35; }
.slot b { position: absolute; left: 6px; top: 2px; font: 400 15px var(--title); }
.slot img { width: 100%; height: 40px; object-fit: contain; display: block; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .5)); }
.slot span { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .cnt { position: absolute; right: 6px; top: 2px; font-style: normal; font-weight: 700; font-size: 13px; color: var(--sun); }

#hud .chat { position: absolute; left: calc(18px + var(--safe-l)); bottom: calc(90px + var(--safe-b)); width: min(420px, calc(var(--gw) * .6)); }
#hud .chat-log .line { font-size: 15px; font-weight: 600; padding: 1px 8px; border-radius: 8px; background: rgba(34, 22, 58, .45); margin-top: 3px; width: fit-content; max-width: 100%; transition: opacity 1s; }
#hud .chat-log .line.sys { color: #d6cde6; font-size: 13.5px; }
#hud .chat-log .line.old { opacity: 0; }
#hud.chatting .chat-log .line.old { opacity: 1; }
#hud .chat-log .player-avatar { width: 1.25em; height: 1.25em; margin-right: .3em; border: 1.5px solid rgba(255, 255, 255, .85); box-shadow: none; vertical-align: middle; }
/* the chat box: emotes, a line to type, a hint */
#hud .chat { z-index: 3; }
.chat-box { pointer-events: auto; margin-top: 6px; padding: 8px; border: 3px solid var(--ink); border-radius: 16px; background: rgba(255, 247, 230, .97); box-shadow: 0 4px 0 var(--ink); color: var(--ink); text-shadow: none; }
.emotes { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-bottom: 6px; }
.emo { aspect-ratio: 1; padding: 0; border: 2px solid var(--ink); border-radius: 10px; background: #fff; font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: transform .08s; touch-action: manipulation; }
.emo:hover, .emo:active { background: var(--sun); transform: scale(1.1); }
.chat-row { display: flex; gap: 6px; }
.chat-in { flex: 1; min-width: 0; padding: 7px 10px; border: 3px solid var(--ink); border-radius: 12px; font-size: 16px; font-weight: 600; color: var(--ink); background: #fff; outline: none; }
.chat-in:focus { box-shadow: 0 0 0 3px var(--sun); }
.chat-help { margin-top: 5px; font-weight: 600; font-size: 12px; color: var(--ink2); min-height: 1.3em; }
.chat-help kbd { font: inherit; padding: 0 4px; border: 1.5px solid var(--ink2); border-radius: 4px; background: #fff; }
/* an emote's emoji over someone's head (or yours, while the camera watches you) */
.tag-emo { display: none; margin-bottom: 2px; font-size: 34px; line-height: 1.1; text-shadow: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); animation: emo-pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.tag.emoting .tag-emo, .tag.self .tag-emo { display: block; }
.tag.self .tag-emo { font-size: 44px; }
@keyframes emo-pop { 0% { transform: translateY(12px) scale(.2); opacity: 0; } 100% { transform: none; opacity: 1; } }

.board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.board-in { display: flex; gap: 14px; }
.board .col, .results .col { padding: 10px 14px; border: 3px solid var(--ink); border-radius: 18px; background: rgba(34, 22, 58, .88); min-width: 290px; }
.col h3 { margin: 0 0 6px; font: 400 26px var(--title); letter-spacing: 1px; display: flex; justify-content: space-between; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.col table { width: 100%; border-collapse: collapse; color: #fff; font-weight: 600; font-size: 15px; }
.col th { font-size: 12.5px; opacity: .7; font-weight: 600; text-align: right; padding: 2px 6px; }
.col td { padding: 4px 6px; text-align: right; border-top: 1px solid rgba(255, 255, 255, .12); }
.col td:first-child { text-align: left; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col tr.me td { color: var(--sun); }
.mvp { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--sun); color: var(--ink); font-size: 11px; text-shadow: none; }
.results { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 12, 38, .72); pointer-events: auto; }
.res-in { text-align: center; }
.res-title { font: 400 clamp(56px, calc(var(--gw) * .1), 110px)/1 var(--title); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink); letter-spacing: 3px; animation: wobble 2.2s ease-in-out infinite; }
.res-title.win { color: var(--sun); } .res-title.lose { color: #b8aecb; }
.res-score { margin: 8px 0; font: 400 40px var(--title); }
.res-mvp { font-weight: 700; font-size: 19px; margin-bottom: 12px; }
.res-back { margin-top: 14px; font-weight: 700; opacity: .85; }
.pause { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 12, 38, .55); pointer-events: auto; cursor: pointer; }
.pause-box { cursor: default; width: min(420px, calc(var(--gw) * .92)); max-height: calc(var(--gh) * .94); overflow-y: auto; padding: 18px 20px; border: 4px solid var(--ink); border-radius: 22px; background: var(--cream); color: var(--ink); text-shadow: none; box-shadow: 0 8px 0 var(--ink); display: flex; flex-direction: column; gap: 10px; }
.pause-box h2 { margin: 0; font: 400 32px var(--title); }
.pause-note { margin: 0; font-weight: 600; color: var(--ink2); }
.slider { display: flex; flex-direction: column; gap: 2px; font-weight: 700; font-size: 15px; }
.slider input { accent-color: var(--coral); }
.cross-pick { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 15px; }
.cross-pick span { margin-right: auto; }
.xc { width: 36px; height: 32px; padding: 0; border: 3px solid var(--ink); border-radius: 10px; background: var(--c); color: var(--ink); font: 700 14px var(--font); cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.xc.on { outline: 3px solid var(--coral); outline-offset: 2px; }
.keys { font-size: 12.5px; color: var(--ink2); line-height: 1.5; }

/* touch: a stick under the left thumb; under the right, the fire button
   with jump, aim and crouch round it; the ammo (tap to reload) and the
   weapons in the middle at the bottom; ⏸ for the menu. Sized by the match's
   frame (--gw, --gh), which is the screen turned when the phone is upright. */
.touch { position: absolute; inset: 0; z-index: 1; pointer-events: auto; touch-action: none;
  --f: clamp(76px, calc(var(--gh) * .25), 116px); --b: clamp(50px, calc(var(--gh) * .15), 70px);
  --fx: calc(var(--gw) * .035 + var(--safe-r)); --fy: calc(var(--gh) * .12 + var(--safe-b));
  --R: calc(var(--f) / 2 + var(--b) / 2 + 10px); }
.t-stick { position: absolute; left: calc(40px + var(--safe-l)); bottom: calc(60px + var(--safe-b)); width: 140px; height: 140px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .5); background: rgba(34, 22, 58, .25); opacity: .55; }
.t-stick.on { opacity: 1; }
.t-knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; border-radius: 50%; background: rgba(255, 255, 255, .8); border: 3px solid var(--ink); }
/* the small buttons sit on an arc round the fire button's middle */
.t-btn { position: absolute; width: var(--b); height: var(--b); border-radius: 50%; border: 3px solid var(--ink); background: rgba(255, 247, 230, .78); color: var(--ink); font-weight: 700; font-size: 15px; text-shadow: none; padding: 0;
  right: calc(var(--fx) + var(--f) / 2 + var(--dx, 0px) - var(--b) / 2); bottom: calc(var(--fy) + var(--f) / 2 + var(--dy, 0px) - var(--b) / 2); }
.t-btn.on { background: var(--sun); transform: scale(.94); }
.t-fire { right: var(--fx); bottom: var(--fy); width: var(--f); height: var(--f); background: rgba(255, 93, 143, .88); color: #fff; font-size: 19px; text-shadow: 0 2px 0 var(--ink); }
.t-fire.on { background: #ff3d7a; }
.t-jump { --dy: var(--R); }
.t-aim { --dx: calc(var(--R) * .77); --dy: calc(var(--R) * .64); }
.t-aim.on { background: var(--sun); transform: none; box-shadow: 0 0 0 4px rgba(255, 210, 63, .5); }
.t-crouch { --dx: calc(var(--R) * .97); --dy: calc(var(--R) * -.26); }
.t-menu { display: none; }
#hud.touchy .t-menu { display: grid; place-items: center; position: absolute; z-index: 3; top: calc(8px + var(--safe-t)); right: calc(10px + var(--safe-r)); width: 42px; height: 42px; padding: 0; border: 3px solid var(--ink); border-radius: 12px; background: rgba(255, 247, 230, .85); font-size: 18px; pointer-events: auto; touch-action: none; }
#hud.touchy .hud-top { z-index: 2; }
#hud.touchy .scorebox { pointer-events: auto; touch-action: none; }
#hud.touchy .board { z-index: 2; pointer-events: auto; }
#hud.touchy .pause, #hud.touchy .results { z-index: 4; }
#hud:not(.touchy) .assist-box { display: none; }
#hud.touchy .keys { display: none; }
#hud.touchy .vitals { top: calc(8px + var(--safe-t)); bottom: auto; left: calc(10px + var(--safe-l)); }
#hud.touchy .hp { padding: 3px 8px; gap: 6px; }
#hud.touchy .hp-bar { width: 100px; height: 12px; }
#hud.touchy .hp-num { font-size: 22px; min-width: 36px; }
/* the weapons and the ammo: buttons, in the middle at the bottom */
#hud.touchy .arms { z-index: 2; left: 50%; right: auto; transform: translateX(-50%); bottom: calc(4px + var(--safe-b)); align-items: center; gap: 4px; touch-action: none; }
#hud.touchy .ammo { pointer-events: auto; align-items: center; padding: 1px 12px 2px; border: 3px solid var(--ink); border-radius: 13px; background: rgba(34, 22, 58, .65); }
#hud.touchy .ammo:not(.gun) { visibility: hidden; }
#hud.touchy .ammo .mag { font-size: 24px; }
#hud.touchy .ammo .max { font-size: 14px; }
#hud.touchy .ammo .note { display: none; }
#hud.touchy .ammo .rl { display: block; font-style: normal; font-weight: 700; font-size: 20px; color: var(--sun); margin-left: 4px; }
#hud.touchy .ammo.empty { border-color: var(--sun); animation: pulse .5s ease-in-out infinite alternate; }
#hud.touchy .slots { gap: 5px; }
#hud.touchy .slot { width: 58px; padding: 3px 3px; border-radius: 12px; }
#hud.touchy .slot.on { transform: translateY(-3px); }
#hud.touchy .slot span, #hud.touchy .slot b { display: none; }
#hud.touchy .slot img { height: 30px; }
#hud.touchy .feed { top: calc(48px + var(--safe-t)); right: auto; left: calc(10px + var(--safe-l)); align-items: flex-start; }
#hud.touchy .kill { font-size: 12px; padding: 2px 8px; }
#hud.touchy .kill img { height: 16px; width: 32px; }
#hud.touchy .chat { bottom: auto; top: 46%; width: calc(var(--gw) * .4); }
/* the chat box at the top, clear of the thumbs (and of the keyboard) */
#hud.touchy.chatting .chat { top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(470px, calc(var(--gw) * .62)); }
#hud.touchy .emo { font-size: 22px; }
.t-chat { display: none; }
#hud.touchy .t-chat { display: grid; place-items: center; position: absolute; z-index: 3; top: calc(8px + var(--safe-t)); right: calc(60px + var(--safe-r)); width: 42px; height: 42px; padding: 0; border: 3px solid var(--ink); border-radius: 12px; background: rgba(255, 247, 230, .85); font-size: 19px; pointer-events: auto; touch-action: none; }
#hud.touchy .scorebox b { font-size: 28px; }
#hud.touchy .timer { font-size: 18px; }
#hud.touchy .pip { width: 22px; height: 22px; font-size: 11px; border-width: 2px; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .room-main { grid-template-columns: 1fr; }
  .teams { grid-template-columns: 1fr 1fr; }
  .vs { display: none; }
}
@media (max-width: 760px) {
  .logo { left: 16px; top: 52px; }
  .logo h1 { font-size: 46px; }
  .logo p { font-size: 14px; }
  .menu-panel { top: 46%; left: 10px; right: 10px; width: auto; bottom: 10px; }
  .board-in { flex-direction: column; }
  .hp-bar { width: 130px; }
  .slot { width: 80px; }
}
