/* The big screen: one canvas, letterboxed to 16:9, that everything is drawn
   on. The camera's <video> is never shown; it only feeds the tracker and the
   faces on the dolls. */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--r6-deep);
  color: var(--r6-pip);
  font-family: var(--r6-font-sans);
}

.motion-app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--r6-deep);
}

.motion-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Kept playing but out of sight: `display: none` would stop the frames the
   faces are cut from. */
.motion-video {
  position: absolute;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

/* The lab pages' start screen (public/lab/): a logo and two buttons. The big
   screen's own start screen is .motion-open, below. */
.motion-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px;
  background: var(--r6-night);
  text-align: center;
}

.motion-app[data-state="live"] .motion-start {
  display: none;
}

.motion-start__logo {
  width: min(52vw, 520px);
  height: auto;
}

.motion-start__product {
  margin: -8px 0 24px;
  color: var(--r6-mist);
  font-family: var(--r6-font-display);
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: .5em;
  text-indent: .5em;
}

.motion-start__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.motion-button {
  min-width: 220px;
  min-height: 60px;
  padding: 0 32px;
  border: 0;
  border-radius: var(--r6-radius-control);
  background: var(--r6-glow);
  color: var(--r6-night);
  font: 700 20px/1 var(--r6-font-sans);
  cursor: pointer;
}

.motion-button:hover {
  background: var(--r6-glow-hover);
}

.motion-button--quiet {
  border: 1px solid var(--r6-line-strong);
  background: transparent;
  color: var(--r6-pip);
}

.motion-button--quiet:hover {
  background: var(--r6-face-2);
}

.motion-button:disabled {
  background: var(--r6-face-2);
  color: var(--r6-mist);
  cursor: default;
}

.motion-status {
  min-height: 1.6em;
  max-width: 34em;
  margin: 0;
  color: var(--r6-mist);
  font-size: 16px;
  line-height: 1.6;
}

.motion-app[data-state="error"] .motion-status {
  color: var(--r6-danger-text);
}

/* The big screen's start screen: the lockup, one big 開始, and the settings
   folded away.
   Shown until the bodies are coming in (data-state="live"), and again when
   the camera or the tracker fails. */
.motion-open {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(90% 90% at 30% 45%, #1B1830 0%, transparent 60%),
    var(--r6-deep);
}

.motion-app[data-state="live"] .motion-open {
  display: none;
}

/* The pointer hides when it rests on the projection (main.js). */
.motion-app[data-state="live"].motion-app--still {
  cursor: none;
}

.motion-card {
  display: grid;
  gap: 18px;
  width: min(720px, 100%);
  padding: 40px;
  border: 1px solid var(--r6-line);
  border-radius: var(--r6-radius-card);
  background: var(--r6-face);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.motion-card p {
  margin: 0;
  line-height: 1.6;
}

.motion-card__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 18px;
}

.motion-card__logo {
  display: block;
  width: auto;
  height: 56px;
  max-width: 100%;
}

.motion-card__product {
  padding-bottom: 6px;
  color: var(--r6-mist);
  font-family: var(--r6-font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .4em;
}

.motion-card__title {
  margin: 8px 0 0;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.2;
}

.motion-open__button {
  min-height: 112px;
  border: 0;
  border-radius: var(--r6-radius-control);
  background: var(--r6-glow);
  color: var(--r6-night);
  font: inherit;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: .2em;
  text-indent: .2em;
  cursor: pointer;
}

.motion-open__button:hover {
  background: var(--r6-glow-hover);
}

.motion-open__button:focus-visible {
  outline: 4px solid var(--r6-pip);
  outline-offset: 4px;
}

.motion-open__button:disabled {
  opacity: .6;
  cursor: progress;
}

.motion-note,
.motion-field small {
  color: var(--r6-mist);
  font-size: 14px;
}

.motion-note--center {
  text-align: center;
}

.motion-settings {
  padding: 12px 18px;
  border: 1px solid var(--r6-line);
  border-radius: var(--r6-radius-control);
  background: var(--r6-night);
}

.motion-settings summary {
  min-height: 32px;
  color: var(--r6-mist);
  font-weight: 700;
  line-height: 32px;
  cursor: pointer;
}

.motion-settings__body {
  display: grid;
  gap: 16px;
  padding: 8px 0 6px;
}

.motion-field {
  display: grid;
  gap: 6px;
}

.motion-field[hidden] {
  display: none;
}

.motion-field span {
  font-weight: 700;
}

.motion-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--r6-line);
  border-radius: 12px;
  background: var(--r6-face);
  color: var(--r6-pip);
  font: inherit;
  font-size: 18px;
}

.motion-field select:focus-visible {
  outline: 3px solid var(--r6-glow);
  outline-offset: 2px;
}

/* Right under 開始, so it is in sight with the settings open too. */
.motion-open__status {
  color: var(--r6-mist);
  font-size: 16px;
  text-align: center;
}

.motion-open__status:empty {
  display: none;
}

.motion-app[data-state="error"] .motion-open__status {
  color: var(--r6-danger-text);
  font-weight: 700;
}

.motion-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  font-size: 15px;
}

.motion-links a {
  color: var(--r6-glow-text);
}

/* The set-up bar: press D to show or hide it. */
.motion-hud {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border: 1px solid var(--r6-line);
  border-radius: var(--r6-radius-control);
  background: rgba(21, 22, 30, .9);
  color: var(--r6-mist);
  font-size: 14px;
}

.motion-hud[hidden] {
  display: none;
}

.motion-hud b {
  margin-left: 4px;
  color: var(--r6-pip);
  font-size: 16px;
}

.motion-hud select,
.motion-hud button {
  max-width: 220px;
  margin-left: 4px;
  padding: 4px 8px;
  border: 1px solid var(--r6-line-strong);
  border-radius: 8px;
  background: var(--r6-face);
  color: var(--r6-pip);
  font: inherit;
}
