:root {
  color-scheme: dark;
  --bg: #0b1014;
  --band: #101820;
  --panel: #151d24;
  --panel-strong: #1b2630;
  --text: #edf4f7;
  --muted: #aebdc5;
  --line: #2d3b45;
  --gold: #c6b56c;
  --teal: #4aa7a4;
  --green: #7bd88f;
  --red: #ff7a7a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0e12;
  color: #ffffff;
  padding: 0.1rem 0.3rem;
  font-size: 0.92em;
}

button {
  min-height: 40px;
  border: 1px solid #6ccac5;
  border-radius: 8px;
  background: #6ccac5;
  color: #051113;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 20, 0.92);
  padding: 0.8rem max(1rem, calc((100vw - 1180px) / 2));
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand span {
  display: grid;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.topbar nav a {
  border-radius: 8px;
  color: var(--muted);
  padding: 0.45rem 0.65rem;
}

.topbar nav a:hover {
  background: var(--panel);
  color: var(--text);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.native-trigger-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #05080b;
  color-scheme: dark;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 2;
}

.native-trigger-frame-active {
  opacity: 1;
}

.native-bootstrap-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(-100vw, -100vh);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(340px, 1.18fr);
  gap: 1rem;
  align-items: stretch;
  min-height: 520px;
}

.hero-copy,
.player-shell,
.panel,
.explain-band,
.metrics-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 10ch;
  font-size: 4rem;
}

h2 {
  font-size: 1.55rem;
}

.hero-copy p:not(.eyebrow) {
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pill {
  border: 1px solid #44616d;
  border-radius: 999px;
  background: #0d151b;
  color: #d8e7ec;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.38rem 0.62rem;
}

.pill-ok {
  border-color: #4b8f5c;
  color: var(--green);
}

.pill-warn {
  border-color: #9d8549;
  color: var(--gold);
}

.pill-error {
  border-color: #9b4b4b;
  color: var(--red);
}

.pill-muted {
  color: var(--muted);
}

.player-shell {
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  overflow: hidden;
  background: #070b0f;
}

.video-frame {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  background: #05080b;
  aspect-ratio: 16 / 9;
}

.video-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #05080b;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #070b0f;
  background-size: 38px 38px;
  z-index: 3;
}

.video-placeholder strong {
  color: var(--text);
  font-size: 1.25rem;
}

.video-placeholder strong,
.video-placeholder span {
  max-width: min(32rem, 100%);
  overflow-wrap: anywhere;
}

body[data-player-mode="native-firefox-h3-mcquic"] .video-frame,
body[data-player-mode="native-firefox-h3-mcquic-failed"] .video-frame {
  background: #05080b;
}

.player-toolbar {
  display: grid;
  grid-template-columns: auto minmax(10rem, 0.9fr) minmax(12rem, 1.35fr);
  align-items: center;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
  padding: 0.75rem;
}

.renderer-label,
#endpointLabel {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  white-space: normal;
}

#endpointLabel {
  justify-self: end;
  text-align: right;
}

.renderer-label {
  color: #d8e7ec;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1rem;
  overflow: hidden;
  background: var(--line);
}

.metrics-strip div {
  display: grid;
  gap: 0.25rem;
  background: var(--panel-strong);
  padding: 1rem;
}

.metrics-strip span,
.telemetry-grid span {
  color: var(--muted);
  font-size: 0.82rem;
}

.metrics-strip strong,
.telemetry-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.35rem;
  line-height: 1.15;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.panel {
  padding: 1.35rem;
}

.panel-heading {
  margin-bottom: 1rem;
}

.detail-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.telemetry-grid div {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111820;
  padding: 0.8rem;
}

.panel-note {
  margin: 1rem 0 0;
  color: var(--muted);
}

.native-trigger-note {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.status-ok {
  color: var(--green);
}

.status-warn {
  color: var(--gold);
}

.status-error {
  color: var(--red);
}

.support-list,
.install-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.support-list li,
.install-list li {
  margin: 0.45rem 0;
}

.support-list strong {
  color: var(--text);
}

.support-pass {
  color: var(--green);
}

.support-fail {
  color: var(--red);
}

.explain-band {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1.5rem;
}

.explain-band p:last-child {
  margin: 0;
  color: var(--muted);
}

.live-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  border-top: 1px solid var(--line);
  margin: 0 auto;
  color: var(--muted);
  padding: 1.2rem 0 2rem;
}

.live-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.live-footer nav a {
  border-radius: 8px;
  color: var(--muted);
  padding: 0.45rem 0.65rem;
}

.live-footer nav a:hover {
  background: var(--panel);
  color: var(--text);
}

@media (max-width: 920px) {
  .hero-band,
  .content-grid,
  .explain-band {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 12ch;
    font-size: 3rem;
  }

  .hero-band {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .live-footer {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 1rem, 1180px);
  }

  .topbar nav {
    justify-content: flex-start;
  }

  .live-footer nav {
    justify-content: flex-start;
  }

  main {
    width: min(100% - 1rem, 1180px);
    padding-top: 0.5rem;
  }

  .hero-copy,
  .panel,
  .explain-band {
    padding: 1rem;
  }

  h1 {
    font-size: 2.35rem;
  }

  .metrics-strip,
  .telemetry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .player-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .video-frame {
    min-height: 0;
  }

  .renderer-label,
  #endpointLabel {
    text-align: left;
    white-space: normal;
  }
}
