html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050913;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f2efe8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #050913;
  z-index: 1;
}

.slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
  background: #050913;
  overflow: hidden;
}

.slide.is-active {
  opacity: 1;
  z-index: 2;
}

/*
  Letterbox without stretching - absolute center + max bounds.
  Works even when mobile-lock forces height:auto !important and when
  object-fit is missing on older TV browsers.
*/
.slide img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: auto !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

#fallback {
  display: none;
  text-align: center;
  padding: 2rem;
  z-index: 3;
}

#fallback.is-visible {
  display: block;
}

#fallback h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 0.5rem;
  color: #c4a35a;
}

#fallback p {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.95rem;
  opacity: 0.85;
}

#tv-chrome {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 25;
  max-width: min(22rem, calc(100% - 2rem));
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

#live-status {
  margin: 0 0 0.45rem;
  padding: 0.35rem 0.55rem;
  background: rgba(5, 9, 19, 0.75);
  border: 1px solid rgba(196, 163, 90, 0.35);
  font-size: 0.78rem;
  opacity: 0.9;
}

#live-status.is-live {
  border-color: #2f7a4a;
}

#tv-auth-toggle,
#tv-auth-logout,
#tv-auth button {
  border: 1px solid #c4a35a;
  background: rgba(5, 9, 19, 0.85);
  color: #f2efe8;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

#tv-auth {
  display: none;
  margin-top: 0.4rem;
  padding: 0.75rem;
  background: rgba(5, 9, 19, 0.92);
  border: 1px solid rgba(196, 163, 90, 0.45);
}

#tv-auth.is-open {
  display: block;
}

#tv-auth label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

#tv-auth input {
  font: inherit;
  padding: 0.4rem 0.5rem;
  max-width: 100%;
}

#tv-auth-msg {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

body.is-fullscreen #tv-chrome {
  display: none;
}

#fs-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 3.2rem;
  z-index: 20;
  border: 2px solid #c4a35a;
  background: rgba(5, 9, 19, 0.85);
  color: #f2efe8;
  padding: 0.75rem 1.1rem;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

#fs-btn:hover {
  background: #c4a35a;
  color: #050913;
}

#fs-btn.is-hidden {
  display: none;
}

#beattie-designer-credit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  background: rgba(5, 9, 19, 0.72);
  margin: 0;
  padding: 0.35rem 1rem !important;
  font-size: 0.7rem;
}

body.is-fullscreen #beattie-designer-credit-bar {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .slide { transition: none; }
}
