/* ==========================================================================
   BHARAT OPEN WORLD: GTA 5 STYLE AAA GAME STYLESHEET
   Tactical Military Glassmorphism, GTA 5 Circular Radar, Weapon HUD & Dialogue
   ========================================================================== */

:root {
  --bg-dark: #060911;
  --bg-card: rgba(13, 18, 30, 0.92);
  --bg-glass: rgba(10, 15, 26, 0.85);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-tactical: rgba(245, 158, 11, 0.45);

  --gta-green: #22c55e;
  --gta-blue: #3b82f6;
  --gta-yellow: #eab308;
  --gta-gold: #f59e0b;
  --gta-saffron: #ff9933;
  --gta-red: #ef4444;
  --gta-cyan: #38bdf8;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;

  --font-display: 'Chakra Petch', 'Impact', sans-serif;
  --font-heading: 'Rajdhani', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--color-text);
  touch-action: none;
}

#game-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#game-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ==========================================================================
   IN-GAME HUD OVERLAY
   ========================================================================== */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hidden {
  display: none !important;
}

/* --- TOP HUD BAR --- */
#hud-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(5, 8, 15, 0.94) 0%, rgba(5, 8, 15, 0.4) 80%, transparent 100%);
  pointer-events: auto;
}

.top-left-status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-chip {
  background: var(--bg-glass);
  border: 1px solid var(--border-tactical);
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gta-gold);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.2);
  backdrop-filter: blur(10px);
}

/* Wanted Stars */
.wanted-stars-container {
  display: flex;
  gap: 4px;
  background: rgba(10, 15, 26, 0.7);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wanted-stars-container .star {
  font-size: 18px;
  color: #475569;
}

.wanted-stars-container .star.active-star {
  color: #fbbf24;
  text-shadow: 0 0 10px #f59e0b;
}

/* Center Mission HUD Card */
.top-center-status {
  display: flex;
  align-items: center;
}

#mission-hud-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 8px 18px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  max-width: 520px;
}

.mission-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gta-saffron);
  box-shadow: 0 0 10px var(--gta-saffron);
  animation: pulse-dot 1.5s infinite;
}

.mission-text-group {
  display: flex;
  flex-direction: column;
}

.mission-hdr {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--gta-cyan);
  letter-spacing: 0.5px;
}

.mission-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.mission-dist-badge {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gta-gold);
  border-left: 1px solid var(--border-glass);
  padding-left: 12px;
}

/* Top Right Actions & Cash */
.top-right-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cash-counter {
  font-family: var(--font-display);
  font-size: 26px;
  color: #34d399;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
  padding: 2px 10px;
}

.top-action-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--color-text);
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.top-action-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--gta-cyan);
  transform: translateY(-1px);
}

/* --- WEAPONS HUD (TOP RIGHT CORNER BENEATH HEADER) --- */
#weapon-hud-display {
  position: absolute;
  top: 75px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 15, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.weapon-ico {
  font-size: 26px;
}

.weapon-details {
  display: flex;
  flex-direction: column;
}

.weapon-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--gta-gold);
}

.weapon-ammo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

/* --- GTA 5 BOTTOM-LEFT CIRCULAR RADAR --- */
#gta-radar-wrapper {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: auto;
}

.radar-bezel {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #080d1a;
  border: 4px solid #1e293b;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

#radar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.radar-north-pointer {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
}

.vitals-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 160px;
  margin-top: 6px;
}

.vital-bar {
  width: 100%;
  height: 7px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.health-bar .vital-fill {
  height: 100%;
  background: var(--gta-green);
  box-shadow: 0 0 6px var(--gta-green);
  transition: width 0.2s ease;
}

.armor-bar .vital-fill {
  height: 100%;
  background: var(--gta-blue);
  box-shadow: 0 0 6px var(--gta-blue);
  transition: width 0.2s ease;
}

.stamina-bar .vital-fill {
  height: 100%;
  background: var(--gta-yellow);
  box-shadow: 0 0 6px var(--gta-yellow);
  transition: width 0.1s linear;
}

/* --- DIALOGUE SUBTITLES BOX (BOTTOM CENTER) --- */
#dialogue-box {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 8, 15, 0.94);
  border: 1px solid var(--gta-gold);
  padding: 12px 28px;
  border-radius: 30px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: #f1f5f9;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
  max-width: 680px;
  text-align: center;
  pointer-events: none;
  z-index: 25;
}

/* --- TOAST ALERTS --- */
#hud-toast {
  position: absolute;
  top: 145px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--gta-cyan);
  padding: 8px 22px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 100;
}

.toast-hidden {
  opacity: 0;
  transform: translate(-50%, -10px) !important;
  pointer-events: none;
}

/* --- MOBILE TOUCH CONTROLS --- */
#mobile-controls-container {
  position: absolute;
  bottom: 24px;
  left: 200px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.mobile-touch-cluster {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.dpad-middle-row {
  display: flex;
  gap: 32px;
}

.dpad-btn {
  width: 60px;
  height: 60px;
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 12px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  touch-action: manipulation;
}

.dpad-btn:active, .dpad-btn.active-touch {
  background: rgba(56, 189, 248, 0.4);
  border-color: var(--gta-cyan);
  transform: scale(0.94);
}

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

.touch-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.touch-pill:active {
  transform: scale(0.95);
  background: rgba(245, 158, 11, 0.3);
}

.sprint-pill { color: var(--gta-yellow); border-color: rgba(234, 179, 8, 0.4); }
.fire-pill { color: #f87171; border-color: rgba(239, 68, 68, 0.5); }

/* In-Vehicle Speedometer Cluster */
#vehicle-speedo-cluster {
  margin-bottom: 8px;
}

.speedo-dial-box {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.speedo-svg {
  transform: rotate(-90deg);
}

.speedo-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 10;
}

.speedo-fill {
  fill: none;
  stroke: var(--gta-cyan);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 390;
  stroke-dashoffset: 390;
  transition: stroke-dashoffset 0.15s ease-out;
}

.speedo-text-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speedo-digits {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

.speedo-unit {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  color: var(--gta-cyan);
}

.action-circle-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--gta-gold);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.action-circle-btn .ico { font-size: 24px; }
.action-circle-btn .lbl { font-family: var(--font-heading); font-size: 11px; font-weight: 700; color: var(--gta-gold); }

/* ==========================================================================
   MODAL WINDOWS & MENUS
   ========================================================================== */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.menu-dialog, .pause-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(245, 158, 11, 0.18);
  overflow: hidden;
  animation: slide-up 0.3s ease-out;
}

.menu-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #080c14 100%);
  border-bottom: 2px solid var(--gta-saffron);
  padding: 30px 36px 22px;
}

.game-badge {
  display: inline-block;
  background: rgba(255, 153, 51, 0.18);
  border: 1px solid var(--gta-saffron);
  color: var(--gta-saffron);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.game-title {
  font-family: var(--font-display);
  font-size: 54px;
  line-height: 0.95;
  letter-spacing: 2px;
  color: #ffffff;
}

.game-title span {
  color: var(--gta-gold);
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

.game-subtitle {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-top: 6px;
}

.menu-body {
  padding: 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(11, 16, 27, 0.6);
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.input-wrapper input {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glass);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  outline: none;
}

.mode-selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mode-card {
  background: rgba(11, 18, 30, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.mode-card.active-mode {
  border-color: var(--gta-gold);
  background: rgba(15, 25, 45, 0.9);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.15);
}

.mode-card h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.mode-card p {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
}

.btn-play-mode {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gta-gold) 0%, #d97706 100%);
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-play-mode:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-play-mode.live-accent {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .mode-selection-grid { grid-template-columns: 1fr; }
  #mobile-controls-container { left: 160px; }
  .mission-sub { display: none; }
}

@media (max-width: 600px) {
  #mobile-controls-container { left: 140px; }
  .dpad-btn { width: 48px; height: 48px; font-size: 18px; }
  .action-circle-btn { width: 62px; height: 62px; }
}
