:root {
  color-scheme: dark;
  --bg-top: #02050d;
  --bg-bottom: #040915;
  --panel: rgba(7, 14, 28, 0.36);
  --panel-border: rgba(135, 181, 255, 0.14);
  --text: #edf4ff;
  --muted: #b7c6ec;
  --accent: #7ee7ff;
  --accent-warm: #ffd36e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(46, 116, 255, 0.18), transparent 35%),
    radial-gradient(circle at bottom, rgba(255, 198, 94, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 90%);
  pointer-events: none;
}

#scene {
  display: block;
  width: 100vw;
  height: 100vh;
}

.hud {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 380px);
  align-content: space-between;
  gap: 1rem;
  padding: 1.2rem;
  pointer-events: none;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  padding: 1rem 1.1rem;
}

.hero h1,
.controls h2,
.status h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  letter-spacing: 0.03em;
}

.hero h1 {
  margin-top: 0.2rem;
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 0.95;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.description {
  margin: 0.7rem 0 0;
  max-width: 30ch;
  color: var(--muted);
  line-height: 1.5;
}

.controls ul {
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  color: var(--muted);
}

.controls li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
}

.controls span,
.metric strong {
  color: var(--text);
}

.controls span {
  min-width: 74px;
  color: var(--accent-warm);
  font-weight: 700;
}

.status {
  align-self: end;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  color: var(--muted);
}

.mobile-controls {
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  display: none;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  pointer-events: none;
}

.mobile-pad {
  display: grid;
  gap: 0.55rem;
  pointer-events: auto;
}

.touch-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.touch-row.dual {
  justify-content: end;
}

.touch-button {
  min-width: 64px;
  min-height: 64px;
  border: 1px solid rgba(158, 204, 255, 0.24);
  border-radius: 18px;
  background: rgba(7, 14, 28, 0.42);
  color: var(--text);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.touch-button.small {
  min-width: 58px;
  min-height: 58px;
  font-size: 0.95rem;
}

.touch-button.camera-toggle {
  width: 100%;
  min-height: 56px;
  font-size: 0.92rem;
}

.touch-button:active,
.touch-button.is-active {
  background: rgba(31, 78, 142, 0.85);
  border-color: rgba(126, 231, 255, 0.7);
  transform: scale(0.97);
}

@media (max-width: 720px) {
  .hud {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 0.7rem;
    padding: 0.75rem;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .description {
    max-width: none;
    font-size: 0.94rem;
  }

  .panel {
    border-radius: 18px;
    padding: 0.85rem 0.95rem;
    background: rgba(7, 14, 28, 0.28);
  }

  .controls {
    display: none;
  }

  .status {
    align-self: start;
    max-width: 220px;
    background: rgba(7, 14, 28, 0.22);
  }

  .metric {
    margin-top: 0.55rem;
    font-size: 0.9rem;
  }

  .mobile-controls {
    display: flex;
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero {
    max-width: 78%;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .eyebrow {
    font-size: 0.64rem;
  }

  .description {
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .status {
    max-width: 180px;
  }

  .hero {
    background: rgba(7, 14, 28, 0.22);
  }

  .touch-button {
    min-width: 56px;
    min-height: 56px;
    border-radius: 16px;
    background: rgba(7, 14, 28, 0.3);
  }

  .touch-button.small {
    min-width: 50px;
    min-height: 50px;
  }
}
