@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  color-scheme: dark;
  --bg: radial-gradient(120% 120% at 20% 20%, #0d1b2a 0%, #05070f 55%, #010104 100%);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --accent: #8ad7ff;
  --accent-2: #c7a2ff;
  --text: #eaf1ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: -20% -10% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 30% 30%, rgba(117, 209, 255, 0.22), rgba(0, 0, 0, 0));
  filter: blur(40px);
  opacity: 0.9;
  pointer-events: none;
  mix-blend-mode: screen;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
}

#canvas-host {
  position: absolute;
  inset: 0;
}

canvas {
  display: block;
}

.hud {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

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

.hud__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud__title::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, #b7f1ff, #5cc0ff 70%);
  box-shadow: 0 0 20px rgba(138, 215, 255, 0.6);
}

.hud__subtitle {
  font-size: 13px;
  color: rgba(234, 241, 255, 0.8);
  letter-spacing: 0.01em;
}

.hud__status {
  align-items: center;
  text-align: right;
  pointer-events: all;
  gap: 0.6rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(154, 214, 255, 0.2), rgba(199, 162, 255, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.status-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8ad7ff;
  box-shadow: 0 0 10px rgba(138, 215, 255, 0.8);
}

.pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  color: #fff;
  padding: 10px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.pill:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.32);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
}

.pill:active {
  transform: translateY(0) scale(0.98);
}

.pill.hidden {
  display: none;
}

#fullscreen-btn {
  margin-top: 6px;
  align-self: flex-end;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(154, 214, 255, 0.25), rgba(240, 195, 255, 0.12));
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

#fullscreen-btn:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(154, 214, 255, 0.5);
  background: linear-gradient(135deg, rgba(154, 214, 255, 0.35), rgba(240, 195, 255, 0.22));
}

#fullscreen-btn:active {
  transform: translateY(0) scale(0.99);
}

#input-video {
  position: fixed;
  width: 140px;
  bottom: 24px;
  right: 24px;
  opacity: 0.12;
  filter: grayscale(0.3) contrast(1.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px) saturate(140%);
}

@media (max-width: 640px) {
  .hud {
    grid-template-columns: 1fr;
    align-items: flex-start;
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .hud__group {
    width: 100%;
  }

  #gesture-indicator {
    text-align: left;
  }

  #fullscreen-btn {
    align-self: flex-start;
  }

  #input-video {
    width: 90px;
    right: 12px;
    bottom: 12px;
  }
}
