/* css/style.css */
/* HUD design system: quiet graphite glass in the corners of the screen, taxi yellow for whatever is active,
   street-sign green for street names, so that the city itself stays the star */

:root {
  /* Surfaces */
  --glass: rgba(18, 19, 22, 0.62);
  --glass-strong: rgba(16, 17, 20, 0.88);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --hover: rgba(255, 255, 255, 0.08);
  --divider: rgba(255, 255, 255, 0.1);

  /* Text */
  --text: #f6f5f2;
  --text-2: rgba(246, 245, 242, 0.68);
  --text-3: rgba(246, 245, 242, 0.44);

  /* Accents */
  --taxi: #ffc21a;
  --taxi-ink: #17140a;
  --sign-green: #0b6a46;
  --highway: #c08a3e;
  --ok: #5ee08f;
  --warn: #ffc857;
  --bad: #ff7a6b;

  /* Shape & motion */
  --edge: 20px;
  --bar-h: 50px;
  --r-panel: 16px;
  --r-ctl: 10px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.2);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-sign: 'Overpass', 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* Kente: six strip-woven blocks (warp stripes, weft bars, checks, ladder) in taxi gold, green, red & graphite: the
     loading band's cloth & the kente rule */
  --kente-strip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 48' preserveAspectRatio='none' shape-rendering='crispEdges'%3E%3Cg transform='translate%280 0%29'%3E%3Crect x='0' y='0' width='48' height='48' fill='%2314945a'/%3E%3Crect x='0' y='9' width='48' height='5' fill='%23ffc21a'/%3E%3Crect x='0' y='21' width='48' height='5' fill='%23ffc21a'/%3E%3Crect x='0' y='34' width='48' height='5' fill='%23ffc21a'/%3E%3Crect x='0' y='15' width='48' height='2' fill='%2316171a'/%3E%3Crect x='0' y='31' width='48' height='2' fill='%2316171a'/%3E%3C/g%3E%3Cg transform='translate%2848 0%29'%3E%3Crect x='0' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='7' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='10' y='0' width='7' height='48' fill='%2314945a'/%3E%3Crect x='17' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='20' y='0' width='8' height='48' fill='%23ffc21a'/%3E%3Crect x='28' y='0' width='3' height='48' fill='%23c8372a'/%3E%3Crect x='31' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='38' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='41' y='0' width='7' height='48' fill='%2314945a'/%3E%3C/g%3E%3Cg transform='translate%2896 0%29'%3E%3Crect x='0' y='0' width='48' height='48' fill='%23c8372a'/%3E%3Crect x='0' y='6' width='48' height='4' fill='%2316171a'/%3E%3Crect x='0' y='38' width='48' height='4' fill='%2316171a'/%3E%3Crect x='0' y='19' width='48' height='10' fill='%23ffc21a'/%3E%3Crect x='0' y='23' width='48' height='2' fill='%2316171a'/%3E%3C/g%3E%3Cg transform='translate%28144 0%29'%3E%3Crect x='0' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='7' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='10' y='0' width='7' height='48' fill='%2314945a'/%3E%3Crect x='17' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='20' y='0' width='8' height='48' fill='%23ffc21a'/%3E%3Crect x='28' y='0' width='3' height='48' fill='%23c8372a'/%3E%3Crect x='31' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='38' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='41' y='0' width='7' height='48' fill='%2314945a'/%3E%3C/g%3E%3Cg transform='translate%28192 0%29'%3E%3Crect x='0' y='0' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='0' y='8' width='8' height='8' fill='%2316171a'/%3E%3Crect x='0' y='16' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='0' y='24' width='8' height='8' fill='%2316171a'/%3E%3Crect x='0' y='32' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='0' y='40' width='8' height='8' fill='%2316171a'/%3E%3Crect x='8' y='0' width='8' height='8' fill='%2316171a'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='8' y='16' width='8' height='8' fill='%2316171a'/%3E%3Crect x='8' y='24' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='8' y='32' width='8' height='8' fill='%2316171a'/%3E%3Crect x='8' y='40' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='16' y='0' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='16' y='8' width='8' height='8' fill='%2316171a'/%3E%3Crect x='16' y='16' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='16' y='24' width='8' height='8' fill='%23c8372a'/%3E%3Crect x='16' y='32' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='16' y='40' width='8' height='8' fill='%2316171a'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%2316171a'/%3E%3Crect x='24' y='8' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='24' y='16' width='8' height='8' fill='%23c8372a'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='24' y='32' width='8' height='8' fill='%2316171a'/%3E%3Crect x='24' y='40' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='32' y='0' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='32' y='8' width='8' height='8' fill='%2316171a'/%3E%3Crect x='32' y='16' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='32' y='24' width='8' height='8' fill='%2316171a'/%3E%3Crect x='32' y='32' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='32' y='40' width='8' height='8' fill='%2316171a'/%3E%3Crect x='40' y='0' width='8' height='8' fill='%2316171a'/%3E%3Crect x='40' y='8' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='40' y='16' width='8' height='8' fill='%2316171a'/%3E%3Crect x='40' y='24' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='40' y='32' width='8' height='8' fill='%2316171a'/%3E%3Crect x='40' y='40' width='8' height='8' fill='%23ffc21a'/%3E%3C/g%3E%3Cg transform='translate%28240 0%29'%3E%3Crect x='0' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='7' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='10' y='0' width='7' height='48' fill='%2314945a'/%3E%3Crect x='17' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='20' y='0' width='8' height='48' fill='%23ffc21a'/%3E%3Crect x='28' y='0' width='3' height='48' fill='%23c8372a'/%3E%3Crect x='31' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='38' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='41' y='0' width='7' height='48' fill='%2314945a'/%3E%3C/g%3E%3Cg transform='translate%28288 0%29'%3E%3Crect x='0' y='0' width='48' height='48' fill='%23ffc21a'/%3E%3Crect x='0' y='5' width='48' height='7' fill='%2314945a'/%3E%3Crect x='0' y='36' width='48' height='7' fill='%2314945a'/%3E%3Crect x='0' y='22' width='48' height='4' fill='%2316171a'/%3E%3Crect x='0' y='16' width='48' height='2' fill='%23c8372a'/%3E%3Crect x='0' y='30' width='48' height='2' fill='%23c8372a'/%3E%3C/g%3E%3Cg transform='translate%28336 0%29'%3E%3Crect x='0' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='7' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='10' y='0' width='7' height='48' fill='%2314945a'/%3E%3Crect x='17' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='20' y='0' width='8' height='48' fill='%23ffc21a'/%3E%3Crect x='28' y='0' width='3' height='48' fill='%23c8372a'/%3E%3Crect x='31' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='38' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='41' y='0' width='7' height='48' fill='%2314945a'/%3E%3C/g%3E%3Cg transform='translate%28384 0%29'%3E%3Crect x='0' y='0' width='48' height='48' fill='%2316171a'/%3E%3Crect x='8' y='0' width='5' height='48' fill='%23ffc21a'/%3E%3Crect x='35' y='0' width='5' height='48' fill='%23ffc21a'/%3E%3Crect x='13' y='5' width='22' height='4' fill='%23ffc21a'/%3E%3Crect x='13' y='18' width='22' height='4' fill='%23ffc21a'/%3E%3Crect x='13' y='31' width='22' height='4' fill='%23ffc21a'/%3E%3Crect x='13' y='44' width='22' height='4' fill='%23ffc21a'/%3E%3Crect x='20' y='10' width='8' height='6' fill='%2314945a'/%3E%3Crect x='20' y='36' width='8' height='6' fill='%2314945a'/%3E%3C/g%3E%3Cg transform='translate%28432 0%29'%3E%3Crect x='0' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='7' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='10' y='0' width='7' height='48' fill='%2314945a'/%3E%3Crect x='17' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='20' y='0' width='8' height='48' fill='%23ffc21a'/%3E%3Crect x='28' y='0' width='3' height='48' fill='%23c8372a'/%3E%3Crect x='31' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='38' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='41' y='0' width='7' height='48' fill='%2314945a'/%3E%3C/g%3E%3C/svg%3E"); /* (the band's order: weft blocks between warp stripes) */
  --kente: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 288 48' preserveAspectRatio='none' shape-rendering='crispEdges'%3E%3Cg transform='translate%280 0%29'%3E%3Crect x='0' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='7' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='10' y='0' width='7' height='48' fill='%2314945a'/%3E%3Crect x='17' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='20' y='0' width='8' height='48' fill='%23ffc21a'/%3E%3Crect x='28' y='0' width='3' height='48' fill='%23c8372a'/%3E%3Crect x='31' y='0' width='7' height='48' fill='%23ffc21a'/%3E%3Crect x='38' y='0' width='3' height='48' fill='%2316171a'/%3E%3Crect x='41' y='0' width='7' height='48' fill='%2314945a'/%3E%3C/g%3E%3Cg transform='translate%2848 0%29'%3E%3Crect x='0' y='0' width='48' height='48' fill='%2314945a'/%3E%3Crect x='0' y='9' width='48' height='5' fill='%23ffc21a'/%3E%3Crect x='0' y='21' width='48' height='5' fill='%23ffc21a'/%3E%3Crect x='0' y='34' width='48' height='5' fill='%23ffc21a'/%3E%3Crect x='0' y='15' width='48' height='2' fill='%2316171a'/%3E%3Crect x='0' y='31' width='48' height='2' fill='%2316171a'/%3E%3C/g%3E%3Cg transform='translate%2896 0%29'%3E%3Crect x='0' y='0' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='0' y='8' width='8' height='8' fill='%2316171a'/%3E%3Crect x='0' y='16' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='0' y='24' width='8' height='8' fill='%2316171a'/%3E%3Crect x='0' y='32' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='0' y='40' width='8' height='8' fill='%2316171a'/%3E%3Crect x='8' y='0' width='8' height='8' fill='%2316171a'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='8' y='16' width='8' height='8' fill='%2316171a'/%3E%3Crect x='8' y='24' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='8' y='32' width='8' height='8' fill='%2316171a'/%3E%3Crect x='8' y='40' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='16' y='0' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='16' y='8' width='8' height='8' fill='%2316171a'/%3E%3Crect x='16' y='16' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='16' y='24' width='8' height='8' fill='%23c8372a'/%3E%3Crect x='16' y='32' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='16' y='40' width='8' height='8' fill='%2316171a'/%3E%3Crect x='24' y='0' width='8' height='8' fill='%2316171a'/%3E%3Crect x='24' y='8' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='24' y='16' width='8' height='8' fill='%23c8372a'/%3E%3Crect x='24' y='24' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='24' y='32' width='8' height='8' fill='%2316171a'/%3E%3Crect x='24' y='40' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='32' y='0' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='32' y='8' width='8' height='8' fill='%2316171a'/%3E%3Crect x='32' y='16' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='32' y='24' width='8' height='8' fill='%2316171a'/%3E%3Crect x='32' y='32' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='32' y='40' width='8' height='8' fill='%2316171a'/%3E%3Crect x='40' y='0' width='8' height='8' fill='%2316171a'/%3E%3Crect x='40' y='8' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='40' y='16' width='8' height='8' fill='%2316171a'/%3E%3Crect x='40' y='24' width='8' height='8' fill='%23ffc21a'/%3E%3Crect x='40' y='32' width='8' height='8' fill='%2316171a'/%3E%3Crect x='40' y='40' width='8' height='8' fill='%23ffc21a'/%3E%3C/g%3E%3Cg transform='translate%28144 0%29'%3E%3Crect x='0' y='0' width='48' height='48' fill='%23c8372a'/%3E%3Crect x='0' y='6' width='48' height='4' fill='%2316171a'/%3E%3Crect x='0' y='38' width='48' height='4' fill='%2316171a'/%3E%3Crect x='0' y='19' width='48' height='10' fill='%23ffc21a'/%3E%3Crect x='0' y='23' width='48' height='2' fill='%2316171a'/%3E%3C/g%3E%3Cg transform='translate%28192 0%29'%3E%3Crect x='0' y='0' width='48' height='48' fill='%2316171a'/%3E%3Crect x='8' y='0' width='5' height='48' fill='%23ffc21a'/%3E%3Crect x='35' y='0' width='5' height='48' fill='%23ffc21a'/%3E%3Crect x='13' y='5' width='22' height='4' fill='%23ffc21a'/%3E%3Crect x='13' y='18' width='22' height='4' fill='%23ffc21a'/%3E%3Crect x='13' y='31' width='22' height='4' fill='%23ffc21a'/%3E%3Crect x='13' y='44' width='22' height='4' fill='%23ffc21a'/%3E%3Crect x='20' y='10' width='8' height='6' fill='%2314945a'/%3E%3Crect x='20' y='36' width='8' height='6' fill='%2314945a'/%3E%3C/g%3E%3Cg transform='translate%28240 0%29'%3E%3Crect x='0' y='0' width='48' height='48' fill='%23ffc21a'/%3E%3Crect x='0' y='5' width='48' height='7' fill='%2314945a'/%3E%3Crect x='0' y='36' width='48' height='7' fill='%2314945a'/%3E%3Crect x='0' y='22' width='48' height='4' fill='%2316171a'/%3E%3Crect x='0' y='16' width='48' height='2' fill='%23c8372a'/%3E%3Crect x='0' y='30' width='48' height='2' fill='%23c8372a'/%3E%3C/g%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0a0b0d;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 14px;
  height: 14px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  cursor: grab;
}

#canvas-container:active {
  cursor: grabbing;
}

/* Soft scrims behind the HUD: keep small type legible over a bright midday street */
body::before,
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

body::before {
  top: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
}

body::after {
  bottom: 0;
  height: 210px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0));
}

/* ------------------------------------------------------------------------------------------------------------------
   Glass panel
   ------------------------------------------------------------------------------------------------------------------ */
.panel {
  background: var(--grain), var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-panel);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow);
}

/* ------------------------------------------------------------------------------------------------------------------
   Loading screen
   ------------------------------------------------------------------------------------------------------------------ */
#loading-overlay {
  --loom-x: clamp(20px, 7vw, 112px);
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: var(--grain), radial-gradient(110% 80% at 18% 22%, #1a1c21 0%, #0c0d10 58%, #060607 100%);
  transition: opacity 0.7s var(--ease-out) 0.15s, visibility 0.7s 0.15s;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loom { position: absolute; inset: 0; }

.loom-head {
  position: absolute;
  left: var(--loom-x);
  right: var(--loom-x);
  top: 17vh;
  animation: rise-in 0.9s var(--ease-out) both;
}

.loom-title {
  font: 800 clamp(52px, 7.4vw, 96px)/0.88 var(--font-sign);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text);
}

/* ("Life" in taxi yellow: the game's recurring Accra taxi) */
.loom-title span { color: var(--taxi); }

.loom-sub {
  margin-top: 18px;
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}

/* progress over the band's left end: the woven share & what's happening now */
.loom-meter {
  position: absolute;
  left: var(--loom-x);
  right: var(--loom-x);
  bottom: calc(100% - 65vh + 16px);
  display: flex;
  align-items: baseline;
  gap: 16px;
  animation: rise-in 0.9s var(--ease-out) 0.1s both;
}

.loom-pct {
  flex: none;
  min-width: 2.6ch;
  font: 800 56px/1 var(--font-sign);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--taxi);
}

.loom-pct small { margin-left: 2px; font-size: 24px; font-weight: 700; color: var(--text-2); }

#loading-status {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The band: a kente strip on the loom, edge to edge. Unwoven blocks show the bare warp threads; a stage done beats
   its weft block down into them; the gold shuttle runs across the band under the woven cloth meanwhile */
.loom-band {
  position: absolute;
  left: 0;
  right: 0;
  --band-h: clamp(56px, 9vh, 92px);
  top: 65vh;
  height: var(--band-h);
  display: flex;
  isolation: isolate;
  border-block: 3px solid #0b0c0e;
  box-shadow: 0 -1px 0 rgba(255, 194, 26, 0.35), 0 1px 0 rgba(255, 194, 26, 0.35), 0 24px 48px -20px rgba(0, 0, 0, 0.8);
  transition: transform 0.7s var(--ease-out), opacity 0.5s ease;
}

.loom-block {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(246, 245, 242, 0.15) 0 1px, transparent 1px 5px), #101114;
}

.loom-block::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  /* (weft ribs & the warp showing through over the motif: it reads as cloth, not a flat fill) */
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 5px),
    var(--kente) var(--mx) 0 / 600% 100% no-repeat;
  transform: translateY(-101%);
}

/* the beat: the weft drops, the batten slams it home (a 3px drive past the line, then it settles) */
.loom-block.is-woven::after { animation: loom-beat 0.5s both; }
.loom-block.is-woven::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  z-index: 3;
  height: 4px;
  background: #ffe7a3;
  box-shadow: 0 0 10px 1px rgba(255, 194, 26, 0.75);
  animation: loom-batten 0.62s both;
}

@keyframes loom-beat {
  0% { transform: translateY(-101%); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }
  62% { transform: translateY(3px); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  100% { transform: none; }
}

@keyframes loom-batten {
  0% { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.6); }
  50% { transform: translateY(calc(var(--band-h) - 1px)); opacity: 1; }
  100% { transform: translateY(calc(var(--band-h) - 1px)); opacity: 0; }
}
.loom-block.m1 { --mx: 0%; }
.loom-block.m2 { --mx: 20%; }
.loom-block.m3 { --mx: 40%; }
.loom-block.m4 { --mx: 60%; }
.loom-block.m5 { --mx: 80%; }
.loom-block.m6 { --mx: 100%; }

/* the shuttle: a gold head carrying its weft thread across the bare warp (its span starts where the cloth ends:
   --woven, set at each stage) */
.loom-shuttle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--woven, 0) * 100%);
  right: 0;
  z-index: 1;
  overflow: hidden;
}

.loom-shuttle::before {
  content: '';
  position: absolute;
  inset: 0;
  /* the thread behind the head, then the head: a short bright bobbin the band's height */
  background:
    linear-gradient(90deg, transparent calc(100% - 9px), #ffe7a3 calc(100% - 9px), var(--taxi) calc(100% - 3px), transparent calc(100% - 3px)) 0 0 / 100% 100% no-repeat,
    linear-gradient(#ffc21a, #ffc21a) 0 50% / 100% 2px no-repeat;
  transform: translateX(-100%);
  animation: loom-shuttle 1.6s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  will-change: transform;
}

@keyframes loom-shuttle {
  to { transform: translateX(0); }
}

/* tips: stacked, each shown 5 s in turn (CSS only: it keeps cycling while the build holds the main thread) */
.loom-tips {
  position: absolute;
  right: var(--loom-x);
  bottom: 8vh;
  width: min(400px, calc(100vw - 2 * var(--loom-x)));
  display: grid;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-panel);
  background: var(--grain), var(--glass-strong);
  box-shadow: var(--shadow);
  animation: rise-in 0.9s var(--ease-out) 0.25s both;
}

.loom-tip {
  grid-area: 1 / 1; /* (all in one cell: the card is as tall as the longest tip) */
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  opacity: 0;
  animation: loom-tip 45s infinite;
}

.loom-tip:nth-child(2) { animation-delay: 5s; }
.loom-tip:nth-child(3) { animation-delay: 10s; }
.loom-tip:nth-child(4) { animation-delay: 15s; }
.loom-tip:nth-child(5) { animation-delay: 20s; }
.loom-tip:nth-child(6) { animation-delay: 25s; }
.loom-tip:nth-child(7) { animation-delay: 30s; }
.loom-tip:nth-child(8) { animation-delay: 35s; }
.loom-tip:nth-child(9) { animation-delay: 40s; }

@keyframes loom-tip {
  0% { opacity: 0; transform: translateY(6px); }
  1.4%, 10% { opacity: 1; transform: none; }
  11.1%, 100% { opacity: 0; transform: translateY(-4px); }
}

.loom-tips kbd, .key-chip {
  display: inline-block;
  min-width: 1.9em;
  padding: 1px 6px 2px;
  margin: 0 1px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.07);
  font: 700 12px/1.4 var(--font-sign);
  color: var(--taxi);
  text-align: center;
}

.loom-credit {
  position: absolute;
  left: var(--loom-x);
  bottom: 8vh;
  font-size: 12px;
  color: var(--text-2);
}

/* out: the band slides down into the city as the screen fades */
#loading-overlay.hidden .loom-band { transform: translateY(5vh); opacity: 0; }
#loading-overlay.hidden .loom-head { transform: translateY(-3vh); transition: transform 0.7s var(--ease-out); }

@media (max-width: 620px) {
  .loom-block:nth-child(n + 12) { display: none; } /* (10 blocks: the shuttle is child 1) */
  .loom-head { top: 12vh; }
  .loom-sub { font-size: 14px; }
  .loom-pct { font-size: 44px; }
  #loading-status { font-size: 13.5px; white-space: normal; }
  .loom-meter { gap: 12px; }
  .loom-tips { bottom: calc(8vh + 30px); }
  .loom-credit { bottom: 4vh; }
}

@media (prefers-reduced-motion: reduce) {
  .loom-shuttle::before { animation: none; opacity: 0; }
  .loom-block.is-woven::after, .loom-block.is-woven::before { animation: none; transform: none; }
  .loom-block.is-woven::before { opacity: 0; }
  .loom-tip { animation: none; }
  .loom-tip:first-child { opacity: 1; }
}

/* The kente rule: the loading band's cloth as a thin strip, wherever the game marks a moment (match end, the
   Battle Royale button) */
.kente-rule {
  height: 22px;
  background: var(--kente-strip) 0 0 / 340px 100% repeat-x; /* (10 blocks of 34px: the sprite stretches to any box) */
  box-shadow: inset 0 1px 0 #0b0c0e, inset 0 -1px 0 #0b0c0e;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------------------------------------------------------
   HUD layout: four corners plus the bottom centre, the middle of the screen stays clear
   ------------------------------------------------------------------------------------------------------------------ */
.hud {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}

.hud > * {
  pointer-events: auto;
}

.hud-top-right {
  top: var(--edge);
  right: var(--edge);
}

.hud-bottom-left {
  left: var(--edge);
  bottom: var(--edge);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.hud-bottom-center {
  left: 50%;
  bottom: var(--edge);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hud-bottom-right {
  right: var(--edge);
  bottom: var(--edge);
}

/* Clean view [H]: everything but the toggle itself steps out of the way */
body.hud-minimized::before,
body.hud-minimized::after {
  opacity: 0;
}

body.hud-minimized .hud:not(.hud-top-right) {
  opacity: 0;
}

body.hud-minimized .hud:not(.hud-top-right),
body.hud-minimized .hud:not(.hud-top-right) > * {
  pointer-events: none;
}

body.hud-minimized .hud-bottom-left,
body.hud-minimized .hud-bottom-right { transform: translateY(12px); }
body.hud-minimized .hud-bottom-center { transform: translate(-50%, 12px); }

body.hud-minimized .toolbar > :not(#btn-toggle-hud) {
  display: none;
}

.map-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--taxi);
  color: var(--taxi-ink);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}


/* ------------------------------------------------------------------------------------------------------------------
   Top right: toolbar (time of day, teleport, map, clean view)
   ------------------------------------------------------------------------------------------------------------------ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--bar-h);
  padding: 0 5px;
}

.toolbar-divider {
  flex: none;
  width: 1px;
  height: 20px;
  margin: 0 5px;
  background: var(--divider);
}

/* The day cycle's clock: game time in Accra & the season (read-only, it runs on its own) */
.day-clock {
  height: 36px;
  padding: 0 11px 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}

.day-clock .icon { color: var(--text-2); }

.tool-btn {
  height: 36px;
  padding: 0 11px;
  border-radius: var(--r-ctl);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  transition: background-color 0.2s ease;
}

.tool-btn:hover,
.tool-btn.is-open {
  background: var(--hover);
}

.tool-btn .icon-sm {
  margin-left: -2px;
  color: var(--text-3);
  transition: transform 0.3s var(--ease-out);
}

.tool-btn.is-open .icon-sm {
  transform: rotate(180deg);
}

.tool-btn.icon-only {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.icon-show {
  display: none;
}

body.hud-minimized .icon-hide {
  display: none;
}

body.hud-minimized .icon-show {
  display: block;
}

.tool-btn:active,
.icon-btn:active,
.mode-btn:active,
.camera-current:active,
.pop-item:active {
  transform: scale(0.97);
}

/* ------------------------------------------------------------------------------------------------------------------
   Popovers (teleport destinations, cameras)
   ------------------------------------------------------------------------------------------------------------------ */
.popover {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 6px;
  min-width: 264px;
  max-height: calc(100vh - 2 * var(--edge) - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  color: var(--text);
  background: var(--grain), var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 28px 60px -22px rgba(0, 0, 0, 0.8), 0 4px 14px rgba(0, 0, 0, 0.3);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.26s var(--ease-out), overlay 0.26s allow-discrete, display 0.26s allow-discrete;
}

.popover[data-side='above'] {
  transform-origin: bottom right;
}

.popover:not(:popover-open) {
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
}

.popover[data-side='above']:not(:popover-open) {
  transform: translateY(4px) scale(0.98);
}

@starting-style {
  .popover:popover-open {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  .popover[data-side='above']:popover-open {
    transform: translateY(4px) scale(0.98);
  }
}

.pop-title {
  padding: 9px 10px 6px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.pop-title:not(:first-child) {
  margin-top: 5px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.pop-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 9px;
  text-align: left;
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  transition: background-color 0.15s ease;
}

.pop-item:hover {
  background: var(--hover);
}

.pop-item.active,
.pop-item.active:hover {
  background: var(--text);
  color: #121314;
}

.pop-item.active kbd {
  color: rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.08);
  box-shadow: none;
}

.tp-btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.pop-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}

/* ------------------------------------------------------------------------------------------------------------------
   Bottom left: street-name signs over the GPS radar
   ------------------------------------------------------------------------------------------------------------------ */
.location {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  pointer-events: none;
}

.location-place {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 0 14px rgba(0, 0, 0, 0.4);
  animation: rise-in 0.4s var(--ease-out) both;
}

.location-signs {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: rise-in 0.4s var(--ease-out) both;
}

.location-near {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Green blade, white inset border, Highway Gothic lettering: the street-name sign */
.street-sign {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 9px 13px 7px;
  font-family: var(--font-sign);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 55%), var(--sign-green);
  border-radius: 6px;
  outline: 1.5px solid rgba(255, 255, 255, 0.92);
  outline-offset: -4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 10px 22px -10px rgba(0, 0, 0, 0.75);
}

.radar {
  position: relative;
  width: 288px;
  height: 184px;
  overflow: hidden;
  border-radius: 18px;
  background: #0a1118;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out);
}

.radar:hover {
  transform: translateY(-2px);
}

/* Inner rim: a soft vignette so the map sinks into the frame */
.radar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 0 30px rgba(0, 0, 0, 0.55);
}

#minimap-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.radar-north {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  background: rgba(10, 12, 15, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.radar-key {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(10, 12, 15, 0.6);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.radar:hover .radar-key {
  color: var(--taxi-ink);
  background: var(--taxi);
  box-shadow: none;
}

/* ------------------------------------------------------------------------------------------------------------------
   Bottom centre: travel mode switcher & keyboard guide
   ------------------------------------------------------------------------------------------------------------------ */
.controls-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  max-width: 600px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  animation: rise-in 0.35s var(--ease-out) both;
}

.hint kbd {
  color: #ffffff;
  background: rgba(12, 13, 15, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  text-shadow: none;
}

.hint-label {
  margin-left: 4px;
}

.mode-switch {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 5px;
}

/* The taxi-yellow pill glides to the selected mode (positioned by main.js) */
.mode-indicator {
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: var(--ind-w, 0px);
  transform: translateX(var(--ind-x, 0px));
  border-radius: 12px;
  background: var(--taxi);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out);
}

.mode-switch.no-anim .mode-indicator {
  transition: none;
}

.mode-btn {
  position: relative;
  z-index: 1;
  height: 42px;
  padding: 0 12px 0 11px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  transition: color 0.25s ease, background-color 0.2s ease;
}

.mode-btn:hover {
  color: var(--text);
  background: var(--hover);
}

.mode-btn.active,
.mode-btn.active:hover {
  color: var(--taxi-ink);
  background: transparent;
}

.mode-btn .icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.7;
}

.mode-btn kbd {
  margin-left: 2px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.mode-btn.active kbd {
  color: rgba(23, 20, 10, 0.62);
  background: rgba(23, 20, 10, 0.1);
  box-shadow: none;
}

/* ------------------------------------------------------------------------------------------------------------------
   Bottom right: speed cluster & camera switcher
   ------------------------------------------------------------------------------------------------------------------ */
.cluster {
  width: 272px;
  overflow: hidden;
}

.gauge {
  padding: 13px 16px 15px;
}

.gauge-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.gauge-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.gauge-alt {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

body[data-mode='helicopter'] .gauge-alt {
  opacity: 1;
}

.gauge-alt-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.gauge-speed {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 5px;
}

#hud-speed {
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.gauge-unit {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.gauge-meter {
  position: relative;
  height: 4px;
  margin-top: 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* Speed as a share of the mode's top speed; it turns taxi yellow on boost */
#hud-speed-meter {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--text);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.25s linear, background-color 0.2s ease;
}

body.is-boosting #hud-speed-meter {
  background: var(--taxi);
}

.camera-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-top: 1px solid var(--divider);
}

.icon-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-ctl);
  display: inline-grid;
  place-items: center;
  color: var(--text-2);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--hover);
}

.camera-current {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--r-ctl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.camera-current:hover,
.camera-current.is-open {
  background: var(--hover);
}

.camera-current .icon {
  color: var(--text-3);
}

#hud-active-camera {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------------------------------------------------------
   Full-screen interactive street map ([M])
   ------------------------------------------------------------------------------------------------------------------ */
.fullmap-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #0a1118;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.fullmap-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fullmap-canvas-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: crosshair;
}

.fullmap-canvas-wrap.is-panning {
  cursor: grabbing;
}

#fullmap-canvas {
  touch-action: none;
  display: block;
  width: 100%;
  height: 100%;
}

.fullmap-header {
  position: absolute;
  top: var(--edge);
  left: var(--edge);
  right: var(--edge);
  display: flex;
  align-items: stretch;
  gap: 10px;
  pointer-events: none;
}

.fullmap-header > * {
  pointer-events: auto;
}

.fullmap-modal:not(.hidden) .fullmap-header,
.fullmap-modal:not(.hidden) .map-controls,
.fullmap-modal:not(.hidden) .fullmap-footer {
  animation: rise-in 0.45s var(--ease-out) both;
}

.fullmap-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 20px 9px 11px;
}

.fullmap-title h2 {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.fullmap-subtitle {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fullmap-search-wrap {
  flex: 0 1 440px;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--text-3);
  cursor: text;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.fullmap-search-wrap:focus-within {
  color: var(--text-2);
  border-color: rgba(255, 255, 255, 0.24);
  background: var(--grain), var(--glass-strong);
}

.fullmap-search {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  user-select: text;
}

.fullmap-search::placeholder {
  color: var(--text-3);
}

.fullmap-close {
  margin-left: auto;
  height: auto;
  padding: 0 14px 0 12px;
  border-radius: var(--r-panel);
}

.fullmap-close:hover {
  background: var(--grain), var(--glass-strong);
}

/* (centred with `translate`, which the rise-in entrance animation on `transform` leaves alone) */
.map-controls {
  position: absolute;
  top: 50%;
  right: var(--edge);
  translate: 0 -50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.map-compass {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.map-compass svg {
  width: 44px;
  height: 44px;
}

.map-compass text {
  font: 800 7.5px var(--font-sans);
  fill: #ffffff;
}

.map-zoom {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
}

.fullmap-footer {
  position: absolute;
  left: 50%;
  bottom: var(--edge);
  translate: -50% 0;
  display: flex;
  max-width: min(560px, calc(100% - 2 * var(--edge) - 2 * 200px));
}

.fullmap-status {
  min-width: 0;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fullmap-legend {
  position: absolute;
  right: var(--edge);
  bottom: var(--edge);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.fullmap-modal:not(.hidden) .fullmap-legend {
  animation: rise-in 0.45s var(--ease-out) both;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  flex: none;
  display: inline-block;
}

.player-swatch {
  width: 10px;
  height: 11px;
  background: #ffffff;
  clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
}

.landmark-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 2px #0b0f14, 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.gps-swatch,
.bridge-swatch {
  width: 16px;
  height: 4px;
  border-radius: 2px;
}

.gps-swatch { background: var(--taxi); }
.bridge-swatch { background: var(--highway); }

.legend-counts {
  padding-left: 14px;
  border-left: 1px solid var(--divider);
  color: var(--text-3);
}

/* ------------------------------------------------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------------------------------------------------ */
@media (max-width: 1800px) {
  .legend-counts { display: none; }
}

@media (max-width: 1360px) {
  .fullmap-legend { display: none; }
}

@media (max-width: 1240px) {
  .controls-hint { display: none; }
  .mode-btn kbd { display: none; }
}

@media (max-width: 1080px) {
  .mode-label,
  .tool-label,
  .tool-btn kbd { display: none; }
  .mode-btn { padding: 0 12px; }
  .tool-btn:not(.icon-only):not(.fullmap-close) { gap: 4px; padding: 0 9px; }
}

@media (max-width: 820px) {
  :root { --edge: 12px; }
  .radar { width: 220px; height: 148px; }
  .cluster { width: 220px; }
  #hud-speed { font-size: 34px; }
  .fullmap-title > div { display: none; }
  .fullmap-title { padding: 9px; }
  .fullmap-footer { max-width: calc(100% - 2 * var(--edge)); bottom: calc(var(--edge) + 34px); }
  .map-controls { top: auto; bottom: calc(var(--edge) + 96px); translate: none; }
}

@media (max-width: 620px) {
  .day-clock { padding: 0 8px; }
  .radar { display: none; }
  .hud-bottom-right { bottom: calc(var(--edge) + 64px); }
  .gauge { display: none; }
  .camera-switch { border-top: 0; }
}

/* Touch controls reserve the bottom corners; mode and camera selection remain within reach. */
#touch-controls {
  position: fixed;
  z-index: 12;
  left: max(var(--edge), env(safe-area-inset-left));
  right: max(var(--edge), env(safe-area-inset-right));
  bottom: calc(max(var(--edge), env(safe-area-inset-bottom)) + 72px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
  -webkit-touch-callout: none;
}

#touch-controls[hidden],
.touch-action[hidden] { display: none; }

.touch-movement { text-align: center; }

#touch-stick {
  position: relative;
  width: 136px;
  height: 136px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 32%, transparent 33%), var(--glass);
  box-shadow: var(--shadow), inset 0 0 0 12px rgba(255, 255, 255, 0.025);
  pointer-events: auto;
  touch-action: none;
}

.touch-stick-axis::before,
.touch-stick-axis::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
}
.touch-stick-axis::before { top: 16px; bottom: 16px; width: 1px; left: 50%; }
.touch-stick-axis::after { left: 16px; right: 16px; height: 1px; top: 50%; }

#touch-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(246, 245, 242, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: translate(calc(-50% + var(--stick-x, 0px)), calc(-50% + var(--stick-y, 0px)));
  pointer-events: none;
}

#touch-stick.is-pressed #touch-stick-knob { background: var(--taxi); border-color: var(--taxi); }

.touch-caption,
.touch-look-hint {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 550;
  text-shadow: 0 1px 5px #000;
}
.touch-caption { display: block; margin-top: 8px; }
.touch-look-hint {
  position: fixed;
  top: calc(max(var(--edge), env(safe-area-inset-top)) + 120px);
  right: max(var(--edge), env(safe-area-inset-right));
  padding: 4px;
}

.touch-actions {
  display: grid;
  grid-template-columns: repeat(2, 64px);
  gap: 10px;
  padding-bottom: 22px;
}
.touch-action {
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 650;
  pointer-events: auto;
  touch-action: none;
}
.touch-action > [aria-hidden] { font-size: 23px; line-height: 1; }
.touch-boost { grid-column: 2; border-color: rgba(255, 194, 26, 0.65); color: var(--taxi); }
.touch-action.is-pressed { color: var(--taxi-ink); background: var(--taxi); border-color: var(--taxi); }

body.touch-enabled .controls-hint,
body.touch-enabled .radar,
body.touch-enabled .gauge,
body.touch-enabled kbd,
body.touch-enabled .toolbar-divider,
body.touch-enabled .seg-label { display: none; }

body.touch-enabled .hud-top-right { top: max(var(--edge), env(safe-area-inset-top)); right: max(var(--edge), env(safe-area-inset-right)); }
body.touch-enabled .toolbar { gap: 2px; padding: 4px; }
body.touch-enabled .tool-btn { min-width: 44px; min-height: 44px; }
body.touch-enabled .tool-label { display: none; }
body.touch-enabled .hud-bottom-center { bottom: max(var(--edge), env(safe-area-inset-bottom)); }
body.touch-enabled .mode-label { display: block; font-size: 10px; }
body.touch-enabled .mode-btn { width: 62px; height: 48px; padding: 0; flex-direction: column; justify-content: center; gap: 3px; }
body.touch-enabled .hud-bottom-right { top: calc(max(var(--edge), env(safe-area-inset-top)) + 62px); right: max(var(--edge), env(safe-area-inset-right)); bottom: auto; }
body.touch-enabled .cluster { width: 230px; }
body.touch-enabled .camera-switch { border: 0; }
body.touch-enabled .camera-switch .icon-btn { width: 44px; height: 44px; }
body.touch-enabled .hud-bottom-left { left: max(var(--edge), env(safe-area-inset-left)); bottom: calc(max(var(--edge), env(safe-area-inset-bottom)) + 254px); max-width: calc(100% - 2 * var(--edge)); }
body.touch-enabled .fullmap-header { top: max(var(--edge), env(safe-area-inset-top)); left: max(var(--edge), env(safe-area-inset-left)); right: max(var(--edge), env(safe-area-inset-right)); }
body.touch-enabled .map-controls .icon-btn { width: 44px; height: 44px; }
body.touch-enabled .pop-item { min-height: 44px; }

@media (max-width: 360px) {
  body.touch-enabled .toolbar { width: 194px; height: auto; flex-wrap: wrap; justify-content: center; }
  body.touch-enabled .hud-bottom-right { top: calc(max(var(--edge), env(safe-area-inset-top)) + 114px); }
  .touch-look-hint { top: calc(max(var(--edge), env(safe-area-inset-top)) + 172px); }
}

@media (max-height: 500px) {
  body.touch-enabled .hud-bottom-left { display: none; }
  body.touch-enabled .hud-bottom-right { top: calc(max(var(--edge), env(safe-area-inset-top)) + 58px); }
  #touch-controls { bottom: max(var(--edge), env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Get in / get out prompt (F / E, or tap) */
.enter-prompt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 8px;
  padding: 7px 14px 7px 8px;
  border: 0;
  border-radius: 999px;
  font: 600 13px/1 inherit;
  font-family: inherit;
  color: #fff;
  background: rgba(12, 13, 15, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 26, 0.55);
  cursor: pointer;
  pointer-events: auto;
  animation: rise-in 0.25s var(--ease-out) both;
}
.enter-prompt[hidden] { display: none; }
.enter-prompt kbd {
  color: #111;
  background: #ffd21a;
  box-shadow: none;
}
.mode-switch.no-active .mode-indicator { opacity: 0; }

/* perf overlay (P) */
.perf-overlay {
  position: fixed;
  top: 76px;
  right: 12px;
  z-index: 60;
  margin: 0;
  padding: 8px 10px;
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d8f5d0;
  background: rgba(8, 12, 10, 0.78);
  border-radius: 6px;
  pointer-events: none;
  white-space: pre;
}
.perf-overlay[hidden] { display: none; }
.quality-toast {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 6px 14px;
  font: 600 13px/1.3 system-ui, sans-serif;
  color: #fff;
  background: rgba(10, 14, 12, 0.8);
  border-radius: 6px;
  pointer-events: none;
}
.quality-toast[hidden] { display: none; }

/* ------------------------------------------------------------------------------------------------------------------
   Battle royale (js/game): the match HUD; free-roam UI steps aside while it runs
   ------------------------------------------------------------------------------------------------------------------ */
.tool-btn-match { position: relative; font-weight: 700; color: #ffd666; }
/* (a strip of the loading screen's kente under it: the way into the match) */
.tool-btn-match::before { content: ''; flex: none; width: 15px; height: 20px; border-radius: 3px; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px), var(--kente) 0 0 / 600% 100% no-repeat; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 194, 26, 0.35); } /* (the warp-stripe block: gold, green & red threads) */
.tool-btn-match[aria-pressed="true"]::before { opacity: 0.45; }
.tool-btn-match[aria-pressed="true"] { color: #ff8a80; }
.in-match #mode-switch,
.in-match .hud-bottom-right,
.in-match #hud-controls-hint,
.in-match .enter-prompt,
.in-match #btn-teleport,
.in-match [data-camera] { display: none !important; }

/* The match HUD speaks the game's system: graphite glass with grain, taxi yellow for the active thing, Overpass
   (the road-sign face) for every number a player reads at a glance */
.mh {
  --shield: #4fa8ff;
  --health: #5ee08f;
  --danger: #ff5a4f;
  --storm: #c08cff;
  --recon: #6fe0ff;
  --num: 700 1em/1 var(--font-sign);
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  color: var(--text);
  font: 600 13px/1.3 var(--font-sans);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}
.mh [hidden] { display: none !important; }
.mh-ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mh-top, .mh-feed-row, .mh-prompt, .mh-slot, .mh-vitals, .mh-foe, .mh-end-panel {
  background: var(--grain), var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow);
}

/* overlays: storm, low health, scope */
.mh-storm { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s var(--ease-out); background: radial-gradient(ellipse at center, rgba(120, 40, 200, 0.06) 35%, rgba(110, 30, 190, 0.55)); }
.mh-lowhp { position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s var(--ease-out); background: radial-gradient(ellipse at center, transparent 55%, rgba(200, 20, 20, 0.45)); animation: mh-pulse 1.1s ease-in-out infinite; }
.mh-scope { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0 28vh, #050506 28.2vh); }
.mh-scope::before, .mh-scope::after { content: ''; position: absolute; left: 50%; top: 50%; background: #050506; }
.mh-scope::before { width: 56vh; height: 1px; transform: translate(-50%, -50%); }
.mh-scope::after { width: 1px; height: 56vh; transform: translate(-50%, -50%); }

/* crosshair & markers */
.mh-cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.mh-cross i { position: absolute; left: 0; top: 0; background: rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); transition: background 0.12s; }
.mh-cross-t, .mh-cross-b { width: 2px; height: 9px; }
.mh-cross-l, .mh-cross-r { width: 9px; height: 2px; }
.mh-cross-dot { position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.mh-cross.is-on i, .mh-cross.is-on .mh-cross-dot { background: var(--danger); }
.mh-target { position: absolute; left: 50%; top: calc(50% + 26px); transform: translateX(-50%); font: 700 12px/1 var(--font-sans); color: #ff9a92; letter-spacing: 0.01em; }
.mh-hit { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; }
.mh-hit::before, .mh-hit::after { content: ''; position: absolute; background: #fff; }
.mh-hit::before { left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%); }
.mh-hit::after { top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%, 0 65%, 100% 65%, 100% 100%, 0 100%); }
.mh-hit.is-head::before, .mh-hit.is-head::after { background: var(--taxi); }
.mh-hit.is-kill::before, .mh-hit.is-kill::after { background: var(--danger); }
.mh-arc { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; border-radius: 50%; opacity: 0; border-top: 5px solid rgba(255, 170, 60, 0.95); transform: translate(-50%, -50%);
  -webkit-mask: conic-gradient(from -25deg, #000 50deg, transparent 0); mask: conic-gradient(from -25deg, #000 50deg, transparent 0); }
.mh-arc.is-hurt { width: 260px; height: 260px; border-top: 8px solid var(--danger); }
.mh-stamina { position: absolute; left: calc(50% + 46px); top: calc(50% - 24px); width: 5px; height: 48px; border-radius: 3px; background: rgba(0, 0, 0, 0.45); overflow: hidden; opacity: 0; transition: opacity 0.3s; }
.mh-stamina span { position: absolute; inset: 0; background: var(--taxi); transform-origin: bottom; }

/* world-anchored: damage numbers, enemies' bars, recon marks */
.mh-dmg { position: absolute; inset: 0; }
.mh-num { position: absolute; left: 0; top: 0; font: 700 20px/1 var(--font-sign); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 6px rgba(0, 0, 0, 0.5); }
.mh-num.is-shield { color: #9fd0ff; }
.mh-num.is-head { color: var(--taxi); font-size: 25px; }
.mh-foe { position: absolute; left: 0; top: 0; width: 92px; padding: 5px 7px 6px; border-radius: 9px; opacity: 0; transition: opacity 0.18s var(--ease-out); }
.mh-foe-name { font: 700 11px/1 var(--font-sans); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-foe-bar { height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.mh-foe-bar + .mh-foe-bar { margin-top: 3px; }
.mh-foe-bar span { display: block; height: 100%; transform-origin: left; transition: transform 0.18s var(--ease-out); }
.mh-foe-bar.is-shield span { background: var(--shield); }
.mh-foe-bar.is-health { height: 6px; }
.mh-foe-bar.is-health span { background: var(--health); }
.mh-mark { position: absolute; left: 0; top: 0; opacity: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: opacity 0.2s; }
.mh-mark::before { content: ''; width: 13px; height: 13px; transform: rotate(45deg); background: var(--danger); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.mh-mark b { font: 700 11px/1 var(--font-sign); }

/* top bar */
.mh-top { position: absolute; top: 76px; right: var(--edge); display: flex; align-items: center; height: 38px; padding: 0 4px; border-radius: 12px; }
.mh-stat { display: flex; align-items: center; gap: 7px; padding: 0 12px; height: 100%; color: var(--text-2); }
.mh-stat + .mh-stat { border-left: 1px solid var(--divider); }
.mh-stat b { font: var(--num); font-size: 17px; color: var(--text); }
.mh-stat.is-storm { color: var(--storm); }
.mh-stat.is-storm.is-moving b { color: var(--storm); animation: mh-pulse 1.2s ease-in-out infinite; }
.mh-stat.is-recon { color: var(--recon); }
.mh-stat.is-recon.is-active b { color: var(--recon); }

/* kill feed */
.mh-feed { position: absolute; top: var(--edge); left: var(--edge); display: flex; flex-direction: column; align-items: flex-start; gap: 5px; max-width: 46vw; }
.mh-feed-row { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 9px; font-weight: 500; color: var(--text-2); animation: mh-in 0.35s var(--ease-out); transition: opacity 0.4s, transform 0.4s var(--ease-out); }
.mh-feed-row b { font-weight: 700; color: var(--text); }
.mh-feed-row.is-mine { background: var(--grain), rgba(255, 194, 26, 0.2); }
.mh-feed-row.is-mine b { color: var(--taxi); }
.mh-feed-row.is-out { opacity: 0; transform: translateX(-8px); }
.mh-feed-gun { width: 34px; height: 20px; }
.mh-feed-cause { font-size: 11px; color: var(--text-3); }
.mh-feed-head { font-size: 10.5px; font-weight: 700; color: var(--taxi); }

/* vitals */
.mh-vitals { position: absolute; left: 50%; bottom: var(--edge); transform: translateX(-50%); width: min(380px, 70vw); padding: 10px 14px 11px; border-radius: 14px; display: flex; flex-direction: column; gap: 6px; }
.mh-status { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 8px; background: rgba(10, 11, 13, 0.7); color: var(--taxi); font-weight: 700; font-size: 12px; }
.mh-vital { display: grid; grid-template-columns: 18px 1fr 34px; align-items: center; gap: 9px; }
.mh-vital .mh-ic { width: 17px; height: 17px; }
.mh-vital.is-shield { color: var(--shield); }
.mh-vital.is-health { color: var(--health); }
.mh-vital-track { position: relative; height: 12px; border-radius: 4px; background: rgba(0, 0, 0, 0.5); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.mh-vital.is-health .mh-vital-track { height: 16px; }
.mh-vital-fill, .mh-vital-trail { position: absolute; inset: 0; transform-origin: left; }
.mh-vital-trail { background: rgba(255, 255, 255, 0.55); }
.mh-vital-fill { transition: transform 0.15s var(--ease-out); }
.mh-vital.is-shield .mh-vital-fill { background: linear-gradient(#8cc8ff, var(--shield) 55%, #2f7de1); }
.mh-vital.is-health .mh-vital-fill { background: linear-gradient(#a6f5c2, var(--health) 55%, #2fae5a); }
.mh-vital-track i { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(10, 11, 13, 0.7); z-index: 1; }
.mh-vital-num { font: var(--num); font-size: 18px; color: var(--text); text-align: right; }
.mh-vital.is-empty { opacity: 0.55; }
.mh-vital.is-low { color: var(--danger); }
.mh-vital.is-low .mh-vital-fill { background: linear-gradient(#ffb0a8, var(--danger) 55%, #c22d22); animation: mh-pulse 0.9s ease-in-out infinite; }

/* inventory */
.mh-inv { position: absolute; right: var(--edge); bottom: var(--edge); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.mh-ammo { display: flex; align-items: baseline; gap: 6px; }
.mh-ammo b { font: var(--num); font-size: 38px; }
.mh-ammo span { font: var(--num); font-size: 16px; color: var(--text-2); }
.mh-ammo span::before { content: '/'; margin-right: 6px; color: var(--text-3); }
.mh-ammo.is-low b { color: var(--danger); }
.mh-weapon-name { font-weight: 700; font-size: 12.5px; color: var(--text-2); min-height: 16px; }
.mh-slots { display: flex; gap: 6px; }
.mh-slot { position: relative; width: 66px; height: 62px; border-radius: 11px; display: grid; place-items: center; overflow: hidden; transition: transform 0.2s var(--ease-out), border-color 0.2s, background 0.2s; }
.mh-slot.is-empty { opacity: 0.55; }
.mh-slot.is-sel { transform: translateY(-6px); border-color: var(--taxi); background: var(--grain), rgba(40, 36, 22, 0.78); box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--taxi), var(--shadow); }
.mh-slot kbd { position: absolute; top: 4px; left: 6px; font: 700 10px/1 var(--font-sans); color: var(--text-3); }
.mh-slot.is-sel kbd { color: var(--taxi); }
.mh-slot-icon { width: 50px; height: 30px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
.mh-slot em { position: absolute; right: 6px; bottom: 6px; font: 700 11px/1 var(--font-sign); font-style: normal; color: var(--text); }
.mh-slot-band { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.mh-reserve { display: flex; gap: 12px; padding-right: 2px; }
.mh-ammo-tag { display: inline-flex; align-items: center; gap: 4px; }
.mh-ammo-tag img { width: 26px; height: 16px; }
.mh-ammo-tag b { font: var(--num); font-size: 12.5px; }
.mh-ammo-tag.is-none { opacity: 0.4; }

/* prompt & centre message */
.mh-prompt { position: absolute; left: 50%; bottom: calc(var(--edge) + 112px); transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; border-radius: 11px; font-weight: 700; animation: mh-prompt 0.25s var(--ease-out); }
.mh-prompt kbd { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--taxi); color: var(--taxi-ink); font: 800 13px/1 var(--font-sans); text-shadow: none; box-shadow: 0 2px 0 #b38400; }
.mh-prompt img { width: 40px; height: 24px; }
.mh-center { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); max-width: 80vw; font: 700 24px/1.2 var(--font-sign); text-align: center; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.mh-center.is-in { animation: mh-rise 0.45s var(--ease-out); }

/* end screen */
.mh-end { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: auto; background: radial-gradient(ellipse at center, rgba(6, 7, 9, 0.35), rgba(6, 7, 9, 0.8)); animation: mh-fade 0.5s var(--ease-out); }
.mh-end-panel { position: relative; overflow: hidden; width: min(520px, calc(100vw - 32px)); padding: 42px 26px 20px; border-radius: 20px; background: var(--grain), var(--glass-strong); text-align: center; animation: mh-panel 0.55s var(--ease-out); }
.mh-end-place { font: 800 84px/0.9 var(--font-sign); color: var(--text); letter-spacing: -0.02em; }
.mh-end.is-won .mh-end-place, .mh-end.is-won h2 { color: var(--taxi); }
.mh-end h2 { margin: 8px 0 4px; font: 800 28px/1.1 var(--font-sans); letter-spacing: -0.01em; text-wrap: balance; }
.mh-end p { color: var(--text-2); font-weight: 500; }
.mh-end-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 20px; border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
.mh-end-stats:empty { display: none; }
.mh-end-stat { padding: 12px 6px; display: flex; flex-direction: column; gap: 4px; }
.mh-end-stat + .mh-end-stat { border-left: 1px solid var(--divider); }
.mh-end-stat b { font: var(--num); font-size: 22px; }
.mh-end-stat span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.mh-end-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mh-btn { padding: 11px 16px; border-radius: var(--r-ctl); background: var(--taxi); color: var(--taxi-ink); font: 800 14px/1 var(--font-sans); text-shadow: none; cursor: pointer; transition: transform 0.15s var(--ease-out), filter 0.15s, background 0.15s; }
.mh-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mh-btn:active { transform: translateY(1px); }
.mh-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mh-btn.is-quiet { background: rgba(255, 255, 255, 0.1); color: var(--text); box-shadow: inset 0 0 0 1px var(--glass-border); }
.mh-btn.is-quiet:hover { background: rgba(255, 255, 255, 0.16); }
.mh-end-note { margin-top: 14px; font-size: 12px; color: var(--text-3); font-weight: 500; }

@keyframes mh-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes mh-rise { from { opacity: 0; transform: translate(-50%, 10px); filter: blur(4px); } }
@keyframes mh-fade { from { opacity: 0; } }
@keyframes mh-pulse { 50% { opacity: 0.55; } }
@keyframes mh-panel { from { opacity: 0; transform: translateY(12px) scale(0.98); filter: blur(4px); } }
@keyframes mh-prompt { from { opacity: 0; transform: translate(-50%, 6px); } }

/* flip the car upright (free roam & the match) */
.flip-prompt {
  position: fixed; left: 50%; bottom: calc(var(--edge) + 168px); transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 11px; cursor: pointer;
  background: var(--grain), var(--glass); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow);
  color: var(--text); font: 700 13px/1.3 var(--font-sans); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  animation: mh-prompt 0.25s var(--ease-out);
}
.flip-prompt[hidden] { display: none; }
.flip-prompt kbd { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--taxi); color: var(--taxi-ink); font: 800 13px/1 var(--font-sans); text-shadow: none; box-shadow: 0 2px 0 #b38400; }
.flip-prompt:focus-visible { outline: 2px solid var(--taxi); outline-offset: 2px; }
@media (pointer: coarse) { .flip-prompt kbd { display: none; } .flip-prompt { padding: 10px 16px; } }

@media (prefers-reduced-motion: reduce) {
  .mh *, .mh *::before { animation: none !important; transition: none !important; }
}
@media (max-width: 820px) {
  .mh-top { top: 66px; height: 34px; }
  .mh-feed { top: 108px; max-width: 70vw; }
  .mh-feed-row { padding: 4px 8px; font-size: 11.5px; }
  .mh-vitals { left: var(--edge); bottom: 92px; transform: none; width: min(260px, 64vw); padding: 7px 10px 8px; }
  .mh-vital { grid-template-columns: 14px 1fr 28px; gap: 7px; }
  .mh-vital-num { font-size: 15px; }
  .mh-status { left: 0; transform: none; }
  .mh-inv { right: 8px; left: 8px; align-items: stretch; }
  .mh-ammo, .mh-weapon-name { align-self: flex-end; }
  .mh-slots { justify-content: space-between; gap: 4px; }
  .mh-prompt { bottom: 196px; }
  .mh-stat { padding: 0 8px; }
  .mh-stat b { font-size: 15px; }
  .mh-slot { flex: 1; width: auto; max-width: 60px; height: 52px; }
  .mh-slot-icon { width: 38px; height: 24px; }
  .mh-ammo b { font-size: 30px; }
  .mh-ammo { position: absolute; right: 0; bottom: 64px; }
  .mh-weapon-name { position: absolute; right: 0; bottom: 104px; }
  .mh-reserve { display: none; }
}
/* an enemy in sight at range: a red chevron over its head */
.mh-spot { position: absolute; left: 0; top: 0; width: 12px; height: 9px; opacity: 0; transition: opacity 0.25s var(--ease-out); background: var(--danger); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 0 1px #000) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
/* cars' health: over a car you hit or aim at, and in the vitals while driving (taxi yellow, red once it burns) */
.mh-car .mh-foe-name { display: flex; align-items: center; gap: 5px; color: var(--taxi); }
.mh-car .mh-ic { width: 13px; height: 13px; }
.mh-foe-bar.is-car { height: 6px; }
.mh-foe-bar.is-car span { background: var(--taxi); }
.mh-car.is-burning .mh-foe-name { color: var(--danger); }
.mh-car.is-burning .mh-foe-bar span { background: var(--danger); animation: mh-pulse 0.6s ease-in-out infinite; }
.mh-vital.is-car { color: var(--taxi); }
.mh-vital.is-car .mh-vital-track { height: 8px; }
.mh-vital.is-car .mh-vital-fill { background: linear-gradient(#ffe68a, var(--taxi) 55%, #d9a300); }
.mh-vital.is-car .mh-vital-num { font-size: 14px; }
.mh-vital.is-car.is-low { color: var(--danger); }
.mh-vital[hidden] { display: none; }
.mh-end-rule { position: absolute; left: 24px; right: 24px; top: 0; } /* (clear of the panel's rounded corners) */
