/* The public programme page: the picture and nothing else.
   Every pixel of chrome here is a pixel of the demo that isn't the demo. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: "Barlow Condensed", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

.screen {
  position: relative;
  height: 100dvh;
  display: grid;
  place-items: center;
}

/* Letterbox: the largest 16:9 rectangle that fits, never cropped. */
#programme {
  width: min(100vw, calc(100dvh * 16 / 9));
  box-shadow: 0 0 120px rgba(0, 0, 0, .9);
}

.live-badge {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 700; letter-spacing: .22em;
  background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  transition: opacity .3s;
}
.live-badge .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulse 2s ease-in-out infinite;
}
.live-badge[data-status="reconnecting"] { color: #fbbf24; }
.live-badge[data-status="reconnecting"] .dot {
  background: #fbbf24; box-shadow: 0 0 10px #fbbf24;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.offline {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center; gap: 18px;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(3px);
  letter-spacing: .2em; text-transform: uppercase; font-size: 14px;
  color: #cbd5e1;
}
.offline[hidden] { display: none; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fades away so it isn't in shot, comes back on intent. */
.fs {
  position: absolute; right: 16px; bottom: 16px;
  padding: 8px 14px;
  font: inherit; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: #e2e8f0;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s;
}
body:hover .fs, .fs:focus-visible { opacity: 1; }
.fs:hover { background: rgba(255, 255, 255, .14); }

/* Sound: stays in view until someone turns it on, because a viewer who does
   not know there is sound will never go looking for the button. After that it
   fades like the fullscreen button. */
.sound {
  position: absolute; right: 150px; bottom: 16px;
  display: none;
  padding: 8px 14px;
  font: inherit; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: #fff;
  background: rgba(239, 68, 68, .85);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .3s;
}
body[data-mode="video"] .sound { display: block; }
.sound[data-on="true"] {
  color: #e2e8f0;
  background: rgba(0, 0, 0, .55);
  border-color: rgba(255, 255, 255, .22);
  opacity: 0;
}
body:hover .sound[data-on="true"], .sound:focus-visible { opacity: 1; }
.sound[data-on="true"]:hover { background: rgba(255, 255, 255, .14); }
