:root {
  color-scheme: dark;
  --ink: #f5f5f5;
  --ink-bright: #ffffff;
  --muted: rgba(255, 255, 255, 0.6);
  --dim: rgba(255, 255, 255, 0.45);
  --surface: #181b20;
  --surface-2: #1f2227;
  --line: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.3);
  --accent: #41c77a;
  --accent-hover: #66d794;
  --accent-ink: #07130d;
  --accent-soft: rgba(50, 152, 220, 0.15);
  --label: #fc8403;
  --danger: #f14668;
  --danger-hover: #ff3860;
  --warning: #ffdd57;
  --page: #14161a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  display: flex;
  flex-direction: column;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.site-header,
footer {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  gap: 11px;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 27px;
  height: 27px;
  border: 1px solid rgba(65, 199, 122, 0.36);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.brand-mark i {
  display: block;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
}

.brand-mark i:nth-child(1) {
  height: 5px;
}
.brand-mark i:nth-child(2) {
  height: 11px;
}
.brand-mark i:nth-child(3) {
  height: 7px;
}

.header-note,
footer {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

main {
  flex: 1;
}

.page {
  width: min(1060px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(58px, 9vh, 110px) 0 90px;
}

#sharerView {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 40px);
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--label);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  font-weight: 640;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.lede {
  max-width: 36rem;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.7;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 36px);
}

.center-stack {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.share-glyph {
  position: relative;
  width: 94px;
  height: 72px;
  margin-bottom: 38px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 9px;
}

.share-glyph::after {
  content: "";
  position: absolute;
  left: 29px;
  right: 29px;
  bottom: -11px;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 9px 0 -0.5px rgba(255, 255, 255, 0.55);
}

.share-glyph span,
.share-glyph b {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 50%;
  inset: 20px 31px;
}

.share-glyph b {
  inset: 13px 24px;
  opacity: 0.36;
}

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    opacity 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:focus-visible,
.icon-button:focus-visible,
.sound-prompt:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.button-primary {
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 600;
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.button-large {
  min-width: 190px;
  min-height: 50px;
  border-radius: 8px;
  font-size: 1rem;
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface-2);
}

.button-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.button-danger {
  border-color: rgba(241, 70, 104, 0.3);
  color: var(--danger);
}

.button-danger:hover:not(:disabled) {
  border-color: rgba(255, 56, 96, 0.5);
  color: var(--danger-hover);
}

.fine-print,
.viewer-footnote {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.session-bar,
.viewer-heading,
.media-controls,
.action-row {
  display: flex;
  align-items: center;
}

.session-bar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill,
.viewer-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 670;
  letter-spacing: 0.025em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(65, 199, 122, 0.12);
}

.status-dot.status-waiting,
.status-dot.is-ended {
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(255, 221, 87, 0.12);
}

.video-frame {
  position: relative;
  overflow: hidden;
  background: #0a0c0f;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.local-frame {
  aspect-ratio: 16 / 10;
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0c0f;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  background: var(--surface-2);
  text-align: center;
}

.notice,
.error-message {
  margin: 14px 0 0;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 0.79rem;
  line-height: 1.45;
}

.notice {
  color: var(--warning);
  background: rgba(255, 221, 87, 0.08);
  border: 1px solid rgba(255, 221, 87, 0.15);
}

.error-message {
  color: #ffb0bd;
  background: rgba(241, 70, 104, 0.08);
  border: 1px solid rgba(241, 70, 104, 0.2);
}

.field-label {
  display: block;
  margin: 22px 0 9px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.link-row input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink-bright);
  background: var(--page);
  font-size: 0.82rem;
}

.action-row {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.viewer-page {
  max-width: 1180px;
  padding-top: 48px;
}

.viewer-heading {
  justify-content: space-between;
  margin-bottom: 28px;
}

.leave-link {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 670;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.leave-link:hover {
  color: var(--ink-bright);
}

.remote-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.viewer-overlay strong {
  color: var(--ink);
  font-size: 1rem;
}

.viewer-overlay span:last-child {
  max-width: 330px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.loader {
  width: 25px;
  height: 25px;
  margin-bottom: 7px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.play-prompt {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  min-height: 44px;
  border: 1px solid rgba(65, 199, 122, 0.32);
  border-radius: 8px;
  padding: 0 21px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  font-weight: 640;
  cursor: pointer;
}

.play-prompt:hover {
  background: var(--accent-hover);
}

.media-controls {
  min-height: 67px;
  gap: 12px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.icon-button:disabled {
  color: #596273;
  cursor: default;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button .vol-muted {
  display: none;
}

.icon-button.is-muted .vol-wave {
  display: none;
}

.icon-button.is-muted .vol-muted {
  display: inline;
}

.icon-button.is-low .vol-wave-high {
  display: none;
}

.volume-slider {
  width: 110px;
  accent-color: var(--accent);
}

.volume-slider:disabled {
  opacity: 0.35;
}

.control-spacer {
  flex: 1;
}

.fullscreen-button span {
  width: 15px;
  height: 15px;
  border: solid currentColor;
  border-width: 2px 0 0 2px;
  position: relative;
}

.fullscreen-button span::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  right: -1px;
  bottom: -1px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
}

.viewer-footnote {
  margin-top: 0;
  text-align: center;
}

.unsupported-page {
  max-width: 680px;
}

.unsupported-page h1 {
  font-size: clamp(2.5rem, 7vw, 4.6rem);
}

footer {
  min-height: 80px;
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  #sharerView {
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

  .intro {
    max-width: 610px;
  }

  .center-stack {
    min-height: 310px;
  }
}

@media (max-width: 560px) {
  .site-header,
  footer,
  .page {
    width: min(100% - 26px, 1060px);
  }

  .header-note {
    display: none;
  }

  .site-header {
    min-height: 70px;
  }

  .page {
    padding-top: 38px;
  }

  #sharerView {
    gap: 35px;
  }

  .card {
    border-radius: 10px;
  }

  .link-row {
    grid-template-columns: 1fr;
  }

  .link-row .button {
    width: 100%;
  }

  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .remote-frame {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
  }

  .play-prompt {
    bottom: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
