:root {
  --bg: #070707;
  --text: #ffffff;
  --muted: #b7b7b7;
  --line: rgba(255, 255, 255, 0.12);
  --sidebar-w: 76px;
  --sidebar-expanded: 268px;
  --sidebar-bg: #242225;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; color: var(--text); font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { overflow: hidden; }
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

.app {
  display: block;
  height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 22px 12px 22px;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
  z-index: 40;
  transition: width 0.22s ease;
}
.sidebar:hover,
.sidebar:focus-within {
  width: var(--sidebar-expanded);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  margin: 0 6px 28px;
  color: #fff;
  min-width: 200px;
}
.brand svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.brand-mini svg { width: 100%; height: 100%; }
.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.sidebar:hover .brand-name,
.sidebar:focus-within .brand-name,
.sidebar.open .brand-name { opacity: 1; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #f4f4f4;
  white-space: nowrap;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.side-link:hover { background: rgba(255,255,255,0.06); }
.side-link.active { background: rgba(255,255,255,0.1); color: #fff; }
.side-link[hidden] { display: none !important; }
.side-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.side-icon svg { width: 22px; height: 22px; }
.side-label {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.sidebar:hover .side-label,
.sidebar:focus-within .side-label,
.sidebar.open .side-label {
  opacity: 1;
  transform: none;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 10px 0;
  min-width: 200px;
}
.brand-mini { width: 28px; height: 28px; margin-bottom: 12px; color: #fff; }
.footer-brand { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-copy { margin: 4px 0 14px; font-size: 0.68rem; color: #8a8a8a; }
.footer-links { display: flex; flex-direction: column; gap: 4px; }
.footer-links a { font-size: 0.72rem; color: #9d9d9d; }
.footer-links a:hover { color: #fff; }
.footer-brand,
.footer-copy,
.footer-links {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.sidebar:hover .footer-brand,
.sidebar:hover .footer-copy,
.sidebar:hover .footer-links,
.sidebar:focus-within .footer-brand,
.sidebar:focus-within .footer-copy,
.sidebar:focus-within .footer-links,
.sidebar.open .footer-brand,
.sidebar.open .footer-copy,
.sidebar.open .footer-links {
  opacity: 1;
  pointer-events: auto;
}

.main {
  min-width: 0;
  height: 100vh;
  margin-left: var(--sidebar-w);
  overflow: auto;
  background: #000;
}
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 99px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 18px 42px 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,.92), rgba(0,0,0,.28) 70%, transparent);
}

.tabs { display: flex; align-items: center; gap: 28px; }
.tab {
  position: relative;
  padding: 6px 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #d8d8d8;
}
.tab:hover, .tab.active { color: #fff; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: #fff;
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  width: min(340px, 36vw);
  height: 40px;
  padding: 0 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 0.9rem;
}
.search input::placeholder { color: #8f8f8f; }
.search svg, .icon-btn svg, .btn-play svg, .btn-info svg, .btn-circle svg, .react-btn svg,
.season-btn svg, .carousel-btn svg, .help-fab svg { width: 18px; height: 18px; }

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); }
.icon-btn svg { width: 22px; height: 22px; }
.badge {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 14px; height: 14px;
  padding: 0 4px;
  border-radius: 99px;
  background: #e10600;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
.mobile-menu-btn { display: none; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  padding: 0 0 40px;
}
.shimmer-block,
.shimmer-hero,
.shimmer-line,
.shimmer-card {
  background: linear-gradient(90deg, #161616 15%, #2a2a2a 45%, #161616 75%);
  background-size: 200% 100%;
  animation: shimmer 1.25s ease-in-out infinite;
}
.shimmer-hero {
  height: 58vh;
  min-height: 360px;
}
.shimmer-row { padding: 28px 42px 8px; }
.shimmer-line {
  width: 180px;
  height: 18px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.shimmer-line.short { width: 120px; }
.shimmer-cards { display: flex; gap: 22px; overflow: hidden; }
.shimmer-card {
  flex: 0 0 320px;
  height: 208px;
  border-radius: 4px;
}

.hero {
  position: relative;
  min-height: 58vh;
  padding: 18px 42px 56px;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: none;
}
body.bw-images .hero-media img {
  filter: grayscale(1) contrast(1.12) brightness(0.72);
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.86) 0%, rgba(0,0,0,.42) 42%, rgba(0,0,0,.18) 100%),
    linear-gradient(180deg, rgba(0,0,0,.12) 0%, transparent 38%, #000 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 620px; padding-top: 54px; }
.hero-kicker {
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d0d0d0;
}
.hero-title {
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
}
.hero-desc {
  max-width: 520px;
  margin-bottom: 26px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #d8d8d8;
}
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-play, .btn-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 700;
}
.btn-play { background: #fff; color: #111; }
.btn-play:hover { background: #ececec; }
.btn-info { background: rgba(255,255,255,0.16); }
.btn-info:hover { background: rgba(255,255,255,0.24); }
.btn-circle, .react-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: 50%;
}
.btn-circle:hover, .btn-circle.active,
.react-btn:hover, .react-btn.active {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
}
.reactions { display: flex; gap: 10px; margin-top: 18px; }
.react-btn { width: 38px; height: 38px; }

.hero-nav { pointer-events: none; }
.hero-nav.hidden { display: none; }
.hero-arrow {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  transform: translateY(-50%);
}
.hero-arrow.prev { right: auto; left: 18px; }
.hero-arrow.next { right: 18px; }
.hero-arrow:hover { background: rgba(0,0,0,0.7); }
.hero-arrow svg { width: 18px; height: 18px; }
.hero-dots {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 4;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
}
.hero-dot.active {
  width: 22px;
  border-radius: 99px;
  background: #fff;
}

.group-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 4px 42px 10px;
  position: relative;
  z-index: 3;
}
.color-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}
.color-switch.hidden { display: none !important; }
.group-bar.hidden { display: none !important; }
.group-label {
  font-size: 0.82rem;
  color: #b5b5b5;
  font-weight: 600;
}
.group-toggle {
  display: inline-flex;
  padding: 3px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
}
.group-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 650;
  color: #cfcfcf;
}
.group-btn.active {
  background: #fff;
  color: #111;
}

.section { position: relative; z-index: 2; padding: 8px 42px 28px; }
.catalog-rows { position: relative; z-index: 2; }
.catalog-rows .section:last-child { padding-bottom: 80px; }
.empty-state { color: var(--muted); padding: 24px 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; }
.season-wrap { position: relative; }
.season-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}
.season-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  padding: 8px;
  background: #151515;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 5;
}
.season-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
}
.season-menu button:hover, .season-menu button.active { background: rgba(255,255,255,0.08); }

.carousel { position: relative; }
.episode-row {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 6px 44px 18px;
  margin: 0 -44px;
  scrollbar-width: none;
}
.episode-row::-webkit-scrollbar { display: none; }
.episode-card { flex: 0 0 320px; cursor: pointer; }
.thumb {
  position: relative;
  aspect-ratio: 16 / 10.4;
  overflow: hidden;
  border-radius: 4px;
  background: #111;
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: none;
  transition: transform 0.35s ease, filter 0.25s ease;
}
body.bw-images .thumb img {
  filter: grayscale(1) contrast(1.08) brightness(0.78);
}
.episode-card:hover .thumb img { transform: scale(1.05); }
.thumb-rank,
.thumb-rank {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 0.8;
  color: #fff;
  text-shadow: 0 6px 16px rgba(0,0,0,0.75);
  letter-spacing: -0.06em;
  z-index: 2;
}
.thumb-label {
  position: absolute;
  left: 10px; top: 10px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px #000;
}
.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.18);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.episode-card:hover .play-overlay, .episode-card.active .play-overlay { opacity: 1; }
.play-overlay span {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
}
.play-overlay svg { width: 18px; height: 18px; margin-left: 2px; }
.episode-title { margin: 12px 0 8px; font-size: 0.98rem; font-weight: 700; letter-spacing: -0.02em; }
.episode-meta { display: flex; align-items: center; gap: 14px; font-size: 0.78rem; color: #c3c3c3; }
.episode-meta span { display: inline-flex; align-items: center; gap: 6px; }
.episode-meta svg { width: 13px; height: 13px; }

.carousel-btn {
  position: absolute;
  top: 78px;
  z-index: 3;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(20,20,20,0.82);
  border: 1px solid rgba(255,255,255,0.18);
}
.carousel-btn.prev { left: -6px; }
.carousel-btn.next { right: -6px; }
.carousel-btn:hover { background: #2a2a2a; }

.empty-state { padding: 28px 8px; color: var(--muted); }

.help-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 40;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  box-shadow: var(--shadow);
}
.help-fab svg {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
}
.help-ring {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 50%;
}
.help-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 34px;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,0.62);
}
.panel {
  position: fixed;
  z-index: 70;
  background: #121212;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.drawer {
  top: 0; right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  padding: 0;
}
.modal {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  border-radius: 16px;
  overflow: hidden;
}
.modal-media { height: 240px; overflow: hidden; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(0.8); }
.modal-body, .drawer-body { padding: 22px 24px 28px; }
.modal h2, .drawer h2 { margin-bottom: 10px; font-size: 1.4rem; }
.modal p, .drawer p, .notif-item p { color: var(--muted); line-height: 1.55; }
.menu-item {
  display: flex;
  width: 100%;
  padding: 12px 8px;
  border-radius: 8px;
  text-align: left;
}
.menu-item:hover { background: rgba(255,255,255,0.06); }
.notif-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif-item strong { display: block; margin-bottom: 4px; }

.player {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: #000;
}
.player video { width: min(1100px, 94vw); max-height: 78vh; background: #000; }
.player-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: linear-gradient(to bottom, rgba(0,0,0,.7), transparent);
}
.close-x {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  font-size: 1.4rem;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.82);
}
.login-card {
  width: min(420px, 92vw);
  padding: 28px 24px;
  background: #171417;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
}
.login-card h2 { margin-bottom: 8px; }
.login-card p { color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.login-card input {
  width: 100%;
  height: 44px;
  margin-bottom: 10px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: #101010;
  color: #fff;
}
.login-error { color: #ff8b8b; margin: 0 0 12px; }
.login-card .btn-play { width: 100%; justify-content: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 90;
  padding: 10px 16px;
  background: #fff;
  color: #111;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .episode-card { flex-basis: 280px; }
}

@media (max-width: 860px) {
  .main { margin-left: 0; }
  .sidebar {
    width: min(280px, 84vw);
    transform: translateX(-110%);
    transition: transform 0.25s ease, width 0.22s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    width: min(280px, 84vw);
  }
  .sidebar.open .brand-name,
  .sidebar.open .side-label,
  .sidebar.open .footer-brand,
  .sidebar.open .footer-copy,
  .sidebar.open .footer-links {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .mobile-menu-btn { display: grid; }
  .topbar, .hero, .section, .group-bar { padding-left: 20px; padding-right: 20px; }
  .tabs { gap: 16px; }
  .tab { font-size: 0.86rem; }
  .search { width: 42px; padding: 0; justify-content: center; }
  .search input { display: none; }
  .search.open { width: min(260px, 58vw); padding: 0 14px; }
  .search.open input { display: block; }
  .episode-row { padding-left: 20px; padding-right: 20px; margin: 0 -20px; }
  .help-fab { width: 62px; height: 62px; }
  .hero-arrow { width: 36px; height: 36px; }
  .hero-arrow.prev { left: 8px; }
  .hero-arrow.next { right: 8px; }
}
