/* Display page — what the TV shows. Deliberately plain: no animation loops. */
.hidden { display: none !important; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif; cursor: default; }
body.idle { cursor: none; }

#stage {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7vh 8vw;
  transition: background-color .4s ease, color .4s ease;
}
#headline { font-weight: 800; line-height: 1.02; letter-spacing: -.02em; margin: 0; overflow-wrap: anywhere; font-size: clamp(40px, 10vw, 220px); }
#headline[data-len="m"] { font-size: clamp(32px, 7vw, 160px); }
#headline[data-len="l"] { font-size: clamp(28px, 5vw, 110px); }
#subtext { margin: 3vh 0 0; font-size: clamp(18px, 3vw, 64px); line-height: 1.25; opacity: .88; overflow-wrap: anywhere; max-width: 60ch; }
#subtext[data-len="l"] { font-size: clamp(16px, 2.2vw, 44px); }

/* Remote blackout and local stop are plain black layers. No strobe, no fade loops. */
.black { position: fixed; inset: 0; background: #000; }
/* Local stop is the top layer of the page — above pairing, error and status panels. */
#localStop { z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
#localStop p { color: #2a2a2a; font: 13px ui-monospace, monospace; margin: 0 0 18px; }
#localStop button { font: inherit; color: #3a3a3a; background: none; border: 1px solid #222; border-radius: 6px; padding: 2px 6px; cursor: pointer; }
#remoteBlackout { z-index: 10; }

#chip {
  position: fixed; right: 14px; bottom: 12px; z-index: 30;
  font: 12px/1 ui-monospace, "SF Mono", Menlo, monospace;
  color: #bbb; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.15);
  padding: 7px 9px; border-radius: 8px; transition: opacity .6s;
}
#chip.fade { opacity: 0; }
#chip[data-tone="bad"] { color: #ffb0a5; }
#chip[data-tone="warn"] { color: #f2d27a; }

#tools {
  position: fixed; left: 12px; top: 12px; z-index: 60; display: flex; gap: 8px;
  transition: opacity .3s;
}
body.idle #tools { opacity: 0; pointer-events: none; }
#tools button {
  font: 600 13px ui-sans-serif, system-ui, sans-serif; color: #eee; background: rgba(20,20,20,.8);
  border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 8px 12px; cursor: pointer;
}
#tools button.stop { background: #000; border-color: #f5e663; color: #f5e663; }

#localBanner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #f2c14e; color: #1a1200; font: 600 14px ui-sans-serif, system-ui, sans-serif; text-align: center; padding: 6px; }

#pairPanel, #supersededPanel {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: #121210; color: #f3efe4; font-family: ui-sans-serif, system-ui, sans-serif;
}
.panel .box { width: min(460px, calc(100% - 32px)); }
.panel h2 { margin: 0 0 8px; }
.panel p { color: #a9a293; margin: 0 0 14px; }
#pairPanel form { display: flex; gap: 8px; }
#pairPanel input { flex: 1; font: 20px ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; padding: 12px; border-radius: 10px; border: 1px solid #3a3730; background: #1c1b18; color: inherit; }
.panel button { font: 600 16px ui-sans-serif, system-ui, sans-serif; padding: 12px 16px; border-radius: 10px; border: 0; background: #f5e663; color: #1a1800; cursor: pointer; }
#pairPanel .err { color: #ff8a7a; min-height: 1.4em; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  #stage, #chip, #tools { transition: none; }
}
