/* The signage player (S5, IP-947). Full screen, dark, HTW tokens from the vendored
   htw/htw.css (loaded first, never edited). Everything starts on black so a slow item never
   flashes white. No inline styles anywhere: the CSP has no 'unsafe-inline'. */

html, body.sg-body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--htw-dark-ink);
  cursor: none;
}
body.sg-body { font-family: var(--font-sans); }

/* --- stage: two slots stacked, cross-faded --------------------------------------------- */
.sg-stage {
  position: fixed;
  inset: 0 0 var(--sg-strip-h, 0) 0;
  background: #000;
}
body.sg-has-strip { --sg-strip-h: 7vh; }

.sg-slot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 800ms ease-in-out;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sg-slot.sg-on { opacity: 1; }

.sg-slot img,
.sg-slot video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.sg-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* --- notice template ------------------------------------------------------------------ */
.sg-notice {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 8vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4vh;
  border-left: 1.2vw solid var(--htw-logo-cyan);
}
.sg-notice-navy  { background: var(--htw-navy); color: #fff; }
.sg-notice-blue  { background: var(--htw-blue); color: #fff; }
.sg-notice-light { background: #fff; color: var(--htw-ink); }
.sg-notice-cyan  { background: var(--htw-cyan); color: var(--htw-navy); border-left-color: var(--htw-navy); }
.sg-notice-title {
  margin: 0;
  font-size: 8vh;
  line-height: 1.1;
  font-weight: 700;
}
.sg-notice-body {
  margin: 0;
  font-size: 4.5vh;
  line-height: 1.35;
  white-space: pre-line;
  max-width: 70ch;
}
.sg-notice-image {
  max-height: 35vh;
  max-width: 60vw;
  object-fit: contain;
  align-self: flex-start;
}

/* --- holding slide: nothing is scheduled right now ------------------------------------ */
.sg-holding {
  position: fixed;
  inset: 0 0 var(--sg-strip-h, 0) 0;
  background: var(--htw-navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3vh;
}
.sg-holding[hidden] { display: none; }
.sg-holding-mark {
  font-size: 14vh;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fff;
  opacity: .85;
}
.sg-holding-line {
  width: 18vw;
  height: .6vh;
  background: var(--htw-logo-cyan);
}

/* --- pairing -------------------------------------------------------------------------- */
.sg-pairing {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--htw-navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5vh 5vw;
  box-sizing: border-box;
}
.sg-pairing[hidden] { display: none; }
.sg-pairing-lead { font-size: 5vh; margin: 0 0 3vh; color: var(--htw-dark-slate); }
.sg-pairing-code {
  font-size: 22vh;
  line-height: 1;
  margin: 0 0 5vh;
  font-weight: 700;
  letter-spacing: .15em;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  color: #fff;
  border-bottom: 1vh solid var(--htw-logo-cyan);
  padding-bottom: 2vh;
}
.sg-pairing-help { font-size: 3.6vh; max-width: 60ch; margin: 0; }
.sg-pairing-note { font-size: 2.6vh; color: var(--htw-dark-slate); margin: 3vh 0 0; min-height: 3vh; }

/* --- bottom strip: ticker and clock --------------------------------------------------- */
.sg-strip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sg-strip-h, 7vh);
  z-index: 10;
  background: var(--htw-dark-nav);
  border-top: .4vh solid var(--htw-logo-cyan);
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 3.2vh;
}
.sg-strip[hidden] { display: none; }
.sg-ticker {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
}
.sg-ticker-track {
  display: inline-block;
  padding-left: 100%;
  white-space: nowrap;
  animation: sg-ticker var(--sg-ticker-s, 30s) linear infinite;
}
.sg-ticker-track:empty { animation: none; padding-left: 0; }
@keyframes sg-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
.sg-clock {
  flex: none;
  padding: 0 3vw;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.sg-clock:empty { display: none; }

/* --- takeover: above everything ------------------------------------------------------- */
.sg-takeover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vh 8vw;
  box-sizing: border-box;
  text-align: center;
  background: var(--htw-navy);
  color: #fff;
  border: 2vh solid var(--htw-logo-cyan);
}
.sg-takeover[hidden] { display: none; }
.sg-takeover-warning { background: var(--htw-warning-tint); color: var(--htw-ink); border-color: var(--htw-warning); }
.sg-takeover-danger  { background: var(--htw-danger); color: #fff; border-color: var(--htw-destructive-text); }
.sg-takeover-message {
  margin: 0;
  font-size: 9vh;
  line-height: 1.2;
  font-weight: 700;
  white-space: pre-line;
}

/* --- preview badge (admin host only) -------------------------------------------------- */
.sg-preview-badge {
  position: fixed;
  top: 1vh;
  right: 1vw;
  z-index: 60;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 1.8vh;
  padding: .4vh .8vw;
  border-radius: .5vh;
  pointer-events: none;
}
body.sg-preview { cursor: default; }
