/* ==========================================================================
   息壤 — 3D 场景漫游与角色动作控制样式 (支持桌面端 & 移动端无感自动横屏双摇杆模式)
   ========================================================================== */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #0a1428;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #eef6ff;
}

/* ==========================================================================
   Auto-Landscape Stage Container (#game-stage)
   Automatically displays in landscape on portrait mobile screens without prompts
   ========================================================================== */
#game-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  touch-action: none;
}

@media screen and (max-width: 960px) and (orientation: portrait) {
  #game-stage {
    top: 50%;
    left: 50%;
    width: 100vh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
  }
}

body.auto-rotated-landscape #game-stage {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
}

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

#webgl-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#webgl-container canvas:active {
  cursor: grabbing;
}

/* ==========================================================================
   Loading Overlay — 《山海造化 × 永恒星环矩阵》全息分布式加载舱
   ========================================================================== */
#loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 28px 22px;
  background: #040814;
  overflow: hidden;
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.65s ease, transform 0.65s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.04);
}

/* Layer 1: ShanHai Floating Continent Megastructure Background */
.shanhai-bg-layer {
  position: absolute;
  inset: -2%;
  z-index: 0;
  background:
    url("../../ready_to_use/videos_and_icons/shanhai_loading_bg.webp") center center / cover no-repeat,
    radial-gradient(circle at 50% 42%, #0c2246 0%, #040814 100%);
  filter: saturate(1.12) contrast(1.05);
  animation: shanhaiBgBreathe 16s ease-in-out infinite alternate;
}

@keyframes shanhaiBgBreathe {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.045) translate3d(0, -4px, 0);
  }
}

/* Layer 2: Dynamic Quantum Particle & Constellation Canvas */
#loading-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Layer 3: Cosmic Vignette & Cyber-Bronze Frame Overlay */
.shanhai-vignette-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(4, 10, 24, 0.05) 0%, rgba(4, 10, 24, 0.42) 68%, rgba(2, 6, 16, 0.86) 100%),
    linear-gradient(180deg, rgba(3, 8, 20, 0.68) 0%, rgba(3, 8, 20, 0) 18%, rgba(3, 8, 20, 0.12) 72%, rgba(2, 6, 16, 0.92) 100%);
}

/* Top Telemetry Header Bar */
.loading-top-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ltb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(6, 16, 36, 0.84), rgba(8, 22, 48, 0.45));
  border: 1px solid rgba(0, 229, 255, 0.32);
  border-left: 3px solid #00e5ff;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ltb-emblem-wrap {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.22), rgba(6, 18, 40, 0.85));
  border: 1px solid rgba(0, 229, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
}

.ltb-emblem-wrap img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.ltb-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ltb-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ltb-brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.65);
}

.ltb-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 213, 79, 0.2), rgba(0, 229, 255, 0.18));
  border: 1px solid rgba(255, 213, 79, 0.55);
  color: #ffe082;
  font-weight: 600;
}

.ltb-lore-quote {
  font-size: 11.5px;
  color: #9ec5eb;
  letter-spacing: 0.4px;
}

.ltb-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ltb-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(6, 16, 36, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.35);
  backdrop-filter: blur(8px);
  font-size: 11.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.ltb-stat-pill.gold {
  border-color: rgba(255, 213, 79, 0.45);
}

.ltb-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 10px #00e676;
  animation: pulseDotGlow 1.6s ease-in-out infinite;
}

@keyframes pulseDotGlow {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}

.ltb-stat-label {
  color: #8ab4dc;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
}

.ltb-stat-val {
  color: #64f4ff;
  font-weight: 700;
}

.ltb-stat-pill.gold .ltb-stat-val {
  color: #ffd54f;
}

/* Center Stage: 3D Side Telemetry Panels + Central Orbital Core */
.loading-center-stage {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  perspective: 1100px;
  margin: 6px 0;
}

.holo-side-panel {
  width: min(310px, 27vw);
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(6, 18, 40, 0.78), rgba(4, 11, 26, 0.62));
  border: 1px solid rgba(0, 229, 255, 0.34);
  backdrop-filter: blur(10px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 22px rgba(0, 229, 255, 0.08);
  position: relative;
  transition: transform 0.35s ease;
}

.holo-side-panel::before,
.holo-side-panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.holo-side-panel::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid #00f2fe;
  border-left: 2px solid #00f2fe;
  border-top-left-radius: 12px;
}

.holo-side-panel::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid #ffd54f;
  border-right: 2px solid #ffd54f;
  border-bottom-right-radius: 12px;
}

.holo-side-panel.holo-left {
  transform: rotateY(14deg) translateZ(10px);
}

.holo-side-panel.holo-right {
  transform: rotateY(-14deg) translateZ(10px);
  border-color: rgba(255, 213, 79, 0.32);
}

.holo-panel-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.22);
}

.holo-panel-tag {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #00e5ff;
}

.holo-side-panel.holo-right .holo-panel-tag {
  color: #ffd54f;
}

.holo-panel-cn {
  font-size: 12px;
  color: #bfe2ff;
  font-weight: 600;
}

.holo-wireframe-box {
  position: relative;
  width: 100%;
  height: 106px;
  border-radius: 8px;
  background: radial-gradient(circle at center, rgba(0, 229, 255, 0.1), rgba(3, 9, 22, 0.65));
  border: 1px solid rgba(0, 229, 255, 0.2);
  overflow: hidden;
  margin-bottom: 10px;
}

.holo-terrain-svg,
.holo-topology-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.holo-scan-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00f2fe, #ffd54f, transparent);
  box-shadow: 0 0 10px #00f2fe;
  animation: holoLaserScan 3.2s ease-in-out infinite;
}

@keyframes holoLaserScan {
  0%, 100% {
    top: 8%;
    opacity: 0.35;
  }
  50% {
    top: 88%;
    opacity: 0.95;
  }
}

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

.holo-stage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  color: #7ea2c7;
  transition: all 0.25s ease;
}

.holo-stage-item.active {
  background: rgba(0, 229, 255, 0.14);
  border-color: rgba(0, 229, 255, 0.45);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.18);
}

.holo-stage-item.done {
  background: rgba(0, 230, 118, 0.1);
  border-color: rgba(0, 230, 118, 0.35);
  color: #d0f8e4;
}

.stage-idx {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.15);
  color: #64f4ff;
  font-weight: 700;
}

.holo-stage-item.done .stage-idx {
  background: rgba(0, 230, 118, 0.22);
  color: #69f0ae;
}

.stage-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-state {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  color: #6c8eb4;
}

.holo-stage-item.active .stage-state {
  color: #ffd54f;
}

.holo-stage-item.done .stage-state {
  color: #69f0ae;
}

.holo-telemetry-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tele-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
}

.tele-k {
  color: #84a9d0;
}

.tele-v {
  color: #eef6ff;
  font-weight: 600;
}

.tele-v.cyan {
  color: #64f4ff;
}

.tele-v.gold {
  color: #ffd54f;
}

.tele-v.ok {
  color: #69f0ae;
}

.tele-v.mono {
  font-family: "JetBrains Mono", Consolas, monospace;
}

/* Central Orbital Holographic Core Gauge */
.holo-core-orbit {
  position: relative;
  width: min(290px, 38vh);
  height: min(290px, 38vh);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 28px rgba(0, 229, 255, 0.32));
}

.core-orbit-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.orbit-ring-cw {
  transform-origin: 160px 160px;
  animation: spinOrbitCW 26s linear infinite;
}

.orbit-ring-ccw {
  transform-origin: 160px 160px;
  animation: spinOrbitCCW 18s linear infinite;
}

@keyframes spinOrbitCW {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinOrbitCCW {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

#loading-ring-arc {
  transition: stroke-dashoffset 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.core-center-readout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.core-sub-label {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: 2px;
  color: #9ec5eb;
  margin-bottom: 2px;
}

.core-pct-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  line-height: 1;
}

.core-pct-num {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 40px;
  font-weight: 800;
  color: #ffffff;
  text-shadow:
    0 0 16px rgba(0, 229, 255, 0.85),
    0 0 32px rgba(255, 213, 79, 0.55);
}

.core-pct-unit {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 17px;
  font-weight: 700;
  color: #ffd54f;
  margin-left: 2px;
}

.core-phase-tag {
  margin-top: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #041022;
  background: linear-gradient(90deg, #00e5ff, #ffd54f);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

/* Bottom Energy Dock */
.loading-bottom-dock {
  position: relative;
  z-index: 5;
  width: min(1060px, 96%);
  margin: 0 auto;
  padding: 14px 22px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(6, 16, 36, 0.82), rgba(4, 10, 24, 0.92));
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.7),
    0 0 28px rgba(0, 229, 255, 0.14);
  backdrop-filter: blur(10px);
}

.lbd-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.lbd-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lbd-sys-prefix {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #00e5ff;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.loading-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lbd-status-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11.5px;
  white-space: nowrap;
}

.lbd-sync-label {
  color: #8ab4dc;
}

.lbd-sync-val {
  color: #ffd54f;
  text-shadow: 0 0 10px rgba(255, 213, 79, 0.5);
}

/* Segmented Cyan-Gold Energy Cells + Laser Beam Track */
.lbd-progress-frame {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.lbd-frame-diamond {
  color: #ffd54f;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(255, 213, 79, 0.8);
  line-height: 1;
}

.lbd-bar-chamber {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lbd-segments-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  height: 12px;
}

.lbd-seg {
  height: 100%;
  transform: skewX(-24deg);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.22);
  transition: all 0.25s ease;
}

.lbd-seg.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.85), rgba(0, 242, 254, 0.95));
  border-color: #70f0ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.65);
}

.lbd-seg.gold.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.9), rgba(255, 213, 79, 0.96));
  border-color: #ffe082;
  box-shadow: 0 0 14px rgba(255, 213, 79, 0.75);
}

.loading-bar-bg {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: visible;
  position: relative;
}

.loading-bar-fill {
  width: 8%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00c6ff 0%, #00f2fe 60%, #ffd54f 100%);
  box-shadow:
    0 0 14px rgba(0, 229, 255, 0.85),
    0 0 24px rgba(255, 213, 79, 0.45);
  transition: width 0.22s ease;
  position: relative;
}

.laser-head-flare {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 0 10px 3px #00f2fe,
    0 0 20px 6px #ffd54f;
}

.lbd-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.loading-sub {
  font-size: 11.5px;
  color: #a8ccf0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loading-sub code,
.lbd-asset-tags code {
  color: #70f0ff;
  background: rgba(0, 229, 255, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.lbd-asset-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #82a8d0;
  white-space: nowrap;
}

/* ==========================================================================
   HUD Layer
   ========================================================================== */
#hud-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hud-panel {
  pointer-events: auto;
  background: rgba(9, 20, 42, 0.76);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

/* Top-Left Panel */
.hud-top-left {
  position: absolute;
  top: 14px;
  left: 16px;
  padding: 14px 16px;
  width: 416px;
  max-width: calc(100% - 32px);
  z-index: 25;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
  flex-shrink: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.scale-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid rgba(0, 230, 118, 0.45);
  color: #69f0ae;
  font-weight: 600;
  white-space: nowrap;
}

.hud-collapse-btn {
  display: none;
  margin-left: auto;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.16);
  border: 1px solid rgba(0, 229, 255, 0.4);
  border-radius: 999px;
  cursor: pointer;
}

.mobile-mini-status {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #bfe3ff;
}

.mobile-mini-status .mini-zone {
  color: #ffffff;
  font-weight: 600;
}

.mobile-mini-status .mini-fps {
  color: #69f0ae;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12.5px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-label {
  color: #8ab0d8;
}

.info-val {
  color: #eef6ff;
  font-weight: 600;
}

.info-val.mono {
  font-family: "JetBrains Mono", Consolas, monospace;
  color: #bfe3ff;
}

.info-val.accent {
  color: #00e5ff;
}

.info-val.ok {
  color: #69f0ae;
  font-size: 11.5px;
}

.teleport-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tp-label {
  font-size: 11.5px;
  color: #8ab0d8;
  font-weight: 600;
}

.teleport-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.tp-btn {
  padding: 5px 6px;
  font-size: 11.5px;
  border-radius: 6px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(18, 38, 76, 0.75);
  color: #d6ecff;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.tp-btn:hover,
.tp-btn.active {
  background: rgba(0, 229, 255, 0.24);
  border-color: #00e5ff;
  color: #ffffff;
}

/* Top-Right Tool Buttons */
.hud-top-right {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
  z-index: 20;
}

.tool-btn {
  padding: 8px 14px;
  font-size: 12.5px;
  color: #e2f1ff;
  background: rgba(9, 20, 42, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tool-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
}

.tool-btn strong {
  color: #00e5ff;
}

/* ==========================================================================
   Mobile Dual-Thumb Controls (Left Virtual Joystick + Right Jump/Wave Buttons)
   ========================================================================== */
#mobile-joystick-zone {
  position: absolute;
  bottom: 18px;
  left: 22px;
  width: 124px;
  height: 138px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  z-index: 18;
}

.joystick-base {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 30, 62, 0.45) 0%, rgba(8, 20, 44, 0.78) 100%);
  border: 2px solid rgba(0, 229, 255, 0.42);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(0, 229, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.joystick-base.active {
  border-color: rgba(0, 229, 255, 0.85);
  box-shadow: 0 4px 24px rgba(0, 229, 255, 0.32), inset 0 0 22px rgba(0, 229, 255, 0.25);
}

.joystick-base.sprinting {
  border-color: #00e676;
  box-shadow: 0 4px 26px rgba(0, 230, 118, 0.45), inset 0 0 22px rgba(0, 230, 118, 0.28);
}

.joystick-dir-arrows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: rgba(0, 229, 255, 0.35);
  font-size: 9px;
}

.joystick-dir-arrows span {
  position: absolute;
}

.joystick-dir-arrows .arr-up {
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.joystick-dir-arrows .arr-down {
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.joystick-dir-arrows .arr-left {
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
}

.joystick-dir-arrows .arr-right {
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
}

.joystick-stick {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #80f8ff, #00b8d4 70%, #0078a8 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 229, 255, 0.65);
  pointer-events: none;
  transform: translate3d(0, 0, 0);
}

.joystick-base.sprinting .joystick-stick {
  background: radial-gradient(circle at 35% 35%, #b9f6ca, #00e676 70%, #00a152 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 14px rgba(0, 230, 118, 0.8);
}

.joystick-hint {
  margin-top: 5px;
  font-size: 10px;
  color: rgba(191, 227, 255, 0.75);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

/* Mobile Right Action Buttons */
#mobile-right-controls {
  position: absolute;
  bottom: 22px;
  right: 22px;
  display: none;
  align-items: flex-end;
  gap: 12px;
  pointer-events: auto;
  touch-action: none;
  z-index: 18;
}

.mobile-action-circle {
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  backdrop-filter: blur(8px);
  transition: transform 0.1s ease, background 0.15s ease;
}

.mobile-action-circle.primary {
  width: 66px;
  height: 66px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.35), rgba(10, 28, 60, 0.85));
  border: 2px solid rgba(0, 229, 255, 0.75);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 229, 255, 0.3);
}

.mobile-action-circle.sub {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.28), rgba(10, 28, 60, 0.82));
  border: 1.5px solid rgba(0, 230, 118, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.mobile-action-circle:active {
  transform: scale(0.91);
  background: rgba(0, 229, 255, 0.48);
}

.mobile-action-circle .mac-icon {
  font-size: 17px;
  line-height: 1.1;
}

.mobile-action-circle.sub .mac-icon {
  font-size: 14px;
}

.mobile-action-circle .mac-text {
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}

.mobile-action-circle.sub .mac-text {
  font-size: 10px;
}

/* Bottom-Center Action Bar */
.hud-bottom-center {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px 12px;
  width: min(980px, calc(100% - 24px));
  z-index: 15;
}

.controls-hint-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: #a9caec;
  margin-bottom: 10px;
}

.controls-hint-row code {
  color: #00e5ff;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-weight: 700;
  color: #06152d;
  background: #00e5ff;
  border-radius: 4px;
  margin: 0 2px;
}

.action-buttons-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 7px;
}

.anim-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 4px;
  border-radius: 9px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: rgba(16, 34, 68, 0.82);
  color: #e6f4ff;
  cursor: pointer;
  transition: all 0.16s ease;
}

.anim-btn:hover {
  background: rgba(0, 229, 255, 0.22);
  border-color: #00e5ff;
  transform: translateY(-2px);
}

.anim-btn.active {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.35), rgba(0, 150, 255, 0.25));
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

.anim-btn .anim-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.anim-btn small {
  font-size: 10px;
  color: #82b1de;
  font-family: "JetBrains Mono", Consolas, monospace;
  white-space: nowrap;
}

/* Toast Notification */
#toast-container {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.xr-toast {
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(7, 19, 42, 0.9);
  border: 1px solid #00e5ff;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  max-width: 85%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Mobile & Touch Landscape Game Mode Adaptation
   ========================================================================== */
body.is-touch-device #mobile-joystick-zone,
body.is-touch-device #mobile-right-controls {
  display: flex;
}

body.is-touch-device .controls-hint-row {
  display: none;
}

body.is-touch-device .hud-top-left {
  width: auto;
  min-width: 220px;
  max-width: min(350px, 50%);
  padding: 7px 11px;
}

body.is-touch-device .brand-header {
  margin-bottom: 3px;
}

body.is-touch-device .brand-title {
  font-size: 13px;
}

body.is-touch-device .scale-badge {
  display: none;
}

body.is-touch-device .hud-collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

body.is-touch-device .mobile-mini-status {
  display: flex;
}

body.is-touch-device .hud-top-left:not(.expanded) .hud-collapsible-body {
  display: none;
}

body.is-touch-device .hud-top-left.expanded {
  width: min(380px, 80%);
  max-height: calc(100% - 24px);
  overflow-y: auto;
  background: rgba(7, 17, 38, 0.94);
}

body.is-touch-device .hud-top-left.expanded .mobile-mini-status {
  display: none;
}

body.is-touch-device .hud-top-right {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 46%;
}

body.is-touch-device .tool-btn {
  padding: 5px 9px;
  font-size: 11px;
  border-radius: 8px;
}

body.is-touch-device .tool-btn .tool-lbl {
  display: none;
}

body.is-touch-device .hud-bottom-center {
  width: min(460px, calc(100% - 290px));
  padding: 5px 7px;
  bottom: 10px;
  border-radius: 10px;
}

body.is-touch-device .action-buttons-row {
  display: flex;
  overflow-x: auto;
  gap: 5px;
  scrollbar-width: none;
}

body.is-touch-device .action-buttons-row::-webkit-scrollbar {
  display: none;
}

body.is-touch-device .anim-btn {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 5px 6px;
}

body.is-touch-device .anim-btn kbd,
body.is-touch-device .anim-btn small {
  display: none;
}

body.is-touch-device .anim-btn .anim-title {
  font-size: 11px;
}

@media (pointer: coarse), screen and (max-width: 1024px) {
  #mobile-joystick-zone,
  #mobile-right-controls {
    display: flex;
  }

  .controls-hint-row {
    display: none;
  }

  .hud-top-left {
    width: auto;
    min-width: 220px;
    max-width: min(350px, 50%);
    padding: 7px 11px;
  }

  .brand-header {
    margin-bottom: 3px;
  }

  .brand-title {
    font-size: 13px;
  }

  .scale-badge {
    display: none;
  }

  .hud-collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
  }

  .mobile-mini-status {
    display: flex;
  }

  .hud-top-left:not(.expanded) .hud-collapsible-body {
    display: none;
  }

  .hud-top-left.expanded {
    width: min(380px, 80%);
    max-height: calc(100% - 24px);
    overflow-y: auto;
    background: rgba(7, 17, 38, 0.94);
  }

  .hud-top-left.expanded .mobile-mini-status {
    display: none;
  }

  .hud-top-right {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
    max-width: 46%;
  }

  .tool-btn {
    padding: 5px 9px;
    font-size: 11px;
    border-radius: 8px;
  }

  .tool-btn .tool-lbl {
    display: none;
  }

  .hud-bottom-center {
    width: min(460px, calc(100% - 290px));
    padding: 5px 7px;
    bottom: 10px;
    border-radius: 10px;
  }

  .action-buttons-row {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    scrollbar-width: none;
  }

  .action-buttons-row::-webkit-scrollbar {
    display: none;
  }

  .anim-btn {
    flex: 0 0 auto;
    min-width: 52px;
    padding: 5px 6px;
  }

  .anim-btn kbd,
  .anim-btn small {
    display: none;
  }

  .anim-btn .anim-title {
    font-size: 11px;
  }

  /* Compact Loading Overlay for Mobile Landscape */
  #loading-overlay {
    padding: 10px 14px;
  }

  .ltb-lore-quote,
  .ltb-stat-pill.gold,
  .lbd-asset-tags {
    display: none;
  }

  .holo-side-panel {
    width: min(230px, 30%);
    padding: 8px 10px;
  }

  .holo-wireframe-box {
    height: 62px;
    margin-bottom: 6px;
  }

  .holo-stage-list,
  .holo-telemetry-rows {
    gap: 3px;
  }

  .holo-stage-item,
  .tele-row {
    padding: 3px 6px;
    font-size: 10px;
  }

  .holo-core-orbit {
    width: min(170px, 34vh);
    height: min(170px, 34vh);
  }

  .core-pct-num {
    font-size: 28px;
  }

  .loading-bottom-dock {
    padding: 9px 14px 8px;
  }

  .lbd-sys-prefix {
    display: none;
  }
}
