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

html,
body {
  width: 600px;
  height: 600px;
  overflow: hidden;
}

body {
  background: #000;
  color: #eef3f1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  width: 600px;
  height: 600px;
  padding: 8px;
}

.top-bar,
.bottom-bar {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.top-bar { top: 16px; left: 20px; right: 20px; }
.bottom-bar { right: 20px; bottom: 20px; left: 20px; }

h1 {
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0;
}

#status {
  margin-top: 2px;
  color: #9aaca5;
  font-size: 0.72rem;
}

.battery,
.readout {
  min-width: 70px;
  border: 1px solid rgba(238, 243, 241, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: #1c2421;
  color: #b7c8c2;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.battery.high {
  color: #39d98a;
}

.battery.medium {
  color: #f0b44c;
}

.battery.low {
  color: #ff6b6b;
}

.action-row {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 240px;
  height: 88px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.command-button,
.emergency-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid #7aa890;
  border-radius: 18px;
  font-size: clamp(1rem, 4vmin, 1.25rem);
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

.command-button:active,
.command-button.pressed,
.emergency-button:active,
.emergency-button.pressed {
  transform: scale(0.96);
  filter: brightness(1.14);
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  line-height: 1;
}

.takeoff {
  background: #1c4935;
}

.land {
  background: #1c3447;
}

.gesture-panel {
  position: absolute;
  inset: 0;
}

.gesture-pad {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 600px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #000;
  cursor: crosshair;
}

.axis {
  display: none;
}

.axis.horizontal {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
}

.axis.vertical {
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
}

.origin-dot,
.stick-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.origin-dot {
  border: 1px solid #b7c8c2;
}

.stick-dot {
  background: #48c48f;
  box-shadow: 0 0 0 5px #1f513b;
}

.gesture-pad.active .origin-dot,
.gesture-pad.active .stick-dot {
  opacity: 1;
}

.pad-label {
  display: none;
}

.gesture-pad.active .pad-label {
  color: #eef3f1;
}

.emergency-button {
  width: 160px;
  min-height: 64px;
  background: #712d35;
}

.readout {
  min-width: 138px;
  white-space: nowrap;
}

/* Keep the display transparent while preserving discoverable safety controls. */
.app-shell:has(button:focus) .top-bar,
.app-shell:has(button:focus) .bottom-bar,
.app-shell:has(button:focus) .action-row,
.app-shell:has(.gesture-pad.active) .top-bar,
.app-shell:has(.gesture-pad.active) .bottom-bar {
  opacity: 1;
  pointer-events: auto;
}

[data-glasses-focus]:focus {
  outline: 0;
  box-shadow: 0 0 20px #48d5ff, inset 0 0 0 3px #72e5ff;
  transform: scale(0.93);
}

/* A regular desktop browser has no additive display: keep the HUD visible there. */
@media (hover: hover), (pointer: fine) {
  .top-bar,
  .bottom-bar,
  .action-row {
    opacity: 1;
    pointer-events: auto;
  }
}
