/* Black stays unlit on the Meta Ray-Ban Display waveguide. */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  inline-size: 100%;
  block-size: 100%;
  background: #000;
  color: #fff;
}

body {
  display: grid;
  place-items: center;
  min-inline-size: 0;
  overflow: hidden;
  font-family: system-ui, "Segoe UI", sans-serif;
  line-height: 1.25;
}

#app {
  inline-size: min(100vw, 100dvh);
  block-size: min(100vw, 100dvh);
  overflow: hidden;
}

.screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  inline-size: 100%;
  block-size: 100%;
  padding: clamp(1.25rem, 5vmin, 2.25rem);
  gap: 0.65rem;
}

.screen[hidden] {
  display: none;
}

#watch {
  padding: 0.4rem 0.5rem 0.5rem;
  gap: 0.28rem;
}

#watch .title {
  font-size: 1rem;
}

#watch .meta {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0.1rem 0.7rem;
}

#watch .subline,
#watch .hint {
  font-size: 0.95rem;
  line-height: 1.15;
}

#message:empty {
  display: none;
}

.stage,
.meta {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.45rem;
  min-inline-size: 0;
  min-block-size: 0;
  text-align: center;
}

.brand,
.title,
.subline,
.hint,
.code {
  margin: 0;
}

.brand {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  font-size: clamp(2.8rem, 14vmin, 4.6rem);
  font-weight: 650;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.title {
  font-size: clamp(1.15rem, 4.2vmin, 1.5rem);
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-inline-size: 100%;
}

.subline,
.hint,
a {
  color: rgb(255 255 255 / 0.82);
  font-size: 1.15rem;
}

.hint {
  max-inline-size: 28ch;
}

#boot-error:empty {
  display: none;
}

a {
  font-weight: 650;
}

#player-frame {
  position: relative;
  min-inline-size: 0;
  min-block-size: 0;
  background: #000;
}

#player-frame iframe,
#player-host {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

#player-frame iframe {
  /* Temple swipes stay on Play and Stop. The phone drives the player. */
  pointer-events: none;
}

.captions {
  position: absolute;
  z-index: 2;
  inset-inline: 0.35rem;
  bottom: 0.2rem;
  margin: 0;
  max-height: 46%;
  overflow: hidden;
  text-align: center;
  font-size: clamp(2.35rem, 9.2vmin, 3.35rem);
  font-weight: 760;
  line-height: 1.12;
  color: #fff;
  pointer-events: none;
}

.captions:empty {
  display: none;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-content: end;
}

.actions.single {
  grid-template-columns: 1fr;
}

button {
  appearance: none;
  min-block-size: 3.4rem;
  padding: 0.7rem 1rem;
  border: 2px solid rgb(255 255 255 / 0.82);
  border-radius: 1.15rem;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 650;
}

#toggle,
#new-code,
#install {
  background: #fff;
  color: #000;
  border-color: #fff;
}

button:active {
  transform: scale(0.98);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #ffe14a;
  outline-offset: 5px;
}

@media (prefers-reduced-motion: reduce) {
  button:active {
    transform: none;
  }
}
