:root {
  --movement-panel-width: min(430px, calc(100vw - 32px));
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0c1014;
  color: #f6f1e8;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  background: #0c1014;
}

.ambient-type {
  position: fixed;
  left: 50%;
  bottom: 26px;
  color: rgb(255 255 255 / 2.5%);
  font-size: clamp(28px, 4.6vw, 72px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  white-space: nowrap;
  transform: translateX(-50%);
}

.hud {
  position: fixed;
  z-index: 2;
  top: 16px;
  left: 16px;
  right: 16px;
  min-height: 76px;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.hud.is-hidden {
  opacity: 0;
  transform: translateY(-14px);
}

.controls,
.status {
  border: 1px solid rgb(255 255 255 / 14%);
  background: rgb(10 15 19 / 68%);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 40px rgb(0 0 0 / 24%);
}

.brand {
  --logo-frame-size: clamp(58px, 10vh, 105px);
  --logo-aspect: 1;
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: calc(var(--logo-frame-size) * var(--logo-aspect));
  height: var(--logo-frame-size);
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  pointer-events: none;
  overflow: visible;
}

.brand span,
.status p {
  display: block;
  margin: 0;
  color: #fff7e6;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.status-arrow {
  display: inline-block;
  margin-left: 6px;
  color: #f4c95d;
  font-size: 15px;
  line-height: 1;
  transform: translateY(-1px);
}

.brand-logo {
  display: block;
  grid-area: 1 / 1;
  width: 90%;
  height: 90%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.brand::after {
  content: "";
  grid-area: 1 / 1;
  display: block;
  width: 90%;
  height: 90%;
  background: rgb(255 255 255 / 25%);
  filter:
    drop-shadow(0 10px 22px rgb(0 0 0 / 58%))
    drop-shadow(0 0 18px rgb(244 201 93 / 24%));
  -webkit-mask: url("./assets/logo.svg") center / contain no-repeat;
  -webkit-mask-mode: luminance;
  mask: url("./assets/logo.svg") center / contain no-repeat;
  mask-mode: luminance;
  pointer-events: none;
}

.brand-logo-image.is-hidden {
  display: none;
}

.controls {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  pointer-events: auto;
  transform: translateX(-50%);
}

button {
  min-width: 132px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 6px;
  background: #f4c95d;
  color: #12100b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.05;
  white-space: nowrap;
}

button.secondary {
  background: #243038;
  color: #f6f1e8;
}

#resetButton {
  height: 58px;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  min-width: 48px;
  width: 48px;
  padding: 0;
}

.fullscreen-button {
  height: 58px;
}

.fullscreen-button.is-unavailable {
  display: none;
}

.fullscreen-icon {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
  background:
    linear-gradient(#f6f1e8, #f6f1e8) left top / 7px 2px no-repeat,
    linear-gradient(#f6f1e8, #f6f1e8) left top / 2px 7px no-repeat,
    linear-gradient(#f6f1e8, #f6f1e8) right top / 7px 2px no-repeat,
    linear-gradient(#f6f1e8, #f6f1e8) right top / 2px 7px no-repeat,
    linear-gradient(#f6f1e8, #f6f1e8) left bottom / 7px 2px no-repeat,
    linear-gradient(#f6f1e8, #f6f1e8) left bottom / 2px 7px no-repeat,
    linear-gradient(#f6f1e8, #f6f1e8) right bottom / 7px 2px no-repeat,
    linear-gradient(#f6f1e8, #f6f1e8) right bottom / 2px 7px no-repeat;
}

.fullscreen-button.is-active .fullscreen-icon {
  transform: scale(0.72);
}

.immersive-control {
  display: grid;
  align-content: center;
  gap: 4px;
  height: 58px;
  min-width: 178px;
}

.experience-control {
  display: grid;
  align-content: center;
  gap: 5px;
  height: 58px;
  min-width: 150px;
  color: #f4c95d;
  font-size: 9px;
  font-weight: 800;
}

.experience-control span {
  display: block;
  line-height: 1;
  text-align: center;
}

.experience-control select {
  width: 100%;
  height: 32px;
  padding: 0 34px 0 12px;
  border: 1px solid rgb(244 201 93 / 56%);
  border-radius: 6px;
  background: rgb(36 48 56 / 92%);
  color: #f6f1e8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.05;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgb(244 201 93 / 8%);
}

.immersive-control button {
  width: 100%;
  height: 32px;
}

.move-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 246px;
  height: 58px;
  padding: 0 14px;
  background: #f7efe0;
  color: #10151a;
  text-align: left;
}

.key-cluster {
  display: grid;
  grid-template-columns: repeat(3, 16px);
  grid-template-rows: repeat(2, 16px);
  gap: 2px;
  width: 52px;
  flex: 0 0 auto;
}

.move-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.move-copy strong,
.move-copy small {
  display: block;
  white-space: nowrap;
}

.move-copy strong {
  font-size: 13px;
  line-height: 1.1;
}

.move-copy small {
  color: #4f5b62;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
}

.key-cluster span {
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: #1a242c;
  color: #f7efe0;
  font-size: 9px;
  line-height: 1;
}

.key-cluster span:first-child {
  grid-column: 2;
}

.key-cluster span:nth-child(2) {
  grid-column: 1;
}

button:hover {
  filter: brightness(1.05);
}

.switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 20px;
  padding: 0 2px;
  color: #f6f1e8;
  font-size: 10px;
  font-weight: 800;
  pointer-events: auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-label {
  color: #c9d8d2;
  white-space: nowrap;
}

.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 999px;
  background: #26313a;
  transition: background 160ms ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #f7efe0;
  box-shadow: 0 3px 8px rgb(0 0 0 / 30%);
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: #f4c95d;
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
  background: #12100b;
}

.switch-state {
  min-width: 24px;
  color: #f7efe0;
}

.status {
  display: none;
}

.test-badge {
  position: fixed;
  z-index: 2;
  right: 16px;
  bottom: 16px;
  padding: 9px 12px;
  border: 1px solid rgb(244 201 93 / 28%);
  background: rgb(10 15 19 / 58%);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #c9d8d2;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 14px 40px rgb(0 0 0 / 18%);
}

.aim-reticle {
  position: fixed;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 1px solid rgb(72 220 231 / 58%);
  border-radius: 50%;
  box-shadow:
    0 0 14px rgb(72 220 231 / 24%),
    inset 0 0 10px rgb(72 220 231 / 18%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.85);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
}

.aim-reticle::before,
.aim-reticle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgb(72 220 231 / 58%);
  transform: translate(-50%, -50%);
}

.aim-reticle::before {
  width: 28px;
  height: 1px;
}

.aim-reticle::after {
  width: 1px;
  height: 28px;
}

.aim-reticle.is-visible {
  opacity: 1;
}

.aim-reticle.is-active {
  border-color: rgb(244 201 93 / 92%);
  box-shadow:
    0 0 22px rgb(244 201 93 / 48%),
    inset 0 0 12px rgb(244 201 93 / 30%);
  transform: translate(-50%, -50%) scale(1.08);
}

.aim-reticle.is-active::before,
.aim-reticle.is-active::after {
  background: rgb(244 201 93 / 88%);
}

.movement-stack {
  position: fixed;
  z-index: 2;
  left: 50%;
  width: var(--movement-panel-width);
  bottom: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.vr-hands-hud {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 0 22px rgb(72 220 231 / 28%));
  transform: translateY(18px);
  transform-origin: 50% 100%;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.vr-hands-hud.is-visible {
  opacity: 0.78;
  transform: translateY(0);
}

.status p + p {
  margin-top: 4px;
}

.movement-help {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: var(--movement-panel-width);
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgb(11 16 20 / 82%);
  color: #f7efe0;
  box-shadow: 0 18px 52px rgb(0 0 0 / 34%);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.movement-help.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.movement-help strong,
.movement-help span {
  display: block;
}

.movement-help strong {
  font-size: 11px;
  line-height: 1.25;
}

.movement-help span {
  margin-top: 2px;
  color: #c9d8d2;
  font-size: 9px;
  line-height: 1.35;
}

.movement-help kbd {
  min-width: 38px;
  padding: 6px 8px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #f4c95d;
  color: #12100b;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.mouse-icon {
  position: relative;
  width: 28px;
  height: 42px;
  border: 2px solid #f7efe0;
  border-radius: 16px;
}

.mouse-icon::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 9px;
  border-radius: 999px;
  background: #f4c95d;
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  .hud {
    right: 16px;
    min-height: 170px;
  }

  .brand {
    min-width: 0;
    width: min(calc(var(--logo-frame-size) * var(--logo-aspect)), calc(100vw - 32px));
  }

  .controls {
    top: 74px;
    left: 0;
    right: auto;
    width: min(360px, calc(100vw - 32px));
    transform: none;
  }

  .controls {
    flex-wrap: wrap;
  }

  button {
    flex: 1 1 120px;
  }

  .move-button {
    flex: 1 1 calc(100% - 58px);
    order: 1;
  }

  .fullscreen-button {
    order: 2;
  }

  .experience-control {
    order: 3;
  }

  .immersive-control {
    order: 4;
  }

  #resetButton {
    order: 5;
  }

  .switch {
    width: fit-content;
  }

  .movement-help {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .movement-help kbd {
    grid-column: 1 / -1;
    width: fit-content;
  }
}
