@font-face {
  font-family: 'IBM Plex Mono';
  src: url('./assets/fonts/IBMPlexMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --hud-color: rgb(255 255 255 / 50%);
  --edge-x: clamp(16px, 2.3vw, 48px);
  --edge-y: clamp(16px, 3.8vh, 38px);
  font: clamp(13px, 1.05vw, 22px)/1.35 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--hud-color);
  background: #101722;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow: hidden; }
#view, canvas { display: block; width: 100vw; height: 100dvh; touch-action: none; }
canvas { cursor: grab; }
canvas:active { cursor: grabbing; }
header, footer {
  position: fixed;
  inset-inline: var(--edge-x);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 20px;
  pointer-events: none;
  text-shadow: 0 1px 4px #090d13b3;
}
header { top: max(var(--edge-y), env(safe-area-inset-top)); }
footer { bottom: max(var(--edge-y), env(safe-area-inset-bottom)); align-items: end; }
h1 { margin: 0; font: inherit; font-size: 1.3em; }
.actions, .metrics { display: flex; gap: clamp(10px, 1.25vw, 26px); }
.actions { pointer-events: auto; align-items: flex-start; }
.readouts { margin-inline-start: auto; display: grid; justify-items: end; gap: .48em; }
.lighting-controls { display: grid; pointer-events: auto; }
.slider-row { display: flex; align-items: center; gap: .75em; min-height: 2em; }
.actions .slider-row { min-height: 0; }
/* Reserve the slider's space while keeping it out of keyboard navigation. */
#sound-volume-control[hidden] { display: flex !important; visibility: hidden; }
.slider-row input {
  appearance: none;
  width: clamp(76px, 7vw, 142px);
  height: 24px;
  margin: 0;
  background: linear-gradient(to right, currentColor var(--slider-fill), rgb(255 255 255 / 20%) var(--slider-fill))
    center / 100% .66em no-repeat;
  color: inherit;
  cursor: pointer;
}
.slider-row input::-webkit-slider-thumb { appearance: none; width: 2px; height: .66em; background: transparent; }
.slider-row input::-moz-range-thumb { width: 2px; height: .66em; border: 0; background: transparent; }
.slider-row input:hover { color: rgb(255 255 255 / 72%); }
.slider-row input:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
.slider-row input:disabled { cursor: default; }
.metrics { white-space: nowrap; text-align: right; }
button {
  appearance: none;
  min-height: 40px;
  padding: 0 .68em;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-shadow: inherit;
  cursor: pointer;
}
.actions button { border-top: 1px dotted currentColor; white-space: nowrap; }
#sound { box-sizing: content-box; min-width: 9ch; }
#sound-status { position: fixed; top: calc(var(--edge-y) + 88px); right: var(--edge-x); max-width: 28ch; padding: .5em; background: rgb(12 17 25 / 80%); color: rgb(255 255 255 / 90%); }
button:disabled { cursor: default; }
button:not(:disabled):hover, button:focus-visible { color: rgb(255 255 255 / 90%); }
button:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
p { margin: 0; }
#loading, #interact {
  position: fixed;
  left: 50%;
  translate: -50% -50%;
  background: rgb(12 17 25 / 80%);
  color: rgb(255 255 255 / 90%);
  padding: .52em .8em;
  width: max-content;
  max-width: 88vw;
}
#loading { top: 50%; }
#interact { top: 65%; border: 1px dotted var(--hud-color); }
#vr-input {
  border: 0;
  padding: 0;
  max-width: calc(100% - 2 * var(--edge-x));
  background: transparent;
  color: white;
  text-align: center;
  text-shadow: 0 1px 4px #090d13b3;
  overflow: visible;
}
#vr-input::backdrop { background: rgb(0 0 0 / 9%); }
body:has(#vr-input[open]) :is(header, .lighting-controls, #touch-nav) { visibility: hidden; }
.vr-scene-name { color: var(--hud-color); font-size: 1.3em; }
#vr-input h2 { margin: .42em 0 1.45em; font-size: 1.3em; }
.vr-options { display: flex; justify-content: center; gap: clamp(18px, 2vw, 42px); }
.vr-options button {
  display: grid;
  place-items: center;
  width: clamp(80px, 6.8vw, 140px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--hud-color);
  border-radius: 50%;
  color: white;
}
.vr-options button:not(:disabled):is(:hover, :focus-visible) {
  color: white;
  border-color: white;
  background: rgb(255 255 255 / 10%);
}
.vr-options svg { width: 50%; height: 50%; }
#vr-input-status {
  position: absolute;
  inset: 100% 0 auto;
  margin-top: 1em;
  padding: .5em;
  background: rgb(12 17 25 / 80%);
  font-size: max(12px, .72em);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
#touch-nav, .touch { display: none; }
@media (pointer: coarse) {
  #touch-nav {
    position: fixed; right: var(--edge-x); bottom: calc(var(--edge-y) + 9.5rem);
    display: grid; grid-template-columns: repeat(3, 42px); gap: 4px; touch-action: none;
  }
  #touch-nav button { background: rgb(12 17 25 / 68%); border: 1px dotted currentColor; }
  #touch-nav button:first-child { grid-column: 2; }
  #touch-nav button:nth-child(2) { grid-column: 1; }
  .touch { display: block; }
  .desktop { display: none; }
}
@media (max-width: 680px) {
  header { flex-direction: column; gap: 8px; }
  footer { flex-wrap: wrap; gap: 6px 16px; }
  .actions { max-width: 100%; flex-wrap: wrap; gap: 8px; }
  .actions button { padding-inline: .53em; }
  .actions .slider-row { flex-basis: 100%; }
}
