/* HK Odyssey 3D (explore.wikm76.fun) - Sleek Glassmorphic Cyber-Metropolis UI */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #020617;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

#cesiumContainer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#cesiumContainer:active {
  cursor: grabbing;
}

/* Hide default Cesium bottom logo clutter while keeping clean attribution */
.cesium-viewer-bottom {
  opacity: 0.55;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

.hud-glass {
  background: rgba(7, 16, 34, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  border-radius: 14px;
}

/* ==================== TOP BAR ==================== */
.hud-top {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.hud-brand-box,
.hud-actions-box {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hk-badge {
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  color: #020617;
  font-weight: 900;
  font-size: 12px;
  padding: 4px 7px;
  border-radius: 7px;
  letter-spacing: 0.5px;
}

.brand-title h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #f8fafc;
}

.brand-title small {
  display: block;
  font-size: 11px;
  color: #38bdf8;
}

.v-sep {
  width: 1px;
  height: 26px;
  background: rgba(148, 163, 184, 0.22);
}

.stat-pill {
  display: flex;
  flex-direction: column;
  padding: 0 4px;
}

.stat-pill .s-lbl {
  font-size: 10px;
  color: #94a3b8;
}

.stat-pill .s-val {
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
}

.gold {
  color: #fbbf24 !important;
}

.cyan {
  color: #38bdf8 !important;
}

.weather-pill,
.fps-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.fps-pill {
  color: #34d399;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hud-btn {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.hud-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.hud-btn.primary {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
}

.hud-btn.accent {
  background: linear-gradient(135deg, #7c3aed, #db2777);
  border-color: rgba(232, 121, 249, 0.5);
  color: #ffffff;
}

/* ==================== CENTER BANNERS & POPUPS ==================== */
.center-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 19;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(7, 16, 34, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.rb-tag {
  background: #f59e0b;
  color: #020617;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  margin-right: 6px;
}

.rb-mid {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.tour-banner {
  max-width: 620px;
  width: 90%;
}

.tb-content {
  width: 100%;
}

.tb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 4px;
}

.tb-content p {
  font-size: 13.5px;
  color: #f1f5f9;
  line-height: 1.45;
}

.landmark-popup {
  position: fixed;
  top: 82px;
  right: 16px;
  z-index: 22;
  width: 340px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(7, 18, 38, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.55);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.lp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.lp-head h3 {
  font-size: 15px;
  color: #34d399;
}

.lp-head small {
  color: #94a3b8;
  font-size: 11.5px;
}

.landmark-popup p {
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.5;
  margin-bottom: 8px;
}

.lp-trivia {
  font-size: 12px;
  color: #fde047;
  background: rgba(251, 191, 36, 0.1);
  border-left: 3px solid #fbbf24;
  padding: 6px 8px;
  border-radius: 4px;
}

.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 110px;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 40px rgba(251, 191, 36, 0.75);
}

.toast-banner {
  position: fixed;
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(6, 22, 46, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #f8fafc;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.context-prompt {
  position: fixed;
  bottom: 98px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fef08a;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

/* ==================== BOTTOM-LEFT RADAR & TELEMETRY ==================== */
.hud-radar-box {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.radar-wrap {
  position: relative;
  width: 116px;
  height: 116px;
}

#radarCanvas {
  width: 116px;
  height: 116px;
  display: block;
}

.radar-n {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 900;
  color: #38bdf8;
}

.telemetry-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 145px;
}

.tele-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
}

.tele-row b {
  font-size: 13.5px;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tele-row small {
  color: #34d399;
  font-size: 11px;
}

.stamina-bar-bg {
  width: 86px;
  height: 8px;
  background: rgba(30, 41, 59, 0.9);
  border-radius: 99px;
  overflow: hidden;
}

.stamina-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  transition: width 0.1s linear;
}

.tele-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

kbd {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  color: #38bdf8;
}

/* ==================== BOTTOM-CENTER VEHICLE DOCK ==================== */
.hud-bottom-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.vehicle-dock {
  display: flex;
  gap: 8px;
}

.veh-pill {
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.veh-pill:hover {
  border-color: #38bdf8;
  color: #ffffff;
}

.veh-pill.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.32), rgba(16, 185, 129, 0.32));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.dock-keys-hint {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: #94a3b8;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-window {
  background: rgba(9, 18, 38, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  padding: 20px 24px;
  max-height: 88vh;
  overflow-y: auto;
  width: 100%;
}

.hub-window {
  max-width: 1060px;
}

.small-window {
  max-width: 520px;
}

.postcard-window {
  max-width: 860px;
}

.postcard-canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.mw-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.mw-header h2 {
  font-size: 20px;
  color: #f8fafc;
}

.mw-header p {
  font-size: 12.5px;
  color: #94a3b8;
  margin-top: 3px;
}

.close-x {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}

.hub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.hub-tab-btn {
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.hub-tab-btn.active {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  color: #ffffff;
  border-color: #38bdf8;
}

.als-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.als-search-bar input,
.form-group input {
  flex: 1;
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #f8fafc;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  user-select: text;
  -webkit-user-select: text;
}

.als-results-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.als-item {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 8px 12px;
  border-radius: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.region-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: #94a3b8;
  flex-wrap: wrap;
}

.region-filter-btn {
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  cursor: pointer;
}

.region-filter-btn.active {
  background: #38bdf8;
  color: #020617;
  font-weight: 800;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 12px;
}

.hub-card {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
}

.hub-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.hub-card.unlocked {
  border-color: rgba(52, 211, 153, 0.55);
}

.hc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.hc-top b {
  font-size: 14px;
  color: #f8fafc;
}

.hc-tag {
  font-size: 11px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.hub-card p {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}

.hc-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #10b981);
  color: #ffffff;
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}

.btn-danger {
  background: #e11d48;
  color: #ffffff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  flex: 1;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11.5px;
}

.custom-route-builder {
  background: rgba(14, 165, 233, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.crb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.crb-status {
  font-size: 12px;
  color: #7dd3fc;
}

/* Leaderboards */
.lb-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lb-col h3 {
  font-size: 14.5px;
  color: #fbbf24;
  margin-bottom: 10px;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12.5px;
}

.lb-row.top-1 {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.08);
}

.lb-rank {
  font-weight: 800;
  color: #38bdf8;
  width: 32px;
}

.lb-name {
  flex: 1;
}

.lb-name small {
  color: #94a3b8;
  margin-left: 6px;
}

.lb-meta {
  color: #94a3b8;
  font-size: 11.5px;
  margin-right: 10px;
}

.lb-val {
  font-weight: 800;
  color: #34d399;
  font-family: ui-monospace, monospace;
}

/* Settings & Beacon Form */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.beacon-type-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.settings-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.settings-section h4 {
  font-size: 13.5px;
  color: #38bdf8;
  margin-bottom: 10px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.btn-group-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tileset-btn,
.theme-btn,
.perf-btn {
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tileset-btn.active,
.theme-btn.active,
.perf-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

/* Mobile Touch Controls */
.mobile-touch-layer {
  display: none;
}

@media (max-width: 1024px) {
  .hide-lg {
    display: none !important;
  }
}

@media (max-width: 820px) {
  .hide-md {
    display: none !important;
  }
  .lb-dual-grid {
    grid-template-columns: 1fr;
  }
  .mobile-touch-layer {
    display: block;
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 18;
  }
  .joy-zone {
    pointer-events: auto;
    position: absolute;
    left: 18px;
    bottom: 84px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.55);
    border: 2px solid rgba(56, 189, 248, 0.4);
  }
  .joy-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.85);
  }
  .mob-actions {
    pointer-events: auto;
    position: absolute;
    right: 16px;
    bottom: 84px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .mob-btn {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #ffffff;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 800;
  }
  .hud-radar-box {
    display: none;
  }
}
