:root {
  --bg: #000000;
  --panel: #111111;
  --panel-soft: #171717;
  --muted: rgba(255,255,255,0.7);
  --line: rgba(255,255,255,0.09);
  --brand-red: #e50914;
  --brand-red-dark: #b20710;
}

* {
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: #fff;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(229,9,20,0.18), transparent 28%),
    linear-gradient(180deg, #111 0%, #000 24%, #000 100%);
}
main {
  min-height: calc(100vh - 72px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-red), #ff6b6b);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.8rem;
  box-shadow: 0 10px 30px rgba(229,9,20,0.45);
}
.site-header h1 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.2rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
}

.hero {
  padding: 56px 24px 0;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.hero h2 {
  margin: 0 0 12px;
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}
.hero .subtitle {
  max-width: 760px;
  margin: 0 0 24px;
  color: rgba(255,255,255,0.72);
  font-size: 1.08rem;
  line-height: 1.6;
}
.search-bar {
  display: flex;
  gap: 12px;
  max-width: 760px;
}
.search-bar input,
.search-bar select,
input[type="text"], select, input[type="number"] {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 1rem;
  outline: none;
}
.search-bar input {
  flex: 1;
}
.search-bar select {
  min-width: 180px;
}
.search-bar input::placeholder { color: rgba(255,255,255,0.45); }

.featured-panel {
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 0 24px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}
.featured-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 12px;
  overflow: hidden;
}
.carousel-item {
  position: relative;
  border: 0;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  cursor: pointer;
  box-shadow: inset 0 -80px 70px rgba(0,0,0,0.66);
  overflow: hidden;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.carousel-item:hover {
  transform: translateY(-4px);
  filter: brightness(1.05);
}
.carousel-item.active {
  outline: 2px solid rgba(255,255,255,0.5);
}
.carousel-caption {
  width: 100%;
  padding-top: 20px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}
.carousel-controls {
  max-width: 1200px;
  margin: 10px auto 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 0 8px;
}
.carousel-controls button {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
}

.results-panel {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 16px 24px 0;
  background: transparent;
  box-shadow: none;
}
.results-header {
  margin-bottom: 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--panel);
  aspect-ratio: 2 / 3;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(255,255,255,0.04);
}
.card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.82) 100%);
}
.card-title {
  flex: 1;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  font-size: 0.86rem;
}
.card .play {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 7px 9px;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 40px rgba(0,0,0,0.58);
}
.card:hover img { transform: scale(1.06); }
.loading {
  padding: 18px 0 30px;
  text-align: center;
  color: rgba(255,255,255,0.6);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(3px);
}
.modal-content {
  position: relative;
  z-index: 1;
  width: min(1100px, 96vw);
  background: linear-gradient(180deg, rgba(20,20,20,0.98), rgba(17,17,17,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  animation: modalIn 0.18s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-body {
  display: flex;
  gap: 22px;
  padding: 24px;
}
.modal-left img {
  width: 310px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}
.modal-right {
  flex: 1;
  color: #fff;
}
.modal-right h3 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3vw, 2.8rem);
}
.modal-right p {
  margin: 0;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
}
.series-tracker {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
}
.series-tracker.hidden {
  display: none;
}
.tracker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tracker-row label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  min-width: 120px;
}
.tracker-row select {
  min-width: 120px;
  width: 100%;
}
.dub-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.play.big {
  background: linear-gradient(180deg, var(--brand-red), var(--brand-red-dark));
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
}
.small { color: var(--muted); }
.note { color: rgba(255,255,255,0.65); }
.meta { margin-bottom: 12px; }

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: flex;
  flex-direction: column;
}
.player-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 18px;
  background: rgba(0,0,0,0.7);
  border-bottom: 1px solid var(--line);
}
.player-topbar .player-back {
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,0.08);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
}
.player-body {
  flex: 1;
  min-height: 0;
}
.player-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

body.player-open {
  overflow: hidden;
}

@media (max-width: 800px) {
  .search-bar { flex-direction: column; }
  .modal-body { flex-direction: column; }
  .modal-left img { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .carousel { height: 260px; }
}

