:root { --bg: #0b0f14; --fg: #e9eef3; --accent: #ffb43c; --glass: rgba(14, 18, 24, 0.42); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
#canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; }
.hidden { display: none !important; }

#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); z-index: 50; }
#loading .title { font-size: clamp(28px, 6vw, 56px); font-weight: 800; letter-spacing: .18em; color: var(--accent); }
#loading .msg { opacity: .75; font-size: 15px; }

#stats { position: fixed; left: max(8px, env(safe-area-inset-left)); top: max(8px, env(safe-area-inset-top)); margin: 0; padding: 6px 9px; font: 11px/1.45 ui-monospace, Menlo, monospace; background: rgba(0,0,0,.45); border-radius: 6px; pointer-events: none; z-index: 20; white-space: pre; }

#rotate { display: none; position: fixed; inset: 0; z-index: 60; background: var(--bg); align-items: center; justify-content: center; font-size: 20px; }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }

/* ---------------- touch controls */
#touch { display: none; position: fixed; inset: 0; z-index: 10; }
body.touch #touch { display: block; }
#touch-move { position: absolute; left: 0; top: 0; bottom: 0; width: 45%; }
#touch-look { position: absolute; right: 0; top: 0; bottom: 0; width: 55%; }
#stick { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; background: var(--glass); border: 2px solid rgba(255,255,255,.18); opacity: 0; pointer-events: none; transition: opacity .12s; left: 18%; top: 72%; }
#stick.on { opacity: 1; }
body.touch #stick { opacity: .45; }
body.touch #stick.on { opacity: 1; }
#stick .knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255,255,255,.55); }
.tbtns { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, auto); gap: 9px; align-items: end; }
.tbtns-left { position: absolute; left: max(14px, env(safe-area-inset-left)); top: max(60px, calc(env(safe-area-inset-top) + 60px)); display: flex; gap: 8px; }
.tbtn.small { width: 54px; height: 40px; border-radius: 10px; font-size: 10px; }
.tbtn { width: 66px; height: 66px; border-radius: 50%; border: 2px solid rgba(255,255,255,.22); background: var(--glass); color: var(--fg); font: 700 11px system-ui, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; }
.tbtn small { font-size: 9px; opacity: .6; font-weight: 600; }
.tbtn.big { width: 78px; height: 78px; }
.tbtn.on { background: rgba(255,180,60,.55); border-color: var(--accent); }
.stats-btn { position: absolute; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); width: 44px; height: 30px; border-radius: 8px; }

#district { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(110px, calc(env(safe-area-inset-bottom) + 110px)); font: 800 clamp(18px, 3vw, 30px) system-ui, sans-serif; letter-spacing: .06em; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.6), 0 0 2px #000; opacity: 0; pointer-events: none; z-index: 15; }
#district.show { animation: district 4.5s ease forwards; }
@keyframes district { 0% { opacity: 0; transform: translateY(8px); } 10%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
body:not(.touch) #district { bottom: 40px; }

#hud { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 12; pointer-events: none; display: flex; flex-direction: column; gap: 6px; }
body.touch #hud { top: max(10px, env(safe-area-inset-top)); bottom: auto; left: 50%; transform: translateX(-50%); align-items: center; }
#hud .bar { width: 180px; height: 9px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.25); border-radius: 5px; overflow: hidden; }
#hud .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #d33 0%, #f55 100%); transition: width .15s; }
#hud .foe span { font: 700 11px system-ui, sans-serif; text-shadow: 0 1px 3px #000; }
#hud .foe .bar i { background: linear-gradient(90deg, #c80 0%, #fb3 100%); }

#lockhint { position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 8px; background: rgba(0,0,0,.55); font: 600 14px system-ui, sans-serif; pointer-events: none; z-index: 14; }

/* vehicle mode */
body:not(.mode-car) .car-only { display: none; }
body:not(.has-jetpack) .jet-btn, body.mode-car .jet-btn { display: none; }
body:not(.web-mode) .web-btn, body.mode-car .web-btn { display: none; }
body:not(.mode-air) .air-only, body.mode-air .car-only, body:not(.air-jet) .jet-only { display: none; }
body.air-horse .air-only .boost-btn { display: flex; }
body.air-horse .air-only .down-btn { display: none; }
#speedo .alt { display: none; font: 700 14px system-ui, sans-serif; opacity: .9; margin-top: 2px; }
body.mode-air #speedo .alt { display: block; }
body.air-horse #speedo .alt { display: none; }
/* artificial horizon (aircraft): the sky/ground disc turns against the bank and slides with the pitch */
#speedo .horizon { display: none; width: 64px; height: 64px; margin: 6px 0 0 auto; border-radius: 50%; overflow: hidden; position: relative;
  border: 2px solid rgba(255,255,255,.8); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
body.mode-air:not(.air-horse) #speedo .horizon { display: block; }
#speedo .horizon i { position: absolute; left: -50%; top: -50%; width: 200%; height: 200%;
  background: linear-gradient(#3b8fe0 50%, #8a5a2b 50%); transform-origin: 50% 50%; }
#speedo .horizon b { position: absolute; left: 18px; right: 18px; top: 31px; height: 2px; background: #ffd24a; }
body.touch #speedo .horizon { width: 46px; height: 46px; }
body.touch #speedo .horizon b { left: 12px; right: 12px; top: 22px; }
#speedo .moonhint { font: 700 12px system-ui, sans-serif; color: #cfe3ff; margin-top: 2px; }
#speedo .moonhint:empty { display: none; }
body.touch.mode-air #speedo .alt { display: inline-block; margin-left: 8px; }   /* phones: on the speed line, clear of the stars */
body.mode-car .foot-only { display: none; }
.enter-btn { position: absolute; right: max(250px, calc(env(safe-area-inset-right) + 250px)); bottom: max(20px, env(safe-area-inset-bottom)); display: none; background: rgba(255,180,60,.5); border-color: var(--accent); }
body.can-enter .enter-btn, body.mode-car .enter-btn { display: flex; }
body.mode-car .enter-btn { font-size: 10px; }
#speedo { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: 30px; text-align: right; z-index: 12; pointer-events: none; font: 800 38px system-ui, sans-serif; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
#speedo span { font-size: 13px; margin-left: 4px; opacity: .8; }
#speedo .nitro { width: 120px; height: 6px; margin-left: auto; margin-top: 4px; background: rgba(0,0,0,.4); border-radius: 3px; overflow: hidden; }
#speedo .nitro i { display: block; height: 100%; background: linear-gradient(90deg, #39f, #8ef); }
body.touch #speedo { bottom: auto; top: max(54px, calc(env(safe-area-inset-top) + 54px)); right: max(70px, calc(env(safe-area-inset-right) + 70px)); font-size: 28px; }

/* start menu (name, online/offline) */
#menu { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(8,11,15,.82); z-index: 45; }
#menu .title { font-size: clamp(28px, 6vw, 56px); font-weight: 800; letter-spacing: .18em; color: var(--accent); }
#menu label { display: flex; gap: 10px; align-items: center; font-size: 16px; }
#menu input { font: inherit; padding: 10px 12px; min-width: 200px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; }
#menu .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
#menu button { font: 700 16px system-ui, sans-serif; padding: 14px 22px; min-height: 48px; border-radius: 10px; border: 0; background: var(--accent); color: #0b0f14; cursor: pointer; }
#menu button#play-offline { background: rgba(255,255,255,.16); color: #fff; }
#menu button:disabled { opacity: .35; cursor: default; }
#menu .msg { opacity: .8; font-size: 14px; min-height: 1.2em; text-align: center; padding: 0 16px; }
#toast { position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%); padding: 8px 14px; border-radius: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 30; }
#toast.show { opacity: 1; }
#players { position: fixed; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); padding: 4px 10px; border-radius: 6px; background: rgba(0,0,0,.4); color: #fff; font-size: 13px; pointer-events: none; z-index: 20; }

/* combat HUD */
#hud .armor i { background: linear-gradient(90deg, #39c 0%, #6cf 100%); }
#weapon { position: fixed; right: max(14px, env(safe-area-inset-right)); top: max(44px, calc(env(safe-area-inset-top) + 44px)); z-index: 12; pointer-events: none;
  text-align: right; font: 700 14px system-ui, sans-serif; color: var(--fg); text-shadow: 0 1px 3px #000; }
#weapon span { display: block; font-size: 12px; opacity: .85; }
body.touch #weapon { top: auto; bottom: max(200px, calc(env(safe-area-inset-bottom) + 200px)); }
#crosshair { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #f33;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6); z-index: 12; pointer-events: none; }
#wasted { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 15; pointer-events: none;
  font: 900 54px system-ui, sans-serif; letter-spacing: .08em; color: #e33; text-shadow: 0 3px 12px #000; background: rgba(40,0,0,.28); }
.tbtns-weapon { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(190px, calc(env(safe-area-inset-bottom) + 190px)); display: flex; gap: 8px; }
.tbtns-weapon .tbtn.small { width: 66px; }
body:not(.gun) .reload-btn { display: none; }
#hitmark { position: fixed; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; z-index: 13; pointer-events: none; opacity: 0;
  background: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%); }
#hitmark.on { opacity: 1; transition: opacity .25s ease-out; }
#hitmark.kill { background: linear-gradient(45deg, transparent 42%, #f33 42%, #f33 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, #f33 42%, #f33 58%, transparent 58%); }
#scope { position: fixed; inset: 0; z-index: 11; pointer-events: none; background: radial-gradient(circle at center, transparent 0 34vmin, #000 34.5vmin); }
#scope i { position: absolute; background: rgba(0,0,0,.85); }
#scope .h { left: 0; right: 0; top: 50%; height: 1px; }
#scope .v { top: 0; bottom: 0; left: 50%; width: 1px; }
#scope b { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #f22; }
#scope span { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); font: 600 12px system-ui, sans-serif; color: #ddd; }
body:not(.scoped) .zoom-btn { display: none; }
#speedo .carhp { margin-top: 4px; height: 4px; background: rgba(0,0,0,.45); border-radius: 2px; overflow: hidden; }
#speedo .carhp i { display: block; height: 100%; width: 100%; background: #4c4; transition: width .2s; }
#stars { position: fixed; right: max(14px, env(safe-area-inset-right)); top: max(86px, calc(env(safe-area-inset-top) + 86px)); z-index: 12; pointer-events: none; display: flex; gap: 3px; }
#stars i { width: 16px; height: 16px; background: rgba(255,255,255,.15); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
#stars i.on { background: #ffd23f; }
#stars.blink i.on { animation: starblink .6s steps(2) infinite; }
@keyframes starblink { 50% { background: rgba(255,255,255,.3); } }
body.touch #stars { top: auto; bottom: max(240px, calc(env(safe-area-inset-bottom) + 240px)); }
#speedo .fuel { margin-top: 3px; height: 3px; background: rgba(0,0,0,.45); border-radius: 2px; overflow: hidden; }
#speedo .fuel i { display: block; height: 100%; width: 100%; background: #e9b13a; }
#respray { position: fixed; left: 50%; bottom: max(110px, calc(env(safe-area-inset-bottom) + 110px)); transform: translateX(-50%); z-index: 14;
  background: var(--glass); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 10px 12px; text-align: center; }
#respray .t { font: 700 12px system-ui, sans-serif; letter-spacing: .08em; margin-bottom: 8px; }
#respray .sw { display: grid; grid-template-columns: repeat(8, 30px); gap: 6px; }
#respray .sw b { width: 30px; height: 30px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
#respray .sw b.sel { border-color: #fff; }
#respray .n { margin-top: 6px; font: 600 12px system-ui, sans-serif; opacity: .85; }

/* graphics settings */
#menu button.link { background: none; color: #fff; opacity: .8; text-decoration: underline; padding: 8px 12px; min-height: 40px; font-weight: 600; }
.gfx-btn { position: absolute; top: max(8px, env(safe-area-inset-top)); right: calc(max(8px, env(safe-area-inset-right)) + 52px); width: 44px; height: 30px; border-radius: 8px; font-size: 16px; }
#gfx-desk { position: fixed; left: max(10px, env(safe-area-inset-left)); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 30px); width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.35); color: #fff; font-size: 17px; cursor: pointer; z-index: 21; }
#settings { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,11,15,.6); z-index: 60; padding: 16px; }
#settings .panel { width: min(420px, 100%); max-height: 100%; overflow: auto; background: #121821; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; color: #fff; }
#settings .head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
#settings .close { width: 40px; height: 40px; border-radius: 8px; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 16px; cursor: pointer; }
#settings label { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; }
#settings select { font: inherit; min-height: 40px; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: #1b2330; color: #fff; max-width: 62%; }
#settings .note { font-size: 12px; opacity: .65; line-height: 1.4; }
#settings .row { display: flex; justify-content: flex-end; }
#settings .apply { font: 700 15px system-ui, sans-serif; padding: 12px 18px; min-height: 44px; border-radius: 10px; border: 0; background: var(--accent); color: #0b0f14; cursor: pointer; }

/* cheat menu: a grid of codes (touch and desktop) */
#cheats { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,11,15,.6); z-index: 61; padding: 16px; }
#cheats.hidden { display: none; }
#cheats .panel { width: min(640px, 100%); max-height: 100%; overflow: auto; background: #121821; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; color: #fff; }
#cheats .head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
#cheats .close { background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; }
#cheats .note { opacity: .7; font-size: 13px; }
#cheats .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
#cheats .grid button { background: #1d2733; color: #fff; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 10px 8px; text-align: left; cursor: pointer; font: 600 12px system-ui, sans-serif; }
#cheats .grid button small { display: block; opacity: .6; font-weight: 500; margin-top: 2px; letter-spacing: .04em; }
#money { position: fixed; right: max(18px, env(safe-area-inset-right)); top: max(122px, calc(env(safe-area-inset-top) + 122px)); z-index: 12; pointer-events: none;
  font: 800 22px system-ui, sans-serif; color: #8fe08a; text-shadow: 0 2px 4px rgba(0,0,0,.7); }
body.touch #money { top: max(96px, calc(env(safe-area-inset-top) + 96px)); right: max(70px, calc(env(safe-area-inset-right) + 70px)); font-size: 17px; }
#menu .welcome { color: #fff; font-size: 15px; }
#menu .welcome .link { background: none; border: 0; color: #9cd0ff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
#menu .login { display: flex; flex-direction: column; gap: 8px; }
#menu .welcome.hidden, #menu .login.hidden { display: none; }
/* chat: the feed fades after 9 s; the box opens on Enter or the 💬 button */
#chatfeed { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: 120px; z-index: 13; pointer-events: none; display: flex; flex-direction: column; gap: 3px; max-width: min(520px, 70vw); }
#chatfeed div { font: 600 14px system-ui, sans-serif; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9); transition: opacity .8s; overflow-wrap: anywhere; }
#chatfeed div b { color: #ffd24a; margin-right: 6px; }
#chatfeed div.old { opacity: 0; }
#chatbox { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: 70px; z-index: 40; width: min(560px, calc(100vw - 28px)); display: flex; flex-direction: column; gap: 6px; }
#chatbox.hidden { display: none; }
#chatbox input { font: 15px system-ui, sans-serif; padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: rgba(10,14,20,.85); color: #fff; }
#chatbox .presets { display: flex; flex-wrap: wrap; gap: 6px; }
#chatbox.offline input, #chatbox.offline .presets { display: none; }
#chatbox .emotes { display: flex; flex-wrap: wrap; gap: 6px; }
#chatbox .emotes button, #chatbox .presets button { font: 600 12px system-ui, sans-serif; padding: 6px 9px; border-radius: 14px; border: 1px solid rgba(255,255,255,.25); background: rgba(20,28,38,.85); color: #fff; cursor: pointer; }
body.touch #chatfeed { bottom: auto; top: 60px; font-size: 12px; }
/* race: the status line and the JOIN button */
#racehud { position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 14; pointer-events: none; text-align: center;
  color: #fff; text-shadow: 0 2px 5px rgba(0,0,0,.8); font: 800 20px system-ui, sans-serif; display: flex; flex-direction: column; gap: 2px; }
#racehud.hidden, #race-join.hidden { display: none; }
#racehud b { font-size: 56px; color: #ffd24a; }
#racehud b:empty { display: none; }
#race-join { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 15; font: 800 16px system-ui, sans-serif; padding: 10px 18px;
  border-radius: 10px; border: 0; background: #ffd24a; color: #111; cursor: pointer; }
#settings .races { flex-wrap: wrap; gap: 6px; align-items: center; }
#board { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,11,15,.6); z-index: 61; padding: 16px; }
#board.hidden { display: none; }
#board .panel { width: min(760px, 100%); max-height: 100%; overflow: auto; background: #121821; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 16px; color: #fff; display: flex; flex-direction: column; gap: 10px; }
#board .head { display: flex; justify-content: space-between; font-size: 18px; }
#board .close { background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; }
#board .cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
#board .cols h4 { margin: 0 0 6px; font: 700 12px system-ui, sans-serif; letter-spacing: .06em; color: #ffd24a; }
#board .cols ol { margin: 0; padding-left: 20px; font: 13px system-ui, sans-serif; display: grid; gap: 2px; }
.tbtns-gang { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(150px, calc(env(safe-area-inset-bottom) + 150px)); display: none; gap: 6px; z-index: 20; }
body.touch .tbtns-gang { display: flex; }
body.touch.mode-car .tbtns-gang { display: none; }

#settings .mods { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
#settings .mods .mod-add { display: inline-flex; gap: 8px; align-items: center; }
#settings .mod-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#settings .mod-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- the pause menu (Esc, ☰): the old game's look */
#pause { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; background: rgba(4,7,12,.72);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); font-family: -apple-system, Helvetica, Arial, sans-serif; }
#pause.hidden { display: none; }
#pause .box { min-width: 300px; max-width: min(1180px, 96vw); max-height: 90vh; overflow: auto; overscroll-behavior: contain; padding: 22px 26px;
  border-radius: 14px; background: rgba(14,20,30,.8); border: 1px solid rgba(255,255,255,.15); }
#pause .box.wide { width: min(1180px, 96vw); }
#pause h2 { margin: 0 0 14px; font-size: 28px; font-style: italic; font-weight: 800; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff, #ffb86b); -webkit-background-clip: text; background-clip: text; color: transparent; }
#pause .it { padding: 11px 16px; margin: 5px 0; border-radius: 8px; font-size: 17px; font-weight: 600; letter-spacing: .06em; cursor: pointer; border: 1px solid transparent; }
#pause .it.sel { background: rgba(255,210,58,.92); color: #111; }
#pause .it:not(.sel):hover { border-color: rgba(255,255,255,.25); }
#pause .hint { margin-top: 14px; font-size: 11px; letter-spacing: .12em; opacity: .6; }
#pause .sub { font-size: 12px; opacity: .75; margin: 0 0 8px; }
#pause table { border-collapse: collapse; width: 100%; font-size: 13px; }
#pause td { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
#pause td:first-child { white-space: nowrap; font-weight: 700; color: #ffd23a; width: 1%; }
#pause h3 { margin: 6px 0 4px; font-size: 12px; letter-spacing: .18em; opacity: .7; }
#pause .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 22px; }
#pause .grid td { padding: 3px 6px; font-size: 12px; }
#pause .cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
#pause .cht { font: 700 13px system-ui, sans-serif; padding: 9px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; text-align: left; }
#pause .cht small { display: block; font-weight: 500; font-size: 11px; opacity: .6; letter-spacing: .06em; }
#pause .cht:hover { background: rgba(255,210,58,.9); color: #111; }
#pause .row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 8px; }
#pause .mini { font: 700 11px system-ui, sans-serif; padding: 5px 8px; border-radius: 6px; border: 0; background: rgba(255,210,58,.9); color: #111; cursor: pointer; }
#pause table.pl td:first-child { color: #4cff8a; }
@media (max-height: 500px) { #pause .box { padding: 12px 18px; max-height: 94vh; } #pause h2 { font-size: 20px; margin-bottom: 6px; } #pause .it { padding: 8px 14px; font-size: 15px; } }

/* ---- the full map */
#bigmap { position: fixed; inset: 0; z-index: 36; background: #0d2236; }
#bigmap.hidden { display: none; }
#bigmap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#bigmap .bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,0)); font: 700 14px system-ui, sans-serif; }
#bigmap .bar b { font-size: 18px; font-style: italic; letter-spacing: .06em; color: #ffd23a; }
#bigmap .bar .note { flex: 1; font-weight: 500; font-size: 12px; opacity: .75; }
#bigmap .bar button { font: 800 15px system-ui, sans-serif; min-width: 40px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); color: #fff; cursor: pointer; }
body.touch #bigmap .bar .note { display: none; }

/* ---- minimap (bottom left on computers, top left on phones), clock, altitude */
#miniwrap { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); width: 190px; height: 190px; z-index: 12; pointer-events: none; display: none; }
body.playing #miniwrap { display: block; }
#minimap { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.5); }
#waydist { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); font: 800 12px system-ui, sans-serif; color: #e0b8ff; text-shadow: 0 1px 3px #000; }
body.touch #miniwrap { top: max(50px, calc(env(safe-area-inset-top) + 50px)); bottom: auto; left: max(10px, env(safe-area-inset-left)); width: 118px; height: 118px; }
#clock { position: fixed; right: max(14px, env(safe-area-inset-right)); top: max(34px, calc(env(safe-area-inset-top) + 34px)); z-index: 12; pointer-events: none; text-align: right;
  font: 800 18px system-ui, sans-serif; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 4px #000; display: none; }
body.playing #clock { display: block; }
#clock small { display: block; font-size: 11px; font-weight: 600; opacity: .7; }
body.touch #clock { top: max(26px, calc(env(safe-area-inset-top) + 26px)); right: 50%; transform: translateX(50%); text-align: center; font-size: 14px; }
#altbox { position: fixed; left: 50%; top: max(44px, calc(env(safe-area-inset-top) + 44px)); transform: translateX(-50%); z-index: 13; pointer-events: none;
  padding: 5px 12px; border-radius: 8px; background: rgba(0,0,0,.5); font: 800 16px system-ui, sans-serif; letter-spacing: .06em; color: #fff; }
#altbox .thr:not(:empty) { margin-left: 10px; font-size: 13px; color: #ffd23a; }
body.touch #altbox { top: max(60px, calc(env(safe-area-inset-top) + 60px)); font-size: 13px; }
body.mode-air #speedo .alt { display: none; }   /* (the altitude box at the top centre says it now) */

/* computers: health, clock, weapon, wanted stars and money stacked top right (the minimap has the bottom left) */
body:not(.touch) #hud { left: auto; right: max(14px, env(safe-area-inset-right)); top: max(14px, env(safe-area-inset-top)); bottom: auto; align-items: flex-end; }
body:not(.touch) #weapon { top: max(76px, calc(env(safe-area-inset-top) + 76px)); }
body:not(.touch) #stars { top: max(118px, calc(env(safe-area-inset-top) + 118px)); }
body:not(.touch) #money { top: max(142px, calc(env(safe-area-inset-top) + 142px)); }
body:not(.touch) #players { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); right: auto; left: max(220px, calc(env(safe-area-inset-left) + 220px)); }
body:not(.touch) #stats { left: auto; right: max(220px, calc(env(safe-area-inset-right) + 220px)); }
/* phones: ☰ top left, the minimap under it, the left buttons under that */
.menu-btn { position: absolute; left: max(10px, env(safe-area-inset-left)); top: max(8px, env(safe-area-inset-top)); width: 44px; height: 36px; border-radius: 8px; font-size: 20px; }
body.touch .tbtns-left { top: max(8px, env(safe-area-inset-top)); left: calc(max(10px, env(safe-area-inset-left)) + 52px); gap: 6px; }
body.touch .tbtns-left .tbtn.small { height: 36px; }
.tbtns-left2 { position: absolute; left: calc(max(10px, env(safe-area-inset-left)) + 112px); top: max(52px, calc(env(safe-area-inset-top) + 52px));
  display: grid; grid-template-columns: repeat(2, 54px); gap: 6px; }
.tbtns-left2 .tbtn.small, .tbtns-left2 .web-btn { width: 54px; height: 36px; border-radius: 10px; font-size: 10px; }
body:not(.web-mode) .tbtns-left2 .web-btn { display: none; }
body.touch .tbtns-gang { left: calc(max(10px, env(safe-area-inset-left)) + 112px); bottom: auto; top: max(180px, calc(env(safe-area-inset-top) + 180px)); }
body.touch #miniwrap { top: max(52px, calc(env(safe-area-inset-top) + 52px)); left: max(10px, env(safe-area-inset-left)); width: 96px; height: 96px; }
body.touch .menu-btn { z-index: 21; }
