:root {
  color-scheme: dark;
  font: 14px/1.45 "Segoe UI", system-ui, sans-serif;
  color: #f2f2f2;
  background: #111;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
header, .brand, .actions { display: flex; align-items: center; }
header {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 50px;
  padding: max(6px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  background: #151515;
  border-bottom: 1px solid #363636;
}
.brand { margin-right: auto; gap: 12px; font-weight: 600; white-space: nowrap; }
.brand img { width: 48px; height: auto; }
.brand span { padding-left: 12px; border-left: 1px solid #414141; }
.actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions:not(:has(button:not([hidden]))) { display: none; }
#status { color: #aaa; font-size: 12px; }
#status::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px;
}
#status[data-state="live"] { color: #78c7b7; }
#status[data-state="paused"], #status[data-state="connecting"] { color: #d7b25f; }
#status[data-state="error"] { color: #e1b4b8; }
main {
  position: relative;
  display: grid;
  place-items: center;
  overflow: auto;
  background: radial-gradient(ellipse at center, #232323, #171717 75%);
}
main::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(#424242 0.8px, transparent 0.8px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse, transparent 12%, #0009 80%);
}
video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #111; }
section { position: relative; margin: auto; width: min(100%, 380px); padding: 24px; text-align: center; }
.panel-brand {
  display: flex; align-items: center; justify-content: center; gap: .3em;
  font-size: 26px; font-weight: 600; line-height: 1;
}
.panel-brand img { width: 2.91em; height: auto; }
h1 { margin: 16px 0 6px; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; color: #aaa; }
form { display: grid; gap: 12px; margin: 24px auto 0; }
label { display: grid; gap: 6px; text-align: left; font-size: 12px; color: #d9d9d9; }
input, button { border-radius: 5px; font: inherit; }
input { width: 100%; padding: 10px 12px; border: 1px solid #414141; background: #202020; color: inherit; }
button { padding: 8px 13px; font-weight: 600; cursor: pointer; }
.primary { color: #c5e0f5; background: #293b49; border: 1px solid #4a7498; }
.primary:hover { background: #3e556b; }
.secondary { color: #d9d9d9; background: #262626; border: 1px solid #414141; font-size: 12px; }
.secondary:hover { background: #303030; }
:focus-visible { outline: 2px solid #8db7da; outline-offset: 2px; }
#play { margin: 18px auto 0; }
video.navigable { touch-action: none; cursor: grab; user-select: none; }
video.navigable:active { cursor: grabbing; }
dialog { width: min(360px, calc(100% - 32px)); max-height: 90dvh; padding: 20px; border: 1px solid #414141; border-radius: 8px; background: #232323; color: inherit; }
dialog::backdrop { background: #0008; }
dialog h2 { margin: 0; font-size: 18px; }
dialog h3 { margin: 16px 0 8px; font-size: 14px; }
dialog dl + h3 { padding-top: 14px; border-top: 1px solid #414141; }
dialog dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dialog dt { font-weight: 600; }
dialog dd { margin: 0; color: #aaa; }
dialog form { display: flex; justify-content: end; margin-top: 16px; }
@media (max-width: 440px) {
  header { gap: 6px; }
  .brand { gap: 8px; }
  .brand img { width: 36px; }
  .brand span { padding-left: 8px; }
  button { min-height: 44px; }
}
@media (max-height: 440px) {
  section { padding: 12px 24px; }
  .panel-brand { font-size: 19px; }
  h1, form { margin-top: 8px; }
}
