:root {
  --bg-deep: #000000;
  --bg: #050505;
  --bg-elevated: #0d0f0d;
  --surface: #141714;
  --surface-hover: #1d211d;
  --surface-active: #263026;
  --border: #1f241f;
  --border-strong: #2d382d;
  --fg: #f4f8f4;
  --fg-dim: #c7d2c7;
  --muted: #94a094;
  --accent: #22e33c;
  --accent-bright: #5bff70;
  --accent-deep: #0f7a1e;
  --accent-ink: #041505;
  --accent-glow: rgba(34, 227, 60, 0.32);
  --live: #ff5a4d;
  --danger: #ffa79d;
  --radius-pill: 999px;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 6px;
  --tap: 44px;
  --ease: cubic-bezier(0.22, 0.75, 0.3, 1);
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.72);
  --shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.8);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "gg sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--fg);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(1100px 540px at 50% -16%, rgba(34, 227, 60, 0.13), transparent 62%),
    radial-gradient(700px 420px at 6% 10%, rgba(34, 227, 60, 0.06), transparent 60%),
    radial-gradient(700px 420px at 94% 8%, rgba(34, 227, 60, 0.05), transparent 60%);
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(130% 92% at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.64) 100%);
}

#app {
  position: relative;
  z-index: 2;
  min-height: 100%;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-deep);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
  background-clip: content-box;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: calc(10px + var(--safe-top)) calc(14px + var(--safe-right)) 10px calc(14px + var(--safe-left));
  background: linear-gradient(180deg, rgba(6, 8, 6, 0.97), rgba(0, 0, 0, 0.88));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(34, 227, 60, 0.1), 0 8px 26px rgba(0, 0, 0, 0.7);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(34, 227, 60, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.06);
  box-shadow: 0 0 28px rgba(34, 227, 60, 0.45);
}

.search {
  order: 3;
  flex: 1 1 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 16px;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.search::placeholder {
  color: var(--muted);
}

.search:focus {
  outline: none;
  background: #071009;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-left: auto;
  min-width: 0;
}

.role-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.role-badge.host {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  border-color: transparent;
  color: #04160b;
  box-shadow: 0 0 18px var(--accent-glow);
}

.requests-toggle {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #04160b;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease;
}

.requests-toggle:hover {
  background: var(--accent-bright);
}

.requests-panel {
  padding: 13px calc(14px + var(--safe-right)) 13px calc(14px + var(--safe-left));
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.requests-panel.hidden {
  display: none;
}

.requests-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.request-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  transition: background 0.16s ease;
}

.request-row:hover {
  background: var(--surface-hover);
}

.request-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-action {
  flex: none;
  min-height: 32px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: #04160b;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.16s ease;
}

.request-action:hover {
  background: var(--accent-bright);
}

.request-action.secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}

.request-action.secondary:hover {
  background: var(--surface-hover);
  color: var(--fg);
}

.status {
  padding: 15px calc(16px + var(--safe-right)) 15px calc(16px + var(--safe-left));
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.status.error {
  color: #ff9d93;
  white-space: pre-wrap;
  word-break: break-word;
}

.status.hidden {
  display: none;
}

.filter-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 11px calc(14px + var(--safe-right)) 11px calc(14px + var(--safe-left));
  background: transparent;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  flex: none;
  min-height: 36px;
  padding: 8px 17px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease;
}

.filter-tab:hover {
  color: var(--fg);
  background: var(--surface);
}

.filter-tab.active {
  color: #04160b;
  background: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 20px var(--accent-glow);
}

.hero {
  position: relative;
  margin: 4px calc(14px + var(--safe-right)) 18px calc(14px + var(--safe-left));
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 210px;
  display: flex;
  align-items: flex-end;
}

.hero.hidden {
  display: none;
}

.hero-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 22%;
  opacity: 0.55;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.82) 62%, #000 100%);
}

.hero-body {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 16px;
}

.hero-logo {
  max-width: 190px;
  max-height: 62px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.85));
}

.hero-logo.hidden {
  display: none;
}

.hero-title {
  margin: 0 0 7px 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.hero-title.hidden {
  display: none;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  margin-bottom: 8px;
}

.hero-dot {
  color: var(--muted);
}

.hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #04160b;
  font-weight: 800;
}

.hero-description {
  margin: 0 0 13px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-dim);
  max-width: 62ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 9px;
}

.hero-play {
  min-height: 42px;
  padding: 11px 26px;
  font-size: 14px;
  font-weight: 800;
  color: #04160b;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 0 22px var(--accent-glow);
  transition: background 0.16s ease, transform 0.16s ease;
}

.hero-play:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}

.catalog {
  padding: 4px 0 calc(24px + var(--safe-bottom)) 0;
}

.catalog.hidden {
  display: none;
}

.shelf {
  margin-bottom: 26px;
}

.shelf-header {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 0 calc(16px + var(--safe-right)) 11px calc(16px + var(--safe-left));
}

.shelf-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.shelf-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
}

.shelf-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 118px;
  gap: 13px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  padding: 2px calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
  scrollbar-width: thin;
}

.shelf-row .catalog-item {
  scroll-snap-align: start;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 14px;
  padding: 8px calc(16px + var(--safe-right)) 0 calc(16px + var(--safe-left));
}

.poster-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.poster-frame.loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, var(--surface) 20%, var(--surface-hover) 42%, var(--surface) 64%);
  background-size: 260% 100%;
  animation: shimmer 1.35s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 130% 0;
  }
  100% {
    background-position: -130% 0;
  }
}

.poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.72) 100%);
  transition: opacity 0.18s ease;
}

.catalog-item:hover .poster-overlay,
.catalog-item:focus-visible .poster-overlay {
  opacity: 1;
}

.poster-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 15px;
  padding-left: 3px;
  color: #04160b;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 22px var(--accent-glow);
  transform: scale(0.78);
  transition: transform 0.18s ease;
}

.catalog-item:hover .poster-play {
  transform: scale(1);
}

.shelf-viewport {
  position: relative;
}

.shelf-arrow {
  position: absolute;
  top: 0;
  bottom: 12px;
  z-index: 4;
  width: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: var(--fg);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0));
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.shelf-arrow-left {
  left: 0;
}

.shelf-arrow-right {
  right: 0;
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0));
}

.shelf-viewport:hover .shelf-arrow {
  opacity: 1;
}

.shelf-arrow:hover {
  color: var(--accent);
}

@media (hover: hover) and (min-width: 700px) {
  .shelf-arrow {
    display: flex;
  }
}

.shelf-source {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hero.swapping .hero-art,
.hero.swapping .hero-body {
  opacity: 0.35;
}

.hero-art,
.hero-body {
  transition: opacity 0.22s ease;
}

.catalog-item {
  cursor: pointer;
  text-align: left;
  min-width: 0;
  transition: transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.catalog-item:hover {
  transform: translateY(-4px);
}

.catalog-item:active {
  transform: translateY(-1px);
}

.catalog-item:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 4px;
  border-radius: var(--radius-lg);
}

.catalog-item img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  display: block;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.7);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.35s ease;
}

.catalog-item:hover img {
  border-color: var(--accent);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.78), 0 0 22px var(--accent-glow);
  transform: scale(1.05);
}

.catalog-item .label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.16s ease;
}

.catalog-item:hover .label {
  color: var(--accent-bright);
}

.catalog-item .live-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
  background: var(--live);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.player-view {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.player-view.hidden {
  display: none;
}

.player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(9px + var(--safe-top)) calc(12px + var(--safe-right)) 9px calc(12px + var(--safe-left));
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

.player-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-title::before {
  content: "NOW PLAYING";
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1px;
}

#back-button {
  flex: none;
  min-height: 38px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  color: #04160b;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.16s ease;
}

#back-button:hover {
  background: var(--accent-bright);
}

video {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #000;
}

.player-loading {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.player-loading.hidden {
  display: none;
}

.loading-art {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(34px) saturate(1.25);
  opacity: 0.4;
  transform: scale(1.12);
}

.player-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.92));
}

.loading-body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 340px;
  padding: 24px 22px calc(24px + var(--safe-bottom));
  text-align: center;
}

.loading-poster-wrap {
  position: relative;
  width: 116px;
  margin: 0 auto 20px auto;
}

.loading-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 34px var(--accent-glow);
  background: var(--surface);
  display: block;
}

.loading-ring {
  position: absolute;
  inset: -9px;
  border-radius: 18px;
  border: 2px solid var(--accent);
  opacity: 0.5;
  animation: ring-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ring-pulse {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(0.985);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.015);
  }
}

.loading-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 7px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.loading-stage {
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg-dim);
  min-height: 38px;
  margin-bottom: 14px;
}

.loading-track {
  height: 4px;
  border-radius: 99px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 10px;
}

.loading-bar {
  height: 100%;
  width: 36%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: bar-slide 1.6s ease-in-out infinite;
}

@keyframes bar-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(390%);
  }
}

.loading-elapsed {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.player-notice {
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--fg-dim);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.player-view.no-video .player-notice {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  border-bottom: 0;
  background: transparent;
  padding: 24px 20px calc(24px + var(--safe-bottom));
}

.player-view.no-video video {
  display: none;
}

.player-view.no-video .source-picker,
.player-view.no-video #episode-picker {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.player-notice.error {
  color: #ff9d93;
}

.player-notice.hidden,
.player-view.no-video .player-notice.hidden {
  display: none;
}

.notice-text {
  max-width: 44ch;
  font-size: 14px;
}

.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.notice-button {
  min-height: 44px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  color: #04160b;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.notice-button:hover {
  background: var(--accent-bright);
}

.notice-button.secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg-dim);
}

.notice-button.secondary:hover {
  background: var(--surface-hover);
  color: var(--fg);
}

.source-picker {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 14px calc(24px + var(--safe-bottom));
  background: var(--bg);
}

.season-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
}

.source-picker.hidden {
  display: none;
}

.source-picker-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.season-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.season-tabs::-webkit-scrollbar {
  display: none;
}

.season-tab {
  flex: none;
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.season-tab:hover {
  color: var(--fg);
  background: var(--surface-hover);
}

.season-tab.active {
  color: #04160b;
  background: var(--accent);
  border-color: transparent;
  font-weight: 700;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 62px;
  padding: 9px 11px;
  text-align: left;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.episode-row:hover {
  background: var(--surface-hover);
  border-color: var(--accent-deep);
}

.episode-thumb {
  flex: none;
  width: 92px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.episode-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.episode-heading {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.episode-date {
  font-size: 11px;
  color: var(--muted);
}

.source-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  text-align: left;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.16s ease;
}

.source-row:hover {
  background: var(--surface-hover);
}

.source-name {
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.source-tags {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.viewer-note {
  padding: 10px 14px calc(10px + var(--safe-bottom));
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: var(--muted);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.viewer-note.hidden {
  display: none;
}

@media (max-width: 359px) {
  .brand-name {
    display: none;
  }
}

@media (min-width: 480px) {
  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(134px, 1fr));
    gap: 17px;
  }
  .shelf-row {
    grid-auto-columns: 142px;
    gap: 16px;
  }
  .catalog-item .label {
    font-size: 13px;
  }
}

@media (min-width: 660px) {
  .search {
    order: 0;
    flex: 1 1 200px;
    margin: 0 4px;
  }
  .topbar-meta {
    margin-left: 0;
  }
  .role-badge {
    max-width: none;
  }
}

@media (min-width: 900px) {
  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
    gap: 20px;
  }
  .shelf-row {
    grid-auto-columns: 168px;
    gap: 20px;
  }
  .shelf-title {
    font-size: 19px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .player-bar {
    padding-top: calc(4px + var(--safe-top));
    padding-bottom: 4px;
  }
  #back-button {
    min-height: 36px;
    padding: 6px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .catalog-item:hover,
  .catalog-item:hover img {
    transform: none;
  }
  .poster-frame.loading::before {
    animation: none;
  }
}

.source-row.ready {
  border-left-color: var(--accent-bright);
}

.source-ready {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #04160b;
  background: var(--accent-bright);
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
}

.subtitle-button {
  flex: none;
  margin-left: auto;
  min-height: 34px;
  min-width: 44px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.subtitle-button.active {
  color: #04160b;
  background: var(--accent);
  border-color: transparent;
}

.subtitle-button.hidden {
  display: none;
}

.subtitle-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 420px;
  max-height: 46vh;
  overflow-y: auto;
}

.subtitle-row {
  min-height: 42px;
  padding: 10px 13px;
  font-size: 13px;
  text-align: left;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.subtitle-row:hover {
  background: var(--surface-hover);
}

.subtitle-row.active {
  border-color: var(--accent);
  color: var(--accent-bright);
  font-weight: 700;
}

.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 64px 20px;
  text-align: center;
}

.search-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  border-top-color: var(--accent);
  animation: search-spin 0.9s linear infinite;
}

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

.search-loading-text {
  font-size: 14px;
  color: var(--muted);
}

.hero-list {
  min-height: 42px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.16s ease;
}

.hero-list:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero-list.active {
  color: var(--accent-bright);
  border-color: var(--accent-deep);
}

.hero-list.hidden {
  display: none;
}

.screen-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.player-view.theater .screen-frame {
  flex: 0 0 auto;
  margin: 14px calc(14px + var(--safe-right)) 8px calc(14px + var(--safe-left));
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow:
    0 0 0 1px rgba(34, 227, 60, 0.12),
    0 26px 70px rgba(0, 0, 0, 0.9),
    0 0 90px rgba(34, 227, 60, 0.14);
}

.player-view.theater video {
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 52vh;
  flex: none;
}

.theater-idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(90% 70% at 50% 40%, rgba(34, 227, 60, 0.12), transparent 70%),
    #000;
}

.theater-idle.hidden {
  display: none;
}

.theater-idle-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  box-shadow: 0 0 28px var(--accent-glow);
  margin-bottom: 4px;
  animation: idle-breathe 2.6s ease-in-out infinite;
}

@keyframes idle-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.theater-idle-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.theater-idle-sub {
  font-size: 13px;
  color: var(--muted);
  max-width: 34ch;
}

.theater-tray {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left));
}

.theater-tray.hidden {
  display: none;
}

.theater-tray-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.theater-tray-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.theater-mode {
  margin-left: auto;
  min-height: 34px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent-deep);
  border-radius: 999px;
  cursor: pointer;
}

.theater-mode:hover {
  background: var(--surface-hover);
}

.theater-seats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 12px;
}

.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 11px 6px 9px;
  background: linear-gradient(180deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.seat-self {
  border-color: var(--accent-deep);
  box-shadow: 0 0 18px rgba(34, 227, 60, 0.18);
}

.seat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-deep);
  border: 2px solid var(--border-strong);
}

.seat-self .seat-avatar {
  border-color: var(--accent);
}

.seat-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--fg-dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #04160b;
  background: var(--accent);
  padding: 1px 6px;
  border-radius: 999px;
}

.seat-empty {
  grid-column: 1 / -1;
  padding: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.hidden { display: none !important; }

.search { min-height: var(--tap); border-radius: var(--radius-pill); }
.hero-play, .hero-list, .notice-button, .subtitle-row { min-height: var(--tap); }
.filter-tab, .season-tab, .request-action, .theater-mode, .requests-toggle { min-height: 38px; }
.role-badge { border-radius: var(--radius-pill); }

.poster-frame { box-shadow: var(--shadow-card); transition: box-shadow 0.24s var(--ease); }
.catalog-item:hover .poster-frame { box-shadow: var(--shadow-lift), 0 0 26px var(--accent-glow); }
.catalog-item img { box-shadow: none; }
.hero { box-shadow: var(--shadow-lift); }

.hero-play, .hero-rating, .filter-tab.active, .season-tab.active,
.request-action, .requests-toggle, .notice-button, .poster-play,
.seat-tag, .source-ready, .role-badge.host, #back-button { color: var(--accent-ink); }

.status.error, .player-notice.error { color: var(--danger); }

@media (min-width: 900px) {
  .hero { min-height: 340px; }
  .hero-title { font-size: 34px; }
  .hero-body { padding: 30px; max-width: 760px; }
  .shelf-title { font-size: 21px; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px; }
  .shelf-row { grid-auto-columns: 174px; gap: 22px; }
  .shelf-header, .shelf-row, .poster-grid, .hero { padding-left: 30px; padding-right: 30px; }
  .hero { margin-left: 30px; margin-right: 30px; padding-left: 0; padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .catalog-item:hover, .catalog-item:hover img, .hero-play:hover { transform: none; }
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 26px 14px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55) 34%, rgba(0, 0, 0, 0.92));
  opacity: 1;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

.player-controls.idle {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.scrub-row {
  padding: 0 2px 10px;
}

.scrub {
  position: relative;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  touch-action: none;
}

.scrub.locked {
  cursor: default;
  opacity: 0.75;
}

.scrub-buffer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.3);
}

.scrub-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 14px var(--accent-glow);
}

.scrub-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 15px;
  height: 15px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 14px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(0.72);
  transition: transform 0.16s var(--ease);
}

.scrub:hover .scrub-knob,
.scrub:focus-visible .scrub-knob {
  transform: translateY(-50%) scale(1);
}

.scrub.locked .scrub-knob {
  display: none;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ctl-spacer {
  flex: 1;
}

.ctl {
  flex: none;
  min-width: 40px;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.16s var(--ease);
}

.ctl:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ctl-primary {
  min-width: var(--tap);
  min-height: var(--tap);
  font-size: 16px;
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 0 20px var(--accent-glow);
}

.ctl-primary:hover {
  background: var(--accent-bright);
}

.time-readout {
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg-dim);
  white-space: nowrap;
}

.volume {
  flex: none;
  width: 78px;
  height: 4px;
  accent-color: var(--accent);
  background: rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.center-play {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.center-play-button {
  pointer-events: auto;
  width: 72px;
  height: 72px;
  padding-left: 5px;
  font-size: 26px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 40px var(--accent-glow), 0 10px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s var(--ease), background 0.16s var(--ease);
}

.center-play-button:hover {
  transform: scale(1.07);
  background: var(--accent-bright);
}

.player-controls .subtitle-button {
  margin-left: 0;
  min-height: 40px;
}

@media (max-width: 420px) {
  .volume {
    width: 54px;
  }
  .time-readout {
    font-size: var(--text-xs);
  }
}

.ctl {
  min-width: var(--tap);
  min-height: var(--tap);
}

.player-controls .subtitle-button {
  min-height: var(--tap);
  min-width: var(--tap);
}
