/* Sunset Syndicate — Authentic Gameloft / Pixel-Art Indie Game UI (Real Pixel Font + 9-Slice Pixel Frames!) */

@font-face {
  font-family: "SunsetPixel";
  src: url("./assets/sunset_pixel.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-page: #121418;
  --ink: #0b0c10;
  --gold: #f0b82e;
  --gold-hi: #ffe57a;
  --green: #42b851;
  --green-hi: #80eb8e;
  --armor: #5c83b0;
  --armor-hi: #94b8e0;
  --red: #d9382e;
  --ochre: #de8026;
  --cream: #fff9eb;
  --dim: #b4bac7;
  --px-font: "SunsetPixel", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-page);
  color: var(--cream);
  font-family: var(--px-font);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.game-stage {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  max-width: 1600px;
  max-height: 900px;
  background: #1b222c;
  border: 3px solid #3c4352;
  box-shadow: 0 0 0 2px var(--ink), 0 18px 52px rgba(0, 0, 0, 0.78);
  overflow: hidden;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
  transform: translateZ(0);
}

.pixel-logo-img {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ==================== HAND-PIXELLED 9-SLICE UI FRAMES (ZERO EXPENSIVE CSS FILTER PASSES) ==================== */
.gl-frame {
  border: 10px solid transparent;
  border-image: url("./assets/ui_frame_dark.png") 6 fill / 10px stretch;
  image-rendering: pixelated;
}

.gl-frame-gold {
  border: 10px solid transparent;
  border-image: url("./assets/ui_frame_gold.png") 6 fill / 10px stretch;
  image-rendering: pixelated;
}

.gl-frame-green {
  border: 10px solid transparent;
  border-image: url("./assets/ui_frame_green.png") 6 fill / 10px stretch;
  image-rendering: pixelated;
}

/* ==================== AUTHENTIC NOKIA 6300 CLASSIC HANDSET MODE ==================== */
.nokia-chassis,
.nokia-screen-well {
  display: contents;
}

.nk-side-btn,
.nokia-bezel-top,
.nokia-s40-status,
.nokia-s40-softbar,
.nokia-lcd-overlay,
.nokia-keypad-panel,
.nokia-chin,
.nokia-desk-card {
  display: none;
}

.app-shell.nokia-mode {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 34px;
  padding: 12px 16px;
  background: radial-gradient(circle at 46% 42%, #242933 0%, #14171d 55%, #0c0e12 100%);
}

/* Unified Brushed Stainless-Steel Nokia 6300 Candybar Body */
.app-shell.nokia-mode .nokia-chassis {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 332px;
  padding: 6px;
  border-radius: 34px 34px 40px 40px;
  background: linear-gradient(
    135deg,
    #eef1f6 0%,
    #a8b0be 16%,
    #666e7c 36%,
    #cfd5df 56%,
    #88909e 78%,
    #dfe4ec 100%
  );
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(15, 18, 24, 0.7),
    0 0 0 1px #3a404c,
    0 24px 56px rgba(0, 0, 0, 0.85),
    0 6px 16px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  transform-origin: center center;
}

@media (max-height: 700px) {
  .app-shell.nokia-mode .nokia-chassis {
    transform: scale(0.90);
  }
}

@media (max-height: 620px) {
  .app-shell.nokia-mode .nokia-chassis {
    transform: scale(0.80);
  }
}

/* Physical Right-Edge Hardware Buttons (Volume +/- & Power) */
.app-shell.nokia-mode .nk-side-btn {
  display: block;
  position: absolute;
  right: -6px;
  width: 8px;
  z-index: 20;
  background: linear-gradient(90deg, #757d8c 0%, #dde2ea 60%, #98a0ae 100%);
  border: 1px solid #2b303a;
  border-left: none;
  border-radius: 0 3px 3px 0;
  cursor: pointer;
}

.app-shell.nokia-mode .nk-side-btn:hover {
  background: linear-gradient(90deg, #9aa3b4 0%, #ffffff 70%, #b8c0ce 100%);
}

.app-shell.nokia-mode .nk-side-btn:active {
  filter: brightness(1.3);
}

.app-shell.nokia-mode .nk-side-power { top: 44px; height: 22px; }
.app-shell.nokia-mode .nk-side-vol-up { top: 102px; height: 34px; }
.app-shell.nokia-mode .nk-side-vol-dn { top: 142px; height: 34px; }

/* Piano-Black Top Headpiece with Earpiece Mesh & Chrome NOKIA Logo */
.app-shell.nokia-mode .nokia-bezel-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 20px 8px;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, #252932 0%, #111318 44%, #0b0d11 100%);
  border-bottom: 1px solid #2d323d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nokia-earpiece-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nokia-earpiece {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 64px;
  height: 8px;
  padding: 0 7px;
  border-radius: 99px;
  background: #06070a;
  border: 1px solid #6b7382;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nokia-earpiece span {
  width: 5px;
  height: 2px;
  border-radius: 1px;
  background: #3d4350;
}

.nokia-sensor-dot {
  position: absolute;
  right: 22px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3c485e 0%, #090b10 70%);
  border: 1px solid #485060;
}

.nokia-brand-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.nokia-brand {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: #dfe4ec;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.95);
}

.nokia-model {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: #8f97a6;
}

/* Recessed S40 TFT LCD Cavity */
.app-shell.nokia-mode .nokia-screen-well {
  display: flex;
  flex-direction: column;
  padding: 7px 11px 8px;
  background: linear-gradient(180deg, #0d0f14 0%, #14171e 100%);
  border-bottom: 2px solid #596070;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9);
}

/* Authentic Nokia S40 Top Status Bar */
.app-shell.nokia-mode .nokia-s40-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 17px;
  padding: 0 6px;
  background: linear-gradient(180deg, #212a3b 0%, #101520 100%);
  border: 2px solid #4e5666;
  border-bottom: 1px solid #2b3344;
  border-radius: 2px 2px 0 0;
}

.s40-signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
}

.s40-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 9px;
}

.s40-bars i {
  display: block;
  width: 2.5px;
  background: #dce3ee;
}
.s40-bars i:nth-child(1) { height: 3px; }
.s40-bars i:nth-child(2) { height: 5px; }
.s40-bars i:nth-child(3) { height: 7px; }
.s40-bars i:nth-child(4) { height: 9px; }

.s40-net {
  font-size: 7px;
  color: #b7c3d6;
  line-height: 1;
}

.s40-clock {
  font-size: 8px;
  color: #f4eee1;
  letter-spacing: 0.08em;
}

.s40-battery {
  display: inline-flex;
  align-items: center;
}

.s40-batt-body {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px;
  border: 1px solid #cfd6e3;
  height: 8px;
}

.s40-batt-body i {
  display: block;
  width: 3px;
  height: 4px;
  background: #67d676;
}

.s40-batt-tip {
  width: 2px;
  height: 4px;
  background: #cfd6e3;
}

/* Game Stage Inside Nokia TFT LCD (1:1 Un-Stretched Square Pixels!) */
.app-shell.nokia-mode .game-stage {
  width: 298px;
  height: 236px;
  border: none;
  border-left: 2px solid #4e5666;
  border-right: 2px solid #4e5666;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.55);
  background: #141922;
}

.app-shell.nokia-mode #game-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* Subtle Hardware TFT Pixel-Pitch & Glass Sheen (Zero FPS cost) */
.app-shell.nokia-mode .nokia-lcd-overlay {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 65;
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 34%, transparent 35%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.06) 0px, rgba(0, 0, 0, 0.06) 1px, transparent 1px, transparent 2px);
}

/* Authentic Nokia S40 Bottom Softkey Strip */
.app-shell.nokia-mode .nokia-s40-softbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  height: 17px;
  padding: 0 7px;
  background: linear-gradient(180deg, #1b2230 0%, #0d111a 100%);
  border: 2px solid #4e5666;
  border-top: 1px solid #364054;
  border-radius: 0 0 2px 2px;
  font-size: 7.5px;
  color: #f4eee1;
}

.s40-sk-left { text-align: left; }
.s40-sk-center { text-align: center; color: var(--gold-hi); }
.s40-sk-right { text-align: right; }

/* Compact Nokia Screen Title, HUD & Modal Scaling */
.app-shell.nokia-mode .minimap-icon-dock,
.app-shell.nokia-mode .control-whisper,
.app-shell.nokia-mode .mission-sub,
.app-shell.nokia-mode .title-corner-left,
.app-shell.nokia-mode .title-corner-right,
.app-shell.nokia-mode .touch-controls {
  display: none !important;
}

.app-shell.nokia-mode .title-left-column {
  padding: 14px 12px 0;
  gap: 10px;
  max-width: 100%;
  align-items: center;
}
.app-shell.nokia-mode .title-logo-img { width: 190px; }
.app-shell.nokia-mode .arcade-menu { align-items: center; gap: 7px; padding-left: 0; }
.app-shell.nokia-mode .arcade-item { font-size: 11px; gap: 5px; }
.app-shell.nokia-mode .arcade-cursor { width: 11px; }
.app-shell.nokia-mode .arcade-note { font-size: 7px; }
.app-shell.nokia-mode .submenu-heading { font-size: 9px; }
.app-shell.nokia-mode .district-cycler { gap: 8px; padding: 2px 6px; }
.app-shell.nokia-mode .cycler-name { min-width: 104px; font-size: 9.5px; }

.app-shell.nokia-mode .hud-top-left { top: 4px; left: 4px; max-width: 55%; }
.app-shell.nokia-mode .mission-banner { gap: 4px; border-width: 5px; border-image-width: 5px; }
.app-shell.nokia-mode .mission-emblem-wrap { width: 18px; height: 18px; border-width: 1px; }
.app-shell.nokia-mode #mission-emblem-canvas { width: 14px; height: 14px; }
.app-shell.nokia-mode .mission-title { font-size: 7.5px; }
.app-shell.nokia-mode .mission-distance { font-size: 6.5px; padding: 1px 3px; }
.app-shell.nokia-mode .mission-timer { font-size: 7.5px; padding: 1px 4px; }

.app-shell.nokia-mode .hud-top-right { top: 4px; right: 5px; gap: 2px; }
.app-shell.nokia-mode #cash-icon-canvas { width: 13px; height: 13px; }
.app-shell.nokia-mode .cash-value { font-size: 11px; }
.app-shell.nokia-mode .wanted-stars-canvas { width: 84px; height: 15px; }
.app-shell.nokia-mode .vitals-stack { width: 88px; gap: 2px; }
.app-shell.nokia-mode #health-icon-canvas,
.app-shell.nokia-mode #armor-icon-canvas { width: 11px; height: 11px; }
.app-shell.nokia-mode .vital-track { height: 8px; border-width: 1px; }
.app-shell.nokia-mode .weapon-medallion { width: 42px; height: 36px; border-width: 1px; }
.app-shell.nokia-mode #weapon-icon-canvas { width: 22px; height: 22px; margin-bottom: 4px; }
.app-shell.nokia-mode .weapon-key-pip,
.app-shell.nokia-mode .weapon-badge-name,
.app-shell.nokia-mode .weapon-badge-ammo { font-size: 6px; }

.app-shell.nokia-mode .hud-bottom-left { bottom: 4px; left: 4px; }
.app-shell.nokia-mode .minimap-frame { width: 64px; height: 64px; border-width: 2px; }
.app-shell.nokia-mode .minimap-north { font-size: 6px; padding: 0 3px; }
.app-shell.nokia-mode .minimap-district-tag { font-size: 6px; padding: 1px 3px; bottom: 2px; }
.app-shell.nokia-mode .minimap-rivet { width: 3px; height: 3px; }

.app-shell.nokia-mode .hud-bottom-right { bottom: 4px; right: 5px; }
.app-shell.nokia-mode .vehicle-floating-line { font-size: 7px; gap: 4px; }
.app-shell.nokia-mode #speedo-canvas { width: 116px; height: 40px; }

.app-shell.nokia-mode .center-notifications { top: 32px; max-width: 94%; }
.app-shell.nokia-mode .toast-text { font-size: 7px; }
.app-shell.nokia-mode .district-name { font-size: 11px; }
.app-shell.nokia-mode .context-prompt {
  bottom: 58px;
  z-index: 14;
  border-width: 5px;
  border-image-width: 5px;
  gap: 5px;
}
.app-shell.nokia-mode .context-main { font-size: 7.5px; }
.app-shell.nokia-mode .context-sub { display: none !important; }
.app-shell.nokia-mode .keycap-inline { min-width: 16px; height: 16px; font-size: 7.5px; }

.app-shell.nokia-mode .dialogue-box { width: 96%; bottom: 4px; border-width: 6px; border-image-width: 6px; padding: 3px; gap: 6px; }
.app-shell.nokia-mode .dialogue-portrait-frame { width: 44px; height: 44px; border-width: 2px; }
.app-shell.nokia-mode .dialogue-speaker { font-size: 8px; }
.app-shell.nokia-mode .dialogue-mission-tag { font-size: 6.5px; }
.app-shell.nokia-mode .dialogue-text { font-size: 7.5px; min-height: 24px; line-height: 1.45; }
.app-shell.nokia-mode .dialogue-next-prompt { font-size: 7px; }
.app-shell.nokia-mode .result-banner-img { width: 224px; }
.app-shell.nokia-mode .result-title { font-size: 8.5px; }
.app-shell.nokia-mode .result-reward { font-size: 13px; }
.app-shell.nokia-mode .result-choice { font-size: 10px; }
.app-shell.nokia-mode .pause-screen-shell { flex-direction: column; justify-content: flex-start; gap: 8px; padding: 8px; overflow-y: auto; }
.app-shell.nokia-mode .pause-left-col { width: 100%; align-items: center; gap: 6px; }
.app-shell.nokia-mode .pause-banner-img { width: 146px; }
.app-shell.nokia-mode .pause-menu-list { gap: 5px; flex-direction: row; flex-wrap: wrap; justify-content: center; }
.app-shell.nokia-mode .pause-menu-list .arcade-item { font-size: 8.5px; }
.app-shell.nokia-mode .pause-right-panel { width: 100%; border-width: 6px; border-image-width: 6px; }
.app-shell.nokia-mode .gl-modal { width: 98%; max-height: 96%; border-width: 6px; border-image-width: 6px; }
.app-shell.nokia-mode .modal-header { padding: 4px 6px; }
.app-shell.nokia-mode .modal-header h2 { font-size: 8px; }
.app-shell.nokia-mode .map-modal-body { grid-template-columns: 1fr; padding: 5px; gap: 6px; }
.app-shell.nokia-mode .garage-bay-showcase { flex-direction: column; }
.app-shell.nokia-mode .garage-upgrades-grid { grid-template-columns: 1fr; }
.app-shell.nokia-mode .garage-paint-row { grid-template-columns: repeat(2, 1fr); }
.app-shell.nokia-mode .career-stats-grid { grid-template-columns: repeat(2, 1fr); }
.app-shell.nokia-mode .shop-grid { grid-template-columns: 1fr; }
.app-shell.nokia-mode .gl-btn { padding: 4px 7px; font-size: 7.5px; }

/* ==================== NOKIA 6300 HARDWARE CONTROL DECK & T9 KEYPAD ==================== */
.app-shell.nokia-mode .nokia-keypad-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 13px 12px;
  background: linear-gradient(180deg, #1b1e26 0%, #101217 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Upper Control Deck: Wings + Iconic Chrome 5-Way Navi Ring */
.nokia-nav-deck {
  display: grid;
  grid-template-columns: 1fr 94px 1fr;
  align-items: center;
  gap: 9px;
}

.nk-wing {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #292d38 0%, #171a21 100%);
  border: 1px solid #596070;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.75);
}

.nk-wing-divider {
  height: 2px;
  background: linear-gradient(90deg, #5c6373 0%, #dfe4ec 50%, #5c6373 100%);
}

.nk-wing-btn {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.06s;
}

.nk-wing-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nk-wing-btn:active,
.nk-wing-btn.nk-pressed {
  background: rgba(235, 244, 255, 0.22);
  box-shadow: inset 0 0 8px rgba(240, 248, 255, 0.45);
}

.nk-dash {
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: #e2e8f0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.85);
}

.nk-handset-svg {
  display: block;
}

/* Iconic Nokia 6300 Brushed-Chrome Square-Rounded 5-Way Navi Ring */
.nk-navi-ring {
  position: relative;
  width: 94px;
  height: 82px;
  padding: 5px;
  border-radius: 17px;
  background: linear-gradient(
    145deg,
    #f2f5fa 0%,
    #b6becb 28%,
    #77808f 54%,
    #dfe4ed 82%,
    #9ca4b3 100%
  );
  border: 1px solid #454c59;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 3px rgba(20, 24, 32, 0.65),
    0 3px 6px rgba(0, 0, 0, 0.85);
  display: grid;
  grid-template-columns: 20px 1fr 20px;
  grid-template-rows: 19px 1fr 19px;
  align-items: center;
  justify-items: center;
}

.nk-navi-dir {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: #363c48;
  font-size: 7.5px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

.nk-navi-dir:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #0b0c10;
}

.nk-navi-dir:active,
.nk-navi-dir.nk-pressed {
  background: rgba(255, 255, 255, 0.65);
  color: #0b0c10;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.nk-navi-up { grid-column: 2; grid-row: 1; }
.nk-navi-left { grid-column: 1; grid-row: 2; }
.nk-navi-right { grid-column: 3; grid-row: 2; }
.nk-navi-down { grid-column: 2; grid-row: 3; }

/* Glossy Sunken Piano-Black Center OK Button */
.nk-navi-ok {
  grid-column: 2;
  grid-row: 2;
  width: 38px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(180deg, #323744 0%, #101218 55%, #1d212a 100%);
  border: 2px solid #161920;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.34),
    0 1px 2px rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.nk-navi-ok:hover {
  background: linear-gradient(180deg, #3e4554 0%, #181c24 100%);
}

.nk-navi-ok:active,
.nk-navi-ok.nk-pressed {
  background: linear-gradient(180deg, #e5a922 0%, #a87212 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.65);
}

/* Sculpted Nokia 6300 T9 Numeric Keypad with Signature Horizontal Chrome Fret Bars */
.nokia-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px 7px;
  padding: 5px;
  border-radius: 12px;
  background: #0b0d11;
  border: 1px solid #353b47;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.88);
}

.nk-num {
  position: relative;
  height: 38px;
  padding: 3px 6px 2px;
  border-radius: 6px;
  background: linear-gradient(180deg, #343946 0%, #20242d 52%, #171a22 100%);
  border: 1px solid #4e5566;
  border-top: 2px solid #969fae;
  color: #f4f6fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 2px 3px rgba(0, 0, 0, 0.78);
  transition: transform 0.04s, background 0.06s;
}

.nk-num:hover {
  background: linear-gradient(180deg, #3f4656 0%, #282d38 100%);
  border-top-color: #d6dce6;
}

.nk-num:active,
.nk-num.nk-pressed {
  transform: translateY(1px);
  background: linear-gradient(180deg, #4b5466 0%, #2d3442 100%);
  border-color: #dce3ee;
  box-shadow: inset 0 0 10px rgba(240, 248, 255, 0.48);
}

.nk-top {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}

.nk-digit {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: #f8fafc;
}

.nk-t9 {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 7.5px;
  letter-spacing: 0.04em;
  color: #adb5c4;
}

.nk-act {
  font-family: var(--px-font);
  font-size: 6px;
  letter-spacing: 0.05em;
  color: var(--gold-hi);
  opacity: 0.88;
}

/* Iconic Nokia Raised Tactile Homing Dot on the '5' Key */
.nk-tactile-dot {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #dfe4ec;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.9);
}

/* Brushed Stainless-Steel Curved Bottom Chin & Mic Pinhole */
.app-shell.nokia-mode .nokia-chin {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  border-radius: 0 0 34px 34px;
  background: linear-gradient(180deg, #1b1f27 0%, #3a404d 45%, #8a92a1 100%);
  border-top: 1px solid #4e5666;
}

.nokia-mic-hole {
  width: 14px;
  height: 3px;
  border-radius: 99px;
  background: #0a0c10;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Clean Floating Desk Info Card Beside the Phone (Desktop >= 860px) */
.app-shell.nokia-mode .nokia-desk-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 244px;
  padding: 14px 16px;
  border: 8px solid transparent;
  border-image: url("./assets/ui_frame_gold.png") 6 fill / 8px stretch;
  image-rendering: pixelated;
}

@media (max-width: 859px) {
  .app-shell.nokia-mode .nokia-desk-card {
    display: none;
  }
}

.nk-desk-title {
  font-size: 11px;
  color: var(--gold-hi);
  text-shadow: 2px 2px 0 var(--ink);
}

.nk-desk-sub {
  font-size: 7.5px;
  color: var(--dim);
  line-height: 1.5;
}

.nk-desk-keys {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nk-desk-keys > div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  background: #171a22;
  border: 1px solid #3c4352;
  font-size: 7.5px;
}

.nk-desk-keys b { color: var(--gold-hi); }
.nk-desk-keys span { color: var(--cream); }
.nk-exit-btn { width: 100%; }

/* ==================== CLASSIC FLOATING PIXEL-ART TITLE SCREEN ==================== */
.title-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
}

.title-bg-art {
  position: absolute;
  inset: 0;
  background: url("./assets/title_art.jpg") center / cover no-repeat;
  image-rendering: pixelated;
}

.title-left-column {
  position: relative;
  z-index: 2;
  padding: clamp(22px, 4.2vw, 44px) 0 0 clamp(24px, 4.2vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(18px, 3.2vh, 30px);
  max-width: 46%;
}

.title-logo-img {
  width: min(370px, 40vw);
  height: auto;
  animation: logoFloat 2.4s steps(4) infinite;
}

/* Pure Floating Pixel-Art Menu — ZERO Web Cards, ZERO Colored Banners! */
.arcade-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(10px, 2vh, 16px);
  padding-left: 6px;
}

.arcade-item {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 2px 0;
  font-family: var(--px-font);
  font-size: clamp(15px, 2.05vw, 23px);
  line-height: 1.1;
  color: var(--cream);
  letter-spacing: 0.04em;
  /* Crisp 8-direction solid 2px pixel outline + 4px hard retro drop shadow */
  text-shadow:
    -2px -2px 0 var(--ink),
     2px -2px 0 var(--ink),
    -2px  2px 0 var(--ink),
     2px  2px 0 var(--ink),
     0px -2px 0 var(--ink),
     0px  2px 0 var(--ink),
    -2px  0px 0 var(--ink),
     2px  0px 0 var(--ink),
     0px  4px 0 rgba(11, 12, 16, 0.92),
     3px  4px 0 rgba(11, 12, 16, 0.92);
  transition: transform 0.08s steps(2), color 0.06s;
}

.arcade-cursor {
  display: inline-block;
  width: 18px;
  color: var(--gold-hi);
  opacity: 0;
  transform: translateX(-4px);
}

.arcade-item.selected,
.arcade-item:hover,
.arcade-item:focus-visible {
  color: var(--gold-hi);
  transform: translateX(8px);
}

.arcade-item.selected .arcade-cursor,
.arcade-item:hover .arcade-cursor,
.arcade-item:focus-visible .arcade-cursor {
  opacity: 1;
  animation: cursorBounce 0.55s steps(2) infinite;
}

.arcade-note {
  margin-left: 6px;
  font-size: clamp(9px, 1vw, 12px);
  color: var(--green-hi);
}

/* Inline Free Roam District Sub-Menu */
.submenu-heading {
  font-size: clamp(11px, 1.25vw, 14px);
  color: var(--gold-hi);
  letter-spacing: 0.08em;
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px  2px 0 var(--ink), 2px  2px 0 var(--ink),
     0px  3px 0 var(--ink);
  margin-bottom: 2px;
}

.submenu-note {
  font-size: 8.5px;
  color: var(--cream);
  letter-spacing: 0.04em;
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px  1px 0 var(--ink), 1px  1px 0 var(--ink),
     0px  2px 0 var(--ink);
  margin-bottom: 4px;
}

.district-cycler {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 4px 10px;
  margin-bottom: 6px;
  border: 8px solid transparent;
  border-image: url("./assets/ui_frame_gold.png") 6 fill / 8px stretch;
  image-rendering: pixelated;
}

.cycler-arrow {
  background: transparent;
  border: none;
  color: var(--gold-hi);
  font-family: var(--px-font);
  font-size: clamp(14px, 1.6vw, 18px);
  cursor: pointer;
  padding: 2px 4px;
  text-shadow: 2px 2px 0 var(--ink);
}

.cycler-arrow:hover {
  color: #ffffff;
  transform: scale(1.15);
}

.cycler-name {
  min-width: 158px;
  text-align: center;
  font-size: clamp(12px, 1.45vw, 16px);
  color: var(--cream);
  text-shadow: 2px 2px 0 var(--ink);
}

/* Subtle floating bottom corner text — ZERO black footer strip! */
.title-corner-left,
.title-corner-right {
  position: absolute;
  bottom: 12px;
  z-index: 2;
  font-size: clamp(8px, 0.9vw, 10px);
  color: var(--cream);
  letter-spacing: 0.06em;
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px  1px 0 var(--ink), 1px  1px 0 var(--ink),
     0px  2px 0 var(--ink);
}

.title-corner-left { left: 20px; color: var(--gold-hi); }
.title-corner-right { right: 20px; opacity: 0.92; }

/* ==================== FULL-ART RETRO BOOT / LOADING SCREEN ==================== */
.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.loading-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 16, 22, 0.14) 0%, rgba(14, 16, 22, 0.08) 58%, rgba(11, 12, 16, 0.88) 100%),
    url("./assets/title_art.jpg") center / cover no-repeat;
  image-rendering: pixelated;
}

.loading-hero {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding-top: clamp(26px, 7vh, 56px);
}

.loading-logo-img {
  width: min(390px, 54%);
  height: auto;
}

.loading-bottom-dock {
  position: relative;
  z-index: 2;
  padding: 12px clamp(24px, 5vw, 60px) 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loading-dock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.loading-status {
  font-size: 11px;
  color: var(--cream);
  text-shadow: 2px 2px 0 var(--ink);
}

.loading-pct {
  font-size: 12px;
  color: var(--gold-hi);
  text-shadow: 2px 2px 0 var(--ink);
}

.loading-bar-track {
  width: 100%;
  height: 16px;
  background: #0d0f14;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 2px var(--ink), 2px 3px 0 rgba(0, 0, 0, 0.65);
  padding: 2px;
}

.loading-bar-fill {
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0px,
    var(--gold) 10px,
    #b57b14 10px,
    #b57b14 12px
  );
  transition: width 0.16s steps(12);
}

.loading-tip {
  font-size: 9.5px;
  color: var(--gold-hi);
  text-align: center;
  text-shadow: 2px 2px 0 var(--ink);
}

/* ==================== CLASSIC IN-GAME PIXEL HUD ==================== */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* Top-Left: Tight 2-Line Objective Bar */
.hud-top-left {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: 44%;
  contain: layout style;
}

.mission-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 0 0;
  border-width: 7px;
  border-image-width: 7px;
}

.mission-emblem-wrap {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #231d13;
  border: 2px solid var(--gold);
}

#mission-emblem-canvas {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

.mission-text-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.mission-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mission-distance {
  padding: 1px 5px;
  background: #12141a;
  border: 1px solid var(--gold);
  font-size: 7.5px;
  color: var(--gold-hi);
  flex-shrink: 0;
}

.mission-title {
  font-size: clamp(9.5px, 1.1vw, 11.5px);
  color: var(--gold-hi);
  text-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mission-sub {
  font-size: clamp(7.5px, 0.8vw, 8.5px);
  color: var(--cream);
  text-shadow: 1px 1px 0 var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mission-timer {
  margin-left: 4px;
  padding: 3px 6px;
  background: #261d10;
  border: 2px solid var(--gold);
  color: var(--gold-hi);
  font-size: 10.5px;
  flex-shrink: 0;
  text-shadow: 1px 1px 0 var(--ink);
}

.mission-timer.urgent {
  background: #421414;
  border-color: #ef4444;
  color: #fecaca;
  animation: pulseFast 0.45s infinite;
}

/* Top-Right: Floating Outlined Cash + Stars + Compact Vitals + Weapon Medallion */
.hud-top-right {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  contain: layout style;
}

.cash-floating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#cash-icon-canvas {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}

.cash-value {
  font-size: clamp(16px, 1.9vw, 22px);
  color: var(--green-hi);
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px  2px 0 var(--ink), 2px  2px 0 var(--ink),
     0px -2px 0 var(--ink), 0px  2px 0 var(--ink),
    -2px  0px 0 var(--ink), 2px  0px 0 var(--ink),
     0px  4px 0 rgba(11, 12, 16, 0.92);
}

.wanted-stars-canvas {
  display: block;
  width: 130px;
  height: 24px;
  image-rendering: pixelated;
}

.vitals-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: clamp(140px, 13.5vw, 168px);
}

.vital-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

#health-icon-canvas,
#armor-icon-canvas {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.vital-track {
  position: relative;
  flex: 1;
  height: 11px;
  background: #14171d;
  border: 2px solid #6e7687;
  box-shadow: 0 0 0 2px var(--ink), 2px 2px 0 rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.segmented-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 9px,
    rgba(11, 12, 16, 0.52) 9px,
    rgba(11, 12, 16, 0.52) 11px
  );
  pointer-events: none;
}

.vital-fill { height: 100%; transition: width 0.12s linear; }
.health-fill { background: linear-gradient(180deg, #80eb8e 0%, #3ca84d 55%, #237530 100%); }
.armor-fill { background: linear-gradient(180deg, #9ebce0 0%, #587da8 55%, #375375 100%); }

/* Compact Classic Weapon Medallion (like GTA / Gangstar corner weapon icon) */
.weapon-medallion {
  pointer-events: auto;
  position: relative;
  width: 62px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(22, 25, 31, 0.90);
  border: 2px solid #8a92a3;
  box-shadow: 0 0 0 2px var(--ink), 2px 3px 0 rgba(0, 0, 0, 0.6);
  cursor: pointer;
  font-family: var(--px-font);
}

.weapon-medallion:hover {
  border-color: var(--gold-hi);
}

.weapon-key-pip {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 7px;
  color: var(--dim);
}

#weapon-icon-canvas {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  margin-bottom: 6px;
}

.weapon-badge-name {
  position: absolute;
  bottom: 2px;
  left: 4px;
  font-size: 7px;
  color: var(--gold-hi);
  text-shadow: 1px 1px 0 var(--ink);
}

.weapon-badge-ammo {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 8px;
  color: var(--cream);
  text-shadow: 1px 1px 0 var(--ink);
}

/* ==================== UNIFIED TOP-CENTER NOTIFICATIONS ==================== */
.center-notifications {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 40%;
  pointer-events: none;
}

@media (max-width: 1020px) {
  .center-notifications {
    top: 72px;
    max-width: 78%;
  }
}

.toast-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px 6px 1px 3px;
  border-width: 7px;
  border-image-width: 7px;
}

#toast-icon-canvas {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.toast-text {
  font-size: 9.5px;
  color: var(--gold-hi);
  text-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap;
}

.district-floating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
}

.district-name {
  font-size: 16px;
  color: var(--gold-hi);
  letter-spacing: 0.12em;
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px  2px 0 var(--ink), 2px  2px 0 var(--ink),
     0px  4px 0 rgba(11, 12, 16, 0.92);
}

.district-sub {
  font-size: 8.5px;
  color: var(--cream);
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px  1px 0 var(--ink), 1px  1px 0 var(--ink),
     0px  2px 0 var(--ink);
}

/* ==================== SINGLE-SOURCE INTERACTIVE ACTION PROMPT ==================== */
.context-prompt {
  position: absolute;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px 6px 1px 3px;
  border-width: 7px;
  border-image-width: 7px;
  white-space: nowrap;
}

#context-icon-canvas {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.keycap-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--gold-hi);
  border-bottom: 3px solid #8a5c0d;
  font-size: 10px;
}

.context-text-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.context-main { font-size: 10px; color: var(--cream); text-shadow: 2px 2px 0 var(--ink); }
.context-sub { font-size: 8px; color: var(--gold-hi); }

/* ==================== BOTTOM-LEFT: ICON DOCK + MINIMAP ==================== */
.hud-bottom-left {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.minimap-icon-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  width: clamp(122px, 14vw, 152px);
  pointer-events: auto;
}

.dock-icon-btn {
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #232730;
  color: var(--cream);
  border: 2px solid #646c7d;
  box-shadow: 0 0 0 1px var(--ink), 1px 2px 0 rgba(0, 0, 0, 0.6);
  font-family: var(--px-font);
  font-size: 9px;
  cursor: pointer;
}

.dock-icon-btn:hover {
  border-color: var(--gold-hi);
  color: var(--gold-hi);
  background: #333947;
}

.ui-mini-icon {
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
  display: block;
}

.minimap-frame {
  position: relative;
  width: clamp(122px, 14vw, 152px);
  height: clamp(122px, 14vw, 152px);
  border: 3px solid #767f91;
  box-shadow:
    inset 0 0 0 2px #1a1d24,
    0 0 0 2px var(--ink),
    4px 5px 0 rgba(0, 0, 0, 0.6);
  overflow: hidden;
  background: #235982;
}

.minimap-north {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 5px;
  background: rgba(18, 20, 26, 0.94);
  border: 1px solid var(--gold);
  font-size: 7.5px;
  color: var(--gold-hi);
  z-index: 3;
}

.minimap-rivet {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #a4acb8;
  border: 1px solid var(--ink);
  z-index: 2;
}
.minimap-rivet.tl { top: 2px; left: 2px; }
.minimap-rivet.tr { top: 2px; right: 2px; }
.minimap-rivet.bl { bottom: 2px; left: 2px; }
.minimap-rivet.br { bottom: 2px; right: 2px; }

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

.minimap-district-tag {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 20, 26, 0.94);
  border: 1px solid #6e7687;
  padding: 2px 6px;
  font-size: 7.5px;
  color: var(--gold-hi);
  white-space: nowrap;
}

/* ==================== BOTTOM-RIGHT: VINTAGE DASHBOARD + FLOATING WHISPER ==================== */
.hud-bottom-right {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  contain: layout style;
}

.driving-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.vehicle-floating-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 2px;
  font-size: 9px;
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px  1px 0 var(--ink), 1px  1px 0 var(--ink),
     0px  2px 0 var(--ink);
}

.vehicle-name { color: var(--gold-hi); }
.vehicle-hp { color: var(--green-hi); }

#speedo-canvas {
  display: block;
  width: 204px;
  height: 70px;
  image-rendering: pixelated;
}

.control-whisper {
  font-size: 7.5px;
  color: var(--cream);
  opacity: 0.92;
  letter-spacing: 0.05em;
  text-shadow:
    -1px -1px 0 var(--ink), 1px -1px 0 var(--ink),
    -1px  1px 0 var(--ink), 1px  1px 0 var(--ink),
     0px  2px 0 var(--ink);
}

/* ==================== CLASSIC PIXEL-ART DIALOGUE BOX ==================== */
.dialogue-box {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 92%);
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 6px 8px 6px 6px;
  border-width: 8px;
  border-image-width: 8px;
  z-index: 25;
  animation: popIn 0.12s steps(2) both;
}

.dialogue-portrait-frame {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
  border: 2px solid var(--gold);
  background: #1b222e;
  box-shadow: inset 0 0 0 2px var(--ink);
  overflow: hidden;
}

.dialogue-portrait-frame.talking canvas {
  animation: talkBob 0.22s steps(2) infinite;
}

#dialogue-portrait-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.dialogue-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.dialogue-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #3c4352;
  padding-bottom: 3px;
}

.dialogue-speaker {
  font-size: 11px;
  color: var(--gold-hi);
  text-shadow: 2px 2px 0 var(--ink);
}

.dialogue-mission-tag {
  font-size: 7.5px;
  color: var(--dim);
}

.dialogue-text {
  font-size: 10px;
  line-height: 1.65;
  color: var(--cream);
  min-height: 36px;
  text-shadow: 1px 1px 0 var(--ink);
}

.dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dialogue-hint { font-size: 7.5px; color: var(--dim); }

.dialogue-next-prompt {
  background: transparent;
  border: none;
  font-family: var(--px-font);
  font-size: 9px;
  color: var(--gold-hi);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-shadow: 2px 2px 0 var(--ink);
}

.dialogue-next-prompt:hover { color: #ffffff; }
.next-arrow { display: inline-block; animation: cursorBounceY 0.55s steps(2) infinite; }

/* ==================== FLOATING PIXEL-ART MISSION PASSED / FAILED ==================== */
.mission-result-banner {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 38;
  animation: popIn 0.14s steps(2) both;
}

.mission-result-banner.failed {
  background: rgba(20, 8, 10, 0.62);
}

.game-stage:has(#mission-result-banner:not(.hidden)) #context-prompt,
.game-stage:has(#mission-result-banner:not(.hidden)) #toast-bar,
.game-stage:has(#modal-backdrop:not(.hidden)) #context-prompt,
.game-stage:has(#modal-backdrop:not(.hidden)) #toast-bar {
  opacity: 0;
}

.result-floating-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px;
  text-align: center;
}

.result-banner-img {
  width: min(390px, 78vw);
  height: auto;
  animation: logoFloat 2.4s steps(4) infinite;
}

.result-title {
  font-size: clamp(12px, 1.55vw, 16px);
  color: var(--cream);
  letter-spacing: 0.08em;
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px  2px 0 var(--ink), 2px  2px 0 var(--ink),
     0px  4px 0 var(--ink);
}

.result-reward {
  font-size: clamp(18px, 2.5vw, 26px);
  color: var(--green-hi);
  letter-spacing: 0.05em;
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px  2px 0 var(--ink), 2px  2px 0 var(--ink),
     0px  4px 0 var(--ink);
}

.mission-result-banner.failed .result-reward {
  font-size: clamp(12px, 1.45vw, 15px);
  color: #f8a5a0;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 8px;
}

.result-choice {
  font-size: clamp(14px, 1.75vw, 20px);
}

/* ==================== CLASSIC PIXEL BUTTONS (IN-MODAL) ==================== */
.gl-btn {
  padding: 6px 11px;
  background: #2b313d;
  color: var(--cream);
  border: 2px solid #757e91;
  border-bottom-width: 4px;
  font-family: var(--px-font);
  font-size: 8.5px;
  cursor: pointer;
  text-shadow: 1px 1px 0 var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.gl-btn:hover { background: #373f4f; border-color: var(--gold-hi); }
.gl-btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.gl-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gl-btn-mini { padding: 4px 8px; font-size: 7.5px; }

.gl-btn-gold {
  background: #e5a922;
  color: var(--ink);
  border-color: var(--gold-hi);
  border-bottom-color: #8e5f10;
  text-shadow: none;
}
.gl-btn-gold:hover { background: #f2bc38; }

.gl-btn-green {
  background: #369c46;
  color: #ffffff;
  border-color: var(--green-hi);
  border-bottom-color: #1c5926;
}
.gl-btn-green:hover { background: #41b353; }

.gl-btn-steel {
  background: #4a6f99;
  color: #ffffff;
  border-color: var(--armor-hi);
  border-bottom-color: #29415e;
}
.gl-btn-steel:hover { background: #5a82b0; }

/* ==================== MODAL BACKDROP & CLEAN PIXEL WINDOWS ==================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 17, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 50;
}

.gl-modal {
  width: min(670px, 95%);
  max-height: 94%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-width: 8px;
  border-image-width: 8px;
  animation: popIn 0.1s steps(2) both;
}

.modal-wide { width: min(850px, 96%); }
.modal-compact { width: min(440px, 94%); }
.modal-rapsheet { width: min(610px, 95%); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: #171a22;
  border-bottom: 2px solid #4d5566;
}

.modal-title-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.modal-hdr-icon { width: 16px; height: 16px; }
.header-cash { margin-left: auto; font-size: 11px; text-shadow: 2px 2px 0 var(--ink); }

.modal-header h2 {
  font-size: 11px;
  color: var(--gold-hi);
  text-shadow: 2px 2px 0 var(--ink);
}

.modal-close {
  background: #2b313d;
  color: var(--cream);
  border: 2px solid #6b7385;
  padding: 3px 7px;
  font-family: var(--px-font);
  font-size: 8px;
  cursor: pointer;
}

.modal-close:hover { border-color: var(--gold-hi); color: var(--gold-hi); }

.modal-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: #12151c;
  border-bottom: 2px solid #343a47;
  font-size: 7.5px;
  color: var(--dim);
}

.text-green { color: var(--green-hi); }
.text-gold { color: var(--gold-hi); }
.text-red { color: #f87171; }

/* ==================== FLOATING INDIE / GAMELOFT PAUSE MENU ==================== */
.pause-screen-shell {
  width: min(760px, 94%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  padding: 12px 16px;
  animation: popIn 0.1s steps(2) both;
}

.pause-left-col {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.pause-banner-img {
  width: 210px;
  height: auto;
}

.pause-sub-title {
  font-size: clamp(20px, 2.6vw, 28px);
  color: var(--gold-hi);
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px  2px 0 var(--ink), 2px  2px 0 var(--ink),
     0px  4px 0 var(--ink);
}

.pause-menu-list {
  gap: 12px;
}

.pause-menu-list .arcade-item {
  font-size: clamp(14px, 1.7vw, 20px);
}

.pause-right-panel {
  width: 400px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  border-width: 8px;
  border-image-width: 8px;
}

.pause-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #171a22;
  border-bottom: 2px solid #4d5566;
  font-size: 9.5px;
  color: var(--gold-hi);
}

.pause-pane {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pause-toggles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.controls-grid > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #191d25;
  border: 2px solid #3c4352;
  font-size: 8px;
}

.controls-grid b { color: var(--gold-hi); }

/* ==================== CITY MAP & JOBS ==================== */
.map-modal-body {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 10px;
  padding: 8px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

.full-map-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.atlas-canvas-wrap {
  border: 2px solid #646c7d;
  background: #235982;
}

#full-map-canvas {
  display: block;
  width: 100%;
  max-height: 242px;
  object-fit: contain;
  background: #235982;
  image-rendering: pixelated;
  cursor: crosshair;
}

.map-pin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-pin-hint { font-size: 7.5px; color: var(--gold-hi); }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  font-size: 7.5px;
  color: var(--cream);
}

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; }
.dot-player { background: #ffffff; }
.dot-mission { background: var(--gold); }
.dot-pin { background: #dc2626; border: 1px solid #f6d56a; }
.dot-spray { background: var(--green); }
.dot-gun { background: var(--armor-hi); }
.dot-trade { background: var(--ochre); }
.dot-prop { background: var(--gold-hi); }
.dot-cop { background: var(--red); }

.mission-list-col { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.mission-list-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 9px; color: var(--gold-hi); }

.mission-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 140px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 4px;
}

.mission-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  background: #1c2028;
  border: 2px solid #404754;
  font-size: 8.5px;
}

.mission-card.completed { border-color: #2f7d3d; background: #18231b; }
.mission-card.active { border-color: var(--gold); background: #2b2517; }

.mission-contact-thumb {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 2px solid #636b7d;
  background: #131720;
  image-rendering: pixelated;
}

.mission-card.active .mission-contact-thumb { border-color: var(--gold); }
.mission-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mission-card-name { color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mission-card-meta { font-size: 7px; color: var(--dim); }
.mission-launch-btn { padding: 4px 7px; font-size: 7.5px; flex-shrink: 0; }

.map-stats-bar {
  padding: 5px 8px;
  background: #14171e;
  border: 1px solid #3c424f;
  font-size: 7.5px;
  color: var(--dim);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 8px;
}

/* ==================== GUN SHOP ==================== */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  padding: 9px;
  overflow-y: auto;
}

.shop-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: #1c2028;
  border: 2px solid #485060;
}

.shop-card:hover { border-color: var(--gold); }

.shop-card canvas {
  width: 38px;
  height: 38px;
  image-rendering: pixelated;
  background: #12151c;
  border: 2px solid #596173;
  padding: 2px;
  flex-shrink: 0;
}

.shop-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shop-card-title { font-size: 8.5px; color: var(--gold-hi); }
.shop-card-sub { font-size: 7px; color: var(--dim); }

.weapon-stat-bars { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.wstat-row { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 4px; font-size: 6.5px; color: var(--dim); }
.wstat-track { height: 5px; background: #0f1116; border: 1px solid #404654; }
.wstat-fill { height: 100%; background: var(--gold); }
.wstat-fill.dmg { background: #dc453b; }
.wstat-fill.rate { background: #e5a922; }
.wstat-fill.rng { background: #5c83b0; }

/* ==================== STREET MARKET ==================== */
.trade-list { display: flex; flex-direction: column; gap: 6px; padding: 9px; overflow-y: auto; }
.trade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: #1c2028;
  border: 2px solid #485060;
  font-size: 9px;
}
.trade-actions { display: flex; gap: 5px; }
.trade-tag { font-size: 7px; padding: 2px 5px; margin-left: 6px; border: 1px solid var(--ink); }
.trade-low { background: #1c4f26; color: var(--green-hi); }
.trade-high { background: #6b1d19; color: #fca5a5; }
.trade-mid { background: #363c48; color: var(--cream); }

/* ==================== PROPERTY PURCHASE ==================== */
.prop-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.prop-desc { font-size: 9.5px; line-height: 1.6; color: var(--cream); }
.prop-ledger { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.prop-cell { padding: 7px; background: #171a22; border: 2px solid #485060; display: flex; flex-direction: column; gap: 4px; }
.prop-cell span { font-size: 7px; color: var(--dim); }
.prop-cell b { font-size: 11px; }
.prop-actions { display: flex; justify-content: center; gap: 10px; }

/* ==================== PHONE CHEATS ==================== */
.cheat-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.cheat-lcd {
  padding: 7px 8px;
  background: #9bbc0f;
  color: #0f380f;
  border: 3px solid #306230;
  font-size: 12.5px;
  text-align: center;
  letter-spacing: 0.12em;
}
.cheat-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.t9-key {
  padding: 5px 4px;
  background: #232833;
  color: var(--cream);
  border: 2px solid #596173;
  font-family: var(--px-font);
  font-size: 9.5px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}
.t9-key small { font-size: 6.5px; color: var(--dim); }
.t9-key:hover { border-color: var(--gold-hi); background: #2f3644; }
.t9-key:active { background: var(--gold); color: var(--ink); }
.cheat-actions { display: flex; justify-content: center; gap: 8px; }
.cheat-hints { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.slip-code-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: #161921;
  border: 1px solid #3c4352;
  color: var(--cream);
  font-family: var(--px-font);
  font-size: 7px;
  cursor: pointer;
}
.slip-code-btn b { color: var(--gold-hi); }
.slip-code-btn:hover { border-color: var(--gold); background: #222733; }

/* ==================== RICO'S GARAGE ==================== */
.garage-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }

.garage-bay-showcase {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: #161921;
  border: 2px solid #4d5566;
}

.garage-bay-preview {
  width: 104px;
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222732;
  border: 2px solid var(--gold);
}

#garage-car-canvas { width: 88px; height: 52px; image-rendering: pixelated; }

.garage-bay-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.garage-ride-status { font-size: 8.5px; color: var(--cream); }
.garage-quick-row { display: flex; flex-wrap: wrap; gap: 6px; }

.garage-section-label {
  font-size: 7.5px;
  color: var(--gold-hi);
  border-bottom: 1px solid #3c424f;
  padding-bottom: 2px;
}

.garage-upgrades-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.garage-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 7px;
  background: #1c2028;
  border: 2px solid #485060;
}

.garage-card.owned { border-color: #369c46; background: #18251c; }
.garage-card-title { font-size: 8px; color: var(--cream); }
.garage-card-desc { font-size: 6.5px; color: var(--dim); line-height: 1.45; }

.garage-paint-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }

.paint-swatch-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  background: #1c2028;
  border: 2px solid #485060;
  color: var(--cream);
  font-family: var(--px-font);
  font-size: 7.5px;
  cursor: pointer;
}

.paint-swatch-btn:hover { border-color: var(--gold-hi); }
.paint-swatch-btn.active { border-color: var(--gold); background: #2b2517; }
.paint-chip { width: 13px; height: 13px; border: 2px solid var(--ink); flex-shrink: 0; }

/* ==================== CAREER STATS ==================== */
.stats-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }

.rapsheet-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  background: #161921;
  border: 2px solid #485060;
}

.rapsheet-mugshot {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border: 2px solid var(--gold);
  background: #1f2530;
  overflow: hidden;
}

.rapsheet-mugshot canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.rapsheet-identity { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rapsheet-name { font-size: 11px; color: var(--cream); text-shadow: 2px 2px 0 var(--ink); }
.rapsheet-rank-badge { display: inline-block; align-self: flex-start; padding: 2px 6px; background: #2b2314; border: 1px solid var(--gold); font-size: 7.5px; color: var(--gold-hi); }
.rapsheet-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rbar-item { display: flex; flex-direction: column; gap: 2px; font-size: 6.5px; color: var(--dim); }
.rbar-track { height: 6px; background: #0d0f14; border: 1px solid #485060; }
.rbar-fill { height: 100%; background: var(--gold); }
.rbar-fill.green { background: var(--green); }

.career-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.stat-tile { padding: 5px 7px; background: #1c2028; border: 2px solid #424957; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 6.5px; color: var(--dim); }
.stat-value { font-size: 9px; color: var(--gold-hi); text-shadow: 1px 1px 0 var(--ink); }
.stat-value.green { color: var(--green-hi); }
.pause-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

/* ==================== FLOATING VICTORY SPLASH ==================== */
.victory-splash { width: 100%; display: flex; align-items: center; justify-content: center; }
.victory-hero-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(18, 21, 28, 0.90);
  border: 2px solid var(--gold);
}
.victory-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px 14px;
  font-size: 8.5px;
  text-align: left;
  color: var(--cream);
}

/* ==================== RETRO VOLUME SLIDERS ==================== */
.volume-sliders {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 10px;
  background: #151820;
  border: 2px solid #3c424f;
}
.vol-row { display: grid; grid-template-columns: 48px 1fr 38px; align-items: center; gap: 8px; font-size: 8px; color: var(--cream); }
.vol-row b { text-align: right; color: var(--gold-hi); }
.px-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; background: #272c36; border: 2px solid #596070; outline: none; cursor: pointer; }
.px-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 16px; background: var(--gold); border: 2px solid var(--gold-hi); box-shadow: 0 0 0 1px var(--ink); cursor: pointer; }
.px-slider::-moz-range-thumb { width: 12px; height: 16px; background: var(--gold); border: 2px solid var(--gold-hi); border-radius: 0; cursor: pointer; }

/* ==================== MOBILE / TOUCH CONTROLS OVERLAY ==================== */
.touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.touch-dpad {
  position: absolute;
  left: 16px;
  bottom: 178px;
  display: grid;
  grid-template-columns: repeat(3, 38px);
  grid-template-rows: repeat(3, 34px);
  gap: 3px;
  pointer-events: auto;
}

.touch-actions {
  position: absolute;
  right: 16px;
  bottom: 108px;
  display: grid;
  grid-template-columns: repeat(2, 62px);
  gap: 5px;
  pointer-events: auto;
}

.touch-btn {
  height: 34px;
  background: rgba(24, 28, 36, 0.84);
  color: var(--cream);
  border: 2px solid #767f91;
  box-shadow: 0 0 0 1px var(--ink);
  font-family: var(--px-font);
  font-size: 8px;
  cursor: pointer;
  touch-action: none;
}

.touch-btn:active { background: var(--gold); color: var(--ink); }
.touch-btn.t-gold { border-color: var(--gold); color: var(--gold-hi); }
.touch-btn.t-red { border-color: var(--red); color: #fecaca; }
.t-up { grid-column: 2; grid-row: 1; }
.t-left { grid-column: 1; grid-row: 2; }
.t-right { grid-column: 3; grid-row: 2; }
.t-down { grid-column: 2; grid-row: 3; }

@keyframes pulseFast { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes talkBob { 0% { transform: translateY(0); } 100% { transform: translateY(-2px); } }
@keyframes logoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes cursorBounce { 0% { transform: translateX(0); } 100% { transform: translateX(4px); } }
@keyframes cursorBounceY { 0% { transform: translateY(0); } 100% { transform: translateY(2px); } }
@keyframes popIn { 0% { opacity: 0; } 100% { opacity: 1; } }
