* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Mesma identidade do painel/admin: preto, azul e branco. */
  --color-sidebar: #14181d;
  --color-brand: #1b4f72;
  --color-brand-light: #5aa2e0;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.view {
  position: fixed;
  inset: 0;
  display: none;
}

.view.active {
  display: flex;
}

/* --- Tela de pareamento --- */

#pairing-view {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(46, 109, 164, 0.55), transparent 42%),
    radial-gradient(circle at 85% 12%, rgba(27, 79, 114, 0.55), transparent 38%),
    radial-gradient(circle at 50% 95%, rgba(46, 109, 164, 0.35), transparent 50%),
    var(--color-sidebar);
  color: #fff;
  text-align: center;
  gap: 2vh;
  padding: 4vh;
}

#pairing-view .brand {
  font-size: 3vh;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#pairing-view .brand .accent {
  color: var(--color-brand-light);
}

#pairing-expiry {
  font-size: 1.6vh;
  opacity: 0.5;
}

#pairing-view .instructions {
  font-size: 2.4vh;
  max-width: 60ch;
  opacity: 0.85;
}

.fullscreen-hint {
  font-size: 1.6vh;
  opacity: 0.45;
}

#qr-container {
  background: #fff;
  padding: 2vh;
  border-radius: 16px;
  line-height: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#qr-container img {
  width: 28vh;
  height: 28vh;
  display: block;
}

#pairing-code {
  display: flex;
  gap: 1.2vh;
}

.code-char {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7.5vh;
  height: 10vh;
  font-size: 5vh;
  font-weight: 700;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: #fff;
  background: linear-gradient(160deg, rgba(58, 130, 189, 0.55), rgba(27, 79, 114, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 24px rgba(46, 109, 164, 0.35);
}

#pairing-status {
  font-size: 1.8vh;
  opacity: 0.6;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.status-dots {
  display: inline-flex;
  gap: 0.3em;
}

.status-dots span {
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  animation: status-dot-pulse 1.2s ease-in-out infinite;
}

.status-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.status-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes status-dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* --- Tela de exibição --- */

#display-view {
  background: #000;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.slide.visible {
  opacity: 1;
}

.slide img,
.slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

#empty-state {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 2.4vh;
}

#empty-state.visible {
  display: flex;
}
