/* Full-screen interactive 3D results (interactive.html), after Human3R's interactive demo page. */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: 'Inter', sans-serif;
  color: #363636;
  background: #fff;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

sup {
  line-height: 0;
}

.demo {
  --views: 4;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* 3D panels and the input videos */
.viewer-main {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 12px;
  padding: 12px 12px 0;
}

.viewer-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e3e3e8;
  border-radius: 8px;
}

#viewer-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.viewer-input {
  height: 100%;
  max-width: 30%;
  aspect-ratio: 1 / var(--views);
  object-fit: contain;
  object-position: top;
  border-radius: 8px;
  cursor: pointer;
}

.demo-back {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: #363636;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 5px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.demo-back:hover {
  background: #e4e4e4;
  transform: scale(1.05);
}

.viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  background: rgba(255, 255, 255, 0.7);
}

.viewer-loading[hidden] {
  display: none;
}

/* playback bar at the bottom of the 3D panels */
.viewer-transport {
  position: absolute;
  bottom: 14px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(440px, calc(100% - 28px));
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e3e3e8;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transform: translateX(-50%);
}

.viewer-play,
.viewer-speed {
  flex: none;
  height: 28px;
  padding: 0 8px;
  font-size: 0.8rem;
  background: #f5f5f5;
  border: 1px solid #dcdce0;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.viewer-play:hover,
.viewer-speed:hover {
  background: #e4e4e4;
}

.viewer-time {
  flex: none;
  min-width: 7.5em;
  padding: 4px 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  text-align: center;
  border: 1px solid #dcdce0;
  border-radius: 5px;
}

.viewer-seek {
  flex: 1;
  min-width: 0;
  accent-color: #228be6;
}

/* controls and instructions at the bottom of the page */
.demo-panel {
  padding: 12px 16px 10px;
}

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 28px;
}

.demo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #7a7a7a;
}

.demo-chips {
  display: flex;
  gap: 8px;
}

.demo-chip {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.85rem;
  background-color: #f5f5f5;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.demo-chip:hover {
  background-color: #e4e4e4;
  transform: scale(1.05);
}

.demo-chip:active {
  transform: scale(0.95);
}

.demo-chip.is-active {
  color: #fff;
  background-color: #92a8d1;
}

.viewer-follows {
  display: flex;
  gap: 6px;
}

.viewer-follow {
  width: 22px;
  height: 22px;
  padding: 0;
  background: var(--c);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #bbb;
}

.viewer-follow.is-active {
  box-shadow: 0 0 0 2px #222;
}

.demo-help {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em 1.5em;
  margin-top: 10px;
  font-size: 0.9rem;
}

.demo-help i {
  margin-right: 0.2em;
  color: #555;
}

.demo-note {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #7a7a7a;
  text-align: center;
}

@media (pointer: coarse) {
  .hide-on-touchscreens {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .demo-back span,
  .viewer-time {
    display: none;
  }

  .demo-controls {
    gap: 8px 16px;
  }

  .demo-group {
    flex-wrap: wrap;
    justify-content: center;
  }
}
