@font-face {
  font-family: "Instrument Sans";
  src: url("/watch/assets/instrument-sans-v1.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Instrument Sans", sans-serif;
  color: #f7f1eb;
  background: #111015;
  --text: #f7f1eb;
  --muted: #bdb4be;
  --surface: #1a181f;
  --line: #39323f;
  --accent: #ff906e;
  --accent-hover: #ffad94;
  --green: #a7e1be;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 1rem; min-width: 280px; }
button, input { font: inherit; }
a, button, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
h1, h2, p { margin: 0; }
.wrap { width: min(1380px, calc(100% - 96px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid #2b252f; }
.nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.brand-mark {
  width: 33px;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--accent);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #251719;
}
.brand-mark span {
  display: block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}
.subtle-link { color: var(--muted); font-size: .95rem; text-decoration: none; }
.subtle-link:hover { color: var(--text); }

.entry {
  min-height: min(740px, calc(100svh - 77px));
  padding-block: clamp(48px, 8vh, 96px);
  display: grid;
  grid-template-columns: minmax(290px, .87fr) minmax(0, 1.13fr);
  align-items: center;
  gap: clamp(36px, 6vw, 104px);
}
.intro h1 { font-size: clamp(3.5rem, 6.1vw, 6.5rem); line-height: .99; letter-spacing: -.063em; word-spacing: .07em; }
.intro h1 em { color: var(--accent); font-style: normal; }
.intro > p { font-size: 1.15rem; line-height: 1.55; color: var(--muted); margin-top: 24px; max-width: 30ch; }
.entry-form { margin-top: 34px; max-width: 365px; display: grid; gap: 10px; }
.entry-form .button { margin-top: 4px; }
.entry-image {
  aspect-ratio: 1.16;
  min-height: 340px;
  border-radius: 22px;
  position: relative;
  background:
    linear-gradient(0deg, #130e1c57, transparent 65%),
    #211a2e url("/watch/assets/cinema-v1.webp") center center / cover no-repeat;
  box-shadow: inset 0 0 0 1px #d1abd22b, 0 20px 90px #09070b80;
  overflow: hidden;
}
.image-frame { position: absolute; inset: 14px; border-radius: 14px; border: 1px solid #e9bdcd27; }

label { font-weight: 600; color: var(--muted); font-size: .9rem; }
input:not([type="range"]) {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  min-height: 46px;
  color: var(--text);
  background: #15131a;
  border: 1px solid var(--line);
  border-radius: 10px;
}
input::placeholder { color: #a59ba8; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 16px;
  font-weight: 700;
  letter-spacing: -.014em;
  border: 1px solid transparent;
  border-radius: 10px;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease;
}
.accent { background: var(--accent); color: #261719; }
.accent:hover:not(:disabled) { background: var(--accent-hover); }
.secondary { background: #211d26; color: var(--text); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #302837; border-color: #57465c; }
.notice { font-size: .95rem; line-height: 1.45; }
.error { color: #ffb09f; }

.room { padding-block: 36px 48px; }
.room-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.room-top h1 { font-size: clamp(2rem, 4vw, 3.55rem); line-height: 1.07; letter-spacing: -.048em; word-spacing: .05em; overflow-wrap: anywhere; }
.connection-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .9rem; margin-bottom: 7px; }
.connection-state > span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.connection-state[data-live="true"] > span { background: var(--green); }
.icon-copy {
  width: 12px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  box-shadow: -3px 3px 0 -1px #211d26, -3px 3px 0 0 currentColor;
  margin: 0 0 3px 3px;
}
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 310px); align-items: start; gap: 24px; }
.room-side, .viewer { min-width: 0; display: grid; gap: 16px; }
.screen { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #141117; }
.picture { aspect-ratio: 16 / 9; background: #0a090d; isolation: isolate; position: relative; }
video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  background: linear-gradient(0deg, #100d16d4 0%, #15101bc2 54%, #15101b98), #211a2e url("/watch/assets/cinema-v1.webp") center 46% / cover no-repeat;
}
.stage-inner { max-width: 460px; display: grid; justify-items: center; gap: 8px; }
.stage-mark { width: 38px; box-shadow: 0 6px 28px #f5806338; margin-bottom: 5px; }
.stage h2 { font-size: clamp(1.25rem, 2.65vw, 2.4rem); letter-spacing: -.045em; line-height: 1.1; }
.stage p { line-height: 1.4; color: #d8cfd9; text-wrap: balance; }
.stage[data-error] { overflow: auto; place-items: safe center; }
.stage[data-error] p { color: #ffc1b2; overflow-wrap: anywhere; }
.stage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stage-actions:not(:has(> :not([hidden]))) { display: none; }
.download-status { display: grid; gap: 6px; width: min(290px, 100%); }
.download-status progress { width: 100%; accent-color: var(--accent); }
.download-status output, .stream-info { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.stage .button { margin-top: 6px; }
.playback-prompt { position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 5px 32px #100c11bd; }
.video-buffering, .subtitle-playback-error {
  position: absolute;
  z-index: 3;
  left: 50%;
  max-width: calc(100% - 20px);
  padding: 8px 12px;
  border-radius: 9px;
  background: #15121ce8;
  text-align: center;
  font-size: .85rem;
  pointer-events: none;
}
.video-buffering {
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 8px;
}
.buffering-ring {
  width: 32px;
  height: 32px;
  border: 3px solid #f0e9ea48;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: buffer-spin .85s linear infinite;
}
@keyframes buffer-spin { to { transform: rotate(360deg); } }
.subtitle-playback-error { top: 10px; transform: translateX(-50%); color: #ffc1b2; }
.picture:has(> .stage:not([hidden])) > .subtitle-playback-error { display: none; }
.controls { display: grid; gap: 12px; padding: 12px 18px 14px; background: #16151c; }
.timeline-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.transport-row { display: grid; grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr); align-items: center; gap: 8px; }
.transport-center, .volume-controls { display: flex; align-items: center; gap: clamp(5px, 1.7vw, 18px); }
.fullscreen-button { justify-self: end; }
.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid #34313e;
  background: #1d1c25;
  color: var(--text);
  border-radius: 12px;
}
.icon-button svg, .share-controls svg { width: 23px; height: 23px; }
.icon-button:hover:not(:disabled) { background: #2d2531; }
.primary-play {
  width: 64px;
  height: 64px;
  border-color: transparent;
  border-radius: 18px;
  color: #211419;
  background: var(--accent);
}
.primary-play svg { width: 31px; height: 31px; }
.primary-play:hover:not(:disabled) { background: var(--accent-hover); }
.time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; white-space: nowrap; }
input[type="range"] { accent-color: var(--accent); min-width: 0; margin: 0; cursor: pointer; }
input[type="range"]:disabled { opacity: .45; cursor: default; }
.timeline {
  --seek-thumb-size: 13px;
  --played: 0%;
  --buffered: 0%;
  --track: linear-gradient(to right, var(--accent) 0 var(--played), #88828b var(--played) var(--buffered), #38343e var(--buffered) 100%);
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
}
.timeline::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: var(--track); }
.timeline::-moz-range-track { height: 5px; border-radius: 999px; background: var(--track); }
.timeline::-webkit-slider-thumb {
  appearance: none;
  width: var(--seek-thumb-size);
  height: var(--seek-thumb-size);
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}
.timeline::-moz-range-thumb {
  width: var(--seek-thumb-size);
  height: var(--seek-thumb-size);
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}
.seek-control { min-width: 0; position: relative; display: grid; align-items: center; }
.seek-preview {
  position: absolute;
  z-index: 4;
  bottom: calc(100% + 8px);
  left: clamp(min(96px, 50%), var(--seek-preview-x, 50%), max(50%, calc(100% - 96px)));
  transform: translateX(-50%);
  width: max-content;
  max-width: min(192px, 100%);
  overflow: hidden;
  border: 1px solid #514552;
  border-radius: 8px;
  background: #17131b;
  box-shadow: 0 4px 18px #0009;
  pointer-events: none;
}
.seek-preview :is(img, video) {
  position: static;
  display: block;
  width: 192px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #09080b;
}
.seek-preview-time {
  display: block;
  padding: 4px 9px;
  text-align: center;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.volume { width: min(64px, 5vw); }
.screen:fullscreen { border-radius: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.screen:fullscreen .picture { aspect-ratio: auto; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.mode-options .button { padding-inline: 7px; font-size: .95rem; }
.mode-options .button[aria-pressed="true"] { background: #54352f; border-color: #a6604f; color: #ffe4d9; }
.share-controls { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: #16151c; }
.share-controls .panel-note { margin: 0; flex: 1; }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 9px; }
.share-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.share-grid[data-count="5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.picture[data-shares="true"] { aspect-ratio: auto; }
.share-tile { min-width: 0; margin: 0; overflow: hidden; border-radius: 9px; background: #1b1822; border: 1px solid #39323f; }
.share-tile video { position: static; display: block; aspect-ratio: 16 / 9; height: auto; background: #09080b; }
.share-tile figcaption { display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-width: 0; min-height: 45px; }
.share-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-tile .button { min-height: 32px; padding: 3px 7px; font-size: .85rem; }
.share-state { font-size: .85rem; color: var(--muted); }
.share-controls { flex-wrap: wrap; }
.voice-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: var(--surface); border-top: 1px solid var(--line); padding: 10px 14px;
}
.voice-state { display: grid; flex: 1 1 125px; gap: 3px; }
.voice-state strong { font-size: .92rem; }
#voice-status { font-size: .8rem; color: var(--muted); }
#voice-talk { min-height: 46px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#voice-talk svg { width: 18px; height: 18px; }
#voice-talk kbd { font: inherit; font-size: .73rem; border: 1px solid currentColor; padding: 0 4px; border-radius: 4px; }
#voice-talk[aria-pressed="true"] { background: var(--green); color: #183120; }
.screen:fullscreen { grid-template-rows: minmax(0, 1fr) auto auto; }
@media (pointer: coarse) { #voice-talk kbd { display: none; } }
@media (max-width: 480px) {
  .voice-bar { padding: 8px; }
  .voice-state { flex-basis: 104px; }
  .voice-bar .button { min-height: 46px; padding-inline: 9px; }
}
.screen:fullscreen .share-grid { height: 100%; overflow: auto; align-content: center; }

.panel { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.panel h2 { font-size: 1.125rem; letter-spacing: -.025em; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.member-count { color: #ead9ed; background: #302638; padding: 3px 9px; min-width: 26px; text-align: center; border-radius: 7px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.members { margin: 14px 0; padding: 0; list-style: none; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.member { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.avatar { display: grid; place-items: center; height: 36px; width: 36px; border-radius: 11px; flex: 0 0 auto; background: #473249; color: #f4dcf7; font-weight: 700; }
.avatar.alt { background: #443039; color: #ffd7cf; }
.member-text { min-width: 0; flex: 1; }
.member-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.member-role { display: block; color: var(--muted); font-size: .825rem; }
.member-status { color: var(--muted); font-size: .875rem; flex: 0 0 auto; }
.member-status[data-ready="true"] { color: var(--green); }
.panel-note { margin-top: 12px; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.ready-button { width: 100%; }
.ready-button[aria-pressed="true"] { background: #23342d; border-color: #3f664f; color: var(--green); }
.ready-button[aria-pressed="true"]:hover:not(:disabled) { background: #2b4637; }
.source-panel form { display: grid; gap: 8px; margin-top: 14px; }
.source-panel form button { margin-top: 4px; }
.mobile-setup .panel-note a { color: var(--accent); text-decoration: underline; }
.mobile-settings { display: grid; gap: 7px; margin-top: 14px; }
.mobile-settings p { margin: 4px 0; font-size: .93rem; line-height: 1.5; }
.mobile-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-bottom: 5px; }
.mobile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.comment-form { display: flex; gap: 10px; }
.comments { position: absolute; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 4px; inset: 8px 12px 12px; overflow: hidden; pointer-events: none; }
.comment {
  background: #17121ced;
  color: var(--text);
  border: 1px solid #73556e87;
  border-radius: 8px;
  padding: 5px 8px;
  max-width: min(540px, 88%);
  overflow-wrap: anywhere;
  font-size: .93rem;
  animation: disappear var(--remaining) linear forwards;
}
.comment b { color: #ffc4af; margin-right: 8px; }
@keyframes disappear { 0%, 86% { opacity: 1; } 100% { opacity: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }

@media (max-width: 1020px) {
  .wrap { width: min(100% - 48px, 1380px); }
  .room-grid { gap: 16px; }
  .entry { gap: 36px; }
}
@media (max-width: 780px) {
  .wrap { width: calc(100% - 36px); }
  .nav { min-height: 62px; }
  .entry { grid-template-columns: 1fr; gap: 34px; padding-block: 40px; }
  .entry-form { max-width: 100%; }
  .intro h1 { font-size: clamp(3.4rem, 11vw, 5rem); }
  .intro > p { margin-top: 15px; }
  .entry-form { margin-top: 24px; }
  .entry-image { min-height: 0; aspect-ratio: 2.05; }
  .room { padding-block: 26px 32px; }
  .room-grid { grid-template-columns: minmax(0, 1fr); }
  .room-side { grid-row: 2; }
  .room-top { margin-bottom: 18px; align-items: center; }
  .share-grid[data-count="5"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .volume { display: none; }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 28px); }
  .room-top { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .controls { gap: 8px; padding: 8px; }
  .timeline-row { gap: 7px; }
  .icon-button { width: 38px; height: 38px; }
  .primary-play { width: 51px; height: 51px; border-radius: 15px; }
  .share-controls { padding-inline: 8px; gap: 7px; }
  .share-controls .button { padding-inline: 8px; }
  .share-tile figcaption { flex-wrap: wrap; }
  .stage-mark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
