/* BAYPORT UI */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
body { font-family: Arial, Helvetica, sans-serif; user-select: none; }
#game { position: fixed; inset: 0; display: block; }

/* ---------- HUD (top right) ---------- */
#hud {
  position: fixed; top: 14px; right: 16px; text-align: right; z-index: 10;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.85); pointer-events: none;
}
#clock { color: #fff; font-weight: 900; font-size: 22px; letter-spacing: 1px; }
.moneyWrap { position: relative; }
#money { color: #7ae08a; font-weight: 900; font-size: 24px; font-family: 'Courier New', monospace; letter-spacing: 1px; }
.moneyDelta {
  position: absolute; right: 0; top: 100%; font-weight: 900; font-size: 18px;
  animation: rise 1.4s ease-out forwards;
}
@keyframes rise { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-24px); } }
.barWrap {
  width: 190px; height: 14px; background: rgba(0,0,0,0.55);
  border: 2px solid rgba(0,0,0,0.8); margin: 5px 0 0 auto; border-radius: 3px; overflow: hidden;
}
.barWrap div { height: 100%; transition: width 0.25s; }
#hpBar { background: linear-gradient(#e0654a, #b03a28); width: 100%; }
#armorBar { background: linear-gradient(#7aa8e0, #3a6ab8); width: 0%; }
#stars { font-size: 26px; margin-top: 2px; letter-spacing: 2px; }
.star { color: #f0c53a; text-shadow: 2px 2px 0 rgba(0,0,0,0.9); }
.star.off { color: rgba(0,0,0,0.55); -webkit-text-stroke: 1px rgba(255,255,255,0.25); }
.star.flash { animation: starblink 0.3s infinite; }
@keyframes starblink { 50% { opacity: 0.15; } }
#weapon { margin-top: 6px; color: #fff; }
#weapon .wName { font-weight: 900; font-size: 16px; text-transform: uppercase; }
#weapon .wAmmo { font-size: 15px; color: #d8d8c8; font-family: 'Courier New', monospace; font-weight: bold; }

/* ---------- notifications / texts ---------- */
/* below the debug stats panel (top-left) so the two never overlap */
#noti { position: fixed; top: 158px; left: 16px; z-index: 10; pointer-events: none; }
.notiItem {
  background: rgba(10,12,18,0.78); border-left: 4px solid #e8c53a;
  color: #e8d9a0; font-weight: bold; font-size: 15px;
  padding: 8px 14px; margin-bottom: 6px; max-width: 360px;
  transform: translateX(-110%); transition: transform 0.35s ease; border-radius: 0 4px 4px 0;
}
.notiItem.show { transform: translateX(0); }

#objective {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  color: #e8d9a0; font-weight: 900; font-size: 19px; text-align: center;
  text-shadow: 2px 2px 0 #000; display: none; z-index: 10; max-width: 70vw; pointer-events: none;
}
#missionTimer {
  position: fixed; top: 90px; left: 50%; transform: translateX(-50%);
  color: #fff; font-weight: 900; font-size: 34px; text-shadow: 2px 2px 0 #000;
  display: none; z-index: 10; pointer-events: none;
}
#district {
  position: fixed; bottom: 250px; left: 22px; z-index: 10; pointer-events: none;
  font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: bold;
  font-size: 34px; color: #e8c53a; text-shadow: 2px 3px 0 #000;
  opacity: 0; transition: opacity 0.6s;
}
#district.show { opacity: 1; }
#dialog {
  position: fixed; bottom: 46px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6); color: #fff; font-size: 17px; padding: 10px 18px;
  border-radius: 4px; max-width: 66vw; text-align: center; display: none; z-index: 12; pointer-events: none;
}
#dialog b { color: #e8c53a; }
#interact {
  position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%);
  color: #fff; background: rgba(10,12,18,0.7); border: 1px solid rgba(255,255,255,0.3);
  font-weight: bold; font-size: 15px; padding: 6px 14px; border-radius: 4px;
  display: none; z-index: 10; pointer-events: none;
}
#crosshair {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.9); font-size: 22px; font-weight: bold;
  text-shadow: 1px 1px 0 #000; display: none; z-index: 10; pointer-events: none;
}
/* throw-power meter, sits just under the crosshair */
#chargeMeter {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, 26px);
  width: 132px; height: 9px; z-index: 11; pointer-events: none; display: none;
  background: rgba(10,14,20,0.66); border: 1.5px solid rgba(255,255,255,0.55);
  border-radius: 5px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
#chargeFill {
  width: 0%; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #6fe08a 0%, #e8c53a 55%, #e0552a 100%);
  transition: width 0.03s linear;
}
#vehName, #radioName {
  position: fixed; right: 20px; bottom: 60px; color: #e8c53a; font-weight: 900;
  font-size: 22px; font-style: italic; text-shadow: 2px 2px 0 #000; opacity: 0; z-index: 10; pointer-events: none;
}
#radioName { bottom: 92px; color: #8ad8e8; font-size: 17px; }

#speedo {
  position: fixed; right: 20px; bottom: 124px; display: none;
  color: #fff; text-align: right; text-shadow: 2px 2px 0 #000;
  z-index: 10; pointer-events: none;
}
#speedo #speedNum {
  font-family: 'Courier New', monospace; font-weight: 900; font-size: 34px;
}
#speedo .speedUnit { font-size: 14px; font-weight: bold; color: #b8c4d0; margin-left: 5px; }

/* ---------- minimap ---------- */
#minimap { position: fixed; left: 18px; bottom: 18px; z-index: 10; pointer-events: none; }

#bigmapWrap {
  position: fixed; inset: 0; background: rgba(4,6,10,0.82); display: none;
  align-items: center; justify-content: center; z-index: 30;
}
.mapCard { text-align: center; }
#bigmap { border: 3px solid rgba(255,255,255,0.25); border-radius: 6px; max-width: 82vmin; max-height: 82vmin; }
.mapLegend { color: #ccc; font-size: 14px; margin-top: 10px; font-weight: bold; }
.mapLegend span { margin: 0 8px; }

/* ---------- overlays ---------- */
#damageFlash {
  position: fixed; inset: 0; pointer-events: none; z-index: 25; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255,0,0,0) 55%, rgba(180,10,10,0.55) 100%);
}
#damageFlash.on { animation: dmg 0.4s ease-out; }
@keyframes dmg { 0% { opacity: 1; } 100% { opacity: 0; } }

#letterbox .bar {
  position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 26;
  transition: height 0.5s ease; pointer-events: none;
}
#letterbox .bar.top { top: 0; } #letterbox .bar.bottom { bottom: 0; }
#letterbox.on .bar { height: 11vh; }

#wasted {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  flex-direction: column; z-index: 40; pointer-events: none;
}
.bigMain {
  font-family: 'Arial Black', Arial, sans-serif; font-weight: 900; font-size: 9vw;
  letter-spacing: 6px; text-shadow: 4px 6px 0 #000, 0 0 60px rgba(0,0,0,0.8);
  transform: scaleY(1.25);
}
.bigSub { color: #ddd; font-size: 22px; font-weight: bold; text-shadow: 2px 2px 0 #000; margin-top: 12px; }

#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.45s; z-index: 45; }
#fade.on { opacity: 1; }

/* ---------- loading screen ---------- */
#loading {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0a0c16 0%, #05060c 75%);
  opacity: 1; transition: opacity 0.45s ease;
}
#loading.hide { opacity: 0; }
.loadInner { text-align: center; color: #fff; padding: 24px; width: min(460px, 82vw); }
.loadTitle {
  font-family: 'Arial Black', Arial, sans-serif; font-weight: 900;
  font-size: clamp(26px, 6vw, 52px); letter-spacing: 3px; color: #f0e8d0;
  text-shadow: 3px 5px 0 #0a0c14; transform: skewX(-6deg);
}
.loadSub { color: #e8c53a; font-weight: bold; letter-spacing: 10px; font-size: 14px; margin: 8px 0 34px; }
.loadTrack {
  height: 12px; width: 100%; border: 2px solid rgba(232,197,58,0.5); border-radius: 7px;
  background: rgba(232,197,58,0.08); overflow: hidden;
}
#loadBar {
  height: 100%; width: 2%; border-radius: 5px;
  background: linear-gradient(90deg, #b8942a, #e8c53a);
  transition: width 0.3s ease; box-shadow: 0 0 14px rgba(232,197,58,0.5);
}
#loadLabel { margin-top: 14px; color: #98a0b0; font-size: 13.5px; letter-spacing: 1px; font-family: 'Courier New', monospace; }

/* ---------- title ---------- */
#title {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(8,10,20,0.5) 0%, rgba(8,10,24,0.88) 70%);
}
.titleInner { text-align: center; color: #fff; padding: 20px; }
.logo {
  font-family: 'Arial Black', Arial, sans-serif; font-size: clamp(38px, 8vw, 96px);
  font-weight: 900; letter-spacing: 4px; line-height: 0.95;
  color: #f0e8d0; text-shadow: 5px 7px 0 #0a0c14, 5px 7px 0 #0a0c14, 0 0 80px rgba(232,197,58,0.3);
  transform: skewX(-6deg) scaleY(1.15);
}
.logo span { display: block; color: #e8c53a; letter-spacing: 14px; }
.tagline { color: #b8c0d0; font-size: 17px; margin: 14px 0 30px; font-weight: bold; letter-spacing: 1px; }
#titleMenu { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-bottom: 30px; }
.menuBtn {
  font-family: 'Arial Black', Arial, sans-serif; font-size: 22px; letter-spacing: 3px;
  background: rgba(232,197,58,0.12); color: #e8c53a; border: 2px solid #e8c53a;
  padding: 12px 60px; cursor: pointer; transition: all 0.15s; border-radius: 3px;
}
.menuBtn:hover:not(:disabled) { background: #e8c53a; color: #14161c; transform: scale(1.04); }
.menuBtn:disabled { opacity: 0.3; cursor: default; }
.titleControls { color: #98a0b0; font-size: 13.5px; line-height: 1.9; }
.titleControls b { color: #d8d0b8; }
.disclaimer { color: #5a6272; font-size: 11.5px; margin-top: 26px; line-height: 1.6; }

/* ---------- pause / shop ---------- */
#pause, #shop {
  position: fixed; inset: 0; z-index: 48; display: none; align-items: center; justify-content: center;
  background: rgba(6,8,14,0.82); color: #fff;
}
.pauseInner { text-align: center; max-width: 900px; padding: 20px; }
.pauseInner h2 { font-family: 'Arial Black', Arial; font-size: 44px; letter-spacing: 6px; color: #e8c53a; margin-bottom: 26px; }
.pauseCols { display: flex; gap: 34px; text-align: left; font-size: 14.5px; line-height: 2; color: #c8ccd8; flex-wrap: wrap; justify-content: center; }
.pauseCols h3 { color: #e8c53a; margin-bottom: 6px; }
.hint { margin-top: 26px; color: #98a0b0; font-weight: bold; }
.shopBox {
  background: #14181f; border: 2px solid #e8c53a; border-radius: 6px; padding: 28px 40px; min-width: 420px;
}
.shopBox h2 { font-family: 'Arial Black', Arial; color: #e8c53a; letter-spacing: 3px; margin-bottom: 18px; }
.shopBox ul { list-style: none; }
.shopBox li { padding: 9px 0; font-size: 17px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.shopBox li small { display: block; color: #8890a0; font-size: 12.5px; }
.shopBox .price { color: #7ae08a; font-weight: bold; }
.shopBox .hint { font-size: 13px; }

/* ---------- settings menu ---------- */
#settings {
  position: fixed; inset: 0; z-index: 52; display: none;
  align-items: center; justify-content: center;
  background: rgba(6, 8, 14, 0.86); color: #fff;
}
.settingsCard {
  background: #14181f; border: 2px solid #e8c53a; border-radius: 6px;
  padding: 26px 38px 24px; min-width: 520px; max-width: 92vw;
  max-height: 88vh; overflow-y: auto;
}
.settingsCard h2 {
  font-family: 'Arial Black', Arial; font-size: 30px; letter-spacing: 5px;
  color: #e8c53a; margin-bottom: 14px; text-align: center;
}
.settingsCard h3 {
  color: #e8c53a; font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
  margin: 16px 0 8px; border-bottom: 1px solid rgba(232,197,58,0.25); padding-bottom: 4px;
}
.setRow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 6px 0; font-size: 15px; color: #c8ccd8;
}
.setRow .segs { display: flex; align-items: center; gap: 6px; }
.segBtn {
  font-family: Arial, sans-serif; font-size: 12.5px; font-weight: bold;
  background: rgba(232,197,58,0.08); color: #b8a95e;
  border: 1px solid rgba(232,197,58,0.4); border-radius: 3px;
  padding: 5px 13px; cursor: pointer;
}
.segBtn.active { background: #e8c53a; color: #14161c; border-color: #e8c53a; }
.setRow input[type=range] { width: 170px; accent-color: #e8c53a; }
.setRow .sndVal, .setRow .ctrlVal { color: #e8d9a8; width: 44px; text-align: right; font-family: 'Courier New', monospace; }
.setActions { text-align: center; margin-top: 18px; }
.pauseSet { margin-top: 20px; font-size: 16px !important; padding: 8px 34px !important; }

/* ---------- developer menu (F8) ---------- */
#devmenu {
  position: fixed; right: 16px; top: 16px; z-index: 40; width: 340px;
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: rgba(10, 13, 20, 0.92); border: 1px solid rgba(122, 224, 200, 0.4);
  border-radius: 8px; padding: 14px 16px; color: #c8d8d0;
  font-family: 'Courier New', monospace; font-size: 12px;
}
#devmenu h2 { color: #7ae0c8; font-size: 15px; letter-spacing: 2px; margin-bottom: 8px; }
#devmenu .devHint { color: #5a6a64; font-size: 10.5px; letter-spacing: 0; font-weight: normal; }
#devmenu .devStatus { color: #98a8a0; line-height: 1.6; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; }
#devmenu .devStatus b { color: #7ae0c8; }
#devmenu .devSection h3 { color: #a8c0b8; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin: 8px 0 5px; }
#devmenu .devBtns { display: flex; flex-wrap: wrap; gap: 5px; }
#devmenu button {
  font-family: 'Courier New', monospace; font-size: 11.5px;
  background: rgba(122, 224, 200, 0.1); color: #9adec8;
  border: 1px solid rgba(122, 224, 200, 0.35); border-radius: 3px;
  padding: 4px 9px; cursor: pointer;
}
#devmenu button:hover { background: #7ae0c8; color: #10141a; }

/* ---------- rendering debug menu (F7) ---------- */
#rendermenu {
  position: fixed; left: 8px; top: 62px; z-index: 40; width: 232px;
  max-height: calc(100vh - 78px); overflow-y: auto;
  background: rgba(10, 13, 20, 0.92); border: 1px solid rgba(122, 224, 200, 0.4);
  border-radius: 8px; padding: 12px 14px; color: #c8d8d0;
  font-family: 'Courier New', monospace; font-size: 12px;
}
#rendermenu h2 { color: #7ae0c8; font-size: 14px; letter-spacing: 2px; margin-bottom: 6px; }
#rendermenu .devHint { color: #6a7a74; font-size: 10.5px; letter-spacing: 0; font-weight: normal; }
#rendermenu .rmRow { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
#rendermenu .rmRow input { cursor: pointer; margin: 0; }
#rendermenu .devBtns { display: flex; gap: 6px; }
#rendermenu button {
  font-family: 'Courier New', monospace; font-size: 11.5px;
  background: rgba(122, 224, 200, 0.1); color: #9adec8;
  border: 1px solid rgba(122, 224, 200, 0.35); border-radius: 3px;
  padding: 4px 9px; cursor: pointer;
}
#rendermenu button:hover { background: #7ae0c8; color: #10141a; }

/* ---------- mission-jump menu (F9) ---------- */
#missionmenu {
  position: fixed; left: 16px; top: 16px; z-index: 40; width: 360px;
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: rgba(10, 13, 20, 0.92); border: 1px solid rgba(232, 197, 58, 0.4);
  border-radius: 8px; padding: 14px 16px; color: #d8d0b8;
  font-family: 'Courier New', monospace; font-size: 12px;
}
#missionmenu h2 { color: #e8c53a; font-size: 15px; letter-spacing: 2px; margin-bottom: 10px; }
#missionmenu .mmHint { color: #6a6250; font-size: 10.5px; letter-spacing: 0; font-weight: normal; }
#missionmenu .mmList { display: flex; flex-direction: column; gap: 6px; }
#missionmenu .mmRow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
#missionmenu .mmRow.active { border-color: rgba(232, 197, 58, 0.5); background: rgba(232, 197, 58, 0.08); }
#missionmenu .mmInfo { display: flex; flex-direction: column; min-width: 0; }
#missionmenu .mmInfo b { color: #f0e8d0; }
#missionmenu .mmMeta { color: #98907a; font-size: 10.5px; margin-top: 1px; }
#missionmenu button {
  flex: none; font-family: 'Courier New', monospace; font-size: 11.5px;
  background: rgba(232, 197, 58, 0.12); color: #e8c53a;
  border: 1px solid rgba(232, 197, 58, 0.4); border-radius: 3px;
  padding: 5px 12px; cursor: pointer;
}
#missionmenu button:hover { background: #e8c53a; color: #14161c; }

/* debug perf panel is the standard stats.js (created in src/stats.js, top-left) */

/* ---------- on-screen touch controls (mobile only, toggled by touch.js) ---------- */
#touchUI {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
#touchUI * { touch-action: none; -webkit-tap-highlight-color: transparent; }
/* full-screen look pad sits behind the widgets */
#tcLook { position: absolute; inset: 0; pointer-events: auto; }
/* pause button, top-centre (clear of the top-right HUD) */
#tcPause {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: 46px; height: 40px; border-radius: 8px; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  color: #eaf2f5; font-size: 15px; letter-spacing: 1px; text-shadow: 1px 1px 0 #000;
  background: rgba(30, 40, 52, 0.5); border: 2px solid rgba(200, 220, 235, 0.35);
}
/* left thumb-stick */
#tcStick {
  position: absolute; left: max(24px, env(safe-area-inset-left)); bottom: 30px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(120, 150, 170, 0.14); border: 2px solid rgba(200, 220, 235, 0.28);
  pointer-events: auto; display: flex; align-items: center; justify-content: center;
}
#tcKnob {
  width: 66px; height: 66px; border-radius: 50%;
  background: rgba(220, 235, 245, 0.35); border: 2px solid rgba(255, 255, 255, 0.5);
  will-change: transform;
}
/* right button cluster */
#tcButtons {
  position: absolute; right: max(20px, env(safe-area-inset-right)); bottom: 26px;
  width: 210px; display: flex; flex-wrap: wrap-reverse; gap: 12px;
  justify-content: flex-end; pointer-events: none;
}
.tcBtn {
  pointer-events: auto; box-sizing: border-box;
  min-width: 62px; height: 62px; padding: 0 6px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Arial Black', Arial, sans-serif; font-weight: 900; font-size: 13px;
  color: #eaf2f5; text-shadow: 1px 1px 0 #000;
  background: rgba(30, 40, 52, 0.5); border: 2px solid rgba(200, 220, 235, 0.35);
}
.tcBtn.pressed { background: rgba(230, 210, 90, 0.55); border-color: #f0e07a; color: #10141a; }
.tcBtn.fire { background: rgba(150, 40, 40, 0.55); border-color: rgba(240, 140, 140, 0.7); font-size: 26px; width: 74px; height: 74px; }
.tcBtn.aim  { font-size: 22px; }

