:root {
  color-scheme: dark;
  --panel: rgba(9, 12, 18, 0.76);
  --panel-strong: rgba(9, 12, 18, 0.92);
  --text: #f7f4ed;
  --muted: #bac3cd;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #43d1c1;
  --accent-2: #f2c14e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #080a0f;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

button.active {
  border-color: rgba(67, 209, 193, 0.8);
  color: #06120f;
  background: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#app,
#viewer {
  position: fixed;
  inset: 0;
}

canvas {
  display: block;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(16px, 4vw, 32px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: min(680px, 68vw);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.1;
}

.counter {
  min-width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.toolbar {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, auto)) minmax(136px, 190px) minmax(116px, 160px) minmax(70px, auto) minmax(92px, auto);
  align-items: center;
  gap: 10px;
  width: min(980px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.toolbar label {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

#enter-vr {
  border-color: rgba(242, 193, 78, 0.8);
  color: #100c03;
  background: var(--accent-2);
}

.status {
  position: fixed;
  left: clamp(16px, 4vw, 32px);
  right: clamp(16px, 4vw, 32px);
  bottom: 96px;
  z-index: 3;
  max-width: 820px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.status:empty {
  display: none;
}

@media (max-width: 760px) {
  h1 {
    max-width: 62vw;
    font-size: 20px;
  }

  .toolbar {
    grid-template-columns: repeat(3, 1fr);
  }

  .toolbar label {
    grid-column: span 3;
  }
}
