:root {
  --fg: #e8eef7;
  --muted: #8a93a6;
  --accent: #ffb37a;
  --panel-bg: rgba(10, 12, 18, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: #000;
  color: var(--fg);
  font-family:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

#overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 22px;
  z-index: 5;
}

#title {
  max-width: 460px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  pointer-events: auto;
}

#title h1 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
}

#title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

#stats {
  align-self: flex-end;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#stats #fps {
  color: var(--accent);
  font-weight: 600;
}

#loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #000;
  z-index: 10;
  transition: opacity 600ms ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

#loader p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#loader .ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* lil-gui tweaks */
.lil-gui.root {
  --background-color: rgba(10, 12, 18, 0.62);
  --text-color: #e8eef7;
  --title-background-color: rgba(255, 255, 255, 0.04);
  --title-text-color: #e8eef7;
  --widget-color: rgba(255, 255, 255, 0.08);
  --hover-color: rgba(255, 255, 255, 0.14);
  --focus-color: rgba(255, 179, 122, 0.4);
  --number-color: #ffb37a;
  --string-color: #9ed3ff;
  --font-size: 12px;
  --widget-height: 22px;
  --padding: 6px;
  --spacing: 4px;
  --slider-knob-width: 2px;
  --slider-input-width: 28%;
  --color-input-width: 28%;
  --slider-input-min-width: 50px;
  --color-input-min-width: 50px;
  --folder-indent: 8px;
  --widget-padding: 0 0 0 4px;
  --widget-border-radius: 6px;
  --checkbox-size: 14px;
  --scrollbar-width: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  top: 18px;
  right: 18px;
}

@media (max-width: 640px) {
  #title {
    max-width: calc(100vw - 36px);
  }
  .lil-gui.root {
    top: auto;
    bottom: 18px;
    right: 18px;
    left: 18px;
    max-width: none;
  }
}
