:root {
  --bg-deep: #120824;
  --bg-card: rgba(18, 9, 36, 0.94);
  --pink: #ff2e93;
  --cyan: #00f0ff;
  --gold: #ffbe3b;
  --green: #34d399;
  --text: #f8fafc;
  --muted: #b6b1d4;
  --font-display: 'Bungee', 'Impact', sans-serif;
  --font-ui: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-ui);
  user-select: none;
}

.hidden {
  display: none !important;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

/* =========================================
   SPLASH / TITLE SCREEN (MIAMI VICE COVER)
   ========================================= */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 94, 153, 0.24), transparent 58%),
    radial-gradient(circle at 82% 85%, rgba(0, 240, 255, 0.18), transparent 52%),
    linear-gradient(170deg, rgba(20, 8, 42, 0.62) 0%, rgba(14, 6, 30, 0.7) 100%);
}

.splash-sunset-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 46, 147, 0.22) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(500px) rotateX(48deg) translateY(180px);
  transform-origin: center bottom;
}

.splash-container {
  position: relative;
  z-index: 2;
  max-width: 940px;
  width: 100%;
  text-align: center;
  padding: 24px 22px 22px;
  border-radius: 24px;
  background: rgba(15, 7, 31, 0.84);
  backdrop-filter: blur(14px);
  border: 2px solid rgba(0, 240, 255, 0.45);
  box-shadow:
    0 0 42px rgba(255, 46, 147, 0.28),
    0 24px 60px rgba(0, 0, 0, 0.65);
}

.brand-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.vice-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.95;
  margin-bottom: 10px;
}

.logo-top {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.2vw, 2.7rem);
  color: #ffffff;
  letter-spacing: 0.06em;
  text-shadow: 3px 3px 0 #120824, 5px 5px 0 var(--pink), 0 0 24px rgba(255, 46, 147, 0.65);
}

.logo-main {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.6rem);
  background: linear-gradient(180deg, #fff5b8 0%, #ffbe3b 48%, #ff2e93 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 0 #120824) drop-shadow(0 0 24px rgba(255, 46, 147, 0.55));
}

.splash-tagline {
  color: #e2dcf8;
  font-size: clamp(0.88rem, 2vw, 1.05rem);
  max-width: 650px;
  margin: 0 auto 18px;
}

.splash-crew-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.splash-char-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  background: rgba(25, 13, 48, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.splash-char-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.splash-char-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 26px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-4px);
}

.char-img-frame {
  position: relative;
  width: 100%;
  height: 205px;
  overflow: hidden;
  background: #0b0616;
  border-bottom: 3px solid var(--accent);
}

.char-img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.char-key-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(12, 6, 26, 0.88);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-card-body {
  padding: 11px 12px 13px;
}

.char-card-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.char-card-role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}

.char-card-perk {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.32;
}

.splash-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.controls-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.controls-strip strong {
  color: var(--cyan);
  font-family: var(--font-mono);
  margin-right: 4px;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn-neon {
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  color: #ffffff;
  background: linear-gradient(135deg, #ff2e93 0%, #c026d3 55%, #00c8ff 100%);
  box-shadow: 0 0 22px rgba(255, 46, 147, 0.48);
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.btn-neon:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.btn-neon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-xl {
  padding: 14px 30px;
  font-size: 1.05rem;
}

.btn-ghost {
  border: 1.5px solid rgba(0, 240, 255, 0.5);
  border-radius: 12px;
  padding: 10px 16px;
  background: rgba(16, 10, 36, 0.78);
  color: #ffffff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.btn-ghost:hover {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--cyan);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.78rem;
  border-radius: 9px;
}

.btn-mini {
  border: 1.5px solid var(--cyan);
  background: rgba(0, 240, 255, 0.15);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-mini:hover {
  background: rgba(0, 240, 255, 0.32);
}

.btn-mini.is-active {
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.22);
  color: var(--green);
}

.btn-danger-sm {
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  cursor: pointer;
}

/* =========================================
   IN-GAME HUD (GTA VICE CITY)
   ========================================= */
.hud-layer {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.hud-layer button {
  pointer-events: auto;
}

.hud-top-left {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crew-switcher {
  display: flex;
  gap: 7px;
}

.crew-slot {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 5px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(14, 7, 30, 0.84);
  backdrop-filter: blur(8px);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.crew-slot img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid var(--accent);
}

.crew-slot.active {
  border-color: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 55%, transparent);
  transform: scale(1.04);
}

.slot-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.slot-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--accent);
}

.slot-key {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.radio-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}

.radio-btn, .mute-btn {
  border: 1.5px solid rgba(255, 46, 147, 0.55);
  background: rgba(16, 8, 32, 0.82);
  color: #ffffff;
  border-radius: 10px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.radio-btn span {
  color: var(--cyan);
}

.hud-top-center {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, 78vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gps-tracker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 8px;
  border-radius: 14px;
  background: rgba(14, 7, 32, 0.88);
  border: 1.5px solid rgba(0, 240, 255, 0.55);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.25), 0 8px 20px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  max-width: 100%;
}

.gps-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.86rem;
  color: #120824;
  background: var(--pink);
  flex-shrink: 0;
}

.gps-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.gps-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: #ffffff;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gps-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gps-btn {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 8px;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.gps-btn:hover {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.2);
}

.gps-btn.go {
  border-color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 46, 147, 0.4), rgba(0, 240, 255, 0.28));
}

.bloom-btn {
  border-color: rgba(255, 190, 59, 0.55);
}

@media (max-width: 1120px) {
  .hud-top-center {
    top: max(96px, calc(env(safe-area-inset-top) + 88px));
  }
}

.chase-tracker {
  background: rgba(220, 38, 38, 0.9);
  border: 2px solid #ffe047;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 0.84rem;
  text-align: center;
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.6);
  animation: pulseBorder 1.1s infinite alternate;
}

@keyframes pulseBorder {
  from { box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
  to { box-shadow: 0 0 28px rgba(0, 240, 255, 0.75); }
}

.toast-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.toast-pill {
  background: rgba(15, 8, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 4px solid var(--cyan);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  transition: opacity 0.3s ease, transform 0.3s ease;
  text-align: center;
}

.toast-pill.fade-out {
  opacity: 0;
  transform: translateY(-6px);
}

.hud-top-right {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.gta-stats-box {
  background: rgba(14, 7, 30, 0.84);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  border-radius: 14px;
  padding: 8px 14px;
  text-align: right;
  min-width: 158px;
}

.hud-cash {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: #4ade80;
  text-shadow: 0 2px 0 #052e16, 0 0 12px rgba(74, 222, 128, 0.45);
  line-height: 1.1;
}

.hud-substats {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  font-size: 0.76rem;
  color: #e2e8f0;
  margin: 3px 0;
}

.hud-stars {
  font-size: 1.05rem;
  letter-spacing: 2px;
}

.hud-stars .star {
  color: rgba(255, 255, 255, 0.18);
}

.hud-stars .star.lit {
  color: #ffe047;
  text-shadow: 0 0 10px #ff2e93;
}

.hud-quick-btns {
  display: flex;
  gap: 6px;
}

.hud-icon-btn {
  border: 1.5px solid var(--pink);
  background: rgba(20, 8, 38, 0.88);
  color: #ffffff;
  border-radius: 10px;
  padding: 6px 11px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.hud-icon-btn.cyan {
  border-color: var(--cyan);
}

.hud-bottom-left {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
}

.minimap-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#minimapCanvas {
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.65);
}

.district-pill {
  background: rgba(14, 7, 30, 0.88);
  border: 1px solid rgba(255, 46, 147, 0.55);
  color: #ff9ed2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.context-prompt {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
}

.ctx-action-btn {
  border: 2px solid var(--pink);
  background: rgba(18, 8, 36, 0.94);
  color: #ffffff;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 46, 147, 0.55);
  animation: bobUp 1s ease-in-out infinite alternate;
}

.ctx-action-btn.cyan {
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.5);
}

@keyframes bobUp {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

.hud-bottom-right {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.cam-btn {
  border-color: rgba(0, 240, 255, 0.55);
}

/* 3D Projected Floating Speech Bubbles */
.bubble-layer {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}

.bubble-3d {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: 260px;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(14, 7, 30, 0.9);
  border: 1.8px solid var(--cyan);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.32;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.bubble-3d.hero-bubble {
  max-width: 310px;
  font-size: 0.84rem;
  background: rgba(20, 8, 40, 0.94);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.65);
}

/* Neon 1986 Digital Speedometer */
.speedo-box {
  background: rgba(14, 7, 30, 0.88);
  border: 2px solid var(--cyan);
  border-radius: 14px;
  padding: 7px 14px;
  text-align: right;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  backdrop-filter: blur(8px);
}

.speedo-val {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.7);
}

.speedo-unit {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--pink);
  letter-spacing: 0.14em;
  font-weight: 700;
}

.speedo-car {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gold);
  margin-top: 2px;
  text-transform: uppercase;
}

.action-buttons-pad {
  display: flex;
  gap: 10px;
}

.action-circle {
  position: relative;
  overflow: hidden;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2.5px solid var(--pink);
  background: rgba(18, 8, 38, 0.88);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 46, 147, 0.42);
}

.action-circle.cyan {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.38);
}

.act-ico {
  font-size: 1.45rem;
  line-height: 1;
}

.act-txt {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0 4px;
}

.cd-overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100%;
  width: 0%;
  background: rgba(0, 0, 0, 0.58);
  pointer-events: none;
}

/* Mobile Touch Virtual Joystick */
.touch-joystick-wrap {
  display: none;
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  pointer-events: auto;
}

.joy-base {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(18, 8, 38, 0.56);
  border: 2px solid rgba(0, 240, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.joy-knob {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pink), #86198f);
  border: 2px solid #ffffff;
  box-shadow: 0 0 16px rgba(255, 46, 147, 0.7);
}

@media (pointer: coarse), (max-width: 820px) {
  .touch-joystick-wrap {
    display: block;
  }
  .hud-bottom-left {
    bottom: auto;
    top: 106px;
    left: 12px;
  }
  #minimapCanvas {
    width: 104px;
    height: 104px;
  }
  .district-pill {
    font-size: 0.58rem;
  }
}

/* =========================================
   MODALS: MISSIONS & BRICK PHONE
   ========================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 3, 18, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.mission-card {
  width: min(780px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 2px solid var(--accent, var(--pink));
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 0 42px color-mix(in srgb, var(--accent, var(--pink)) 35%, transparent), 0 24px 60px rgba(0,0,0,0.7);
}

.mission-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.mission-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: #ffffff;
  margin-right: 8px;
}

.mission-title-sm {
  font-family: var(--font-display);
  font-size: 0.96rem;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.cutscene-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: stretch;
}

.cutscene-portrait-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cutscene-portrait {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 14px;
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent);
}

.npc-portrait-box {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  border: 3px solid var(--accent);
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.12), #120824);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.npc-emoji {
  font-size: 4.2rem;
}

.npc-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.cutscene-text-wrap {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.speaker-pill {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.dialogue-text {
  font-size: 1.08rem;
  line-height: 1.55;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 14px;
  border-left: 4px solid var(--accent);
}

.dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.step-indicator {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Meters & Mini-Games */
.meter-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.meter-box {
  flex: 1;
  min-width: 210px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.meter-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.meter-fill.cyan { background: linear-gradient(90deg, #0ea5e9, #00f0ff); }
.meter-fill.pink { background: linear-gradient(90deg, #f97316, #ff2e93); }
.meter-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.meter-fill.gold { background: linear-gradient(90deg, #f59e0b, #ffe047); }

.perk-banner {
  background: rgba(255, 94, 153, 0.16);
  border: 1px solid rgba(255, 94, 153, 0.5);
  color: #ffc1de;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.scenario-box {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-left: 4px solid var(--accent);
}

.scenario-speaker {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--gold);
  margin-bottom: 5px;
}

.scenario-quote {
  font-size: 1rem;
  line-height: 1.48;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  text-align: left;
  background: rgba(28, 16, 54, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 15px;
  color: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease;
}

.choice-btn:hover {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  transform: translateX(4px);
}

.choice-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.choice-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan);
  font-weight: 700;
}

.choice-bonus {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 700;
}

.choice-label {
  font-size: 0.94rem;
  font-weight: 600;
}

.feedback-panel {
  background: rgba(0, 240, 255, 0.1);
  border: 1.5px solid var(--cyan);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feedback-panel p {
  line-height: 1.5;
  font-size: 0.96rem;
}

/* Prompt Surgery & Agent Builder Grids */
.sub-instruction {
  font-size: 0.9rem;
  color: #dbd6f2;
  margin-bottom: 12px;
  line-height: 1.42;
}

.terminal-preview {
  background: #090612;
  border: 1.5px solid rgba(0, 240, 255, 0.38);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #7dd3fc;
  white-space: pre-wrap;
  line-height: 1.48;
}

.terminal-preview.good-output {
  border-color: var(--green);
  color: #bbf7d0;
}

.terminal-preview pre {
  font-family: inherit;
  white-space: pre-wrap;
}

.term-head {
  font-size: 0.68rem;
  color: var(--pink);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 700;
}

.comment-strip {
  font-size: 0.86rem;
  color: var(--gold);
  margin-bottom: 12px;
  font-weight: 600;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.module-card {
  text-align: left;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(25, 14, 48, 0.88);
  color: #ffffff;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.module-card:hover {
  border-color: var(--cyan);
}

.module-card.picked {
  border-color: var(--green);
  background: rgba(52, 211, 153, 0.16);
}

.module-card.trap-picked {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
}

.module-title {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.trap-hint {
  color: #f87171;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.scope-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.14);
  color: var(--cyan);
  margin-bottom: 5px;
}

.module-snippet {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.34;
}

.guardrail-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 190, 59, 0.12);
  border: 1.5px solid rgba(255, 190, 59, 0.48);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 0.86rem;
  cursor: pointer;
}

.guardrail-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.agent-log {
  min-height: 170px;
}

.log-line {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  animation: fadeSlide 0.25s ease;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.finale-hero-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.finale-avatar {
  width: 74px;
  height: 74px;
  border-radius: 14px;
  border: 3px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}

.modal-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.retry-card {
  text-align: center;
}

.retry-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #f87171;
  margin-bottom: 10px;
}

.retry-desc {
  font-size: 0.98rem;
  color: #e2e8f0;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* =========================================
   1986 HELLO AI BRICK PHONE
   ========================================= */
.phone-shell {
  width: min(680px, 95vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1b0e36 0%, #100721 100%);
  border: 2.5px solid var(--cyan);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 0 42px rgba(0, 240, 255, 0.3);
}

.phone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255, 46, 147, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.phone-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--cyan);
}

.phone-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
}

.phone-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ptab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 11px 6px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.ptab.active {
  color: #ffffff;
  border-bottom-color: var(--pink);
  background: rgba(255, 46, 147, 0.12);
}

.phone-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.phone-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-mission-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.phone-mission-row.done {
  border-color: rgba(52, 211, 153, 0.45);
}

.pm-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: #120824;
  flex-shrink: 0;
}

.pm-info {
  flex: 1;
}

.pm-title {
  font-weight: 800;
  font-size: 0.9rem;
}

.pm-sub {
  font-size: 0.74rem;
  color: var(--cyan);
  margin: 2px 0;
}

.pm-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

.crew-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crew-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}

.crew-card.active-crew {
  border-color: var(--accent);
}

.crew-photo {
  width: 82px;
  height: 112px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.crew-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.crew-role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #ffffff;
  margin-left: 6px;
}

.crew-tag {
  font-size: 0.8rem;
  color: #e2e8f0;
  margin: 4px 0;
}

.crew-perk {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.artifact-header-note {
  font-size: 0.84rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.artifact-item {
  display: flex;
  gap: 9px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.artifact-item.got {
  border-color: rgba(255, 224, 71, 0.55);
  background: rgba(255, 190, 59, 0.09);
}

.art-icon {
  font-size: 1.35rem;
}

.art-name {
  font-weight: 700;
  font-size: 0.82rem;
}

.art-desc {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}

.share-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rank-showcase {
  text-align: center;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 46, 147, 0.2), rgba(0, 240, 255, 0.15));
  border: 1.5px solid var(--pink);
}

.rank-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--cyan);
}

.rank-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  margin: 4px 0 8px;
}

.rank-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 700;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.share-feedback {
  font-size: 0.84rem;
  color: var(--green);
  text-align: center;
  min-height: 20px;
}

.radio-tuner-box {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 12px;
}

.tuner-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--cyan);
  margin-bottom: 8px;
}

.tuner-btns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.tuner-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(16, 8, 34, 0.8);
  color: #ffffff;
  padding: 8px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.tuner-btn.active {
  border-color: var(--pink);
  background: rgba(255, 46, 147, 0.26);
}

.reset-row {
  text-align: right;
}

/* =========================================
   GTA MISSION PASSED / BUSTED BANNER
   ========================================= */
.banner-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gta-banner {
  text-align: center;
  padding: 26px 42px;
  border-radius: 18px;
  background: rgba(12, 5, 24, 0.92);
  border-top: 4px solid var(--bcolor);
  border-bottom: 4px solid var(--bcolor);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  animation: bannerPop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@keyframes bannerPop {
  from { opacity: 0; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1); }
}

.banner-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  color: var(--bcolor);
  text-shadow: 0 4px 0 #000, 0 0 28px var(--bcolor);
}

.banner-sub {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #ffffff;
  margin-top: 6px;
}

.banner-detail {
  font-size: 0.92rem;
  color: var(--gold);
  margin-top: 6px;
  font-weight: 700;
}

/* =========================================
   RESPONSIVE ADJUSTMENTS (PHONES / SMALL)
   ========================================= */
@media (max-width: 720px) {
  .splash-crew-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .splash-char-card {
    flex-direction: row;
    align-items: center;
  }
  .char-img-frame {
    width: 96px;
    height: 108px;
    flex-shrink: 0;
    border-bottom: none;
    border-right: 3px solid var(--accent);
  }
  .cutscene-body {
    grid-template-columns: 1fr;
  }
  .cutscene-portrait {
    max-height: 190px;
    width: 150px;
  }
  .card-grid, .artifact-grid {
    grid-template-columns: 1fr;
  }
  .slot-meta {
    display: none;
  }
  .crew-slot {
    padding: 4px;
  }
  .gta-stats-box {
    min-width: 120px;
    padding: 6px 10px;
  }
  .hud-cash {
    font-size: 1.05rem;
  }
}
