:root {
  color-scheme: dark;
  --bg: #111;
  --panel: #181818;
  --panel-strong: #202020;
  --text: #f5f5f0;
  --muted: #aaa;
  --line: #303030;
  --accent: #f1c15b;
  --accent-2: #e64b5f;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body.modern-video-ui {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body.modern-video-ui a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(17, 17, 17, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand img {
  display: block;
  width: auto;
  height: 46px;
  max-width: 220px;
  object-fit: contain;
}

.search {
  display: flex;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 12px 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.search button,
.host-button,
.rapid-reveal,
.tez-reveal,
.pager a {
  border: 0;
  background: var(--accent);
  color: #111;
  font-weight: 800;
  padding: 12px 16px;
  cursor: pointer;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.quick-links a,
.category-rail a,
.pager span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
  background: var(--panel);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  padding: 34px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 72px);
  line-height: .96;
  letter-spacing: 0;
}

.intro {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.stats-strip {
  display: flex;
  gap: 10px;
}

.stats-strip span {
  display: grid;
  gap: 3px;
  min-width: 108px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel);
  color: var(--muted);
}

.stats-strip strong {
  color: var(--text);
  font-size: 24px;
}

.category-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 22px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.video-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.video-card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}

.video-card.featured {
  grid-column: span 2;
  grid-row: span 2;
}

.video-card a {
  display: grid;
  height: 100%;
}

.thumb-wrap {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #080808;
  overflow: hidden;
}

.video-card.featured .thumb-wrap {
  aspect-ratio: 16 / 9;
}

.thumb-wrap img,
.poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-mark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(17, 17, 17, .82);
}

.play-mark::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 12px;
  border-left: 13px solid var(--accent);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.video-card strong {
  display: block;
  padding: 8px 12px 14px;
  line-height: 1.3;
  min-height: 54px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 0 42px;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  padding-top: 24px;
}

.watch-card,
.content-panel,
.details-panel,
.similar-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.watch-card {
  overflow: hidden;
}

.poster {
  aspect-ratio: 16 / 9;
  background: #080808;
}

.k2s-preview {
  border-top: 1px solid var(--line);
  background: #121212;
}

.k2s-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.k2s-heading a {
  color: var(--accent);
}

.k2s-frame {
  padding: 0 14px 14px;
}

.k2s-frame iframe,
.k2s-frame video,
.k2s-frame embed,
.k2s-frame object {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 280px;
  border: 0;
  border-radius: var(--radius);
  background: #080808;
}

.k2s-frame a {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--line));
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #111;
  background: var(--accent);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.host-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  background: var(--panel-strong);
}

.host-button {
  border-radius: var(--radius);
}

.rapid-reveal {
  border-radius: var(--radius);
  background: var(--accent-2);
  color: #fff;
}

.tez-reveal {
  border-radius: var(--radius);
  background: #5daeff;
  color: #07111f;
}

.link-reveal:disabled {
  cursor: wait;
  opacity: .72;
}

.download-panel {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #121212;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.download-panel a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent-2) 70%, var(--line));
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #fff;
  background: rgba(230, 75, 95, .18);
  font-weight: 800;
}

.host-empty {
  color: var(--muted);
}

.content-panel,
.details-panel,
.similar-section {
  padding: 18px;
  margin-top: 18px;
}

.content-panel h1 {
  font-size: clamp(28px, 4vw, 48px);
}

.post-copy {
  color: #ddd;
  line-height: 1.65;
}

.post-copy iframe {
  max-width: 100%;
}

.details-panel {
  margin-top: 0;
  align-self: start;
  position: sticky;
  top: 86px;
}

.taxonomy-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.taxonomy-list a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading a {
  color: var(--accent);
  font-weight: 800;
}

.empty {
  color: var(--muted);
}

.footer {
  padding: 34px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

@media (max-width: 980px) {
  .topbar,
  .hero-panel,
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .quick-links {
    justify-content: start;
  }

  .hero-panel {
    display: grid;
  }

  .stats-strip {
    flex-wrap: wrap;
  }

  .video-grid,
  .video-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .details-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .site-shell {
    width: min(100% - 20px, 1440px);
  }

  .search {
    display: grid;
  }

  .brand img {
    height: 40px;
    max-width: 190px;
  }

  .search button {
    width: 100%;
  }

  .video-grid,
  .video-grid.compact {
    grid-template-columns: 1fr;
  }

  .video-card.featured {
    grid-column: auto;
    grid-row: auto;
  }

  h1 {
    font-size: 36px;
  }
}
