* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: #fff; overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }

#stage { position: relative; width: 100vw; height: 100vh; }
#video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }

#subs {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  width: max-content; max-width: 92%;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; text-align: center;
}
.cue {
  font-size: clamp(16px, 3.4vw, 40px); line-height: 1.3; font-weight: 600;
  background: rgba(0, 0, 0, .72); padding: .12em .55em; border-radius: 6px;
  text-shadow: 0 1px 2px #000; animation: fadein .15s ease-out;
}
.cue small { display: block; font-size: .5em; font-weight: 400; color: #ccc; margin-top: 2px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.pill {
  position: absolute; top: 12px; left: 12px; font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, .65);
  transition: opacity .4s; opacity: 0; pointer-events: none;
}
.pill.show { opacity: 1; }
.pill.live { color: #9be29b; }
.pill.error { color: #ffb4a8; }
.pill.waiting, .pill.connecting { color: #ffd98a; }

.btn {
  position: absolute; top: 12px; right: 12px; font-size: 15px; font-weight: 600;
  padding: 8px 14px; border: 0; border-radius: 8px; cursor: pointer;
  background: #9146ff; color: #fff;
}
.btn.big { top: 50%; right: auto; left: 50%; transform: translate(-50%, -50%); font-size: 20px; padding: 14px 26px; }

.center {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; color: #bbb; font-size: 16px; background: #000;
}
.center[hidden] { display: none; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #333; border-top-color: #9146ff;
  animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#debug { position: absolute; top: 44px; left: 12px; font: 12px/1.4 ui-monospace, monospace;
  background: rgba(0, 0, 0, .7); padding: 6px 8px; border-radius: 6px; white-space: pre; }
