@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-rgb: 10, 10, 10;
  --surface: #141414;
  --surface-rgb: 20, 20, 20;
  --surface-alt: #1c1c1c;
  --surface-hover: #262626;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --border-hover: rgba(229, 9, 20, 0.8);
  --text: #f5f5f5;
  --text-rgb: 245, 245, 245;
  --text-secondary: #d0d0d0;
  --text-tertiary: #8c8c8c;
  --accent: #e50914;
  --accent-hover: #ff2d36;
  --accent-rgb: 229, 9, 20;
  --ink: #0a0a0a;
  --success: #46d369;
  --error: #e50914;
  --warning: #f5c518;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: rgb(var(--bg-rgb)); }
body {
  margin: 0;
  min-height: 100vh;
  background: rgb(var(--bg-rgb));
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
button { cursor: pointer; }

.sr, .skip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip:focus {
  width: auto;
  height: auto;
  clip: auto;
  z-index: 30;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--text);
  border-radius: 4px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(var(--bg-rgb));
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 4vw;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.2rem;
  flex: 0 0 auto;
}
.logo img { width: 28px; height: 28px; }
.nav-links { display: none; gap: 4px; }
.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text-secondary);
  border-radius: 4px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.is-on { color: var(--accent); }
.nav-search {
  margin-left: auto;
  position: relative;
  flex: 1 1 220px;
  max-width: 360px;
  display: flex;
  align-items: center;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.nav-search:focus-within { border-color: var(--accent); }
.nav-search svg { width: 18px; height: 18px; fill: var(--text-tertiary); margin-left: 12px; flex: 0 0 auto; }
.nav-search input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  outline: none;
}
.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  z-index: 21;
}
.suggest a { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 6px 8px; }
.suggest a:hover { background: var(--surface-hover); }
.suggest img { width: 72px; height: 42px; object-fit: cover; border-radius: 2px; }
.nav-links a:focus-visible, .play-btn:focus-visible, .poster:focus-visible, .pager a:focus-visible, .tag:focus-visible, .player-tab:focus-visible, .nav-search input:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.hero {
  position: relative;
  min-height: 68vh;
  display: flex;
  align-items: flex-end;
  padding: 12vh 4vw 8vh;
  background: rgb(var(--bg-rgb)) var(--hero) center / cover no-repeat;
  animation: hero-in 600ms ease both;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(var(--bg-rgb), 0.94) 0%, rgba(var(--bg-rgb), 0.55) 42%, rgba(var(--bg-rgb), 0.15) 100%),
    linear-gradient(transparent 30%, rgb(var(--bg-rgb)));
}
.hero-copy { position: relative; z-index: 1; max-width: 38rem; }
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 16ch;
}
.hero p { margin-top: 12px; color: var(--text-secondary); max-width: 42ch; }
.play-btn {
  margin-top: 20px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  background: var(--accent);
  color: var(--text);
  border-radius: 4px;
  font-weight: 600;
}
.play-btn:hover { background: var(--accent-hover); }
.play-btn svg { width: 16px; height: 16px; fill: currentColor; }

.rails { padding: 8px 0 48px; }
.rail { margin-top: 22px; }
.rail-head, .page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4vw;
  margin-bottom: 10px;
}
.rail-head h2, .page-head h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.page-head { padding-top: 28px; display: block; }
.page-head h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.page-head p, .muted { color: var(--text-secondary); margin-top: 8px; }
.rail-head a { color: var(--text-tertiary); min-height: 44px; display: inline-flex; align-items: center; }
.rail-head a:hover { color: var(--text); }
.rail-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 4px 4vw 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}
.poster {
  flex: 0 0 260px;
  scroll-snap-align: start;
  display: block;
  border-radius: 6px;
  transition: transform 200ms ease;
}
.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface);
}
.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 200ms ease;
}
.poster:hover { transform: translateY(-4px); }
.poster:hover img { transform: scale(1.06); }
.poster-shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(transparent, rgba(var(--bg-rgb), 0.92));
}
.poster-title {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poster-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  opacity: 0;
  transition: opacity 200ms ease;
}
.poster:hover .poster-play, .poster:focus-visible .poster-play { opacity: 1; }
.poster-play svg { width: 16px; height: 16px; fill: var(--text); margin-left: 2px; }
.chip {
  position: absolute;
  top: 8px;
  padding: 3px 6px;
  border-radius: 3px;
  background: rgba(var(--bg-rgb), 0.78);
  font-size: 0.72rem;
  font-weight: 600;
}
.chip-time { left: 8px; }
.chip-hd { right: 8px; background: var(--accent); }

.poster-grid, .grid, .cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 8px 4vw 24px;
}
.poster-grid .poster, .grid .poster { flex: none; width: auto; }
.cat-tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface);
  min-height: 44px;
}
.cat-tile img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 12px 12px;
  background: linear-gradient(transparent, rgba(var(--bg-rgb), 0.92));
  font-weight: 600;
}
.cat-tile:hover { outline: 1px solid var(--border-hover); }
.cat-tile:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-tertiary); font-size: 0.9rem; margin-bottom: 10px; }
.crumbs a { min-height: 44px; display: inline-flex; align-items: center; }
.crumbs a:hover { color: var(--text); }
.pager { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 4vw 40px; }
.pager a, .pager span, .player-tab, .tag {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}
.pager a:hover, .tag:hover, .player-tab:hover { color: var(--text); border-color: var(--border-strong); }
.pager .is-on, .player-tab.is-on { background: var(--accent); color: var(--text); border-color: transparent; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4vw 12px; }
.page-head + .tags { padding-top: 0; }

.empty { margin: 28px 4vw; padding: 32px 20px; background: var(--surface); border-radius: 6px; }
.empty h1, .empty h2 { font-size: 1.8rem; margin-bottom: 8px; }
.empty p { color: var(--text-secondary); }
.empty a { color: var(--accent); }

.watch { padding-bottom: 48px; }
.watch .crumbs { padding: 16px 4vw 0; }
.player { padding: 12px 4vw 0; }
.player-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; }
.stage {
  aspect-ratio: 16 / 9;
  background: rgb(var(--bg-rgb));
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.stage iframe, .video-iframe { width: 100%; height: 100%; border: 0; display: block; }
.poster-play-btn, .poster-play#poster-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: rgb(var(--bg-rgb));
  opacity: 1;
  border-radius: 0;
}
#poster-play img { width: 100%; height: 100%; object-fit: cover; }
#poster-play .play-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--accent);
}
#poster-play .play-icon::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 22px;
  border-style: solid;
  border-width: 12px 0 12px 18px;
  border-color: transparent transparent transparent var(--text);
}
.placeholder { height: 100%; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--text-secondary); }
.details { padding: 22px 4vw 0; display: grid; gap: 16px; }
.details h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: -0.03em; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-secondary); }
.stats span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--surface);
}
.details .tags { padding: 0; }
.related { margin-top: 28px; }

.site-foot { border-top: 1px solid var(--border); padding: 28px 4vw 40px; color: var(--text-secondary); }
.site-foot-inner { display: grid; gap: 22px; }
.site-foot a { display: block; min-height: 36px; color: var(--text-secondary); }
.site-foot a:hover { color: var(--text); }
.foot-label { color: var(--text-tertiary); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.foot-copy { color: var(--text-tertiary); font-size: 0.85rem; margin-top: 18px; }

@media (min-width: 800px) {
  .nav-links { display: flex; }
  .site-foot-inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
@media (max-width: 799px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav-search { max-width: none; order: 3; flex: 1 1 100%; margin-left: 0; }
  .nav-links { display: flex; order: 2; overflow-x: auto; }
  .hero { min-height: 78vw; padding-top: 18vh; align-items: flex-end; }
  .poster { flex-basis: 72vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@keyframes hero-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
