:root {
  --bg: #020503;
  --bg-secondary: #04130a;
  --grid: rgba(72, 255, 128, 0.08);
  --line: rgba(79, 255, 149, 0.45);
  --line-strong: rgba(118, 255, 167, 0.9);
  --point: #6bff9f;
  --point-core: #d7ffe4;
  --text: #d9ffe5;
  --muted: rgba(217, 255, 229, 0.65);
  --panel: rgba(2, 10, 6, 0.72);
  --panel-border: rgba(107, 255, 159, 0.18);
  --glow: 0 0 20px rgba(107, 255, 159, 0.26);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(33, 117, 68, 0.18), transparent 38%),
    radial-gradient(circle at bottom, rgba(12, 38, 22, 0.35), transparent 42%),
    linear-gradient(180deg, #010201 0%, #020503 100%);
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
}

body::after {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 2px,
      transparent 5px
    );
  opacity: 0.15;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  isolation: isolate;
}

#input-video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#hand-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  top: 28px;
  left: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
}

.hud__badge,
.hud__panel,
.permission-message {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--glow);
}

.hud__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hud__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--point);
  box-shadow:
    0 0 10px rgba(107, 255, 159, 0.9),
    0 0 20px rgba(107, 255, 159, 0.5);
  animation: pulse 1.5s infinite ease-in-out;
}

.hud__panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 16px;
  min-width: 420px;
  padding: 16px 20px;
  border-radius: 20px;
}

.hud__metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud__label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud__metric strong {
  font-family: "Orbitron", sans-serif;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--text);
}

.reticle {
  position: absolute;
  right: 48px;
  bottom: 48px;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 1;
}

.reticle__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(107, 255, 159, 0.2);
  box-shadow:
    0 0 20px rgba(107, 255, 159, 0.1),
    inset 0 0 20px rgba(107, 255, 159, 0.05);
}

.reticle__ring::before,
.reticle__ring::after {
  content: "";
  position: absolute;
  background: rgba(107, 255, 159, 0.35);
}

.reticle__ring::before {
  top: 50%;
  left: 12%;
  right: 12%;
  height: 1px;
  transform: translateY(-50%);
}

.reticle__ring::after {
  left: 50%;
  top: 12%;
  bottom: 12%;
  width: 1px;
  transform: translateX(-50%);
}

.reticle__ring--large {
  width: 180px;
  height: 180px;
  animation: spin 16s linear infinite;
}

.reticle__ring--small {
  width: 92px;
  height: 92px;
  animation: spinReverse 10s linear infinite;
}

.permission-message {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 48px));
  padding: 24px;
  border-radius: 24px;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.permission-message h1,
.permission-message p {
  margin: 0;
}

.permission-message h1 {
  font-family: "Orbitron", sans-serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.permission-message p {
  font-size: 18px;
  color: var(--muted);
}

.hidden {
  display: none;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.75;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes spinReverse {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0deg);
  }
}

@media (max-width: 760px) {
  .hud {
    top: 20px;
    left: 20px;
    right: 20px;
  }

  .hud__panel {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .reticle {
    right: 20px;
    bottom: 20px;
    width: 120px;
    height: 120px;
  }

  .reticle__ring--large {
    width: 120px;
    height: 120px;
  }

  .reticle__ring--small {
    width: 64px;
    height: 64px;
  }
}
