:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #100f1d;
  color: #f6f4ff;
  font-synthesis: none;
  --border: #38364c;
  --muted: #b6b2ca;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; }
button, input { font: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid #af9dff;
  outline-offset: 4px;
}

.site-header {
  border-bottom: 1px solid #29273b;
  background: #171628;
}

.site-header-inner {
  width: min(100% - 40px, 1140px);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #f6f4ff;
  font-size: 1.06rem;
  font-weight: 720;
  letter-spacing: -.025em;
  text-decoration: none;
}

.brand img { flex: none; border-radius: 10px; }

.button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: .83rem;
  font-weight: 650;
  line-height: 1.2;
}

.button-light {
  background: #292740;
  border-color: #44405f;
  color: #f2eeff;
}

.button-light:hover { background: #393454; }

.button-primary {
  background: #b6a8ff;
  color: #181132;
}

.button-primary:hover { background: #c6bbff; }

.button-dark {
  background: #19182b;
  border-color: var(--border);
  color: #e8e3fa;
}

.button-dark:hover { background: #292640; }

main {
  width: min(100% - 40px, 1140px);
  margin: 0 auto;
}

.viewer {
  display: grid;
  justify-items: center;
  gap: clamp(18px, 3vh, 30px);
  padding: clamp(18px, 3vh, 32px) 0 26px;
}

.viewer-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.viewer-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 720;
  letter-spacing: -.055em;
  line-height: 1.05;
}

.viewer-actions, .dialog-actions, .app-links { display: flex; flex-wrap: wrap; gap: 8px; }

.feeds {
  --phone-width: clamp(160px, calc((100svh - 280px) * .47368), 390px);
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, var(--phone-width)));
  justify-content: center;
  gap: clamp(12px, 4vw, 58px);
  padding: clamp(12px, 3vw, 24px);
  border: 1px solid #322f47;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 25% 0%, #2b234b 0%, transparent 53%),
    radial-gradient(ellipse at 83% 0%, #1a2847 0%, transparent 47%),
    #141325;
}

.feed-leon { --feed-color: #c6b7ff; }
.feed-parth { --feed-color: #a6cbff; }

.feed-header {
  min-height: 24px;
  margin: 0 2px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.feed-header h2 {
  margin: 0;
  color: var(--feed-color);
  font-size: clamp(.88rem, 2.8vw, 1.15rem);
  font-weight: 660;
  letter-spacing: -.014em;
}

.feed-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  white-space: nowrap;
}

.feed-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.feed-status[data-state='waiting'] { color: #f3ca89; }
.feed-status[data-state='live'] { color: #86e5b6; }

.phone {
  position: relative;
  aspect-ratio: 9 / 19;
  overflow: hidden;
  border: 1px solid #484359;
  border-radius: clamp(14px, 3vw, 28px);
  background: #090810;
  box-shadow: 0 12px 22px #05040f66;
}

.placeholder, .video, .video iframe { position: absolute; inset: 0; }

.placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  font-size: clamp(.75rem, 2.5vw, .88rem);
  background: radial-gradient(ellipse at center, #19172c 0%, #0e0d19 70%);
}

.phone-mark {
  width: 25px;
  height: 42px;
  border: 1.5px solid var(--feed-color);
  border-radius: 7px;
  opacity: .75;
}

.phone-mark::after {
  display: block;
  content: '';
  width: 7px;
  height: 2px;
  margin: 4px auto 0;
  border-radius: 2px;
  background: var(--feed-color);
}

.video { pointer-events: none; }
.video iframe { width: 100%; height: 100%; border: 0; }

.notice {
  margin: 0 0 16px;
  color: #d7caff;
  text-align: right;
  font-size: .88rem;
}

.notice:empty { margin: 0; }

.viewer:fullscreen {
  overflow: auto;
  align-content: start;
  gap: 12px;
  padding: 8px clamp(12px, 3vw, 30px);
  background: #100f1d;
}

.viewer:fullscreen .viewer-header { justify-content: flex-end; }
.viewer:fullscreen h1, .viewer:fullscreen #share { display: none; }
.viewer:fullscreen .feeds {
  --phone-width: clamp(160px, calc((100svh - 112px) * .475), 540px);
  padding: 3px 8px;
  border: 0;
  background: transparent;
}

dialog {
  width: min(100% - 28px, 500px);
  max-height: calc(100% - 28px);
  padding: clamp(17px, 4vw, 27px);
  border: 1px solid #4a4364;
  border-radius: 16px;
  background: #1d1a30;
  color: #f6f4ff;
  box-shadow: 0 20px 70px #03021099;
}

dialog::backdrop { background: #060510b8; }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.04em; }
dialog p { margin: 12px 0; color: #d6cfe8; line-height: 1.5; font-size: .93rem; }
.app-links { gap: 14px; margin-bottom: 21px; }
.app-links a { color: #c6b7ff; text-underline-offset: 3px; }

dialog label { display: block; margin: 12px 0 6px; font-size: .89rem; font-weight: 650; }

dialog input {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #57506d;
  border-radius: 7px;
  color: inherit;
  background: #141124;
}

dialog input::placeholder { color: #a9a2ba; }
dialog input[aria-invalid='true'] { border-color: #ffaab2; }
.form-error { color: #ffb3bd; }
.privacy-note { color: var(--muted); font-size: .8rem; }
.dialog-actions { margin-top: 14px; }

@media (max-width: 500px) {
  .site-header-inner, main { width: calc(100% - 24px); }
  .site-header-inner { min-height: 57px; }
  .feeds { padding: 9px; border-radius: 13px; }
  .feed-header { margin-inline: 0; }
}
