/* Todo en vh/vw: se ve desde el sofá, a tres metros, y en cualquier resolución de tele. */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.loading {
  position: fixed;
  left: 30vw;
  right: 0;
  top: 46vh;
  text-align: center;
  font-size: 4vh;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0.3vh 0 rgb(0 0 0 / 35%);
}

.panel {
  position: fixed;
  top: 3vh;
  bottom: 3vh;
  left: 2vw;
  width: 26vw;
  min-width: 300px;
  padding: 2.6vh 1.6vw;
  border-radius: 3vh;
  background: var(--paper);
  box-shadow: 0 1.5vh 5vh rgb(20 33 61 / 28%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.6, 0, 0.3, 1);
}

.panel.away {
  transform: translateX(-120%);
}

.brand {
  font-size: 1.9vh;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  font-size: 5vh;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  margin-top: 0.4vh;
}

#how-to {
  font-size: 2vh;
  line-height: 1.3;
  color: var(--muted);
  margin-top: 0.8vh;
}

.qr {
  width: 25vh;
  height: 25vh;
  margin-top: 1.6vh;
  flex: none;
  border-radius: 1.6vh;
  overflow: hidden;
  background: #fff;
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scan {
  font-size: 2.5vh;
  font-weight: 600;
  margin-top: 1vh;
}

.manual {
  font-size: 1.7vh;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.code-label {
  font-size: 1.7vh;
  color: var(--muted);
  margin-top: 1.2vh;
}

.code {
  font-size: 5.4vh;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-right: -0.16em;
  line-height: 1;
}

.players {
  list-style: none;
  padding: 0;
  margin-top: 1.4vh;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7vh 0.6vw;
  min-height: 0;
}

.players li {
  display: flex;
  align-items: center;
  gap: 0.5vw;
  padding: 0.5vh 0.7vw;
  border-radius: 1.2vh;
  background: #fff;
  font-size: 2vh;
  font-weight: 500;
  min-width: 0;
}

.players li.off {
  opacity: 0.45;
}

.players .dot {
  width: 1.8vh;
  height: 1.8vh;
  border-radius: 50%;
  flex: none;
}

.players .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.players .ms {
  font-size: 1.4vh;
  color: var(--muted);
  flex: none;
}

.hint {
  margin-top: auto;
  padding-top: 1vh;
  font-size: 2.1vh;
  font-weight: 600;
  color: var(--ink);
}

.scores {
  position: fixed;
  top: 2.4vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1vw;
  padding: 0 2vw;
  max-width: 96vw;
}

.score {
  display: flex;
  align-items: center;
  gap: 0.6vw;
  padding: 0.8vh 1.2vw;
  border-radius: 2.4vh;
  background: rgb(20 33 61 / 82%);
  color: #fff;
  font-size: 2.5vh;
  font-weight: 600;
  white-space: nowrap;
}

.score.out {
  opacity: 0.45;
}

.score .dot {
  width: 2vh;
  height: 2vh;
  border-radius: 50%;
}

.score .stars {
  color: #ffd166;
  letter-spacing: 0.1em;
  min-width: 2.6em;
}

.banner {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  text-align: center;
  font-size: 12vh;
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  -webkit-text-stroke: 0.5vh var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.8vh 0 rgb(20 33 61 / 30%);
  animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes pop {
  from {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }
}

.paused {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1vh;
  background: rgb(10 14 28 / 62%);
  color: #fff;
  font-size: 3vh;
}

.paused-title {
  font-size: 12vh;
  font-weight: 700;
  line-height: 1;
}

.offline {
  position: fixed;
  bottom: 3vh;
  right: 3vw;
  padding: 1vh 2vw;
  border-radius: 2vh;
  background: var(--ink);
  color: #fff;
  font-size: 2.2vh;
}

@media (prefers-reduced-motion: reduce) {
  .banner {
    animation: none;
  }

  .panel {
    transition: none;
  }
}
