* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b0e12;
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif; }
#game, #game canvas { width: 100%; height: 100%; display: block; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#minimap { position: absolute; left: 18px; bottom: 18px; border-radius: 50%;
  box-shadow: 0 2px 14px rgba(0,0,0,.5); }
#objective { position: absolute; left: 18px; top: 16px; max-width: 380px;
  background: rgba(10,12,16,.62); border-left: 4px solid #ffd200;
  padding: 10px 14px; border-radius: 0 8px 8px 0; display: none; }
#obj-title { color: #ffd200; font-size: 13px; letter-spacing: 1px; }
#obj-text { color: #fff; font-size: 16px; margin-top: 4px; font-family: Arial, sans-serif; font-weight: bold; }
#obj-timer { color: #fff; font-size: 22px; margin-top: 4px; }
#obj-timer.urgent { color: #ff5a4e; animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
#hint { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: rgba(10,12,16,.7); color: #ffd200; font-size: 17px;
  padding: 10px 22px; border-radius: 24px; display: none; border: 1px solid #ffd200; }
#brand { position: absolute; right: 18px; top: 14px; color: rgba(255,255,255,.75);
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  background: rgba(10,12,16,.5); padding: 6px 12px; border-radius: 6px; }
#banner { position: absolute; left: 0; right: 0; top: 34%; text-align: center;
  opacity: 0; transform: scale(.92); transition: all .25s ease; }
#banner.show { opacity: 1; transform: scale(1); }
#banner-title { font-size: 64px; letter-spacing: 4px;
  color: #fff; text-shadow: 0 0 24px rgba(0,0,0,.8), 0 4px 0 rgba(0,0,0,.45); }
#banner.passed #banner-title { color: #7dff8a; }
#banner.failed #banner-title { color: #ff5a4e; }
#banner-sub { font-size: 24px; color: #ffd200; margin-top: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,.8); }
#banner.stinger #banner-title { font-size: 92px; letter-spacing: 6px; }
#banner.stinger #banner-sub { font-size: 34px; }

/* ---------- first-run hint ---------- */
#firsthint { position: absolute; left: 50%; bottom: 190px; transform: translateX(-50%);
  background: rgba(10,12,16,.78); color: #fff; font-size: 16px; font-family: Arial, sans-serif;
  font-weight: bold; padding: 12px 26px; border-radius: 24px; display: none;
  border: 1px solid rgba(255,210,0,.6); white-space: nowrap; }
#firsthint.show { display: block; animation: fadeout 1s ease 9s forwards; }
@keyframes fadeout { to { opacity: 0; } }

/* ---------- cash + street ---------- */
#cash { position: absolute; right: 18px; top: 52px; color: #7dff8a; font-size: 26px;
  background: rgba(10,12,16,.6); padding: 8px 16px; border-radius: 8px; display: none; }
#cash.pop { animation: cashpop .3s ease; }
@keyframes cashpop { 40% { transform: scale(1.25); } }
#streetname { position: absolute; left: 206px; bottom: 30px; color: #fff; font-size: 15px;
  font-family: Arial, sans-serif; font-weight: bold; background: rgba(10,12,16,.55);
  padding: 6px 14px; border-radius: 6px; display: none; letter-spacing: .5px; }

/* ---------- floating popups ---------- */
#popups { position: absolute; inset: 0; overflow: hidden; }
.popup { position: absolute; transform: translate(-50%, -50%); font-size: 22px; color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.9); opacity: 0; pointer-events: none; white-space: nowrap; }
.popup.show.cash { color: #7dff8a; }
.popup.show.gold { color: #ffd200; }

/* ---------- end card ---------- */
#endcard { position: fixed; inset: 0; z-index: 12; display: flex; align-items: center;
  justify-content: center; background: rgba(5,7,10,.45); }
#endcard.hidden { display: none; }
.ec-inner { text-align: center; }
#ec-title { font-size: 84px; letter-spacing: 5px;
  text-shadow: 0 0 24px rgba(0,0,0,.8), 0 4px 0 rgba(0,0,0,.45); }
#ec-sub { font-size: 30px; color: #ffd200; margin: 10px 0 26px;
  text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.ec-card { display: inline-block; pointer-events: auto; font-family: Arial, sans-serif;
  font-size: 18px; font-weight: bold; color: #0b0e12; background: #ffd200;
  padding: 14px 30px; border-radius: 30px; text-decoration: none; }
.ec-card:hover { background: #ffe066; }
.ec-keys { margin-top: 22px; color: #c6d2e0; font-family: Arial, sans-serif; font-size: 16px; }
.ec-keys b { color: #fff; background: rgba(255,255,255,.14); padding: 3px 10px;
  border-radius: 5px; margin-right: 4px; }

/* ---------- title card ---------- */
#titlecard { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  background: radial-gradient(ellipse at 50% 30%, #1d2b3a 0%, #0b0e12 70%); }
#titlecard.hidden { display: none; }
.tc-inner { text-align: center; }
#titlecard h1 { font-size: 130px; color: #fff; letter-spacing: 18px; margin: 6px 0 2px;
  text-shadow: 0 6px 0 rgba(0,0,0,.4); }
.press { margin-top: 34px; color: #ffd200; font-size: 18px; letter-spacing: 3px;
  animation: blink 1.1s steps(2) infinite; }

/* ---------- Menu ---------- */
#menu { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1d2b3a 0%, #0b0e12 70%); }
#menu.hidden { display: none; }
.menu-inner { text-align: center; max-width: 560px; padding: 30px; }
.kicker { color: #ffd200; letter-spacing: 4px; font-size: 13px; text-transform: uppercase; }
#menu h1 { font-size: 110px; color: #fff; letter-spacing: 14px; margin: 6px 0 2px;
  text-shadow: 0 6px 0 rgba(0,0,0,.4); }
.tag { color: #9fb2c8; font-family: Arial, sans-serif; font-weight: bold; margin-bottom: 26px; }
.missions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.missions button { pointer-events: auto; cursor: pointer; text-align: left;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,210,0,.35);
  border-radius: 10px; padding: 14px 18px; color: #fff; transition: all .15s; }
.missions button:hover { background: rgba(255,210,0,.14); border-color: #ffd200; transform: translateX(4px); }
.mt { display: block; font-size: 20px; letter-spacing: 2px; color: #ffd200; }
.ms { display: block; font-family: Arial, sans-serif; font-size: 14px; color: #c6d2e0; margin-top: 4px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center;
  color: #8fa0b5; font-family: Arial, sans-serif; font-size: 14px; }
.controls b { color: #fff; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 4px; margin-right: 6px; }

/* ---------- Loading ---------- */
#loading { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  gap: 18px; align-items: center; justify-content: center; background: #0b0e12;
  color: #ffd200; font-size: 18px; letter-spacing: 2px; }
#loading.hidden { display: none; }
.spin { width: 46px; height: 46px; border: 4px solid rgba(255,210,0,.25);
  border-top-color: #ffd200; border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
