html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #101820 url("./assets/las-vegas-sphere.png") center center / cover no-repeat;
  font-family: Arial, Helvetica, sans-serif;
}

.background-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.background-video.is-hidden {
  display: none;
}

#scene {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  background: transparent;
}

canvas {
  display: block;
}

.controls {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(34, 34, 34, 0.62);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.controls.is-hidden {
  display: none;
}

.collapse-button,
.show-controls {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
}

.show-controls {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(34, 34, 34, 0.72);
  backdrop-filter: blur(8px);
}

.show-controls.is-visible {
  display: block;
}

.file-button,
.field {
  min-height: 34px;
}

.file-button {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
}

#videoInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#backgroundInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.field {
  display: grid;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.field input[type="number"] {
  width: 58px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.92);
  color: #111111;
}

.mode-field select {
  width: 76px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #111111;
}

.color-field input {
  width: 78px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  padding: 0 7px;
  background: rgba(255, 255, 255, 0.92);
  color: #111111;
  text-transform: uppercase;
}

.joystick-field {
  width: 86px;
}

.joystick {
  position: relative;
  display: block;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at center, transparent 0 5px, rgba(255, 255, 255, 0.22) 6px 7px, transparent 8px);
  cursor: grab;
  touch-action: none;
}

.joystick:active {
  cursor: grabbing;
}

.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
}

.size-field {
  width: 150px;
}

.size-field span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.field input[type="range"] {
  width: 100%;
  accent-color: #ffffff;
}

.timeline-panel {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 3;
  display: grid;
  gap: 8px;
  width: min(780px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(34, 34, 34, 0.62);
  color: #ffffff;
  font-size: 12px;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.timeline-panel.is-hidden {
  display: none;
}

.timeline-row {
  display: grid;
  grid-template-columns: 82px 80px 1fr 92px;
  align-items: center;
  gap: 10px;
}

.timeline-row button {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(30, 30, 30, 0.62);
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0;
  cursor: pointer;
}

.timeline-row input[type="range"] {
  width: 100%;
  accent-color: #ffffff;
}

.timeline-row output {
  text-align: right;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
}

.timeline-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 720px) {
  .controls {
    right: 16px;
    flex-wrap: wrap;
  }

  .size-field {
    width: 100%;
  }

  .timeline-row {
    grid-template-columns: 72px 1fr;
  }

  .timeline-row input[type="range"],
  .timeline-row output {
    grid-column: 1 / -1;
  }
}
