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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1020;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

#map { position: fixed; inset: 0; width: 100vw; height: 100vh; background: #cfe3f2; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-logo { display: none !important; }

.hidden { display: none !important; }

/* ---------- Loading screen ---------- */
#loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #05070b url("../loading-screen-1.jfif") center / cover no-repeat;
}
.loading-bottom {
  position: absolute;
  left: clamp(18px, 5vw, 72px);
  right: clamp(18px, 5vw, 72px);
  bottom: clamp(22px, 5vh, 56px);
}

.bar {
  width: 100%;
  height: 10px;
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.45);
  box-shadow: 0 3px 16px rgba(0,0,0,0.5);
  overflow: hidden;
}
#loading-bar {
  height: 100%;
  width: 0%;
  background: #ffffff;
  transition: width 0.2s ease;
}
#loading-text {
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}
#loading-text:empty { display: none; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }

/* GTA-style radar in the corner. Size is mirrored by SIZE in minimap.js. */
#minimap {
  position: absolute;
  left: 24px;
  bottom: 26px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(12,18,34,0.9);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6), inset 0 0 34px rgba(0,0,0,0.5);
  background: #1c2027;
}
#minimap-map { position: absolute; inset: 0; }
#minimap-blips {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5; /* above the MapLibre canvas */
}

#compass-hud {
  position: absolute;
  left: 240px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
#compass-arrow {
  display: inline-block;
  color: #ff4b4b;
  font-size: 26px;
}

#speedo {
  position: absolute;
  right: 26px;
  bottom: 26px;
  text-align: right;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
#speed-value { font-size: 58px; font-weight: 800; line-height: 1; }
#speed-unit { font-size: 16px; color: #b9c8e6; letter-spacing: 2px; }

#altimeter {
  position: absolute;
  right: 26px;
  bottom: 108px;
  text-align: right;
  font-size: 24px;
  font-weight: 800;
  color: #7cf6c8;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}

#clock {
  position: absolute;
  top: 18px; left: 24px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  font-variant-numeric: tabular-nums;
}
#clock-icon { font-size: 22px; }

#packages-hud {
  position: absolute;
  top: 18px; right: 26px;
  font-size: 26px;
  font-weight: 800;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pkg-icon { font-size: 30px; }

#locality {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffe27a;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

#radio {
  position: absolute;
  left: 24px;
  bottom: 240px; /* clear of the minimap below */
  padding: 8px 14px;
  background: rgba(20,30,55,0.72);
  border-left: 3px solid #7cf6c8;
  border-radius: 8px;
  max-width: 320px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
#radio-station { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; }
#radio-now {
  font-size: 14px;
  font-weight: 600;
  color: #9fe9cf;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#radio-now:empty { display: none; }

#foot-hint,
#house-hint {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 700;
  padding: 8px 18px;
  background: rgba(20,30,55,0.85);
  border: 1px solid rgba(124,246,200,0.5);
  border-radius: 10px;
  white-space: nowrap;
}
#house-hint { bottom: 138px; } /* stacks above the ute hint when both show */
#foot-hint b, #house-hint b { color: #7cf6c8; }

/* ---------- Full-screen "pause map" (Tab) ---------- */
#fullmap {
  position: fixed;
  inset: 0;
  z-index: 58;               /* over the whole driving HUD — the mission
                                objective card (55) and nav-guide arrow (56)
                                included — but under the help panel (60) and any
                                cutscene layers (70+) */
  background: #12151b;
}
/* A soft scrim under the header so the title/legend stay legible over the
   suburb labels the blips canvas paints near the top. */
#fullmap::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 150px;
  z-index: 6;                /* above the blips canvas (5), below the bar (7) */
  background: linear-gradient(to bottom, rgba(8,10,14,0.9), rgba(8,10,14,0));
  pointer-events: none;
}
#fullmap-map { position: absolute; inset: 0; }
#fullmap-blips {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;                /* above the MapLibre canvas */
  pointer-events: none;      /* let drag/scroll reach the map underneath */
}
#fullmap-bar {
  position: absolute;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 7;                /* over the header scrim */
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}
#fullmap-bar h2 { letter-spacing: 3px; font-size: 26px; font-weight: 800; }
#fullmap-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #cdd7e6;
}
#fullmap-legend span { display: inline-flex; align-items: center; gap: 6px; }
#fullmap-legend i {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.7);
}
#fullmap-legend i.you { background: #fff; border-radius: 2px; }
#fullmap-legend i.pkg { background: #54e08a; }
#fullmap-legend i.way { background: #ffcf3f; }
.fullmap-hint { margin-top: 10px; font-size: 13px; color: #8fa8d8; }
.fullmap-hint b { color: #7cf6c8; }

/* dip to black while stepping through a house door (NOT #fade — that id is
   the mission's own cinematic fade, created and styled by mission.js) */
#door-fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 50;
}
#door-fade.show { opacity: 1; }

#toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 700;
  padding: 10px 22px;
  background: rgba(20,30,55,0.85);
  border-radius: 10px;
  border: 1px solid rgba(124,246,200,0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}
#toast.show { opacity: 1; }

/* ---------- Help ---------- */
#help {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10,16,32,0.92);
  border: 1px solid rgba(124,160,255,0.4);
  border-radius: 14px;
  padding: 24px 34px;
  z-index: 60;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
#help h2 { margin-bottom: 14px; letter-spacing: 2px; }
#help ul { list-style: none; line-height: 1.9; }
#help b { color: #7cf6c8; }
#help .dismiss { margin-top: 14px; color: #8fa8d8; font-size: 13px; }
