:root {
  color-scheme: dark;
  --bg: #101718;
  --panel: #192223;
  --line: #2d3838;
  --text: #edf0e9;
  --muted: #9aabaa;
  --accent: #cce59c;
  --danger: #ffb4a6;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
[hidden] {
  display: none !important;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  padding: 12px 15px;
  transition:
    background 0.15s,
    transform 0.15s;
  touch-action: manipulation;
}
button:hover {
  background: #293535;
}
button:active {
  transform: scale(0.96);
}
button:disabled {
  opacity: 0.4;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
header {
  height: 92px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -1px;
}
.brand-icon {
  font-size: 32px;
  color: var(--accent);
  margin-right: 9px;
}
.brand-dot {
  color: var(--accent);
  margin-left: -8px;
}
.header-right {
  display: flex;
  gap: 24px;
  align-items: center;
}
.privacy {
  font-size: 12px;
  color: var(--muted);
}
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 5vw 64px;
  min-height: calc(100dvh - 159px);
}
.eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 2.1px;
  color: var(--accent);
}
h1 {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 500;
  letter-spacing: -1.5px;
  margin: 10px 0 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.status {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
}
.status i,
.live-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.status.online i {
  background: var(--accent);
}
.status.error i {
  background: var(--danger);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 30px;
}
.viewer {
  position: relative;
  background: #070c0c;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
}
.viewer video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#player,
#player > camera-player {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}
#video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
  background: #070c0cc9;
}
.live-label {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #101718aa;
  padding: 7px 9px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 5px;
  pointer-events: none;
}
.live-label i {
  background: var(--accent);
}
.video-toolbar {
  display: flex;
  gap: 9px;
  margin-top: 15px;
}
.video-toolbar button {
  font-size: 12px;
}
.video-toolbar #reconnect {
  margin-left: auto;
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.stream-info {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  padding: 18px 1px;
}
.controls {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #151e1f;
  padding: 23px;
}
.controls section + section {
  border-top: 1px solid var(--line);
  margin-top: 23px;
  padding-top: 23px;
}
h2 {
  font-size: 13px;
  font-weight: 550;
  margin: 0 0 15px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.section-title span {
  font-size: 9px;
  color: var(--muted);
}
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  max-width: 216px;
  margin: 6px auto 14px;
}
.dpad button {
  height: 55px;
  padding: 5px;
  font-size: 23px;
  border-radius: 11px;
}
.dpad #stop {
  background: var(--accent);
  color: #1e2b19;
  border: none;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.dpad small {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
}
.hint {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin: 8px 0 0;
}
.presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.presets button {
  font-size: 11px;
  padding: 10px;
}
.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}
.segmented button {
  flex: 1;
  font-size: 11px;
  border: none;
  padding: 9px 4px;
  background: transparent;
  border-radius: 6px;
}
.segmented button.selected {
  background: var(--accent);
  color: #1e2b19;
}
.notice {
  font-size: 13px;
  color: var(--danger);
  line-height: 1.6;
  min-height: 22px;
}
.login {
  max-width: 390px;
  margin: 6vh auto;
}
.login p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.login form {
  margin-top: 32px;
}
.login label {
  display: block;
  font-size: 12px;
  margin: 20px 0 8px;
}
.login input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel);
}
.primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  background: var(--accent);
  color: #1e2b19;
  font-weight: 600;
  border: none;
  margin-top: 24px;
}
.primary:hover {
  background: #deefbd;
}
#login-error {
  color: var(--danger);
  min-height: 22px;
}
.loading {
  text-align: center;
  color: var(--muted);
  margin: 20vh 0;
}
footer {
  border-top: 1px solid var(--line);
  padding: 23px 5vw;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.8px;
}
@media (max-width: 850px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .controls section:first-child {
    grid-row: span 2;
  }
  .controls section + section {
    margin: 0;
    padding: 0;
    border: none;
  }
  .controls section:last-child {
    border-top: 1px solid var(--line);
    padding-top: 18px;
  }
  .viewer {
    border-radius: 12px;
  }
  main {
    padding-top: 30px;
  }
  .page-heading {
    margin-bottom: 24px;
  }
}
@media (max-width: 500px) {
  header {
    height: 72px;
  }
  .privacy {
    display: none;
  }
  main {
    padding: 28px 18px 40px;
  }
  .page-heading {
    align-items: flex-end;
  }
  .status {
    font-size: 10px;
    padding-bottom: 5px;
  }
  h1 {
    font-size: 32px;
  }
  .controls {
    padding: 16px;
    gap: 16px;
    grid-template-columns: 1.05fr 1fr;
  }
  .dpad {
    gap: 5px;
  }
  .dpad button {
    height: 46px;
  }
  .section-title span {
    display: none;
  }
  .presets {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .presets button {
    padding: 10px 4px;
  }
  .segmented {
    flex-wrap: wrap;
  }
  .segmented button {
    font-size: 10px;
  }
  .video-toolbar {
    gap: 5px;
  }
  .video-toolbar button {
    font-size: 11px;
    padding: 11px 9px;
  }
  .video-toolbar #reconnect {
    font-size: 10px;
    padding: 10px 2px;
  }
  .stream-info {
    font-size: 9px;
  }
  .hint {
    font-size: 10px;
  }
  footer {
    font-size: 8px;
    gap: 20px;
  }
  .eyebrow {
    font-size: 9px;
  }
}

.stream-info {
  align-items: center;
}
.stream-info button {
  font-size: 10px;
  padding: 3px 0;
}
#notice:empty {
  display: none;
}

.dpad button[data-direction] { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dpad button.holding { background: var(--accent, #c8dd8a); color: #182016; }
