:root {
  color-scheme: dark;
  --bg-deep: #07090e;
  --bg-card: #0f131c;
  --bg-card-border: #1e2535;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --mrt-green: #00843d;
  --mrt-green-bright: #10b981;
  --mrt-green-glow: rgba(16, 185, 129, 0.35);
  --mrt-red: #da291c;
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.35);
  --radius-lg: 18px;
  --radius-md: 10px;
  --font-main: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -khtml-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

html, body {
  min-height: 100vh;
  min-height: 100dvh;
  touch-action: manipulation;
  overscroll-behavior: none;
  background: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 132, 61, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(218, 41, 28, 0.08) 0%, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.shell {
  width: min(1140px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --- App Header & Branding --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: rgba(15, 19, 28, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

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

.mrt-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #00843d, #059669);
  padding: 6px 12px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: #ffffff;
  box-shadow: 0 0 15px var(--mrt-green-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mrt-icon {
  font-size: 14px;
}

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

.game-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #ffffff 40%, #fde68a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #171d2b;
  color: var(--text-main);
  border: 1px solid #283144;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.ui-btn:hover {
  background: #222b3d;
  border-color: #3b4760;
  transform: translateY(-1px);
}

.ui-btn:active {
  transform: translateY(1px);
}

.ui-btn-accent {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.ui-btn-accent:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
  box-shadow: 0 0 12px var(--gold-glow);
}

.btn-icon {
  font-size: 14px;
}

/* --- Journey Stepper Timeline --- */
.journey-stepper {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: rgba(15, 19, 28, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stepper-line {
  position: absolute;
  top: 50%;
  left: 36px;
  right: 36px;
  height: 3px;
  background: #1e2638;
  transform: translateY(-50%);
  z-index: 1;
}

.stepper-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mrt-green-bright), var(--gold));
  transition: width 0.45s ease;
  box-shadow: 0 0 10px var(--gold-glow);
}

.step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #131722;
  border: 2px solid #2c364c;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-dim);
  transition: all 0.3s ease;
}

.step-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.step.completed .step-dot {
  background: var(--mrt-green);
  border-color: var(--mrt-green-bright);
  color: #fff;
  box-shadow: 0 0 8px var(--mrt-green-glow);
}

.step.completed .step-name {
  color: var(--text-muted);
}

.step.active .step-dot {
  background: var(--gold);
  border-color: #fff;
  color: #111;
  box-shadow: 0 0 14px var(--gold-glow);
  transform: scale(1.15);
}

.step.active .step-name {
  color: var(--gold);
  font-weight: 700;
}

/* --- Game Container & Canvas Card --- */
.game-container {
  width: 100%;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.game-wrap {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  cursor: default;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  background: #000;
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

canvas:focus-visible {
  box-shadow: inset 0 0 0 3px var(--gold);
}

/* --- On-screen Touch Gamepad & Controller Wings (Mobile Landscape Only) --- */
.touch-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100%;
  height: 100dvh;
  pointer-events: none;
  z-index: 35;
}

.mobile-wing-left {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--wing-width, calc((100vw - (var(--app-height, 100dvh) * 1.7778)) / 2));
  min-width: 145px;
  max-width: 38vw;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: 8px;
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  pointer-events: auto !important;
  touch-action: none !important;
  box-sizing: border-box;
  z-index: 40;
}

.mobile-wing-right {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--wing-width, calc((100vw - (var(--app-height, 100dvh) * 1.7778)) / 2));
  min-width: 145px;
  max-width: 38vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-left: 8px;
  pointer-events: auto !important;
  touch-action: none !important;
  box-sizing: border-box;
  z-index: 40;
}

/* --- Circular Analog Joystick (Left Thumb) --- */
.joystick-zone {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
  pointer-events: auto !important;
}

.joystick-base {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17, 24, 39, 0.88) 0%, rgba(9, 13, 22, 0.96) 100%);
  border: 2px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7), inset 0 0 16px rgba(245, 158, 11, 0.15);
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
  pointer-events: auto !important;
}

.joystick-base::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.joystick-tick {
  position: absolute;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.tick-up    { top: 5px; left: 50%; transform: translateX(-50%); }
.tick-down  { bottom: 5px; left: 50%; transform: translateX(-50%); }
.tick-left  { left: 6px; top: 50%; transform: translateY(-50%); }
.tick-right { right: 6px; top: 50%; transform: translateY(-50%); }

.joystick-stick {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 35%, #fde047 0%, #eab308 55%, #b45309 100%);
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 2px 5px rgba(255, 255, 255, 0.6);
  pointer-events: none;
  will-change: transform;
}

.joystick-stick.active {
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fbbf24 50%, #92400e 100%);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.85), 0 4px 14px rgba(0, 0, 0, 0.7);
}

.touch-overlay button {
  pointer-events: auto;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 20, 30, 0.85);
  color: #ffffff;
  font-size: 19px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: none;
  user-select: none;
  display: grid;
  place-items: center;
  transition: transform 0.1s ease, background 0.15s ease;
}

.touch-overlay button:active,
.touch-overlay button.active {
  background: var(--gold);
  color: #111;
  transform: scale(0.92);
}

.touch-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.run-btn {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  letter-spacing: 0.5px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4) !important;
}

.action-btn {
  width: 64px !important;
  height: 64px !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
  color: #111111 !important;
  font-weight: 800 !important;
  font-size: 23px !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4) !important;
}

/* --- Controls Footer Guide --- */
.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #0d1017;
  border-top: 1px solid var(--bg-card-border);
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.controls-guide {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.6px;
}

.key-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

kbd {
  display: inline-block;
  padding: 3px 7px;
  background: #171d2b;
  border: 1px solid #2d374d;
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

.or {
  font-size: 11px;
  color: var(--text-dim);
  margin: 0 2px;
}

.key-hint {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #cbd5e1;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mrt-green-bright);
  box-shadow: 0 0 8px var(--mrt-green-bright);
  animation: pulse-glow 2s infinite ease-in-out;
}

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

/* --- Mandatory Mobile Orientation Guard Overlay --- */
.orientation-guard {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #07090e;
  background-image:
    radial-gradient(circle at 50% 20%, rgba(0, 132, 61, 0.25) 0%, transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(245, 158, 11, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, #06080e 0%, #0d121d 100%);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(20px);
}

/* Force visible ONLY in portrait mode on mobile/tablet devices */
@media screen and (orientation: portrait), screen and (max-aspect-ratio: 13/14) {
  html.mobile-mode .orientation-guard {
    display: flex !important;
  }
}

.guard-card {
  max-width: 380px;
  width: 100%;
  background: rgba(15, 20, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 132, 61, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Animated rotating phone icon */
.phone-anim {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 6px;
  display: grid;
  place-items: center;
}

.phone-frame {
  width: 44px;
  height: 76px;
  border: 3.5px solid #ffffff;
  border-radius: 12px;
  background: #111827;
  position: relative;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.45);
  animation: rotatePhone 2.6s infinite ease-in-out;
  transform-origin: center center;
}

.phone-screen {
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  background: linear-gradient(135deg, #00843d, #0284c7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.screen-mrt {
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.rotate-glow-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(251, 191, 36, 0.45);
  animation: spinRing 6s linear infinite;
}

.rotate-arrow {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 20px;
  color: #fbbf24;
  animation: pulseArrow 1.3s infinite ease-in-out;
}

@keyframes rotatePhone {
  0%, 20% {
    transform: rotate(0deg);
  }
  50%, 80% {
    transform: rotate(-90deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

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

@keyframes pulseArrow {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
}

.guard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 132, 61, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.8px;
}

.guard-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.guard-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin-top: 4px;
}

.guard-desc {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.4;
}

.guard-subdesc {
  font-size: 12px;
  color: #94a3b8;
}

.guard-rotate-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  transition: transform 0.15s ease;
}

.guard-rotate-btn:active {
  transform: scale(0.96);
}

/* Quick Controls Bar for Mobile Landscape */
.mobile-quick-bar {
  display: none;
  gap: 8px;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.m-pill-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  transition: transform 0.1s ease, background 0.15s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.m-pill-btn:active {
  background: var(--gold);
  color: #111;
  transform: scale(0.9);
}

/* ==========================================================================
   DESKTOP PC INTERFACE — Clean Authentic UI (No Joystick, No Mobile Wings)
   ========================================================================== */
html.pc-mode body {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 16px !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  overflow: auto !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  background: var(--bg-deep) !important;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 132, 61, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(218, 41, 28, 0.08) 0%, transparent 50%) !important;
}

html.pc-mode .shell {
  width: min(1140px, 100%) !important;
  max-width: 1140px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  margin: 0 auto !important;
  height: auto !important;
  max-height: none !important;
}

html.pc-mode .app-header {
  display: flex !important;
}

html.pc-mode .journey-stepper {
  display: flex !important;
}

html.pc-mode .game-container {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  position: static !important;
  overflow: visible !important;
}

html.pc-mode .game-card {
  width: 100% !important;
  height: auto !important;
  border: 1px solid var(--bg-card-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
  background: var(--bg-card) !important;
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
}

html.pc-mode .game-wrap {
  position: relative !important;
  background: #000 !important;
  aspect-ratio: 16 / 9 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  z-index: 1 !important;
}

html.pc-mode canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

html.pc-mode .game-footer {
  display: flex !important;
}

/* Eliminate all virtual mobile controls, joystick, and guards on PC */
html.pc-mode #touch,
html.pc-mode .touch-overlay,
html.pc-mode .mobile-wing,
html.pc-mode .mobile-wing-left,
html.pc-mode .mobile-wing-right,
html.pc-mode .joystick-zone,
html.pc-mode #joystick-zone,
html.pc-mode .mobile-quick-bar,
html.pc-mode #orientation-guard,
html.pc-mode .orientation-guard {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  z-index: -9999 !important;
}

/* ==========================================================================
   MOBILE INTERFACE — Orientation Guard (Portrait) & Landscape Fullscreen
   ========================================================================== */
html.mobile-mode body {
  width: 100vw;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #000;
  position: fixed;
  inset: 0;
}

html.mobile-mode .shell {
  width: 100vw;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  max-width: 100vw;
  max-height: var(--app-height, 100dvh);
  gap: 0;
  padding: 0;
  justify-content: center;
  align-items: center;
}

html.mobile-mode .app-header,
html.mobile-mode .journey-stepper,
html.mobile-mode .game-footer {
  display: none !important;
}

html.mobile-mode .game-container {
  width: 100vw;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

html.mobile-mode .game-card {
  width: 100vw;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  position: relative;
  overflow: hidden;
}

html.mobile-mode .game-wrap {
  position: relative;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  width: calc(var(--app-height, 100dvh) * (16 / 9));
  max-width: calc(var(--app-height, 100dvh) * (16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 0;
  margin: auto;
  z-index: 10;
}

html.mobile-mode canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

html.mobile-mode .touch-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  height: var(--app-height, 100dvh) !important;
  pointer-events: none !important;
  z-index: 35 !important;
  display: none;
}

html.mobile-mode .touch-overlay.visible {
  display: block !important;
}

/* Left Pillarbox Wing: Analog Joystick */
html.mobile-mode .mobile-wing-left {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: var(--wing-width, calc((100vw - (var(--app-height, 100dvh) * 1.7778)) / 2)) !important;
  min-width: 145px !important;
  max-width: 38vw !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding-left: max(12px, env(safe-area-inset-left)) !important;
  padding-right: 8px !important;
  padding-top: max(8px, env(safe-area-inset-top)) !important;
  padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  pointer-events: auto !important;
  touch-action: none !important;
  box-sizing: border-box !important;
  z-index: 40 !important;
}

/* Right Pillarbox Wing: Quick Bar + Action Buttons */
html.mobile-mode .mobile-wing-right {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: var(--wing-width, calc((100vw - (var(--app-height, 100dvh) * 1.7778)) / 2)) !important;
  min-width: 145px !important;
  max-width: 38vw !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding-top: max(10px, env(safe-area-inset-top)) !important;
  padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
  padding-right: max(12px, env(safe-area-inset-right)) !important;
  padding-left: 8px !important;
  pointer-events: auto !important;
  touch-action: none !important;
  box-sizing: border-box !important;
  z-index: 40 !important;
}

html.mobile-mode .mobile-quick-bar {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  padding: 5px 9px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
}

html.mobile-mode .m-pill-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 13.5px;
}

html.mobile-mode .joystick-zone {
  display: flex !important;
  pointer-events: auto !important;
  touch-action: none !important;
}

html.mobile-mode .touch-overlay button {
  pointer-events: auto;
  width: 45px !important;
  height: 45px !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  background: rgba(22, 28, 42, 0.9) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45) !important;
  touch-action: none !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
}

html.mobile-mode .touch-overlay button:active,
html.mobile-mode .touch-overlay button.active {
  background: var(--gold) !important;
  color: #111 !important;
  transform: scale(0.92);
}

html.mobile-mode .touch-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  margin-bottom: 4px;
}

html.mobile-mode .run-btn {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45) !important;
}

html.mobile-mode .action-btn {
  width: 58px !important;
  height: 58px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #111827 !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.5) !important;
}
