* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05070c;
  font-family: "Segoe UI", system-ui, sans-serif; color: #cfe3ff;
  -webkit-user-select: none; user-select: none; }
#game { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }

#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,5,0.55) 100%); }
#damage { position: fixed; inset: 0; pointer-events: none; z-index: 6; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255,30,40,0.5) 100%);
  transition: opacity 0.15s; }

#hud { position: fixed; top: 18px; left: 20px; z-index: 10; pointer-events: none; }
#brand { font-size: 22px; font-weight: 800; letter-spacing: 4px; color: #fff; }
#brand span { color: #22d3ee; }
#objective { margin-top: 8px; font-size: 13px; letter-spacing: 2px; color: #9fb3c8; }
#objective b { color: #22d3ee; }
#healthbar { margin-top: 10px; width: 210px; height: 8px; background: rgba(255,255,255,0.12);
  border-radius: 4px; overflow: hidden; }
#healthfill { height: 100%; width: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #22d3ee, #34d399); transition: width 0.25s; }
#alarm { margin-top: 12px; font-size: 13px; font-weight: 700; letter-spacing: 2px;
  color: #ff4757; animation: blink 0.5s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

#hackui { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  z-index: 10; text-align: center; pointer-events: none; }
#hacklabel { font-size: 14px; letter-spacing: 3px; color: #fff; margin-bottom: 8px; }
#hacklabel b { color: #22d3ee; border: 1px solid #22d3ee; border-radius: 4px; padding: 1px 7px; }
#hackbar { width: 260px; height: 10px; background: rgba(255,255,255,0.12);
  border-radius: 5px; overflow: hidden; margin: 0 auto; }
#hackfill { height: 100%; width: 0%; background: #22d3ee; border-radius: 5px; }

#carprompt { position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%);
  z-index: 10; font-size: 14px; letter-spacing: 3px; color: #fff; pointer-events: none;
  text-shadow: 0 0 12px rgba(34,211,238,0.8); animation: blink 1.2s steps(2) infinite; }
#carprompt b { color: #22d3ee; border: 1px solid #22d3ee; border-radius: 4px; padding: 1px 7px; }
#speedo { position: fixed; bottom: 26px; right: 28px; z-index: 10; pointer-events: none;
  font-size: 30px; font-weight: 800; letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 16px rgba(179,102,255,0.9); font-variant-numeric: tabular-nums; }

#touchhack { position: fixed; bottom: 110px; right: 26px; z-index: 11; width: 84px; height: 84px;
  border-radius: 50%; background: rgba(34,211,238,0.18); border: 2px solid #22d3ee;
  color: #fff; font-weight: 800; letter-spacing: 1px; display: flex;
  align-items: center; justify-content: center; font-size: 14px; }

/* ---------- menu screens: Figma purple-night UI ---------- */
#menubg { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
.menuscreen { position: fixed; inset: 0; z-index: 20; display: flex;
  align-items: center; justify-content: center; }
#pause.menuscreen { z-index: 30; }
#settings.menuscreen { z-index: 40; }
.panel { text-align: center; width: min(92vw, 560px); padding: 34px 36px;
  max-height: 94vh; max-height: 94dvh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(30,18,54,0.88), rgba(16,9,32,0.94));
  border: 1px solid rgba(179,102,255,0.45); border-radius: 18px;
  box-shadow: 0 0 44px rgba(122,60,255,0.28), inset 0 0 60px rgba(90,43,214,0.12);
  backdrop-filter: blur(6px); }
/* compact menu layout for short viewports (itch.io embed etc.) */
@media (max-height: 720px) {
  .panel { padding: 20px 24px; }
  #title-brand { font-size: 11px; letter-spacing: 7px; margin-bottom: 4px; }
  .gamelogo { font-size: 38px; letter-spacing: 5px; margin-bottom: 8px; }
  .gamelogo.small { font-size: 26px; }
  .sub { font-size: 13px; margin-bottom: 12px; }
  .controls { font-size: 11px; gap: 5px 14px; margin-bottom: 14px; }
  .chips { margin-bottom: 12px; }
  .chips span { font-size: 10px; padding: 4px 10px; }
  .btn-primary { font-size: 14px; padding: 11px 30px; }
  .btn-ghost { font-size: 11px; padding: 10px 20px; }
  .note { margin-top: 10px; font-size: 11px; }
  .setrow { margin: 8px 0; padding: 8px 12px; }
  #endstats { margin-bottom: 12px; font-size: 13px; }
}
#pausebtn { position: fixed; top: 18px; right: 20px; z-index: 12;
  width: 44px; height: 44px; border-radius: 10px; font-size: 15px;
  background: rgba(10,16,24,0.6); border: 1px solid rgba(34,211,238,0.5);
  color: #22d3ee; cursor: pointer; backdrop-filter: blur(4px); }
#pausebtn:hover { background: rgba(34,211,238,0.2); }
.volrow { display: flex; align-items: center; gap: 14px; margin: 4px 0 8px; }
.volrow span { font-size: 13px; letter-spacing: 3px; color: #cdb4ff; }
#vol { flex: 1; accent-color: #b366ff; cursor: pointer; }
#title-brand { font-size: 14px; letter-spacing: 10px; color: #b366ff;
  margin-bottom: 8px; text-shadow: 0 0 14px rgba(179,102,255,0.8); }
.gamelogo { font-size: 56px; letter-spacing: 8px; margin-bottom: 14px;
  background: linear-gradient(180deg, #f3c6ff 5%, #b366ff 55%, #ff5fa2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(179,102,255,0.55)); }
.gamelogo.small { font-size: 34px; }
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(179,102,255,0.55)); }
  50% { filter: drop-shadow(0 0 34px rgba(255,95,162,0.8)); } }
.gamelogo { animation: logoPulse 3.2s ease-in-out infinite; }
.btnrow.stacked { flex-direction: column; align-items: stretch; }
.btnrow.stacked .btn-primary, .btnrow.stacked .btn-ghost { width: 100%; }
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.chips span { font-size: 11px; letter-spacing: 2px; color: #b366ff;
  border: 1px solid rgba(179,102,255,0.5); border-radius: 20px;
  padding: 5px 12px; background: rgba(90,43,214,0.15); }
#endtitle.lose { background: linear-gradient(180deg, #ffc2cd, #ff4757 60%, #b31e35);
  -webkit-background-clip: text; background-clip: text; }
.sub { color: #b9a8d9; font-size: 15px; line-height: 1.6; margin-bottom: 22px; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px;
  text-align: left; font-size: 13px; color: #9d8cbd; margin-bottom: 26px; }
.controls b { color: #efe6ff; }
.btnrow { display: flex; gap: 12px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.btn-primary { font-size: 16px; font-weight: 800; letter-spacing: 4px; color: #fff;
  background: linear-gradient(180deg, #8a4dff, #5a2bd6);
  border: 1px solid #b366ff; border-radius: 10px; padding: 14px 40px; cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 0 0 26px rgba(138,77,255,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.12s, box-shadow 0.12s; }
.btn-primary:hover { transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(138,77,255,0.8), inset 0 1px 0 rgba(255,255,255,0.3); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { font-size: 13px; font-weight: 700; letter-spacing: 3px; color: #cdb4ff;
  background: rgba(90,43,214,0.18); border: 1px solid rgba(179,102,255,0.5);
  border-radius: 10px; padding: 12px 26px; cursor: pointer; transition: all 0.12s; }
.btn-ghost:hover { background: rgba(90,43,214,0.4); color: #fff;
  box-shadow: 0 0 18px rgba(138,77,255,0.4); }
.note { margin-top: 16px; font-size: 12px; color: #7d6f96; letter-spacing: 1px; }
#endstats { color: #b9a8d9; margin-bottom: 18px; font-size: 15px; letter-spacing: 1px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 12px 0; padding: 10px 14px; background: rgba(20,10,40,0.5);
  border: 1px solid rgba(179,102,255,0.25); border-radius: 10px; }
.setrow span { font-size: 13px; letter-spacing: 3px; color: #cdb4ff; text-align: left; }
.setrow input[type=range] { flex: 1; max-width: 200px; accent-color: #b366ff; cursor: pointer; }
.toggle { min-width: 78px; font-size: 13px; font-weight: 800; letter-spacing: 2px;
  border-radius: 20px; padding: 8px 16px; cursor: pointer; border: 1px solid;
  transition: all 0.15s; }
.toggle.off { color: #8f9bb0; background: rgba(40,44,60,0.6); border-color: rgba(143,155,176,0.4); }
.toggle.on { color: #06281a; background: linear-gradient(180deg, #4ade80, #22c55e);
  border-color: #4ade80; box-shadow: 0 0 16px rgba(74,222,128,0.5); }

/* ---------- BLACKOUT v2.0: difficulty, pursuit HUD, crosshair ---------- */
.diffrow { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.diffrow > span { font-size: 11px; letter-spacing: 3px; color: #8f7fb8; }
.diffbtn { font-size: 12px; font-weight: 800; letter-spacing: 2px; padding: 9px 18px; border-radius: 20px;
  cursor: pointer; color: #b9a8d9; background: rgba(90,43,214,0.15);
  border: 1px solid rgba(179,102,255,0.4); transition: all 0.15s; }
.diffbtn:hover { color: #fff; box-shadow: 0 0 14px rgba(138,77,255,0.5); }
.diffbtn.sel { color: #fff; background: linear-gradient(180deg, #8a4dff, #5a2bd6);
  border-color: #b366ff; box-shadow: 0 0 18px rgba(138,77,255,0.65); }
.pursuit { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 12;
  font-size: 15px; font-weight: 800; letter-spacing: 3px; padding: 10px 22px; border-radius: 24px;
  pointer-events: none; white-space: nowrap; }
.pursuit.hot { color: #ffd7db; background: rgba(120,10,25,0.72); border: 1px solid #ff4757;
  box-shadow: 0 0 22px rgba(255,71,87,0.55); animation: pursuitBlink 0.7s ease-in-out infinite; }
.pursuit.cool { color: #c9f5dd; background: rgba(8,80,45,0.72); border: 1px solid #34d399;
  box-shadow: 0 0 18px rgba(52,211,153,0.45); }
@keyframes pursuitBlink { 50% { box-shadow: 0 0 34px rgba(255,71,87,0.9); } }
body.playing, body.playing canvas { cursor: none; }
#xhair { position: fixed; top: 50%; left: 50%; width: 26px; height: 26px;
  transform: translate(-50%, -50%); z-index: 11; pointer-events: none; }
#xhair::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  margin-left: -1px; background: rgba(255,255,255,0.92);
  box-shadow: 0 0 6px rgba(0,0,0,0.9), 0 0 10px rgba(34,211,238,0.8); }
#xhair::after { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 2px;
  margin-top: -1px; background: rgba(255,255,255,0.92);
  box-shadow: 0 0 6px rgba(0,0,0,0.9), 0 0 10px rgba(34,211,238,0.8); }
#cammode { position: fixed; right: 18px; bottom: 18px; z-index: 12; font-size: 11px;
  font-weight: 800; letter-spacing: 2px; color: #aef3ff; background: rgba(20,30,50,0.6);
  border: 1px solid rgba(34,211,238,0.4); border-radius: 12px; padding: 6px 12px;
  pointer-events: none; }
#touchshoot { position: fixed; right: 22px; bottom: 118px; z-index: 13; width: 76px; height: 76px;
  border-radius: 50%; background: rgba(120,20,40,0.55); border: 2px solid rgba(255,71,87,0.7);
  color: #ffd7db; font-weight: 800; font-size: 12px; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; }
@media (max-height: 720px) {
  .diffrow { margin-bottom: 10px; }
  .diffbtn { font-size: 11px; padding: 7px 14px; }
  .pursuit { top: 54px; font-size: 12px; padding: 8px 16px; }
}

#minimap { position: fixed; top: 78px; right: 14px; width: 168px; height: 168px;
  border-radius: 50%; z-index: 12; pointer-events: none;
  border: 2px solid rgba(138,77,255,0.55);
  box-shadow: 0 0 18px rgba(138,77,255,0.35), inset 0 0 30px rgba(0,0,0,0.5); }
@media (max-height: 720px) { #minimap { width: 120px; height: 120px; top: 64px; right: 10px; } }

/* ============ STREET-TURF v2: empire HUD, phone, job, capture ============ */
#brand span { color: #b366ff; }
#cashbar { display: flex; gap: 14px; margin-top: 8px; font-weight: 800; letter-spacing: 1px; }
#cash { color: #34d399; font-size: 20px; text-shadow: 0 0 12px rgba(52,211,153,0.6); }
#turf { color: #b366ff; font-size: 15px; align-self: center; text-shadow: 0 0 12px rgba(179,102,255,0.6); }
#heat { color: #ffd166; font-size: 17px; align-self: center; letter-spacing: 2px; }
#heat.hot { color: #ff4757; text-shadow: 0 0 12px rgba(255,71,87,0.8); animation: heatpulse 0.8s infinite; }
@keyframes heatpulse { 50% { opacity: 0.55; } }

#captureui { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 12;
  text-align: center; pointer-events: none; }
#capturelabel { font-size: 13px; font-weight: 800; letter-spacing: 3px; color: #d8b4fe;
  text-shadow: 0 0 14px rgba(179,102,255,0.8); margin-bottom: 6px; }
#capturebar { width: 320px; height: 10px; border-radius: 6px; background: rgba(20,10,40,0.7);
  border: 1px solid rgba(179,102,255,0.5); overflow: hidden; }
#capturefill { height: 100%; width: 0%; border-radius: 6px;
  background: linear-gradient(90deg, #7c3aed, #b366ff, #e9d5ff);
  box-shadow: 0 0 14px rgba(179,102,255,0.9); transition: width 0.15s linear; }

#banner { position: fixed; top: 34%; left: 50%; transform: translate(-50%, -50%); z-index: 30;
  font-size: 34px; font-weight: 900; letter-spacing: 4px; color: #fff; text-align: center;
  text-shadow: 0 0 24px rgba(179,102,255,0.9), 0 2px 8px rgba(0,0,0,0.8); pointer-events: none;
  animation: bannerpop 0.35s ease-out; white-space: nowrap; }
#banner small { display: block; font-size: 15px; letter-spacing: 2px; color: #d8b4fe; margin-top: 6px; }
@keyframes bannerpop { from { transform: translate(-50%,-50%) scale(0.7); opacity: 0; } }
#immortal { position: fixed; top: 12%; left: 50%; transform: translateX(-50%); z-index: 30;
  padding: 8px 24px; font-size: 16px; font-weight: 700; letter-spacing: 3px; color: #ffe9a8;
  background: rgba(20,14,4,0.78); border: 1px solid rgba(255,200,60,0.8); border-radius: 999px;
  text-shadow: 0 0 14px rgba(255,190,40,0.95); box-shadow: 0 0 18px rgba(255,190,40,0.35);
  pointer-events: none; animation: immPulse 1s ease-in-out infinite; }
@keyframes immPulse { 0%,100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.07); } }

/* m4sterOS phone */
#phone { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(5,3,12,0.45); backdrop-filter: blur(2px); }
#phone-screen { width: 340px; max-height: 78vh; display: flex; flex-direction: column;
  background: linear-gradient(160deg, #141021, #0c0918); border: 1px solid rgba(179,102,255,0.45);
  border-radius: 26px; box-shadow: 0 0 40px rgba(124,58,237,0.35), inset 0 0 60px rgba(0,0,0,0.5);
  overflow: hidden; animation: phoneup 0.25s ease-out; }
@keyframes phoneup { from { transform: translateY(26px) scale(0.96); opacity: 0; } }
#phone-status { display: flex; justify-content: space-between; padding: 12px 20px 8px;
  font-size: 12px; font-weight: 800; letter-spacing: 2px; color: #b366ff; }
#phone-tabs { display: flex; border-top: 1px solid rgba(179,102,255,0.2); border-bottom: 1px solid rgba(179,102,255,0.2); }
.ptab { flex: 1; background: none; border: none; color: #8f86a8; font-weight: 800; font-size: 12px;
  letter-spacing: 2px; padding: 12px 0; cursor: pointer; }
.ptab.sel { color: #e9d5ff; background: rgba(124,58,237,0.25); box-shadow: inset 0 -2px 0 #b366ff; }
#phone-body { padding: 16px 18px; overflow-y: auto; color: #d9d2f2; font-size: 13px; line-height: 1.5; }
#phone-body h3 { margin: 0 0 8px; color: #fff; letter-spacing: 1px; font-size: 14px; }
#phone-body .prow { display: flex; justify-content: space-between; align-items: center;
  padding: 9px 4px; border-bottom: 1px solid rgba(179,102,255,0.12); }
#phone-body .pbtn { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; border: none;
  border-radius: 10px; padding: 9px 14px; font-weight: 800; letter-spacing: 1px; cursor: pointer; font-size: 12px; }
#phone-body .pbtn:disabled { opacity: 0.35; cursor: default; }
#phone-body .pbtn.ghost { background: rgba(179,102,255,0.12); border: 1px solid rgba(179,102,255,0.4); }
#phone-body .pdesc { color: #8f86a8; font-size: 12px; margin: 2px 0 10px; }
#phone-body .pstat { color: #34d399; font-weight: 800; }
#phone-hint { text-align: center; padding: 10px; font-size: 11px; color: #6f6588; letter-spacing: 1px;
  border-top: 1px solid rgba(179,102,255,0.2); }

/* job minigame */
#job { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(5,3,12,0.55); }
#job-inner { width: min(480px, 92vw); text-align: center; }
#job-track { position: relative; height: 34px; margin: 22px 8px 14px; border-radius: 17px;
  background: rgba(20,14,40,0.9); border: 1px solid rgba(179,102,255,0.4); overflow: hidden; }
#job-zone { position: absolute; top: 0; bottom: 0; left: 62%; width: 16%;
  background: rgba(52,211,153,0.35); border-left: 1px solid #34d399; border-right: 1px solid #34d399; }
#job-marker { position: absolute; top: -2px; bottom: -2px; width: 5px; left: 0%;
  background: #e9d5ff; box-shadow: 0 0 12px #b366ff; border-radius: 3px; }
#job-stats { display: flex; justify-content: space-between; margin: 6px 10px 16px;
  color: #d9d2f2; font-size: 14px; letter-spacing: 1px; }
#job-stats b { color: #34d399; }
