/* Yellow Box web app */
:root {
  --bg: #100f0c;
  --s1: #1b1915;
  --s2: #26231d;
  --s3: #322e26;
  --line: #36322a;
  --text: #f2ede2;
  --muted: #9e9789;
  --accent: #ffc83d;
  --accent-2: #ffd970;
  --accent-ink: #1a1300;
  --live: #ff5544;
  --good: #7ddc9a;
  --display: 'Bricolage Grotesque', 'Onest', system-ui, sans-serif;
  --body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: clamp(16px, 3.2vw, 44px);
  --side: 224px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
html.no-scroll,
html.no-scroll body {
  overflow: hidden;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.muted {
  color: var(--muted);
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: var(--r-sm);
}
.skip:focus {
  left: 8px;
}
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------ shell */
.tabs {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: var(--side);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 12px;
  background: var(--bg);
  border-right: 1px solid var(--line);
}
.tabs a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.tabs a i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}
.tabs a:hover {
  color: var(--text);
  background: var(--s1);
}
.tabs a.on {
  color: var(--text);
  background: var(--s2);
}
.tabs a.on i {
  color: var(--accent);
}
.tabs .side-brand,
.top-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 19px/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--text);
}
.tabs .side-brand {
  padding: 4px 14px 22px;
  background: none !important;
}
.side-brand img,
.top-brand img {
  width: 30px;
  height: 30px;
}
.shell {
  margin-left: var(--side);
  min-width: 0;
  min-height: 100dvh;
}
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 var(--gutter);
  background: rgba(16, 15, 12, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(54, 50, 42, 0.6);
}
.top-brand {
  display: none;
}
.search {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}
.search input:focus {
  border-color: var(--accent);
}
.top .search-toggle {
  display: none;
}
#install {
  margin-left: auto;
}
main {
  outline: none;
}
body.watching .tabs,
body.watching .top {
  display: none;
}
body.watching .shell {
  margin-left: 0;
  padding-bottom: 0;
}

@media (max-width: 899px) {
  .tabs {
    inset: auto 0 0 0;
    width: auto;
    height: calc(62px + env(safe-area-inset-bottom));
    flex-direction: row;
    justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(16, 15, 12, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .tabs .side-brand,
  .tabs .side-only {
    display: none;
  }
  .tabs a {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0;
    font-size: 11px;
    background: none !important;
    min-width: 0;
  }
  .tabs a i {
    font-size: 18px;
  }
  .shell {
    margin-left: 0;
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }
  .top {
    height: 56px;
    gap: 8px;
  }
  .top-brand {
    display: flex;
    font-size: 17px;
  }
  .search {
    display: none;
  }
  .top .search-toggle {
    display: inline-flex;
    margin-left: auto;
  }
  #install {
    margin-left: 0;
  }
  body.search-open .top-brand {
    display: none;
  }
  body.search-open .search {
    display: block;
    max-width: none;
  }
}

/* ------------------------------------------------------------ buttons & chips */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--s2);
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn-lg {
  height: 48px;
  padding: 0 22px;
  font-size: 15.5px;
}
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 8px;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-2);
}
.btn-ghost {
  background: rgba(242, 237, 226, 0.08);
  border-color: rgba(242, 237, 226, 0.14);
}
.btn-ghost:hover {
  background: rgba(242, 237, 226, 0.14);
}
.btn-ghost.danger {
  color: #ff9a8f;
}
.btn-danger {
  background: var(--live);
  color: #fff;
}
.btn-party {
  background: rgba(255, 200, 61, 0.1);
  border-color: rgba(255, 200, 61, 0.45);
  color: var(--accent);
}
.btn-party:hover {
  background: rgba(255, 200, 61, 0.18);
}
.btn-play {
  position: relative;
  overflow: hidden;
}
.btn-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(26, 19, 0, 0.25);
}
.btn-progress span {
  display: block;
  height: 100%;
  background: var(--accent-ink);
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: rgba(242, 237, 226, 0.08);
  transition: background 0.15s;
}
.btn-icon:hover {
  background: rgba(242, 237, 226, 0.16);
}
.btn-icon.lg {
  width: 48px;
  height: 48px;
  font-size: 17px;
}
.btn-icon.sm {
  width: 30px;
  height: 30px;
  font-size: 13px;
}
.btn-icon.on {
  color: var(--accent);
}
.link-btn {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  padding: 8px 0;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 6px;
  margin-bottom: 8px;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--s1);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.chip:hover {
  color: var(--text);
  border-color: #4a4539;
}
.chip.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.chip-dark {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--s2);
  color: var(--muted);
  font: 600 12px/1 var(--body);
  vertical-align: middle;
}
.dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
  vertical-align: middle;
}
.spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(242, 237, 226, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.page-loading {
  display: grid;
  place-items: center;
  min-height: 40vh;
  width: 100%;
  grid-column: 1 / -1;
}
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.55);
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* ------------------------------------------------------------ type & page */
.page {
  padding: 24px var(--gutter) 48px;
  min-width: 0;
}
.page.narrow {
  max-width: 760px;
  margin: 0 auto;
}
.page-h {
  margin: 0 0 6px;
  font: 800 clamp(26px, 3.4vw, 36px) / 1.1 var(--display);
  letter-spacing: -0.02em;
}
.page-sub {
  margin: 0 0 20px;
  color: var(--muted);
  max-width: 60ch;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.section-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font: 700 20px/1.2 var(--display);
  letter-spacing: -0.01em;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  color: rgba(242, 237, 226, 0.78);
  font-size: 14px;
  font-weight: 500;
}
.meta .fa-star {
  color: var(--accent);
  margin-right: 4px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}
.empty > i {
  font-size: 34px;
  color: var(--accent);
}
.empty p {
  margin: 0;
  max-width: 44ch;
}

/* ------------------------------------------------------------ hero */
.hero,
.title-hero {
  position: relative;
  min-height: clamp(380px, 64vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  z-index: -2;
}
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(16, 15, 12, 0.92) 0%, rgba(16, 15, 12, 0.55) 45%, rgba(16, 15, 12, 0.05) 75%),
    linear-gradient(0deg, var(--bg) 0%, rgba(16, 15, 12, 0) 45%);
}
.hero-body {
  padding: 40px var(--gutter) 28px;
  max-width: 720px;
}
.hero-title,
.title-name {
  margin: 0 0 12px;
  font: 800 clamp(34px, 5.6vw, 68px) / 0.98 var(--display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero-overview,
.title-overview {
  margin: 14px 0 22px;
  max-width: 62ch;
  color: rgba(242, 237, 226, 0.84);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.title-hero {
  min-height: clamp(460px, 72vh, 720px);
}
.title-body {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  padding: 40px var(--gutter) 28px;
  width: 100%;
}
.title-poster {
  width: 210px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--r);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  flex: none;
}
.title-main {
  min-width: 0;
  max-width: 760px;
}
.title-tagline {
  margin: -4px 0 12px;
  color: var(--accent);
  font-weight: 500;
}
.title-overview {
  -webkit-line-clamp: 5;
}
@media (max-width: 899px) {
  .hero-shade {
    background: linear-gradient(0deg, var(--bg) 8%, rgba(16, 15, 12, 0.72) 48%, rgba(16, 15, 12, 0.15) 100%);
  }
  .title-poster {
    display: none;
  }
  .title-body,
  .hero-body {
    padding-bottom: 18px;
  }
  .actions .btn-lg {
    flex: 1 1 auto;
  }
}

/* ------------------------------------------------------------ rows & cards */
.shelf {
  margin: 8px 0 30px;
  min-width: 0;
}
.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.shelf-more {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}
.shelf-more:hover {
  color: var(--accent);
}
.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(124px, 14vw, 176px);
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--s3) transparent;
}
.row > * {
  scroll-snap-align: start;
  min-width: 0;
}
.row-wide {
  grid-auto-columns: clamp(220px, 24vw, 300px);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 22px 14px;
}
.card,
.cw-card {
  display: block;
  min-width: 0;
}
.card-img,
.cw-img {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--s1);
  margin-bottom: 8px;
}
.card-img img,
.cw-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease);
}
.card:hover .card-img img,
.cw-card:hover .cw-img img {
  transform: scale(1.04);
}
.card:focus-visible,
.cw-card:focus-visible,
.ep:focus-visible,
.party-card:focus-visible {
  outline: none;
}
.card:focus-visible .card-img,
.cw-card:focus-visible .cw-img,
.ep:focus-visible .ep-img {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.card-ph {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font: 700 15px/1.2 var(--display);
}
.card-rating {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.68);
  font-size: 12px;
  font-weight: 600;
}
.card-rating i {
  color: var(--accent);
  font-size: 10px;
  margin-right: 4px;
}
.card-t {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-s {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cw-img {
  aspect-ratio: 16/9;
}
.cw-play {
  position: absolute;
  left: 10px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 13px;
}
.cast-row {
  grid-auto-columns: 120px;
}
.cast img,
.cast-ph {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 8px;
  background: var(--s1);
}
.cast-ph {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 30px;
}
.cast {
  text-align: center;
}

/* ------------------------------------------------------------ title page */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 24px;
  margin: 0 0 32px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts dt {
  color: var(--muted);
  font-size: 12.5px;
}
.facts dd {
  margin: 2px 0 0;
  font-weight: 500;
}
.episodes {
  margin-bottom: 34px;
}
.episodes-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.episodes-head .section-h {
  margin: 0;
}
.season-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 1;
}
.ep-list {
  display: grid;
  gap: 4px;
}
.ep {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 10px;
  margin: 0 -10px;
  border-radius: var(--r);
  transition: background 0.15s;
}
.ep:hover {
  background: var(--s1);
}
.ep-img {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--s2);
}
.ep-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ep-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  opacity: 0;
  background: rgba(0, 0, 0, 0.4);
  transition: opacity 0.15s;
}
.ep:hover .ep-play,
.ep:focus-visible .ep-play {
  opacity: 1;
}
.ep-text {
  min-width: 0;
  align-self: center;
}
.ep-t {
  font-weight: 600;
  font-size: 15.5px;
}
.ep-n {
  color: var(--muted);
  margin-right: 10px;
  font-variant-numeric: tabular-nums;
}
.ep-s {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.ep-o {
  margin: 6px 0 0;
  color: rgba(242, 237, 226, 0.75);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 640px) {
  .ep {
    grid-template-columns: 132px 1fr;
    gap: 12px;
  }
  .ep-o {
    display: none;
  }
  .ep-t {
    font-size: 14px;
  }
}

/* ------------------------------------------------------------ modal & toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 4, 3, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.18s;
}
.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--s1);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: pop 0.22s var(--ease);
}
.modal.wide {
  width: min(960px, 100%);
  padding: 0;
  background: #000;
}
.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(242, 237, 226, 0.08);
}
.modal-h {
  margin: 0 36px 8px 0;
  font: 700 22px/1.2 var(--display);
}
.modal-p {
  margin: 0 0 14px;
  color: var(--muted);
}
.modal-p code {
  color: var(--text);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.trailer {
  aspect-ratio: 16/9;
}
.trailer iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.mode-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  text-align: left;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: var(--s2);
}
.mode-card i {
  font-size: 18px;
  color: var(--muted);
}
.mode-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.mode-card.on {
  border-color: var(--accent);
  background: rgba(255, 200, 61, 0.07);
}
.mode-card.on i {
  color: var(--accent);
}
@media (max-width: 480px) {
  .mode-pick {
    grid-template-columns: 1fr;
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 480px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 16px);
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s var(--ease);
}
.toast.in {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.bad {
  background: #ffb4aa;
}
@media (min-width: 900px) {
  .toast {
    bottom: 28px;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* ------------------------------------------------------------ forms, account */
input:not([type='range']):not([type='file']) {
  min-width: 0;
}
.auth {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  margin: 24px auto 0;
}
.auth label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}
.auth input,
.inline-form input,
.join-code input {
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--s1);
  font-size: 15px;
  outline: none;
  color: var(--text);
}
.auth input:focus,
.inline-form input:focus,
.join-code input:focus {
  border-color: var(--accent);
}
.form-err {
  margin: 0;
  min-height: 1.2em;
  color: #ff9a8f;
  font-size: 14px;
}
.inline-form,
.join-code {
  display: flex;
  gap: 8px;
}
.inline-form input {
  flex: 1;
}
.join-code input {
  width: 160px;
  height: 40px;
}
.profile {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 24px;
}
.profile .page-sub {
  margin: 0;
}
.profile #logout {
  margin-left: auto;
}
.profile-avatar {
  position: relative;
  cursor: pointer;
}
.profile-avatar .avatar {
  width: 76px;
  height: 76px;
  font-size: 30px;
}
.profile-edit {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  border: 3px solid var(--bg);
}
.panel {
  padding: 20px;
  margin-bottom: 14px;
  border-radius: var(--r-lg);
  background: var(--s1);
  border: 1px solid var(--line);
}
.panel .section-h {
  font-size: 17px;
}
.people {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.person-who {
  flex: 1;
  min-width: 0;
}
.person-name {
  font-weight: 600;
}
.person-sub {
  color: var(--muted);
  font-size: 13px;
}
.list-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}
.list-link .fa-chevron-right {
  margin-left: auto;
  color: var(--muted);
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--s3);
}
.avatar-letter {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
}

/* ------------------------------------------------------------ party list */
.how-to {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 8px 0 28px;
  border-radius: var(--r);
  background: var(--s1);
  border: 1px solid var(--line);
  color: var(--muted);
}
.how-to i {
  color: var(--accent);
}
.how-to strong {
  color: var(--text);
}
.party-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.party-card {
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--s1);
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}
.party-card:hover,
.party-card:focus-visible {
  border-color: var(--accent);
}
.party-card-img {
  position: relative;
  aspect-ratio: 16/7;
  background: var(--s2) center/cover;
}
.party-card-body {
  display: flex;
  gap: 14px;
  padding: 0 16px 16px;
}
.party-card-poster {
  width: 64px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 8px;
  margin-top: -32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  flex: none;
}
.party-card-body > div {
  padding-top: 12px;
  min-width: 0;
}
.party-card-t {
  font: 700 17px/1.2 var(--display);
}
.party-card-s {
  color: var(--muted);
  font-size: 13px;
}
.live-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 12.5px;
  font-weight: 600;
}
.live-pill.idle {
  color: var(--muted);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255, 85, 68, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(255, 85, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 85, 68, 0);
  }
}

/* ------------------------------------------------------------ now loading stage */
.now-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0a0907;
  transition: opacity 0.45s;
}
.now-loading.leaving {
  opacity: 0;
  pointer-events: none;
}
.nl-bg {
  position: absolute;
  inset: -40px;
  background: center/cover;
  filter: blur(28px) saturate(1.1) brightness(0.42);
  transform: scale(1.08);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  to {
    transform: scale(1.16) translate(-12px, -6px);
  }
}
.nl-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(18px, 4vw, 40px);
  padding: 24px;
  max-width: 760px;
  width: 100%;
}
.nl-poster {
  width: clamp(96px, 16vw, 168px);
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--r);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  flex: none;
}
.nl-text {
  min-width: 0;
  flex: 1;
}
.nl-title {
  font: 800 clamp(26px, 4.4vw, 52px) / 1 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.nl-sub {
  margin-top: 8px;
  color: rgba(242, 237, 226, 0.75);
  font-weight: 500;
}
.nl-steps {
  list-style: none;
  margin: 22px 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14.5px;
  color: rgba(242, 237, 226, 0.45);
}
.nl-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: color 0.3s;
}
.nl-dot {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(242, 237, 226, 0.25);
  flex: none;
}
.nl-steps li.active {
  color: var(--text);
}
.nl-steps li.active .nl-dot {
  border-color: var(--accent);
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
.nl-steps li.done {
  color: rgba(242, 237, 226, 0.75);
}
.nl-steps li.done .nl-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.nl-steps li.done .nl-dot::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.nl-bar {
  height: 3px;
  max-width: 340px;
  border-radius: 3px;
  background: rgba(242, 237, 226, 0.12);
  overflow: hidden;
}
.nl-bar span {
  display: block;
  height: 100%;
  width: 16%;
  background: var(--accent);
  transition: width 0.6s var(--ease);
}
.now-loading.failed .nl-steps li.active {
  color: #ff9a8f;
}
.now-loading.failed .nl-steps li.active .nl-dot {
  animation: none;
  border-color: #ff9a8f;
}
.nl-error p {
  margin: 0 0 14px;
  color: rgba(242, 237, 226, 0.88);
  max-width: 48ch;
}
.nl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 560px) {
  .nl-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .nl-poster {
    display: none;
  }
  .nl-steps {
    margin: 14px 0 12px;
    font-size: 13.5px;
  }
}
.stage-back {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  z-index: 8;
  background: rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------ watch page */
.watch-stage {
  position: relative;
  width: 100%;
  height: min(100dvh, 56.25vw);
  min-height: 220px;
  background: #000;
}
.watch-player {
  position: absolute;
  inset: 0;
}
.watch-info {
  padding: 22px var(--gutter) 56px;
  max-width: 1400px;
}
.wi-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.wi-title {
  margin: 0 0 4px;
  font: 800 clamp(24px, 3vw, 34px) / 1.1 var(--display);
  letter-spacing: -0.02em;
}
.wi-meta {
  color: var(--muted);
  font-weight: 500;
}
.wi-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wi-overview {
  max-width: 72ch;
  color: rgba(242, 237, 226, 0.8);
  margin: 14px 0 26px;
}
.ep-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(180px, 20vw, 240px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--s3) transparent;
}
.ep-mini-img {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--s2);
  margin-bottom: 8px;
  border: 2px solid transparent;
}
.ep-mini.current .ep-mini-img {
  border-color: var(--accent);
}
.ep-mini-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ep-now {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}
.ep-mini-t {
  font-size: 13.5px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 899px) {
  .watch-stage {
    height: auto;
    aspect-ratio: 16/9;
  }
}

/* ------------------------------------------------------------ player */
.yb-player {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.yb-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.yb-player video::cue {
  font-family: var(--body);
  font-size: clamp(15px, 2.3vw, 28px);
  line-height: 1.35;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
}
.yb-player.idle {
  cursor: none;
}
.yb-top,
.yb-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.yb-player.idle .yb-top,
.yb-player.idle .yb-bottom {
  opacity: 0;
  pointer-events: none;
}
.yb-player.idle .yb-top {
  transform: translateY(-8px);
}
.yb-player.idle .yb-bottom {
  transform: translateY(8px);
}
.yb-top {
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 40px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent);
}
.yb-titles {
  min-width: 0;
  flex: 1;
}
.yb-title {
  font: 700 18px/1.2 var(--display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yb-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yb-top-right {
  display: flex;
  gap: 8px;
}
.yb-bottom {
  bottom: 0;
  padding: 40px 12px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
}
.yb-bar {
  display: flex;
  align-items: center;
  gap: 2px;
}
.yb-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #fff;
  font-size: 18px;
  flex: none;
  transition: background 0.15s;
}
.yb-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.yb-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.yb-btn.on {
  color: var(--accent);
}
.yb-qtag {
  position: absolute;
  top: 6px;
  right: 4px;
  padding: 0 3px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 800 8px/12px var(--body);
}
.yb-qtag:empty {
  display: none;
}
.yb-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--live);
  color: #fff;
  font: 700 10px/17px var(--body);
}
.yb-back {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
}
.yb-vol {
  display: flex;
  align-items: center;
}
.yb-vol-range {
  width: 0;
  opacity: 0;
  accent-color: var(--accent);
  transition: width 0.2s, opacity 0.2s;
}
.yb-vol:hover .yb-vol-range,
.yb-vol:focus-within .yb-vol-range {
  width: 84px;
  opacity: 1;
  margin: 0 8px 0 2px;
}
.yb-time {
  margin-left: 8px;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.yb-sep {
  margin: 0 4px;
  opacity: 0.6;
}
.yb-dur {
  opacity: 0.75;
}
.yb-lock {
  margin-left: 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}
.yb-spacer {
  flex: 1;
}
.yb-seek {
  position: relative;
  height: 22px;
  margin: 0 8px 2px;
  cursor: pointer;
  touch-action: none;
  display: flex;
  align-items: center;
}
.yb-player.locked .yb-seek {
  cursor: default;
}
.yb-seek-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  transition: height 0.15s;
}
.yb-seek:hover .yb-seek-track,
.yb-player.seeking .yb-seek-track {
  height: 6px;
}
.yb-seek-buf,
.yb-seek-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  width: 0;
}
.yb-seek-buf {
  background: rgba(255, 255, 255, 0.32);
}
.yb-seek-fill {
  background: var(--accent);
}
.yb-seek-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.15s;
  pointer-events: none;
}
.yb-seek:hover .yb-seek-thumb,
.yb-player.seeking .yb-seek-thumb,
.yb-seek:focus-visible .yb-seek-thumb {
  transform: scale(1);
}
.yb-player.locked .yb-seek-thumb {
  display: none;
}
.yb-seek-tip {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.85);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.yb-player.locked .yb-seek-tip {
  display: none;
}
.yb-seek-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.yb-marker {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid #000;
}
.yb-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 26px;
  padding-left: 5px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.yb-player.paused:not(.buffering):not(.has-error) .yb-bigplay {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.yb-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.yb-spinner span {
  display: block;
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.yb-player.buffering .yb-spinner {
  opacity: 1;
}
.yb-notice {
  position: absolute;
  top: 72px;
  left: 50%;
  z-index: 4;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  font-size: 13.5px;
  font-weight: 600;
  transform: translate(-50%, -6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.yb-notice.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.yb-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
}
.yb-error-box {
  text-align: center;
  max-width: 420px;
}
.yb-error-box > i {
  color: var(--accent);
  font-size: 30px;
}
.yb-error-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.yb-menu {
  position: absolute;
  right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 6;
  width: 250px;
  max-height: calc(100% - 110px);
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  background: rgba(22, 20, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: pop 0.16s var(--ease);
}
.yb-menu-h {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
}
.yb-menu-backbtn {
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
  padding-bottom: 10px;
}
.yb-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}
.yb-opt:hover,
.yb-opt:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.yb-opt span {
  flex: 1;
}
.yb-opt small {
  color: var(--muted);
}
.yb-opt.on {
  color: var(--accent);
}
.yb-opt i {
  font-size: 12px;
}
.yb-opt:disabled {
  opacity: 0.45;
}
.up-next {
  position: absolute;
  right: 18px;
  bottom: 96px;
  z-index: 7;
  width: min(360px, calc(100% - 36px));
  padding: 16px;
  border-radius: 14px;
  background: rgba(22, 20, 16, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: pop 0.25s var(--ease);
}
.up-next-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.up-next-title {
  font: 700 16px/1.3 var(--display);
  margin: 2px 0 12px;
}
.up-next-actions {
  display: flex;
  gap: 8px;
}
@media (max-width: 640px), (pointer: coarse) {
  .yb-hide-sm {
    display: none;
  }
  .yb-vol-range {
    display: none;
  }
  .yb-btn {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
  .yb-time {
    font-size: 12.5px;
    margin-left: 4px;
  }
  .yb-lock {
    display: none !important;
  }
  .yb-bigplay {
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    font-size: 22px;
  }
  .yb-top {
    padding: calc(8px + env(safe-area-inset-top)) 10px 30px;
  }
  .yb-title {
    font-size: 15px;
  }
  .yb-notice {
    top: 56px;
  }
}

/* ------------------------------------------------------------ party room */
.party-room {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.pr-head {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.pr-titles {
  flex: 1;
  min-width: 0;
}
.pr-title {
  font: 700 17px/1.2 var(--display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pr-sub {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-tag {
  color: var(--text);
  font-weight: 600;
}
.mode-tag.together {
  color: var(--accent);
}
.pr-actions {
  display: flex;
  gap: 8px;
}
.party-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  background: var(--bg);
}
.pr-video {
  position: relative;
  background: #000;
  min-height: 0;
  min-width: 0;
}
.pr-player {
  position: absolute;
  inset: 0;
}
.party-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--s1);
  border-left: 1px solid var(--line);
}
.pp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.pp-h {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 15px/1 var(--display);
}
.pp-head-actions {
  display: flex;
  gap: 6px;
}
.pp-close {
  display: none;
}
.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 11.5px/1 var(--body);
  color: var(--muted);
}
.conn .live-dot {
  animation: none;
  background: var(--muted);
}
.conn.live {
  color: var(--text);
}
.conn.live .live-dot {
  background: var(--live);
  animation: pulse 2s infinite;
}
.conn.down {
  color: #ffb4aa;
}
.pp-watchers {
  padding: 10px 16px 6px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.w-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.w-timeline {
  position: relative;
  height: 18px;
  margin: 6px 6px 4px;
}
.w-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--s3);
}
.w-pin {
  position: absolute;
  top: 4px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid var(--s1);
  transition: left 0.6s var(--ease);
}
.w-pin.me {
  top: 2px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  box-shadow: 0 0 0 2px var(--text);
}
.w-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 128px;
  overflow: auto;
}
.w-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.w-row .avatar {
  width: 26px;
  height: 26px;
  font-size: 12px;
}
.w-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.w-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.w-name .host {
  margin-left: 3px;
  font-size: 10px;
  color: var(--accent);
}
.w-rel {
  font-size: 12px;
  color: var(--muted);
}
.w-row.me .w-rel {
  color: var(--accent);
}
.w-time {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(242, 237, 226, 0.85);
}
.pp-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 0 6px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--s3) transparent;
}
.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 16px;
  font-size: 14px;
  line-height: 1.45;
}
.msg .avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
  margin-top: 1px;
}
.msg-body {
  min-width: 0;
  overflow-wrap: anywhere;
}
.msg-name {
  font-weight: 700;
  margin-right: 4px;
}
.msg-at {
  display: inline-block;
  padding: 0 5px;
  margin-right: 4px;
  border: 0;
  border-radius: 4px;
  background: rgba(242, 237, 226, 0.07);
  color: var(--muted);
  font: 500 11.5px/18px var(--body);
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}
button.msg-at:hover {
  background: rgba(255, 200, 61, 0.18);
  color: var(--accent);
}
.msg-text {
  color: rgba(242, 237, 226, 0.92);
}
.msg-sys {
  padding: 4px 16px;
  color: var(--muted);
  font-size: 12.5px;
}
.msg.fresh,
.msg-sys.fresh {
  animation: rise 0.22s var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.voice-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 6px 12px 6px 6px;
  width: 200px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--s2);
  font-size: 12px;
}
.voice-chip i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  flex: none;
}
.voice-chip.playing i,
.voice-chip.unheard i {
  background: var(--accent);
  color: var(--accent-ink);
}
.voice-chip.unheard {
  border-color: var(--accent);
}
.voice-chip.broken {
  opacity: 0.6;
}
.vc-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--s3);
  overflow: hidden;
}
.vc-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
}
.vc-len {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pp-new {
  position: absolute;
  left: 50%;
  bottom: 70px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.pp-compose,
.pp-rec {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  flex: none;
}
.pp-compose input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font-size: 14.5px;
}
.pp-compose input:focus {
  border-color: var(--accent);
}
.pp-compose .send {
  background: var(--accent);
  color: var(--accent-ink);
}
.pp-compose .mic.unavailable {
  opacity: 0.45;
}
.rec-meter {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 0;
}
.rec-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live);
  animation: blink 1s infinite;
}
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

/* Fullscreen (real or pseudo): video fills, chat becomes a translucent drawer. */
.party-stage.is-fs {
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  background: #000;
}
.party-stage.pseudo-fs {
  position: fixed;
  inset: 0;
  z-index: 1500;
  height: 100dvh;
}
.party-stage.is-fs .pr-video {
  height: 100%;
}
.party-stage.is-fs .party-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  width: min(380px, 88vw);
  background: rgba(14, 13, 10, 0.58);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.28s var(--ease), visibility 0s linear 0.28s;
}
.party-stage.is-fs.panel-open .party-panel {
  transform: none;
  visibility: visible;
  transition: transform 0.28s var(--ease), visibility 0s;
}
.party-stage.is-fs .pp-close {
  display: inline-flex;
}
.party-stage.is-fs .pp-head,
.party-stage.is-fs .pp-watchers,
.party-stage.is-fs .pp-compose,
.party-stage.is-fs .pp-rec {
  border-color: rgba(255, 255, 255, 0.08);
}
.party-stage.is-fs .pp-compose input {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.14);
}
.party-stage.is-fs .voice-chip {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.12);
}
.party-stage.is-fs.panel-open .yb-bottom {
  padding-right: min(392px, 88vw);
}
.party-stage.is-fs.panel-open .yb-menu {
  right: min(392px, 88vw);
}

@media (max-width: 899px) {
  .hide-sm {
    display: none;
  }
  .party-room {
    height: auto;
    min-height: 100dvh;
  }
  .pr-head {
    height: 54px;
    padding: 0 10px;
  }
  .party-stage:not(.is-fs) {
    display: flex;
    flex-direction: column;
  }
  .party-stage:not(.is-fs) .pr-video {
    position: sticky;
    top: 0;
    z-index: 5;
    aspect-ratio: 16/9;
    flex: none;
  }
  .party-stage:not(.is-fs) .party-panel {
    border-left: 0;
    height: calc(100dvh - 54px - 56.25vw);
    min-height: 340px;
  }
  .party-stage:not(.is-fs) .w-list {
    max-height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* TV mode: bigger focus rings */
body.tv :focus-visible {
  outline-width: 3px;
  outline-offset: 3px;
}

/* The room header already names the title; the player's own title bar only shows in fullscreen. */
.party-stage:not(.is-fs) .yb-top {
  display: none;
}

/* Chat only (companion): no video here, the chat takes the stage. */
.party-stage.companion {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
.party-stage.companion .pr-video {
  display: none;
}
.party-stage.companion .party-panel {
  width: min(760px, 100%);
  border-right: 1px solid var(--line);
}
@media (max-width: 899px) {
  .party-stage.companion:not(.is-fs) .party-panel {
    height: calc(100dvh - 54px);
  }
}
.party-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-only-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}
.chat-only-link:hover {
  color: var(--accent);
  background: var(--s1);
}
