:root {
  --bg: #09090a;
  --fg: #ecebe6;
  --muted: #7d7b75;
  --line: #222224;
  --chip: #141416;
  --accent: #e5484d;
  color-scheme: dark;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

main { display: grid; grid-template-rows: auto 1fr; height: 100dvh; }

.bar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; font-size: 13px; letter-spacing: .02em;
  border-bottom: 1px solid var(--line);
  transition: opacity .3s;
}
.brand { font-weight: 600; letter-spacing: .18em; text-transform: uppercase; font-size: 12px; }
.muted { color: var(--muted); }
#copy { margin-left: auto; }

.live { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

#stage { position: relative; min-height: 0; display: grid; place-items: center; }
video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity .4s; }
[data-state="watching"] video, [data-state="sharing"] video { opacity: 1; }

.idle { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 16px; text-align: center; }
[data-state="watching"] .idle { display: none; }
[data-state="sharing"] .idle { display: none; }
.status { margin: 0; color: var(--muted); font-size: 15px; }

.primary {
  border: 1px solid var(--fg); background: var(--fg); color: var(--bg);
  padding: 14px 30px; border-radius: 999px; font-size: 16px; font-weight: 600;
  transition: transform .15s, background .15s;
}
.primary:not(:disabled):hover { transform: translateY(-1px); }
.primary:not(:disabled):active { transform: translateY(0); }

.opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.seg { display: inline-flex; background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 12px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.note { margin: 0; max-width: 420px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.ghost { white-space: nowrap; border: 1px solid var(--line); background: rgba(9, 9, 10, .7); padding: 6px 12px; border-radius: 999px; font-size: 12px; backdrop-filter: blur(6px); }
.ghost:hover { border-color: var(--muted); }
.danger { color: var(--accent); }

.hud {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
[data-state="watching"] .hud, [data-state="sharing"] .hud { opacity: 1; pointer-events: auto; }
[data-state="watching"].calm .hud, [data-state="watching"].calm .bar { opacity: 0; }
[data-state="watching"].calm { cursor: none; }
.stats { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font: 11px/1 ui-monospace, "JetBrains Mono", monospace; color: var(--muted); background: rgba(9, 9, 10, .7); padding: 6px 10px; border-radius: 999px; }
.stats:empty { display: none; }
.controls { margin-left: auto; display: flex; gap: 8px; }

/* em tela cheia o vídeo ocupa tudo */
:fullscreen .bar { display: none; }
:fullscreen main { grid-template-rows: 1fr; }

@media (max-width: 520px) {
  .bar { gap: 10px; }
  #people { display: none; }
  .hud { flex-wrap: wrap; justify-content: flex-end; }
  .stats { order: 2; flex-basis: 100%; text-align: right; background: none; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
