@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-dark: #0a0c13;
  --bg-card: rgba(18, 22, 34, 0.88);
  --border-glass: rgba(255, 255, 255, 0.14);
  --primary: #f59e0b;
  --primary-glow: rgba(245, 158, 11, 0.4);
  --sign-green: #008744;
  --accent-cyan: #06b6d4;
  --danger: #ef4444;
  --success: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: 'Cairo', 'Outfit', sans-serif;
  color: var(--text-main);
  direction: rtl;
  touch-action: manipulation;
  -webkit-overflow-scrolling: touch;
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #1b2234 0%, #0a0c13 100%);
  touch-action: manipulation;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  outline: none;
  touch-action: none;
}

/* Header */
.web-header {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 500;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.brand-tag {
  background: rgba(18, 22, 34, 0.85);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-main);
  backdrop-filter: blur(8px);
}

.wallet-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.camera-hint-badge {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: #38bdf8;
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
  cursor: grab;
  transition: all 0.2s;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.camera-hint-badge:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.control-btn {
  background: rgba(18, 22, 34, 0.85);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}

.control-btn:hover {
  background: rgba(30, 38, 58, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* In-Game HUD */
#in-game-hud {
  position: absolute;
  top: 60px;
  left: 16px;
  right: 16px;
  bottom: 16px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 300;
}

.hud-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 8px 16px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  pointer-events: auto;
  align-self: flex-start;
  max-width: 100%;
  flex-wrap: wrap;
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hud-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  direction: ltr;
  text-align: right;
}

.hud-val.highlight {
  color: var(--accent-cyan);
}

.health-box {
  min-width: 120px;
}

.health-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 3px;
}

.health-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--success));
  border-radius: 999px;
  transition: width 0.2s;
}

.pause-pill-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 10px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.pause-pill-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Speedometer Cluster */
.hud-gauge-cluster {
  align-self: center;
  pointer-events: none;
  margin-bottom: 12px;
}

.speed-cluster {
  background: var(--bg-card);
  border: 1.5px solid var(--border-glass);
  padding: 10px 24px;
  border-radius: 24px;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.speed-number {
  font-size: 2.8rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
  color: #fff;
  letter-spacing: -1px;
}

.speed-unit {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Cairo', sans-serif;
}

.gear-rpm-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.gear-badge {
  background: var(--primary);
  color: #000;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
}

.rpm-track {
  width: 110px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.rpm-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  border-radius: 999px;
  transition: width 0.05s;
}

/* ========================================================================= */
/* Authentic 250 KM/H Speedometer (Bottom-Left)                             */
/* ========================================================================= */
.speedometer-container {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 195px;
  height: 195px;
  z-index: 500;
  pointer-events: none;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.75));
  transition: transform 0.2s;
}

#speedo-needle-group {
  pointer-events: none;
}

#speedo-active-arc {
  transition: stroke-dasharray 0.08s ease-out;
}

/* ========================================================================= */
/* Vertical Pedals Stack (Mid-Left)                                         */
/* ========================================================================= */
.pedals-vertical-stack {
  position: absolute;
  bottom: 18px;
  left: 225px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
  pointer-events: auto;
}

/* ========================================================================= */
/* Vertical Pedals Stack (Mid-Left)                                         */
/* Real Automotive Gas Pedal (▲), Handbrake Lever (P), and Brake Pedal (▼)  */
/* ========================================================================= */
.pedals-vertical-stack {
  position: absolute;
  bottom: 18px;
  left: 225px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 500;
  pointer-events: auto;
}

.pedal-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 195px;
  height: 60px;
  padding: 6px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.94) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.18), inset 0 -2px 6px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pedal-treads {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background: repeating-linear-gradient(0deg, #ffffff 0px, #ffffff 2px, transparent 2px, transparent 6px);
  pointer-events: none;
  border-radius: 14px;
}

.pedal-visual-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.pedal-svg-icon {
  width: 36px;
  height: 36px;
  transition: transform 0.12s ease;
}

.pedal-content {
  display: flex;
  flex-direction: column;
  text-align: right;
  flex: 1;
  z-index: 2;
}

.pedal-main-text {
  font-family: 'Cairo', sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.pedal-sub-text {
  font-family: 'Cairo', sans-serif;
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.25;
}

.pedal-glow-strip {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 5px;
  background: rgba(255, 255, 255, 0.2);
  transition: width 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

/* 1. Gas Pedal Theme (دواسة بنزين بسهم أمامي) */
.pedal-action-btn.pedal-gas {
  border-color: rgba(16, 185, 129, 0.35);
}
.pedal-action-btn.pedal-gas:hover {
  border-color: rgba(16, 185, 129, 0.75);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.25);
}
.pedal-action-btn.pedal-gas:active, .pedal-action-btn.pedal-gas.active {
  transform: scale(0.96) translateY(3px);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-color: #10b981;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5), inset 0 0 14px rgba(16, 185, 129, 0.35);
}
.pedal-action-btn.pedal-gas:active .pedal-svg-icon,
.pedal-action-btn.pedal-gas.active .pedal-svg-icon {
  transform: translateY(-2px) scale(1.08);
}
.pedal-action-btn.pedal-gas:active .pedal-glow-strip,
.pedal-action-btn.pedal-gas.active .pedal-glow-strip {
  width: 7px;
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
}

/* 2. Handbrake Lever Theme (شكل هاند بريك) */
.pedal-action-btn.pedal-handbrake {
  border-color: rgba(249, 115, 22, 0.4);
}
.pedal-action-btn.pedal-handbrake:hover {
  border-color: rgba(249, 115, 22, 0.8);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.35);
}
.pedal-action-btn.pedal-handbrake:active, .pedal-action-btn.pedal-handbrake.active {
  transform: scale(0.96) translateY(-2px);
  background: linear-gradient(135deg, rgba(154, 52, 18, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-color: #f97316;
  box-shadow: 0 4px 22px rgba(249, 115, 22, 0.65), inset 0 0 16px rgba(249, 115, 22, 0.4);
}
.pedal-action-btn.pedal-handbrake:active .pedal-svg-icon,
.pedal-action-btn.pedal-handbrake.active .pedal-svg-icon {
  transform: rotate(-6deg) scale(1.1);
}
.pedal-action-btn.pedal-handbrake:active .pedal-glow-strip,
.pedal-action-btn.pedal-handbrake.active .pedal-glow-strip {
  width: 7px;
  background: #f97316;
  box-shadow: 0 0 14px #f97316;
}

/* 3. Brake Pedal Theme (دواسة فرامل بسهم خلفي) */
.pedal-action-btn.pedal-brake {
  border-color: rgba(239, 68, 68, 0.4);
}
.pedal-action-btn.pedal-brake:hover {
  border-color: rgba(239, 68, 68, 0.8);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.3);
}
.pedal-action-btn.pedal-brake:active, .pedal-action-btn.pedal-brake.active {
  transform: scale(0.96) translateY(3px);
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-color: #ef4444;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.55), inset 0 0 14px rgba(239, 68, 68, 0.35);
}
.pedal-action-btn.pedal-brake:active .pedal-svg-icon,
.pedal-action-btn.pedal-brake.active .pedal-svg-icon {
  transform: translateY(2px) scale(1.08);
}
.pedal-action-btn.pedal-brake:active .pedal-glow-strip,
.pedal-action-btn.pedal-brake.active .pedal-glow-strip {
  width: 7px;
  background: #ef4444;
  box-shadow: 0 0 12px #ef4444;
}

/* Reverse Mode Active Theme (Clean white/silver illumination) */
.pedal-action-btn.pedal-brake.reverse-mode {
  border-color: rgba(255, 255, 255, 0.5);
}
.pedal-action-btn.pedal-brake.reverse-mode:hover {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
}
.pedal-action-btn.pedal-brake.reverse-mode:active,
.pedal-action-btn.pedal-brake.reverse-mode.active {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-color: #f8fafc;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.4), inset 0 0 14px rgba(255, 255, 255, 0.3);
}
.pedal-action-btn.pedal-brake.reverse-mode:active .pedal-glow-strip,
.pedal-action-btn.pedal-brake.reverse-mode.active .pedal-glow-strip {
  width: 7px;
  background: #ffffff;
  box-shadow: 0 0 14px #ffffff;
}

/* Dynamic Drift & Donut (خمساية) Indicator Banner */
.hud-drift-banner {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.92), rgba(220, 38, 38, 0.95));
  border: 2px solid #f97316;
  box-shadow: 0 0 35px rgba(249, 115, 22, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  color: #fff;
  z-index: 600;
  pointer-events: none;
  animation: driftBannerPulse 0.45s infinite alternate ease-in-out;
  transition: opacity 0.2s, transform 0.2s;
}
.hud-drift-banner.hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.85);
  pointer-events: none;
}
@keyframes driftBannerPulse {
  0% { transform: translateX(-50%) scale(1.0); }
  100% { transform: translateX(-50%) scale(1.05); box-shadow: 0 0 50px rgba(239, 68, 68, 0.95); }
}
.drift-fire {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px #f97316);
}
.drift-info {
  display: flex;
  flex-direction: column;
  text-align: center;
}
.drift-title {
  font-family: 'Cairo', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  letter-spacing: 0.5px;
  color: #fff;
}
.drift-sub {
  font-family: 'Cairo', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fed7aa;
}

/* ========================================================================= */
/* Interactive Sports Steering Wheel (Bottom-Right)                          */
/* ========================================================================= */
.steering-wheel-container {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 185px;
  height: 185px;
  z-index: 500;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}

.steering-wheel-disc {
  width: 100%;
  height: 100%;
  cursor: grab;
  transform-origin: 50% 50%;
  will-change: transform;
}

.steering-wheel-disc:active {
  cursor: grabbing;
}

.wheel-horn-hub {
  cursor: pointer;
  transform-origin: 100px 100px;
  transition: transform 0.08s ease, filter 0.08s ease;
  pointer-events: auto;
}

.wheel-horn-hub:hover .horn-outer-ring {
  stroke: #f59e0b;
}

.wheel-horn-hub:active,
.wheel-horn-hub.horn-pressed {
  transform: scale(0.92);
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.75));
}

.wheel-horn-hub.horn-pressed .horn-outer-ring {
  stroke: #fbbf24;
  stroke-width: 3.5px;
}

.wheel-horn-hub.horn-pressed .horn-inner-disc {
  fill: #1f1b0a;
}

.wheel-touch-arrow {
  position: absolute;
  bottom: -4px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.15s;
}
.wheel-touch-arrow.left {
  left: -8px;
}
.wheel-touch-arrow.right {
  right: -8px;
}
.wheel-touch-arrow:hover, .wheel-touch-arrow:active {
  background: rgba(245, 158, 11, 0.35);
  border-color: #f59e0b;
}

/* Mobile & Tablet Responsive Layout */
@media (max-width: 960px) {
  .speedometer-container {
    width: 155px;
    height: 155px;
    bottom: 12px;
    left: 12px;
  }
  .pedals-vertical-stack {
    left: 175px;
    bottom: 12px;
    gap: 6px;
  }
  .pedal-action-btn {
    width: 155px;
    height: 52px;
    padding: 4px 10px;
    border-radius: 14px;
    gap: 8px;
  }
  .pedal-visual-art {
    width: 32px;
    height: 32px;
  }
  .pedal-svg-icon {
    width: 30px;
    height: 30px;
  }
  .pedal-main-text {
    font-size: 0.88rem;
  }
  .pedal-sub-text {
    font-size: 0.60rem;
  }
  .steering-wheel-container {
    width: 155px;
    height: 155px;
    bottom: 12px;
    right: 12px;
  }
}

/* Screen Touch Steering Overlay Layer */
.screen-touch-steer-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto; /* Handles touches/clicks directly */
  touch-action: none;
  z-index: 250; /* Sits over canvas, under modals & HUD badges */
  display: flex;
}

.touch-zone-guide {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  user-select: none;
}

.touch-zone-guide.left {
  background: radial-gradient(circle at 10% 50%, rgba(56, 189, 248, 0.16) 0%, transparent 60%);
}

.touch-zone-guide.right {
  background: radial-gradient(circle at 90% 50%, rgba(245, 158, 11, 0.16) 0%, transparent 60%);
}

.screen-touch-steer-layer.touch-active-left .touch-zone-guide.left {
  opacity: 1;
}

.screen-touch-steer-layer.touch-active-right .touch-zone-guide.right {
  opacity: 1;
}

.touch-hint-icon {
  font-size: 2.2rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.8));
  animation: pulseTouchArrow 1.2s infinite ease-in-out;
}

.touch-hint-text {
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: rgba(15, 23, 42, 0.75);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}

@keyframes pulseTouchArrow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

@media (max-width: 768px) {
  /* In mobile view, the top bar must be a sleek single row of pills */
  .web-header {
    top: 6px !important;
    left: 8px !important;
    right: 8px !important;
    height: 32px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 4px !important;
  }
  .header-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    max-width: 78% !important;
  }
  .header-right::-webkit-scrollbar {
    display: none !important;
  }
  .header-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }
  .brand-tag {
    display: none !important; /* Hide giant model tag on mobile to free the sky */
  }
  .wallet-badge, .control-btn, .online-indicator-badge, .garage-btn {
    padding: 3px 8px !important;
    font-size: 0.70rem !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    height: 28px !important;
    box-sizing: border-box !important;
  }
  #btn-open-garage {
    padding: 3px 8px !important;
  }

  /* When driving in-game, automatically hide pre-game buttons to completely clear view */
  body.in-game-running .web-header #btn-open-account-modal,
  body.in-game-running .web-header #btn-open-garage,
  body.in-game-running .web-header #sound-btn,
  body.in-game-running .web-header #fullscreen-btn {
    display: none !important;
  }

  #in-game-hud {
    top: 40px !important;
    left: 8px !important;
    right: 8px !important;
  }
  .hud-top-bar {
    padding: 3px 8px !important;
    gap: 6px !important;
    border-radius: 10px !important;
    background: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
    box-sizing: border-box !important;
  }
  .hud-item {
    gap: 1px !important;
  }
  .hud-label {
    font-size: 0.60rem !important;
  }
  .hud-val {
    font-size: 0.78rem !important;
  }
  .health-box {
    min-width: 70px !important;
  }
  .pause-pill-btn {
    padding: 3px 7px !important;
    font-size: 0.68rem !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 640px) {
  .pedals-vertical-stack {
    left: auto !important;
    right: 12px !important;
    bottom: 175px !important;
  }
  .speedometer-container {
    bottom: 12px !important;
    left: 12px !important;
  }
  .steering-wheel-container {
    bottom: 12px !important;
    right: 12px !important;
  }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1200;
  animation: fadeIn 0.3s ease;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  padding: 20px 10px 40px 10px;
  box-sizing: border-box;
}

.modal-card {
  width: 92%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-glass);
  border-radius: 24px;
  padding: 30px 22px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 40px var(--primary-glow);
  animation: slideUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  margin: auto 0;
}

.highway-sign-banner {
  display: inline-block;
  background: var(--sign-green);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 6px 18px;
  border-radius: 8px;
  border: 2px solid #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 135, 68, 0.5);
}

.highway-sign-banner.danger {
  background: var(--danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.score-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cell-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cell-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  direction: ltr;
}

.cell-val.cash {
  color: var(--primary);
}

.server-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 20px;
}

.server-badge.verified {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--success);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  background: linear-gradient(180deg, rgba(10, 12, 19, 0.96) 0%, rgba(18, 22, 34, 0.98) 100%);
  z-index: 1000;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  padding: 20px 12px 100px 12px;
  box-sizing: border-box;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-card {
  width: 95%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), 0 0 40px var(--primary-glow);
  margin: auto 0;
  max-height: none;
  overflow: visible;
  touch-action: pan-y !important;
}

.start-driving-pulse-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: 2px solid #34d399 !important;
  color: #ffffff !important;
  font-size: 1.18rem !important;
  font-weight: 900 !important;
  padding: 14px 24px !important;
  border-radius: 16px !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6), 0 4px 15px rgba(0, 0, 0, 0.5) !important;
  cursor: pointer !important;
  letter-spacing: 0.5px !important;
  animation: startPulse 2s infinite ease-in-out;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.start-driving-pulse-btn:hover, .start-driving-pulse-btn:active {
  transform: scale(1.02);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.85) !important;
}

@keyframes startPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), 0 4px 15px rgba(0,0,0,0.5);
  }
  50% {
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.85), 0 4px 20px rgba(16, 185, 129, 0.4);
  }
}

.game-logo {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #fde68a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.game-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.highway-badge {
  display: inline-block;
  background: var(--sign-green);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 14px;
  border-radius: 6px;
  border: 2px solid #fff;
  margin-bottom: 24px;
}

.progress-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #06b6d4);
  border-radius: 999px;
  transition: width 0.3s ease;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.8);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  direction: ltr;
}

.server-status {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ========================================================================= */
/* Highway Overhead Sign Modal & Management UI                               */
/* ========================================================================= */
.control-btn.sign-btn {
  background: rgba(0, 135, 68, 0.25);
  border-color: rgba(0, 135, 68, 0.6);
  color: #4ade80;
}
.control-btn.sign-btn:hover {
  background: rgba(0, 135, 68, 0.5);
  border-color: #4ade80;
}

.modal-card.modal-sign {
  max-width: 680px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px;
}

.sign-specs-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 20px;
  text-align: right;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.specs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.specs-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
}

.specs-badge {
  background: #10b981;
  color: #000;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .specs-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.spec-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.spec-card.highlight {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
}

.spec-label {
  font-size: 0.70rem;
  color: var(--text-muted);
}

.spec-val {
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  direction: ltr;
}

.spec-card.highlight .spec-val {
  color: var(--primary);
}

.spec-sub {
  font-size: 0.65rem;
  color: #94a3b8;
}

.spec-tip {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 8px;
  border-right: 3px solid var(--primary);
}

/* Sign Preview Section */
.sign-preview-section {
  margin-bottom: 20px;
  text-align: right;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sign-frame-container {
  width: 100%;
  aspect-ratio: 4 / 1;
  background: #020617;
  border: 3px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 135, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sign-frame-bezel {
  width: 100%;
  height: 100%;
  border: 2px solid #eab308;
  position: relative;
}

.sign-frame-bezel img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.sign-detected-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
}

/* File Dropzone */
.file-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.08);
}

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

.dropzone-icon {
  font-size: 2rem;
}

.dropzone-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sign-form-row {
  margin-bottom: 12px;
}

.sign-text-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.sign-text-input:focus {
  border-color: var(--primary);
}

.sign-upload-status {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.sign-upload-status.success {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success);
  color: #34d399;
}

.sign-upload-status.error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--danger);
  color: #f87171;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* ========================================================================== */
/* Online Presence & Player Account Modal Styles                             */
/* ========================================================================== */

.online-indicator-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

.pulse-green {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #10b981; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.control-btn.profile-btn {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  font-weight: 800;
}

.control-btn.profile-btn:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: #60a5fa;
  color: #fff;
}


.modal-card.modal-account {
  max-width: 640px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 22px;
}

.player-info-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 20px;
  text-align: right;
}

.player-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.player-avatar {
  width: 52px;
  height: 52px;
  background: rgba(59, 130, 246, 0.2);
  border: 1.5px solid rgba(59, 130, 246, 0.5);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.player-details {
  flex: 1;
  text-align: right;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.player-active-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #f8fafc;
}

.account-type-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.account-type-badge.guest {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.account-type-badge.phone {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.player-phone-val {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
}

.player-balance-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 8px 14px;
  border-radius: 12px;
  text-align: center;
}

.player-balance-box .bal-label {
  display: block;
  font-size: 0.72rem;
  color: #fbbf24;
  font-weight: 700;
}

.player-balance-box .bal-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 900;
  color: #f59e0b;
}

.device-recognition-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
}

.device-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.device-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

@media (max-width: 550px) {
  .device-specs-grid {
    grid-template-columns: 1fr;
  }
}

.device-spec-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.device-spec-item .spec-k {
  color: #94a3b8;
  display: block;
  margin-bottom: 2px;
}

.device-spec-item .spec-v {
  color: #e2e8f0;
  font-weight: 700;
}

.code-font {
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.online-text {
  color: #34d399 !important;
}

.device-note {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.5;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.phone-auth-container {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  text-align: right;
}

.form-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 14px;
}

.phone-input-group {
  margin-bottom: 12px;
}

.phone-input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.phone-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.phone-input-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.phone-prefix {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.phone-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 14px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.phone-auth-status {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 10px;
}

.phone-auth-status.success {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success);
  color: #34d399;
}

.phone-auth-status.error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--danger);
  color: #f87171;
}

/* ========================================================================== */
/* Single Player vs Multiplayer Mode Selector & 3D Floating Nametags          */
/* ========================================================================== */
.mode-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.mode-select-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: right;
  transition: all 0.22s ease;
  color: #e2e8f0;
}

.mode-select-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.mode-select-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.mode-select-btn.active .mode-title {
  color: #38bdf8;
  font-weight: 800;
}

.mode-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.mode-text {
  display: flex;
  flex-direction: column;
}

.mode-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
}

.mode-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
}

.nametag-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 20px;
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* 3D Floating Player Nametags in Scene */
#multiplayer-nametags-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}

.player-nametag {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  pointer-events: none;
  user-select: none;
  transition: opacity 0.12s ease;
  will-change: transform, left, top;
  z-index: 65;
}

.nametag-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 12px;
  background: rgba(10, 16, 30, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid #00f0ff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 240, 255, 0.55);
  color: #ffffff;
  font-family: 'Cairo', 'Outfit', sans-serif;
  white-space: nowrap;
}

.nametag-pill.is-me {
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 18px rgba(245, 158, 11, 0.45);
}

.nametag-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding-bottom: 2px;
  width: 100%;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nametag-badge-real {
  color: #10b981;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nametag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
  animation: pulseDot 1.2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.nametag-body {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.nametag-name {
  font-size: 0.88rem;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.nametag-speed {
  font-size: 0.70rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.nametag-dist {
  font-size: 0.66rem;
  font-weight: 700;
  color: #a7f3d0;
  margin-top: 1px;
}

.nametag-arrow {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid #00f0ff;
  margin: 0 auto;
  filter: drop-shadow(0 2px 6px rgba(0, 240, 255, 0.5));
}

.nametag-pill.is-me + .nametag-arrow {
  border-top-color: #f59e0b;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.5));
}

/* In-Game Multiplayer Encounter Toast */
.mp-encounter-pill {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #00f0ff;
  border-radius: 30px;
  padding: 8px 20px;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
  pointer-events: none;
  animation: slideDownToast 0.35s ease;
  white-space: nowrap;
}

@keyframes slideDownToast {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}


