/* Radar, atlas and directions, adopted from the New York / Hong Kong street chrome. */
:root {
  --ui-ink: #1f1a17;
  --ui-paper: #f4e6c6;
  --ui-graphite: #16171b;
  --ui-jade: #21675f;
  --taxi: #e1261c;
  --taxi-ink: #ffffff;
  --text: #f4e6c6;
  --text-2: #c8bda7;
  --text-3: #b3a791;
  --glass-border: #514b43;
  --edge: 16px;
  --r-panel: 12px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}

.my3d-status { margin: 6px 0 0; font-size: 12px; color: var(--text-2); }
.my3d-status:empty { display: none; }
.taxi-garage { position: fixed; inset: 0; z-index: 120; }
.taxi-garage[hidden] { display: none; }
.taxi-garage-backdrop { position: absolute; inset: 0; border: 0; background: rgba(10, 12, 15, 0.45); }
.taxi-garage-sheet {
  position: absolute; right: 16px; bottom: 88px; width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 640px); overflow: auto; padding: 14px; border-radius: 16px;
  background: var(--ui-graphite); color: var(--ui-paper); border: 1px solid var(--glass-border);
}
.taxi-garage-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.taxi-garage-kicker { margin: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.taxi-garage-title { margin: 0; font-size: 18px; }
.taxi-garage-list { display: grid; gap: 8px; }
.garage-card {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 8px; border-radius: 10px; border: 1px solid var(--glass-border);
  background: #221f1c; color: inherit; cursor: pointer;
}
.garage-card.is-selected { border-color: var(--ui-paper); }
.garage-card:disabled { opacity: 0.45; cursor: default; }
.garage-swatch { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.garage-card-title, .garage-card-blurb { display: block; }
.garage-card-blurb { color: var(--text-2); font-size: 12px; }

.hud-bottom-left { position: fixed; left: 16px; bottom: 16px; z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.location {
  max-width: 288px; padding: 6px 10px; border-radius: 8px;
  color: var(--ui-paper); background: var(--ui-graphite); border: 1px solid var(--glass-border);
  font-size: 13px; font-weight: 650;
}
.radar {
  display: block; padding: 0; position: relative; width: 288px; height: 184px; overflow: hidden; border-radius: 18px;
  background: #0a1118; cursor: pointer; border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}
.radar:hover { transform: translateY(-2px); }
#minimap-canvas { display: block; width: 100%; height: 100%; }
.radar-north, .radar-key {
  position: absolute; z-index: 1; color: #fff; background: rgba(10, 12, 15, 0.72);
  font-size: 11px; font-weight: 800; pointer-events: none;
}
.radar-north { top: 7px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.radar-key { top: 8px; right: 8px; border-radius: 4px; padding: 1px 5px; }
.map-open {
  margin-top: 8px; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 2px solid var(--ui-ink);
  background: #fff7de; color: var(--ui-ink); font: inherit; font-weight: 700; cursor: pointer;
}

.fullmap-modal { position: fixed; inset: 0; z-index: 90; background: #0a1118; color: var(--text); }
.fullmap-modal.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.fullmap-canvas-wrap { position: absolute; inset: 0; cursor: crosshair; }
.fullmap-canvas-wrap.is-panning { cursor: grabbing; }
#fullmap-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.fullmap-header, .map-controls, .fullmap-footer, .fullmap-legend { position: absolute; z-index: 2; }
.fullmap-header { top: 16px; left: 16px; right: 16px; display: flex; gap: 10px; pointer-events: none; }
.fullmap-header > * { pointer-events: auto; }
.panel { background: rgba(22, 23, 27, 0.94); border: 1px solid var(--glass-border); border-radius: var(--r-panel); box-shadow: var(--shadow); }
.fullmap-title { display: flex; gap: 10px; align-items: center; padding: 10px 14px; min-width: 0; }
.mta-bullet { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--ui-jade); color: #fff; font-weight: 800; }
.fullmap-title h2 { margin: 0; font-size: 15px; }
.fullmap-subtitle { margin: 2px 0 0; color: var(--text-2); font-size: 12px; }
.fullmap-search-wrap { flex: 1; display: flex; align-items: center; padding: 0 12px; min-width: 0; }
.fullmap-search { width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--text); font: inherit; }
.fullmap-close, .icon-btn, .dir-btn {
  min-height: 44px; border: 1px solid var(--glass-border); border-radius: 8px; background: #302d29; color: var(--text); font: inherit; cursor: pointer;
}
.fullmap-close { padding: 0 12px; }
.map-controls { top: 50%; right: 16px; translate: 0 -50%; display: flex; flex-direction: column; gap: 8px; }
.map-zoom { display: flex; flex-direction: column; padding: 4px; gap: 4px; }
.icon-btn { width: 44px; }
.fullmap-footer { left: 16px; right: 16px; bottom: 16px; }
.fullmap-status { padding: 10px 14px; color: var(--text-2); font-size: 13px; }
.fullmap-legend { right: 16px; bottom: 16px; display: flex; gap: 10px; padding: 8px 12px; font-size: 12px; color: var(--text-2); }
.legend-swatch { display: inline-block; width: 12px; height: 4px; margin-right: 4px; vertical-align: middle; }
.player-swatch { background: #e1261c; height: 12px; }
.landmark-swatch { background: #fff; height: 12px; }
.gps-swatch { background: #ffc21a; }
.bridge-swatch { background: #b27a35; }
.map-context { position: fixed; z-index: 95; width: min(280px, calc(100vw - 24px)); padding: 12px; color: var(--text); }
.map-context[hidden] { display: none; }
.ctx-head { display: flex; justify-content: space-between; gap: 8px; }
.ctx-title { font-weight: 750; }
.ctx-sub { color: var(--text-2); font-size: 12px; }
.ctx-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.dir-btn-primary { background: var(--taxi); color: var(--taxi-ink); border-color: var(--taxi); }
.street-border-choice { box-sizing: border-box; width: min(420px, calc(100vw - 32px)); padding: 20px; color: var(--text); }
.street-border-choice::backdrop { background: rgb(10 17 24 / 68%); }
.street-border-choice h2 { margin: 0; font-size: 19px; }
.street-border-choice p { line-height: 1.5; }
.street-border-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.directions-hk {
  position: fixed; top: 16px; left: 16px; z-index: 40; width: min(340px, calc(100vw - 32px));
  max-height: min(70vh, 520px); overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
  background: rgba(12, 16, 22, 0.94); color: #e8eef6; border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  z-index: 96;
}
.directions-hk[hidden] { display: none !important; }
.dir-head, .dir-actions, .dir-summary { display: flex; align-items: center; gap: 8px; }
.dir-head { justify-content: space-between; }
.dir-title { font-weight: 750; }
.dir-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.dir-field input { min-height: 40px; border-radius: 8px; border: 1px solid var(--glass-border); background: #12151a; color: var(--text); padding: 0 8px; font: inherit; }
.dir-btn-tour { background: var(--ui-jade); border-color: var(--ui-jade); color: var(--ui-paper); }
.dir-time { color: #ffc21a; font-weight: 750; }
.dir-steps { margin: 0; padding-left: 18px; }
.dir-step { margin: 4px 0; font-size: 13px; }
.icon { width: 18px; height: 18px; vertical-align: middle; }

:root {
  --ui-ink: #1f1a17;
  --ui-paper: #f4e6c6;
  --ui-jade: #21675f;
  --taxi: #e1261c;
  --taxi-ink: #ffffff;
  --text: #f4e6c6;
  --text-2: #c8bda7;
  --text-3: #b3a791;
  --glass-border: #514b43;
}
html, body { margin: 0; height: 100%; background: #9fd3dd; color: var(--text); font-family: Inter, "PingFang SC", "Avenir Next", sans-serif; }
canvas#view { display: block; width: 100%; height: 100%; }
kbd { font-family: inherit; border: 1px solid #514b43; border-radius: 4px; padding: 0 4px; }
.hud-top-right { position: fixed; top: 16px; right: 16px; z-index: 6; max-width: calc(100vw - 32px); }
.toolbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; }
.toolbar-divider { width: 1px; align-self: stretch; background: var(--glass-border); }
.tool-btn, .repo-link {
  min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px;
  border-radius: 8px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.tool-btn:hover, .repo-link:hover { background: #302d29; }
.time-switch { display: flex; gap: 2px; padding: 0; }
.teleport-places { position: absolute; top: calc(100% + 8px); right: 0; display: flex; flex-direction: column; gap: 4px; width: min(280px, calc(100vw - 32px)); max-height: 55dvh; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.teleport-places[hidden] { display: none; }
.street-plate-editor { display: grid; gap: 6px; margin-block: 6px 12px; }
.street-plate-editor > div { display: flex; gap: 8px; }
.street-plate-editor input { width: 10ch; padding: 6px 8px; color: #1b2625; background: #f3d567; border: 1px solid #78683b; border-radius: 5px; font: 700 1rem monospace; text-transform: uppercase; }
.street-driver-controls { display: flex; gap: 4px; margin-block: 5px; }
.street-driver-controls[hidden] { display: none; }
.street-driver-controls button { flex: 1; min-height: 26px; padding: 2px 3px; color: #263632; background: #e6d9ba; border: 1px solid #a49475; border-radius: 5px; font: inherit; cursor: pointer; }
.street-driver-controls button[aria-pressed="true"] { color: #fff7e5; background: #21645b; }
.tp-btn { flex: none; min-height: 40px; text-align: left; border: 0; border-radius: 8px; background: #302d29; color: var(--text); font: inherit; cursor: pointer; padding: 6px 10px; }
.gauge-status { margin: 6px 0 0; color: var(--text-2); font-size: 12px; }
.time-btn, .mode-btn, .cam-btn {
  min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  font: inherit; font-weight: 700; cursor: pointer; padding: 0 10px;
}
.time-btn.active, .mode-btn.active { background: var(--ui-paper); color: var(--ui-ink); }
.hud-bottom-center { position: fixed; left: 50%; bottom: 16px; translate: -50% 0; z-index: 6; }
.mode-switch { display: flex; gap: 4px; padding: 4px; }
.hud-bottom-right { position: fixed; right: 16px; bottom: 16px; z-index: 6; width: min(280px, calc(100vw - 32px)); }
.cluster { padding: 10px 12px; color: var(--text); }
.gauge-label, .gauge-unit, .gauge-alt { color: var(--text-2); font-size: 12px; }
.gauge-unit { border: 0; background: transparent; cursor: pointer; font: inherit; padding: 0; }
.gauge-alt { margin-left: 6px; }
body.hud-minimized .hud-bottom-left,
body.hud-minimized .hud-bottom-center,
body.hud-minimized .hud-bottom-right,
body.hud-minimized .directions-hk,
body.hud-minimized #teleport-places,
body.hud-minimized .toolbar > :not(#btn-toggle-hud) {
  visibility: hidden;
  pointer-events: none;
}
.gauge-speed { font-size: 42px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-meter { height: 4px; margin-top: 6px; border-radius: 99px; background: #302d29; overflow: hidden; }
#hud-speed-meter { display: block; height: 100%; width: 0; background: #ffc21a; }
.gauge-wanted { margin: 2px 0 0; color: #ffc21a; letter-spacing: 0.14em; font-size: 14px; }
.camera-switch { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.camera-current { flex: 1; text-align: left; }
:root {
  --glass: rgba(22, 23, 27, 0.72);
  --glass-strong: rgba(22, 23, 27, 0.88);
}

#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)) + 88px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  pointer-events: 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);
  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);
  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: 650; text-shadow: 0 1px 5px #000; }
.touch-caption { display: block; margin-top: 8px; }
.touch-actions { display: grid; grid-template-columns: repeat(2, 72px); gap: 10px; padding-bottom: 22px; }
.touch-action {
  width: 72px; height: 72px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); background: var(--glass-strong);
  color: var(--text); font: inherit; font-size: 11px; font-weight: 700; pointer-events: auto; touch-action: none;
}
.touch-action > [aria-hidden] { font-size: 22px; line-height: 1; }
.touch-boost { grid-column: 2; border-color: rgba(255, 194, 26, 0.65); color: #ffc21a; }
.touch-action.is-pressed { color: var(--taxi-ink); background: var(--taxi); border-color: var(--taxi); }
body.touch-enabled .hud-bottom-center { bottom: max(6px, env(safe-area-inset-bottom)); width: min(100vw - 12px, 720px); z-index: 13; }
body.touch-enabled .mode-switch { flex-wrap: wrap; justify-content: center; }
body.touch-enabled .mode-btn, body.touch-enabled .tool-btn, body.touch-enabled .time-btn { min-height: 44px; }
body.touch-enabled .hud-bottom-left { top: max(8px, env(safe-area-inset-top)); bottom: auto; left: max(8px, env(safe-area-inset-left)); width: 168px; }
body.touch-enabled .location { max-width: 168px; font-size: 12px; }
body.touch-enabled .radar { width: 168px; height: 120px; }
body.touch-enabled .hud-bottom-right {
  top: auto;
  left: auto;
  right: max(8px, env(safe-area-inset-right));
  bottom: calc(max(8px, env(safe-area-inset-bottom)) + 210px);
  width: 168px;
}
body.touch-enabled .gauge-speed { font-size: 28px; }
@media (max-width: 520px) {
  body.touch-enabled .hud-bottom-left { top: 156px; }
}
body.touch-enabled .camera-switch { display: none; }
body.garage-open #touch-controls,
body.touch-enabled .fullmap-modal:not(.hidden) ~ #touch-controls { visibility: hidden; }
@media (max-height: 500px) {
  body.touch-enabled:not(.hud-minimized) .hud-bottom-left {
    display: flex; top: 6px; width: 142px; gap: 3px;
  }
  body.touch-enabled .hud-bottom-left .street-location { display: none; }
  body.touch-enabled .hud-bottom-left .radar { width: 142px; height: 74px; }
  #touch-controls { bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* Planet paper and jade on the primary driving controls. Radar/maps retain
   their dark navigation field; this adds no blur/filter or rendering pass. */
.hud-top-right, .hud-bottom-center, .hud-bottom-right {
  --text: #352d28;
  --text-2: #6d6252;
  --glass-border: #b5a58e;
}
.hud-top-right > .panel, .hud-bottom-center > .panel, .hud-bottom-right > .panel {
  background: rgba(250, 241, 219, 0.96);
  border-color: #8c8170;
  box-shadow: 0 5px 18px -8px rgba(47, 38, 28, 0.38);
}
.hud-top-right .time-btn.active, .hud-bottom-center .mode-btn.active {
  background: var(--ui-jade);
  color: #fff7de;
}
.hud-top-right .tool-btn:hover, .hud-top-right .repo-link:hover,
.hud-top-right .time-btn:hover, .hud-bottom-center .mode-btn:hover,
.hud-bottom-right .cam-btn:hover { background: #dfd5bc; color: #352d28; }
.hud-bottom-right .gauge-meter { background: #d7cbb2; }
.hud-bottom-right #hud-speed-meter { background: var(--ui-jade); }
.hud-bottom-right .gauge-wanted { color: #97621b; }
.location { background: var(--ui-jade); border-color: #4e8475; color: #fff7de; }
.radar { border-color: #b5a58e; box-shadow: 0 5px 18px -8px rgba(47, 38, 28, 0.4); }
.hud-top-right .teleport-places { --text: #f4e6c6; --text-2: #c8bda7; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid #2e8c7d;
  outline-offset: 3px;
}
/* A narrow keyboard viewport also needs the separation used by phone controls. */
@media (max-width: 620px) {
  body:not(.touch-enabled) .hud-bottom-left { top: 176px; bottom: auto; left: 8px; width: 132px; }
  body:not(.touch-enabled) .location { max-width: 132px; font-size: 11px; }
  body:not(.touch-enabled) .radar { width: 132px; height: 84px; }
  body:not(.touch-enabled) .hud-bottom-right { bottom: 112px; right: 8px; width: 168px; }
  body:not(.touch-enabled) .gauge-speed { font-size: 30px; }
  body:not(.touch-enabled) .hud-bottom-center { left: 8px; right: 8px; bottom: 8px; translate: 0; }
  body:not(.touch-enabled) .mode-switch { flex-wrap: wrap; justify-content: center; }
  body:not(.touch-enabled) .mode-btn { min-height: 44px; font-size: 12px; padding: 0 6px; }
}
.hud-bottom-right .icon-btn { background: #e4d8bf; border-color: #b5a58e; color: #352d28; }
.hud-bottom-right .icon-btn:hover { background: #c8dacb; border-color: var(--ui-jade); }

/* Lazy shared landmark/account UI owns one modal input/focus lease. */
.street-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: #131619aa; overflow: auto; overscroll-behavior: contain; }
.street-modal[hidden], .street-modal [hidden], .street-notice[hidden] { display: none; }
.street-notice { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 10001; max-width: min(480px, calc(100vw - 32px)); padding: 12px 16px; }

.time-btn[data-regional-weather][hidden] { display: none !important; }

.street-map-actions { display: flex; align-items: center; gap: 4px; }
.street-map-actions .icon-btn { width: 32px; min-width: 32px; height: 32px; }
.street-map-actions .tool-btn { padding-inline: 6px; white-space: nowrap; font-size: 12px; }
