/*
 * The TV screen with the 3D studio behind it (body[data-stage3d="on"], set by
 * tv.js once the studio runs). The studio fills the whole screen; what was the
 * rail and the board becomes captions over it: glass panels that leave the
 * stage visible. Without the studio none of this applies and tv.css draws
 * the flat layout.
 */

.studio3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}

body[data-stage3d="on"] {
  background: #05061a;
  --glass: rgba(9, 11, 40, 0.9);
  --glass-line: rgba(255, 255, 255, 0.16);
}

body[data-stage3d="on"] .studio3d {
  display: block;
}

body[data-stage3d="on"] .stage {
  display: block;
  padding: 0;
  pointer-events: none;
}

body[data-stage3d="on"] .stage button,
body[data-stage3d="on"] .veil {
  pointer-events: auto;
}

/* ---- what was the rail: the name of the show stays, the rest is on the stage in 3D */

body[data-stage3d="on"] .rail {
  display: contents;
}

body[data-stage3d="on"] .rail__top {
  position: absolute;
  left: 1.8rem;
  top: 1.2rem;
  gap: 1rem;
  z-index: 4;
  text-shadow: 0 0.15rem 0.6rem rgba(0, 0, 0, 0.6);
}

body[data-stage3d="on"] .rail__host,
body[data-stage3d="on"] .seats {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

/* the line being spoken: a caption at the bottom, as on television */
body[data-stage3d="on"] .bubble {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  width: max-content;
  max-width: 70rem;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0.75rem 1.6rem;
  border-radius: 1.2rem;
  border: 0.1rem solid var(--glass-line);
  background: rgba(6, 8, 30, 0.86);
  color: #fff;
  transform: translate(-50%, 0.6rem);
  z-index: 5;
}

body[data-stage3d="on"] .bubble[data-on="true"] {
  transform: translate(-50%, 0);
}

/* in the lobby the caption keeps clear of the panel with the code and the start button */
body[data-stage3d="on"][data-phase="lobby"] .bubble {
  left: 67.5rem;
  max-width: 58rem;
}

body[data-stage3d="on"] .bubble::before {
  display: none;
}

body[data-stage3d="on"] .bubble p {
  font-size: 1.7rem;
  line-height: 1.25;
  text-align: center;
  -webkit-line-clamp: 3;
}

body[data-stage3d="on"] .bubble[data-kind="guest"] {
  border-color: var(--tone);
}

body[data-stage3d="on"] .bubble[data-kind="guest"] p {
  text-align: left;
}

/* ---- the board: captions over the stage */

body[data-stage3d="on"] .board {
  position: absolute;
  inset: 0;
  padding: 1.1rem 1.8rem 1.4rem;
}

body[data-stage3d="on"] .head {
  padding-left: 25.5rem;
  text-shadow: 0 0.15rem 0.6rem rgba(0, 0, 0, 0.6);
}

body[data-stage3d="on"] .view > .screen {
  background: none;
}

/* a question, its answers and what follows them: the upper half, the players stay in view below */
body[data-stage3d="on"] .view > .screen.q {
  position: absolute;
  left: 9rem;
  right: 9rem;
  top: 0.4rem;
  bottom: auto;
  height: auto;
  max-height: 31.5rem;
  padding: 1.3rem 1.8rem 1.4rem;
  border-radius: 1.6rem;
  border: 0.1rem solid var(--glass-line);
  background: var(--glass);
  gap: 0.9rem;
}

body[data-stage3d="on"] .q__text {
  font-size: 2.5rem;
  line-height: 1.16;
}

body[data-stage3d="on"] .q__text[data-size="m"] {
  font-size: 2.15rem;
}

body[data-stage3d="on"] .q__text[data-size="s"] {
  font-size: 1.85rem;
}

body[data-stage3d="on"] .tiles {
  gap: 0.8rem;
}

body[data-stage3d="on"] .tile {
  min-height: 5.2rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

body[data-stage3d="on"] .tiles--compact .tile {
  min-height: 3.6rem;
}

body[data-stage3d="on"] .fact {
  margin-top: 0;
  font-size: 1.25rem;
}

/* cards in the middle (a round begins, a category, the stakes): a panel at the top */
body[data-stage3d="on"] .view > .screen.center {
  position: absolute;
  left: 50%;
  top: 0.6rem;
  bottom: auto;
  width: max-content;
  min-width: 46rem;
  max-width: 82rem;
  height: auto;
  transform: translateX(-50%);
  padding: 1.4rem 2.6rem 1.6rem;
  border-radius: 1.6rem;
  border: 0.1rem solid var(--glass-line);
  background: var(--glass);
  gap: 0.7rem;
}

body[data-stage3d="on"] .view > .screen.center.boot {
  top: 40%;
  min-width: 0;
}

body[data-stage3d="on"] .view > .screen.center.round {
  left: 0;
  top: 5.6rem;
  transform: none;
  width: 46rem;
  min-width: 0;
}

body[data-stage3d="on"] .round h1 {
  font-size: 5.6rem;
  line-height: 1;
}

body[data-stage3d="on"] .round h1[data-size="m"] {
  font-size: 4.6rem;
}

body[data-stage3d="on"] .round h1[data-size="s"] {
  font-size: 3.8rem;
}

body[data-stage3d="on"] .round .dots {
  display: none;
}

/* the lobby: how to join, on the left; the studio fills with players on the right */
body[data-stage3d="on"] .view > .screen.lobby {
  position: absolute;
  left: 0;
  top: 0.8rem;
  bottom: 0.2rem;
  width: 33rem;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.3rem 1.5rem;
  border-radius: 1.6rem;
  border: 0.1rem solid var(--glass-line);
  background: var(--glass);
}

body[data-stage3d="on"] .lobby__main {
  display: contents;
}

body[data-stage3d="on"] .lobby > *,
body[data-stage3d="on"] .lobby__main > * {
  margin: 0;
  text-align: center;
}

body[data-stage3d="on"] .lobby__qr {
  order: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

body[data-stage3d="on"] .lobby__setup {
  order: 4;
}

body[data-stage3d="on"] .lobby__go {
  order: 5;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body[data-stage3d="on"] .lobby h1 {
  font-size: 3.3rem;
  line-height: 1;
}

body[data-stage3d="on"] .lobby__how {
  font-size: 1.25rem;
}

body[data-stage3d="on"] .lobby .code span {
  width: 4.4rem;
  height: 5.2rem;
  font-size: 3.5rem;
}

body[data-stage3d="on"] .lobby__qr .qr {
  width: 15rem;
  height: 15rem;
}

body[data-stage3d="on"] .lobby__host {
  display: none;
}

body[data-stage3d="on"] .lobby__setup {
  justify-content: center;
}

body[data-stage3d="on"] .lobby .lobby__go {
  margin-top: auto;
  align-items: center;
}

body[data-stage3d="on"] .lobby__go .hint {
  font-size: 1.1rem;
}

/* the entrance: the presenter's name as a plate in the lower third */
body[data-stage3d="on"] .view > .screen.onair3d {
  position: absolute;
  left: 3.2rem;
  bottom: 7.4rem;
  top: auto;
  width: max-content;
  max-width: 52rem;
  height: auto;
  display: block;
}

.plate {
  position: relative;
  padding: 1.1rem 2rem 1.2rem 1.8rem;
  border-radius: 1.3rem;
  border-left: 0.6rem solid var(--honey);
  background: rgba(6, 8, 30, 0.86);
  animation: plate-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
  animation-delay: 1.6s;
}

.plate .kicker {
  margin: 0;
}

.plate__name {
  margin: 0.1rem 0 0;
  font-size: 4.4rem;
  line-height: 1.02;
}

.plate__role {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
  color: var(--mist);
  max-width: 44rem;
}

.plate .live {
  position: absolute;
  right: 1rem;
  top: -1.1rem;
}

@keyframes plate-in {
  from {
    opacity: 0;
    transform: translateX(-3rem);
  }
}

/* the table of scores: a narrow list on the right, the desks rise on the stage */
body[data-stage3d="on"] .view > .screen.table {
  position: absolute;
  right: 0;
  top: 0.8rem;
  bottom: auto;
  left: auto;
  width: 30rem;
  height: auto;
  max-height: 47rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border-radius: 1.6rem;
  border: 0.1rem solid var(--glass-line);
  background: var(--glass);
  gap: 0.45rem;
}

body[data-stage3d="on"] .table h1 {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
}

body[data-stage3d="on"] .table .rank {
  height: 3.6rem;
  min-height: 0;
  font-size: 1.35rem;
}

body[data-stage3d="on"] .table .rank .avatar {
  width: 2.7rem;
  height: 2.7rem;
}

/* the end: the winners stand on the stage; the prizes and the button lie below them */
body[data-stage3d="on"] .view > .screen.end {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.2rem;
  top: auto;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

body[data-stage3d="on"] .end .podium {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

body[data-stage3d="on"] .end .award,
body[data-stage3d="on"] .end__rest {
  background: var(--glass);
  border: 0.1rem solid var(--glass-line);
}

body[data-stage3d="on"] .end__rest {
  padding: 0.5rem 1.2rem;
  border-radius: 1rem;
}

body[data-stage3d="on"][data-phase="ended"] .bubble {
  bottom: auto;
  top: 5.2rem;
}

body[data-stage3d="on"] .confetti {
  display: none;
}
