/* GTA 1 Arcade HUD & Clean Game UI */
@keyframes gta-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes gta-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes gta-banner-in { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* GTA Overlay Canvas for target arrows & world markers */
#gta-arrow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

/* Stylish Game Menu Button (Top Left, to the right of player badge) */
#menu-btn {
  position: fixed;
  top: 14px;
  left: 148px;
  z-index: 25;
  background: rgba(14, 20, 28, 0.92);
  color: #ffd700;
  border: 1.5px solid #ffd700;
  border-radius: 6px;
  padding: 8px 16px;
  font-family: 'Courier New', Courier, monospace, ui-monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 215, 0, 0.2);
  transition: all 0.15s ease-out;
  user-select: none;
}
#menu-btn:hover {
  background: #ffd700;
  color: #080c10;
  box-shadow: 0 0 16px #ffd700;
  transform: translateY(-1px);
}
#menu-btn:active {
  transform: translateY(1px);
}

/* GTA 1 Dialogue Pager (Appears ONLY during dialogue interactions) */
#gta-pager {
  display: none;
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  background: rgba(8, 12, 18, 0.95);
  border: 2px solid #ffd700;
  border-radius: 6px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.85), 0 0 15px rgba(255, 215, 0, 0.3);
  z-index: 28;
  font-family: 'Courier New', Courier, monospace, ui-monospace;
  box-sizing: border-box;
  padding: 10px 16px 12px;
  color: #ffffff;
  transition: all 0.2s ease-out;
}
#gta-pager.active {
  display: block;
}
.gta-pager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 215, 0, 0.35);
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.gta-pager-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffd700;
}
.gta-pager-tag .gta-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39ff14;
  box-shadow: 0 0 8px #39ff14;
  animation: gta-blink 1s infinite;
}
.gta-pager-timer {
  font-size: 12px;
  color: #8b9bab;
  letter-spacing: 0.5px;
}
.gta-pager-content {
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.5px;
  margin: 0;
  color: #f0f4f8;
  text-shadow: 1px 1px 0 #000;
}
.gta-pager-content strong {
  color: #ffd700;
}

/* Dialogue choices inside Pager */
.gta-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.gta-choice-btn {
  background: #141f28;
  color: #ffd700;
  border: 1px solid #ffd700;
  border-radius: 4px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.gta-choice-btn:hover {
  background: #ffd700;
  color: #080c10;
  box-shadow: 0 0 10px #ffd700;
  transform: translateY(-1px);
}
.gta-choice-btn:active {
  transform: translateY(1px);
}

/* GTA 1 Arcade Banner (Mission Passed / Failed) */
#gta-banner {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 29;
  pointer-events: none;
  text-align: center;
  font-family: 'Courier New', Courier, monospace, ui-monospace;
  opacity: 0;
  transition: opacity 0.3s;
}
#gta-banner.show {
  opacity: 1;
  animation: gta-banner-in 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.gta-banner-box {
  padding: 16px 36px;
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}
.gta-banner-box.passed {
  background: linear-gradient(135deg, rgba(8, 30, 16, 0.95), rgba(12, 60, 24, 0.95));
  border: 3px solid #39ff14;
  box-shadow: 0 0 35px rgba(57, 255, 20, 0.5);
}
.gta-banner-box.failed {
  background: linear-gradient(135deg, rgba(35, 10, 10, 0.95), rgba(70, 12, 12, 0.95));
  border: 3px solid #ff2a2a;
  box-shadow: 0 0 35px rgba(255, 42, 42, 0.6);
}
.gta-banner-box.newjob {
  background: linear-gradient(135deg, rgba(8, 25, 40, 0.95), rgba(12, 45, 75, 0.95));
  border: 3px solid #00f0ff;
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.5);
}
.gta-banner-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 3px;
  margin: 0 0 6px;
  text-transform: uppercase;
}
.gta-banner-box.passed .gta-banner-title {
  color: #39ff14;
  text-shadow: 0 0 15px rgba(57, 255, 20, 0.8), 2px 2px 0 #000;
}
.gta-banner-box.failed .gta-banner-title {
  color: #ff3b30;
  text-shadow: 0 0 15px rgba(255, 59, 48, 0.8), 2px 2px 0 #000;
}
.gta-banner-box.newjob .gta-banner-title {
  color: #00f0ff;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.8), 2px 2px 0 #000;
}
.gta-banner-sub {
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #ffffff;
  margin: 0;
  text-shadow: 1px 1px 0 #000;
}

/* Fullscreen Menu Screen */
#game-menu {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 16, 0.82);
  backdrop-filter: blur(5px);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-family: 'Courier New', Courier, monospace, ui-monospace;
  box-sizing: border-box;
  padding: 16px;
}
#game-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.game-menu-box {
  background: rgba(13, 19, 27, 0.98);
  border: 2px solid #ffd700;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(255, 215, 0, 0.25);
  width: min(850px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #e2e8f0;
}
.game-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 2px solid rgba(255, 215, 0, 0.35);
  background: rgba(20, 29, 41, 0.95);
}
.game-menu-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #ffd700;
  letter-spacing: 2px;
}
.game-menu-close {
  background: transparent;
  color: #ffd700;
  border: 1px solid #ffd700;
  border-radius: 4px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
}
.game-menu-close:hover {
  background: #ffd700;
  color: #080c10;
}
.game-menu-tabs {
  display: flex;
  background: rgba(10, 15, 22, 0.95);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}
.game-menu-tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b9bab;
  font: inherit;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.game-menu-tab-btn.active {
  color: #ffd700;
  border-bottom-color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
}
.game-menu-tab-btn:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
}
.game-menu-body {
  padding: 20px;
  overflow-y: auto;
  line-height: 1.5;
}
.game-menu-body h2 {
  color: #ffd700;
  font-size: 16px;
  margin: 0 0 10px;
  letter-spacing: 1.5px;
}
.game-menu-body h3 {
  color: #ff3eb9;
  font-size: 12px;
  margin: 16px 0 0;
  letter-spacing: 2px;
}
.game-menu-body p {
  color: #c5d0d9;
  font-size: 13px;
  margin: 6px 0 14px;
}
.gta-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.gta-control-card {
  background: rgba(20, 28, 38, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gta-control-label {
  font-size: 13px;
  color: #e2e8f0;
}
.gta-control-key {
  background: #080c10;
  color: #ffd700;
  border: 1px solid #ffd700;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.gta-control-label { margin-right: 10px; }
.gta-quest-box {
  background: rgba(20, 28, 38, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.gta-quest-title {
  color: #ffd700;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 0 0 8px;
}
.gta-quest-obj {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}
.gta-quest-obj:last-child {
  border-bottom: none;
}
.gta-quest-obj.done {
  color: #39ff14;
}
.gta-quest-obj.active {
  color: #ffd700;
  font-weight: bold;
}
.gta-quest-obj.locked {
  color: #64748b;
}

/* Debug / Dev Screen */
.gta-debug-section {
  background: rgba(14, 21, 30, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
.gta-debug-title {
  color: #00f0ff;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gta-debug-clock-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.gta-debug-clock {
  font-size: 26px;
  font-weight: 900;
  color: #00f0ff;
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  background: #080c10;
  border: 1px solid #00f0ff;
  border-radius: 6px;
  padding: 4px 16px;
  min-width: 105px;
  text-align: center;
}
.gta-debug-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.gta-debug-btn {
  background: #141f28;
  color: #00f0ff;
  border: 1px solid #00f0ff;
  border-radius: 4px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gta-debug-btn:hover {
  background: #00f0ff;
  color: #080c10;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  transform: translateY(-1px);
}
.gta-debug-btn:active {
  transform: translateY(1px);
}
.gta-debug-btn.warn {
  color: #ff3b30;
  border-color: #ff3b30;
}
.gta-debug-btn.warn:hover {
  background: #ff3b30;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.6);
}
.gta-debug-btn.gold {
  color: #ffd700;
  border-color: #ffd700;
}
.gta-debug-btn.gold:hover {
  background: #ffd700;
  color: #080c10;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}
.gta-debug-btn.active {
  background: rgba(0, 240, 255, 0.25);
  box-shadow: inset 0 0 8px #00f0ff;
}
.gta-debug-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.gta-debug-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.gta-debug-slider-row label {
  width: 140px;
  font-size: 12px;
  color: #e2e8f0;
}
.gta-debug-slider-row input[type="range"] {
  flex: 1;
  accent-color: #00f0ff;
  cursor: pointer;
}
.gta-debug-slider-row output {
  width: 52px;
  text-align: right;
  font-size: 12px;
  font-weight: bold;
  color: #00f0ff;
}
.gta-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.gta-telemetry-card {
  background: #080c10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 12px;
}
.gta-telemetry-label {
  font-size: 11px;
  color: #8b9bab;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.gta-telemetry-val {
  font-size: 14px;
  font-weight: bold;
  color: #39ff14;
}

@media (max-width: 650px) {
  #menu-btn { top: 10px; left: 135px; padding: 5px 12px; font-size: 11px; }
  #gta-pager { top: 8px; width: calc(100vw - 16px); padding: 8px 12px; }
  .gta-banner-title { font-size: 22px; }
  .gta-banner-sub { font-size: 13px; }
  .game-menu-box { width: 98vw; max-height: 94vh; }
  .game-menu-body { padding: 12px; }
  .gta-controls-grid { grid-template-columns: 1fr; }
  .gta-debug-clock-box { flex-direction: column; align-items: flex-start; }
  .gta-debug-slider-row { flex-wrap: wrap; }
  .gta-debug-slider-row label { width: 100%; }
}

/* Conversation: one speaker, one reply per row, scene stays visible above. */
#gta-pager {
  top: auto;
  bottom: 24px;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  padding: 20px 24px;
  border: 1px solid #526074;
  border-radius: 14px;
  background: #111b29f5;
  box-shadow: 0 12px 50px #0008;
  font-family: system-ui, sans-serif;
}
.gta-pager-bar { gap: 16px; padding-bottom: 12px; border-color: #ffffff20; }
.gta-pager-tag { font-size: 15px; letter-spacing: 0; text-transform: none; color: #fff; }
.gta-pager-tag .gta-led { display: none; }
.gta-pager-content { font-size: 17px; line-height: 1.65; letter-spacing: 0; text-shadow: none; }
.gta-choices { display: grid; gap: 8px; margin-top: 18px; }
.gta-choice-btn {
  min-height: 46px;
  padding: 12px 14px;
  background: #243247;
  border: 1px solid #485b74;
  border-radius: 8px;
  color: #f1f5fa;
  font: 15px/1.45 system-ui, sans-serif;
  box-shadow: none;
}
.gta-choice-btn:hover { transform: none; background: #344964; color: #fff; box-shadow: none; }
.dialogue-close { flex-shrink: 0; border: 0; border-radius: 6px; background: #ffffff10; color: #d6dfe9; padding: 10px; font: 13px system-ui; cursor: pointer; }
.gta-choice-btn:focus-visible, .dialogue-close:focus-visible,
#mission-phone button:focus-visible, #mission-phone-button:focus-visible { outline: 3px solid #83caff; outline-offset: 3px; }
#mission-phone-button {
  position: fixed; left: 14px; top: 58px; z-index: 26;
  padding: 11px 14px; border-radius: 8px; border: 1px solid #687c93;
  background: #162538; color: #eef5ff; font: 14px system-ui; cursor: pointer;
}
#mission-phone {
  box-sizing: border-box;
  position: fixed; right: 24px; bottom: 24px; z-index: 34;
  width: min(330px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px); overflow-y: auto;
  border: 7px solid #20262e; border-radius: 32px;
  background: #edf1f6; color: #1b2b3d;
  box-shadow: 0 22px 80px #0008, inset 0 0 0 1px #fff;
  padding: 14px 18px 24px; font: 15px/1.6 system-ui, sans-serif;
}
#mission-phone[hidden] { display: none; }
.phone-speaker { width: 48px; height: 5px; border-radius: 8px; background: #222e3b; margin: 0 auto 18px; }
#mission-phone header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #c6d1dd; padding-bottom: 10px; }
#mission-phone h2 { margin: 0; font-size: 20px; }
#mission-phone header button { background: transparent; border: 0; color: #34465b; cursor: pointer; font-size: 25px; min-width: 44px; min-height: 44px; }
.phone-label { color: #53667c; font-size: 13px; margin: 18px 0 10px; }
#phone-sender { font-weight: 700; color: #253d58; }
#phone-message { border-radius: 4px 16px 16px; padding: 16px; background: #d8e4f0; margin: 0; font-size: 16px; line-height: 1.65; white-space: pre-line; }
.phone-route { font-size: 12px; color: #586a7b; }
#mission-phone .phone-go { display: block; width: 100%; min-height: 46px; margin-top: 20px; border: 0; border-radius: 10px; background: #244a70; color: #fff; font: 15px system-ui; cursor: pointer; padding: 12px; }
#gta-banner { top: 22%; }
.gta-banner-title { font-size: 22px; }
@media (max-width: 650px) {
  #gta-pager { bottom: 12px; padding: 16px; }
  .gta-pager-content { font-size: 16px; }
  #mission-phone { right: 16px; bottom: 16px; max-height: calc(100dvh - 32px); }
  #mission-phone-button { left: 8px; top: 48px; font-size: 12px; }
}
