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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0b1020;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  color: #f8fafc;
  -webkit-tap-highlight-color: transparent;
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 1;
  touch-action: none;
}

#canvas-container canvas {
  display: block;
  touch-action: none;
}

/* ===== 《网上来宾 | LAIBIN ONLINE》 启动界面（对标网上南宁居民卡质感） ===== */
#welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(125deg, rgba(10, 15, 30, 0.76) 0%, rgba(15, 23, 42, 0.50) 55%, rgba(10, 15, 30, 0.82) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

#welcome-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-layout {
  width: min(92vw, 760px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border-radius: 24px;
  background: rgba(11, 16, 30, 0.82);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62);
}

.start-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.start-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.48);
  color: #6ee7b7;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
}

.start-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.start-logo-badge {
  width: 82px;
  height: 65px;
  object-fit: contain;
  background: #fafbfc;
  padding: 5px 7px;
  border-radius: 14px;
  border: 1.5px solid rgba(45, 212, 191, 0.55);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.28);
  flex-shrink: 0;
}

.rc-logo-mini {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
  background: #ffffff;
  padding: 1px;
}

.mini-logo-img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
  background: #fafbfc;
  padding: 2px;
  border: 1px solid rgba(45, 212, 191, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.start-title {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 4px 18px rgba(56, 189, 248, 0.35);
}

.start-title span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #38bdf8;
  margin-top: 4px;
}

.start-desc {
  font-size: 13px;
  line-height: 1.65;
  color: #cbd5e1;
}

.start-btns {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

.btn-main {
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #0b1120;
  background: linear-gradient(135deg, #34d399, #38bdf8);
  box-shadow: 0 8px 22px rgba(56, 189, 248, 0.34);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-main:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn-sub-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-ghost {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(30, 41, 59, 0.72);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  background: rgba(51, 65, 85, 0.92);
  border-color: rgba(56, 189, 248, 0.55);
}

/* 网上来宾居民卡 */
.resident-card {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(155deg, #f8fafc, #e2e8f0);
  color: #0f172a;
  border: 2px solid #0f172a;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.rc-header {
  background: linear-gradient(90deg, #0284c7, #0d9488);
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.rc-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 6px;
  font-size: 12px;
}

.rc-label {
  color: #64748b;
  font-weight: 600;
}

.rc-val {
  color: #0f172a;
  font-weight: 800;
}

.rc-plate {
  display: inline-block;
  background: #16a34a;
  color: #fff;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
}

.rc-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 8px 14px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}

/* ===== 极简清爽游戏 HUD（对标网上南宁极简风格） ===== */
#hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

#hud.hud-hidden {
  opacity: 0;
}
#hud.hud-hidden * {
  pointer-events: none !important;
}

.hud-pill {
  background: rgba(11, 16, 28, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

/* Top Center Compass Bar (docked neatly beside top-left badge -> zero overlap with top-right toolbar!) */
.hud-compass {
  position: absolute;
  top: 14px;
  left: 298px;
  transform: none;
  padding: 6px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #e2e8f0;
  pointer-events: auto;
}

.compass-dir {
  color: #34d399;
  font-weight: 900;
  min-width: 24px;
  text-align: center;
}

.compass-zone {
  color: #fde68a;
}

/* Top Left Mini Brand Badge */
.hud-top-left {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  pointer-events: auto;
}

.mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
}

.mini-title {
  font-size: 13px;
  font-weight: 800;
}
.mini-sub {
  font-size: 10.5px;
  color: #94a3b8;
}

/* Top Right Clock & Quick Toggles */
.hud-top-right {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 12px;
  pointer-events: auto;
}

.game-clock {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  padding: 0 8px 0 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mini-btn:hover {
  background: rgba(51, 65, 85, 0.92);
}

.mini-btn.active {
  background: linear-gradient(135deg, #10b981, #0284c7);
  color: #fff;
  border-color: rgba(110, 231, 183, 0.65);
}

/* Bottom Left Compact Ride / Wheelie Status */
.hud-bottom-left {
  position: absolute;
  bottom: 16px;
  left: 14px;
  padding: 8px 11px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: auto;
  min-width: 170px;
}

/* Interactive Food Prompt Pill (111.mp4 ¥100 Challenge) */
#interact-prompt {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 35;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.94), rgba(2, 132, 199, 0.94));
  border: 2px solid #fef08a;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  white-space: nowrap;
}

#interact-prompt.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.budget-pill {
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ride-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ride-mode {
  font-size: 12px;
  font-weight: 800;
  color: #34d399;
}

.ride-speed {
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.ride-speed small {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  margin-left: 2px;
}

.ride-controls {
  display: flex;
  gap: 5px;
}

.wheelie-badge {
  display: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 1px;
}

.wheelie-badge.active {
  display: block;
}

/* Bottom Center Slim Teleport Bar */
.hud-bottom-center {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 14px;
  pointer-events: auto;
  max-width: 94vw;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.hud-bottom-center::-webkit-scrollbar { display: none; }

.tp-btn {
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.65);
  color: #cbd5e1;
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tp-btn:hover {
  background: rgba(16, 185, 129, 0.24);
  color: #fff;
}

.tp-btn.current-zone {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(52, 211, 153, 0.72);
  color: #a7f3d0;
}

.nav-pill-btn {
  border: 1px solid rgba(192, 132, 252, 0.65);
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.62), rgba(168, 85, 247, 0.55));
  color: #f5d0fe;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-pill-btn:hover {
  filter: brightness(1.15);
}

/* 《南宁 online》同款右下角智能终端 + 实时圆形雷达小地图 */
.nn-phone-card {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 174px;
  padding: 10px 11px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(15, 22, 36, 0.86), rgba(10, 14, 24, 0.92));
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.nn-phone-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.65);
}
.nn-phone-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}
.nn-phone-road {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}
.nn-phone-coords {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.nn-phone-key {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 800;
}
.nn-phone-clock-row {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nn-phone-sub {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.6px;
  color: #94a3b8;
  font-weight: 700;
}
.nn-phone-clock {
  font-size: 21px;
  font-weight: 900;
  color: #fef08a;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.nn-radar-wrap {
  margin: 7px auto 5px;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45);
}
.nn-radar-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.nn-phone-keys {
  text-align: center;
  font-size: 9.5px;
  color: #94a3b8;
  font-weight: 600;
}

/* Toast */
#toast-banner {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 40;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(11, 16, 28, 0.88);
  border: 1px solid rgba(52, 211, 153, 0.55);
  font-size: 12.5px;
  font-weight: 700;
  color: #ecfdf5;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

#toast-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#restore-hud-btn {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 35;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.52);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11.5px;
  cursor: pointer;
  display: none;
}
#restore-hud-btn.visible { display: block; }

/* Mobile Dual-Thumb Controls (enabled on all touch devices & narrow viewports, both portrait & landscape!) */
#mobile-controls {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}
#mobile-controls.enabled {
  display: block;
}

.joystick-zone {
  position: absolute;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 52px);
  left: max(14px, env(safe-area-inset-left));
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.68) 100%);
  border: 2px solid rgba(148, 163, 184, 0.36);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  touch-action: none;
}
.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #38bdf8);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.45);
  pointer-events: none;
}

.mobile-right-btns {
  position: absolute;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 52px);
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  touch-action: none;
}
.mob-top-row, .mob-main-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.mob-circle-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  touch-action: none;
  transition: transform 0.1s ease, background 0.12s ease;
}
.mob-sm-btn {
  width: 44px;
  height: 44px;
  font-size: 10px;
}
.mob-boost-btn {
  width: 54px;
  height: 54px;
  border-color: rgba(56, 189, 248, 0.65);
  background: linear-gradient(145deg, rgba(14, 116, 144, 0.85), rgba(30, 58, 138, 0.88));
}
.mob-wheelie-btn {
  width: 60px;
  height: 60px;
  font-size: 12px;
  border-color: rgba(251, 191, 36, 0.75);
  background: linear-gradient(145deg, rgba(225, 29, 72, 0.88), rgba(217, 119, 6, 0.88));
}
.mob-circle-btn:active, .mob-circle-btn.pressed {
  transform: scale(0.91);
  filter: brightness(1.2);
}

@media (max-width: 1360px) and (min-width: 921px) {
  .hud-bottom-center {
    left: 50%;
    max-width: calc(100vw - 430px);
  }
  .hud-bottom-center .tp-btn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
}
@media (max-width: 1280px) {
  .hud-compass { top: 68px; left: 14px; transform: none; }
  .social-quick-bar { top: 108px !important; left: 14px !important; }
}
@media (max-width: 920px) {
  .nn-phone-card { display: none; }
}

/* ===== Full Mobile & Tablet Responsive Layout (Zero Overlap on Portrait 390x844 & Landscape 844x390!) ===== */
@media (max-width: 920px) {
  #welcome-overlay {
    align-items: flex-start;
  }
  .start-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 16px;
    margin: auto 0;
    width: min(95vw, 520px);
    border-radius: 18px;
  }
  .start-logo-badge {
    width: 62px;
    height: 50px;
    border-radius: 11px;
  }
  .start-title {
    font-size: 26px;
  }
  .start-title span {
    font-size: 11px;
    letter-spacing: 2px;
  }
  .start-desc {
    font-size: 12px;
    line-height: 1.55;
  }
  .btn-main {
    padding: 12px 14px;
    font-size: 13.5px;
  }
  .btn-sub-row {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  #btn-start-feedback {
    grid-column: 1 / -1;
  }
  .btn-ghost {
    padding: 9px 10px;
    font-size: 12px;
  }
  .rc-body {
    padding: 10px 12px;
    gap: 7px;
  }
  .start-disclaimer {
    margin-top: 4px;
    font-size: 10px;
  }

  /* Row 1 Left: Compact Brand (budget pill docks cleanly at Row 3 Left so Row 1 never overlaps on 390px!) */
  .hud-top-left {
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
    padding: 4px 9px;
    gap: 6px;
    border-radius: 10px;
  }
  .mini-logo-img {
    width: 25px;
    height: 25px;
    border-radius: 7px;
  }
  .mini-title { font-size: 11.5px; }
  .mini-sub { display: none; }

  /* Row 1 Right: Compact Time / Submit / Hide Toggles */
  .hud-top-right {
    top: max(8px, env(safe-area-inset-top));
    right: 8px;
    padding: 4px 6px;
    gap: 4px;
    border-radius: 10px;
  }
  .game-clock, #btn-cinematic, .hide-xs {
    display: none;
  }
  #fps-badge {
    font-size: 10px !important;
    margin-right: 0 !important;
  }
  .hud-top-right .mini-btn {
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 7px;
  }

  /* Row 2 Left: Strictly single-line Compass + Current Street Zone */
  .hud-compass {
    top: calc(max(8px, env(safe-area-inset-top)) + 40px);
    left: 8px;
    padding: 3px 8px;
    gap: 5px;
    font-size: 10.5px;
    max-width: 214px;
    white-space: nowrap;
  }
  .compass-dir { white-space: nowrap; flex-shrink: 0; }
  .compass-zone {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 102px;
  }
  .nav-pill-btn {
    padding: 2px 6px;
    font-size: 9.5px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .budget-pill {
    position: fixed;
    top: calc(max(8px, env(safe-area-inset-top)) + 78px);
    left: 8px;
    margin-left: 0;
    padding: 3px 8px;
    font-size: 10.5px;
    white-space: nowrap;
    background: rgba(11, 16, 28, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* Row 2 Right: Compact Live Speedometer Badge (keeps bottom-left 100% clear for virtual joystick!) */
  .hud-bottom-left {
    top: calc(max(8px, env(safe-area-inset-top)) + 40px);
    right: 8px;
    left: auto;
    bottom: auto;
    min-width: 0;
    padding: 3px 9px;
    border-radius: 999px;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  .hud-bottom-left .ride-controls {
    display: none;
  }
  .hud-bottom-left .ride-mode {
    font-size: 10.5px;
  }
  .hud-bottom-left .ride-speed {
    font-size: 14px;
  }
  .hud-bottom-left .wheelie-badge {
    font-size: 10px;
    padding: 1px 6px;
  }

  /* Bottom Edge: Swipeable Single-Line Landmark Teleport Bar */
  .hud-bottom-center {
    bottom: max(8px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 16px);
    padding: 4px 6px;
    border-radius: 11px;
  }
  .tp-btn {
    padding: 5px 9px;
    font-size: 11px;
  }

  #interact-prompt {
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 178px);
    max-width: 92vw;
    white-space: normal;
    text-align: center;
    padding: 8px 14px;
    font-size: 12px;
  }
  #toast-banner {
    top: calc(max(8px, env(safe-area-inset-top)) + 104px);
    max-width: 92vw;
    white-space: normal;
    text-align: center;
    font-size: 11.5px;
    padding: 6px 12px;
  }

  /* Mobile City Map & Feedback Modal Adjustments */
  .map-card {
    padding: 10px 12px 12px;
    width: 96vw;
  }
  .map-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .map-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .map-title { font-size: 13.5px; }
  .map-sub { font-size: 10px; }
  .map-board {
    height: min(440px, 66dvh);
  }
  .map-legend {
    font-size: 9.5px;
    padding: 4px 8px;
    gap: 8px;
  }

  .fb-card {
    padding: 14px;
    max-height: 90dvh;
    touch-action: pan-y;
  }
  .fb-grid-2 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  /* 16px prevents iOS Safari automatic page zoom when focusing form fields! */
  .fb-field input, .fb-field select, .fb-field textarea {
    font-size: 16px;
    padding: 8px 10px;
  }

  /* Row 3 Right on Mobile: Compact Social/Friends/Business Pills opposite budget-pill (zero overlap!) */
  .social-quick-bar {
    top: calc(max(8px, env(safe-area-inset-top)) + 78px) !important;
    left: auto !important;
    right: 8px !important;
    max-width: calc(100vw - 142px);
    padding: 3px 5px !important;
    gap: 4px !important;
    border-radius: 10px !important;
  }
  .social-quick-bar .mini-btn {
    padding: 3px 6px !important;
    font-size: 10px !important;
    border-radius: 7px !important;
    white-space: nowrap;
  }
  #btn-account-pill {
    max-width: 106px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #follow-status-banner {
    top: calc(max(8px, env(safe-area-inset-top)) + 114px);
    font-size: 11px;
    padding: 5px 11px;
  }
  #toast-banner {
    top: calc(max(8px, env(safe-area-inset-top)) + 114px) !important;
  }
  .biz-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 395px) {
  #fps-badge { display: none; }
}

/* Landscape Mobile Mode (e.g. 844x390) */
@media (max-height: 520px) and (orientation: landscape) {
  .joystick-zone {
    width: 92px;
    height: 92px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .mobile-right-btns {
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .mob-sm-btn { width: 38px; height: 38px; font-size: 9.5px; }
  .mob-boost-btn { width: 46px; height: 46px; }
  .mob-wheelie-btn { width: 50px; height: 50px; font-size: 10.5px; }
  .hud-bottom-center {
    max-width: calc(100vw - 310px);
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* Compliance Disclaimer on Start Screen */
.start-disclaimer {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(203, 213, 225, 0.72);
}

/* Interactive 1:1 GIS 来宾市区全城地图 Modal (M 键) */
#city-map-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 24, 0.80);
  backdrop-filter: blur(10px);
}
#city-map-modal.open { display: flex; }

.map-card {
  width: min(880px, 95vw);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(13, 20, 36, 0.97), rgba(18, 28, 52, 0.97));
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  padding: 14px 18px 16px;
  color: #f8fafc;
}
.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.map-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.map-title { font-size: 16px; font-weight: 900; color: #fef08a; }
.map-sub { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }

.map-board {
  position: relative;
  width: 100%;
  height: min(540px, 72dvh);
  border-radius: 12px;
  background: #10192b;
  border: 1px solid rgba(148, 163, 184, 0.28);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
#city-gis-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#city-gis-canvas:active {
  cursor: grabbing;
}
.map-legend {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(11, 16, 28, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  pointer-events: none;
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.map-legend i {
  display: inline-block;
  width: 12px;
  height: 4px;
  border-radius: 2px;
}
.mini-btn-submit {
  background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
  color: #ffffff !important;
  border-color: rgba(254, 240, 138, 0.75) !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.mini-btn-submit:hover {
  filter: brightness(1.08);
}

/* Feedback & Media Upload Modal (右上角「提交意见/素材」弹窗) */
#feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 24, 0.8);
  backdrop-filter: blur(10px);
  padding: 16px;
}
#feedback-modal.open { display: flex; }

.fb-card {
  width: min(560px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(24, 34, 62, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  padding: 18px 20px;
  color: #f8fafc;
}
.fb-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.fb-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fb-field label { font-size: 12px; font-weight: 800; color: #cbd5e1; }
.fb-field input, .fb-field select, .fb-field textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9); color: #fff; font-size: 13px;
  font-family: inherit;
}
.fb-field textarea { resize: vertical; min-height: 76px; }

.fb-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.55);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  background: rgba(14, 165, 233, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 10px;
}
.fb-dropzone:hover, .fb-dropzone.drag {
  border-color: #fef08a;
  background: rgba(245, 158, 11, 0.14);
}
.fb-drop-title { font-size: 13.5px; font-weight: 800; color: #7dd3fc; }
.fb-drop-sub { font-size: 11.5px; color: #94a3b8; margin-top: 3px; }

.fb-file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fb-file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 8px;
  background: rgba(51, 65, 85, 0.85); font-size: 11.5px; color: #e2e8f0;
}
.fb-rm-btn {
  border: none; background: transparent; color: #fca5a5; cursor: pointer; font-weight: 900;
}
.fb-progress-wrap {
  display: none; margin-bottom: 10px;
}
.fb-progress-track {
  height: 8px; border-radius: 999px; background: #1e293b; overflow: hidden; margin-top: 4px;
}
.fb-progress-bar {
  height: 100%; width: 0%; background: linear-gradient(90deg, #34d399, #38bdf8);
  transition: width 0.15s ease;
}
.fb-status { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.fb-status.ok { color: #4ade80; }
.fb-status.err { color: #fda4af; }

.fb-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px;
}
.fb-admin-link {
  font-size: 11.5px; color: #94a3b8; text-decoration: none;
}
.fb-admin-link:hover { color: #fef08a; text-decoration: underline; }

.map-player-dot {
  position: absolute;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid #fff;
  box-shadow: 0 0 14px #22c55e;
  z-index: 6;
  pointer-events: none;
}

/* ===== Online Social / Account / Co-op Strolling / Life-Sim Business UI ===== */
.social-quick-bar {
  position: absolute;
  top: 68px;
  left: 14px;
  padding: 5px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
#btn-account-pill.logged-in {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(52, 211, 153, 0.65);
  color: #a7f3d0;
}
#follow-status-banner {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(6, 78, 59, 0.9);
  border: 1px solid #34d399;
  color: #ecfdf5;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
}
#follow-status-banner.visible { display: block; }

.social-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 24, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px;
}
.social-modal.open { display: flex; }
.social-card {
  width: min(620px, 96vw);
  max-height: 90dvh;
  overflow-y: auto;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(13, 20, 38, 0.98), rgba(22, 33, 62, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
  padding: 18px 20px;
  color: #f8fafc;
}
.social-card input {
  user-select: text;
  -webkit-user-select: text;
}
.social-sec-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #7dd3fc;
  margin: 10px 0 6px;
}
.social-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 7px;
}
.uid-tag {
  font-family: monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.social-empty-box {
  text-align: center;
  padding: 26px 14px;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
}
.biz-summary-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-size: 12.5px;
  margin-bottom: 10px;
}
.biz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.biz-card {
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.dev-code-box {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fef08a;
  font-size: 12px;
  margin-bottom: 10px;
}
.otp-send-btn {
  min-width: 108px;
  justify-content: center;
  transition: all 0.18s ease;
}
.otp-send-btn:disabled,
.otp-send-btn.is-counting {
  background: rgba(51, 65, 85, 0.9) !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  color: #cbd5e1 !important;
  cursor: not-allowed !important;
  opacity: 0.92;
  box-shadow: none !important;
}
.auth-mail-helper {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #94a3b8;
}
.auth-mail-helper strong {
  color: #fde68a;
}
.sent-tip-box {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.48);
  color: #d1fae5;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.sent-tip-box strong {
  color: #fef08a;
}
