/* TV shell: views, the scaled 1920×1080 stage, fades, pixel shift and badges. */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

/* Black until the first answer from the API, so a connected TV never flashes white. */
body.tv {
  background: var(--sleep-bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
}

[hidden] { display: none !important; }

.view {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 8vw;
  text-align: center;
}

/* No key: a white page with a short text. No data, no images, no office name. */
.public {
  background: #FFFFFF;
}

.public p {
  margin: 0;
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 80px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.public-sticker {
  justify-self: center;
  width: clamp(80px, 9vw, 180px);
  margin-bottom: 3vh;
  transform: rotate(-8deg);
  animation: public-drift 17s ease-in-out infinite alternate;
}

@keyframes public-drift {
  from { transform: translate(-8px, 6px) rotate(-12deg); }
  to   { transform: translate(8px, -10px) rotate(-4deg); }
}

.public p::after {
  content: "";
  display: block;
  width: 3ch;
  height: 0.18em;
  margin: 0.6em auto 0;
  background: var(--hiq-pink);
}

/* Sleep: black, and a note that is barely visible (opacity at most 0.08, about #141414) */
.sleep {
  position: fixed;
  inset: 0;
  background: var(--sleep-bg);
  overflow: hidden;
}

.sleep-note,
.sleep-diamond {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  color: #FFFFFF;
  opacity: 0;
  transition: opacity 4s ease-in-out;
  white-space: nowrap;
}

.sleep-note {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.sleep-diamond {
  width: 48px;
  height: 40px;
}

.sleep-note.is-visible,
.sleep-diamond.is-visible { opacity: 0.08; }

/* ---- The stage: built for 1920×1080, scaled to fit, centered, black bars otherwise ---- */
.screen {
  position: fixed;
  inset: 0;
  background: #000000;
  overflow: hidden;
}

.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  transform: translate(-50%, -50%) scale(var(--stage-scale, 1));
  overflow: hidden;
  background: var(--ink);
}

/* Against burn-in: the whole content moves 0→8 px and 0→6 px and back, over 240 s (design.md → Rörelse). */
.shift {
  position: absolute;
  inset: 0;
  animation: shell-shift 240s ease-in-out infinite;
}

@keyframes shell-shift {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(8px, 0); }
  50%      { transform: translate(8px, 6px); }
  75%      { transform: translate(0, 6px); }
}

.skin-root {
  position: absolute;
  inset: 0;
}

/* Fade via black when the skin changes: 0.75 s out, 0.75 s in. */
.fade {
  position: absolute;
  inset: 0;
  background: #000000;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.75s ease-in-out;
  z-index: 10;
}

.fade.is-clear { opacity: 0; }

/* ---- Badges: simulation and preview bottom left, fetch problems bottom right ---- */
.badges {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  gap: 12px;
  padding: 0 80px 14px;
  pointer-events: none;
  z-index: 5;
}

.badge {
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(20, 18, 28, 0.85);
  color: var(--dark-muted);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.badge-status {
  margin-left: auto;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-weight: 500;
}
