* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: #09090b;
  color: #f4f4f5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
}

.mono-idx {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #71717a;
  margin-right: 8px;
  font-weight: 500;
}

.mono-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #71717a;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* TOP BAR */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }

.brand img {
  height: 36px;
  width: 36px;
  object-fit: contain;
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-circle-btn,
.guest-pill {
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 18, 22, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #e4e4e7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.top-circle-btn { width: 36px; }
.guest-pill { padding: 0 14px; gap: 7px; font-size: 13px; font-weight: 500; }

.top-circle-btn:hover,
.guest-pill:hover {
  background: rgba(39, 39, 46, 0.9);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* GENRE DRAWER */
.genre-drawer {
  position: fixed;
  top: 66px;
  right: 32px;
  z-index: 45;
  max-width: min(620px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 16px;
  background: rgba(17, 18, 21, 0.92);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.genre-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4d8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.genre-pill.active,
.genre-pill:hover {
  background: #fff;
  color: #09090b;
  border-color: #fff;
}

/* SEARCH OVERLAY */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: start center;
  padding-top: 90px;
}

.search-overlay-box {
  width: min(560px, 92vw);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #a1a1aa;
}

.search-overlay-box input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font-size: 16px;
}

.search-close-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #a1a1aa;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: pointer;
}

/* HERO */
.hero {
  position: relative;
  width: 100%;
  height: 78vh;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  padding: 0 36px 56px;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  transition: opacity 0.6s ease;
}

.trailer-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.trailer-wrap.visible {
  opacity: 1;
}

.trailer-wrap iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 177.78vh);
  height: max(100%, 56.25vw);
  transform: translate(-50%, -50%) scale(1.18);
  border: 0;
  pointer-events: none;
}

.modal-banner .trailer-wrap iframe {
  width: 100%;
  height: 380%;
  transform: translate(-50%, -50%) scale(1.12);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 9, 11, 0.92) 0%, rgba(9, 9, 11, 0.55) 42%, rgba(9, 9, 11, 0.1) 100%),
    linear-gradient(180deg, rgba(9, 9, 11, 0.35) 0%, rgba(9, 9, 11, 0) 35%, #09090b 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.hero-featured-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #a1a1aa;
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 12px;
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #f4f4f5;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #a1a1aa;
  margin-bottom: 12px;
}

.hero-star { color: #f59e0b; font-weight: 600; }
.dot { color: #52525b; }

.hero-desc {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
  color: #d4d4d8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.btn-white-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 0;
  background: #ffffff;
  color: #09090b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.btn-white-pill:hover { opacity: 0.92; transform: translateY(-1px); }

.btn-circle-glass {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(24, 24, 28, 0.65);
  backdrop-filter: blur(16px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-circle-glass:hover,
.btn-circle-glass.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
}

.hero-dashes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-dash {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dash.active {
  width: 28px;
  background: #ffffff;
}

/* ROWS */
.rows-container {
  padding: 0 36px 110px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.row-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
}

.row-more {
  font-size: 12px;
  color: #a1a1aa;
  cursor: pointer;
}
.row-more:hover { color: #fff; }

.cards {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}
.cards::-webkit-scrollbar { display: none; }

.card {
  position: relative;
  flex: 0 0 165px;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #141418;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #ffffff;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}
.card-progress-fill {
  height: 100%;
  background: #fff;
}

/* SEARCH / CATEGORY GRID */
.search-page {
  padding: 96px 36px 110px;
}

.search-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.search-page-title { margin: 0; font-size: 20px; }

.btn-outline-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #e4e4e7;
  font-size: 13px;
  cursor: pointer;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 16px;
}

.cards-grid .card { flex: unset; width: 100%; }

/* BOTTOM FLOATING GLASS DOCK */
.bottom-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24, 24, 29, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
}

.dock-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #a1a1aa;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.dock-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.dock-btn.active { background: #ffffff; color: #09090b; }

/* INFO MODAL (Image 2 Clone) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  display: none;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}

.modal-overlay.open { display: grid; }

.modal-card {
  position: relative;
  width: min(760px, 100%);
  background: #111215;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.85);
  margin: auto;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(17, 18, 21, 0.75);
  color: #e4e4e7;
  cursor: pointer;
  font-size: 14px;
}

.modal-banner {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.modal-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-banner-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 18, 21, 0.25) 0%, rgba(17, 18, 21, 0.75) 70%, #111215 100%);
}

.modal-id-tag {
  position: absolute;
  top: 18px;
  left: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.7);
}

.modal-inner {
  padding: 0 28px 28px;
  margin-top: -110px;
  position: relative;
  z-index: 2;
}

.modal-head {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  margin-bottom: 20px;
}

.modal-poster {
  width: 136px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
}

.modal-title {
  margin: 0 0 10px;
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.08;
}

.modal-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #a1a1aa;
}

.modal-match { color: #4ade80; font-weight: 600; }
.hd-badge {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 10px;
  font-weight: 600;
  color: #e4e4e7;
}
.modal-star { color: #f59e0b; font-weight: 600; }

.modal-btns-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.btn-dark-pill {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f4f5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-dark-pill.active,
.btn-dark-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

.modal-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0 0 20px;
}

.modal-synopsis-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 28px;
  margin-bottom: 24px;
}

.modal-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #d4d4d8;
}

.fact-val {
  font-size: 13px;
  color: #e4e4e7;
}

.modal-section { margin-top: 22px; }

.modal-sec-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}

.cast-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.cast-row::-webkit-scrollbar { display: none; }

.cast-item {
  flex: 0 0 82px;
  text-align: center;
}

.cast-item img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  display: block;
  background: #1c1c22;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.cast-name {
  font-size: 12px;
  font-weight: 600;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-role {
  font-size: 11px;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.season-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.season-select {
  padding: 6px 12px;
  border-radius: 8px;
  background: #1c1c22;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
}

.episodes-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.episodes-grid::-webkit-scrollbar { display: none; }

.ep-card {
  flex: 0 0 150px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}
.ep-card:hover, .ep-card.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
}
.ep-num { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #a1a1aa; }
.ep-name { font-size: 13px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.modal-recs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.modal-rec-card {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-rec-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.modal-rec-card span { display: block; padding: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* FULL-PAGE PLAYER EMBED */
.play-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: none;
}
.play-modal.open { display: block; }
.play-modal iframe { width: 100%; height: 100%; border: 0; display: block; }

.play-floating-bar {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 100000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(24, 24, 29, 0.78);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  padding: 9px 18px;
  border-radius: 999px;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 680px) {
  .topbar { padding: 14px 18px; }
  .hero { padding: 0 18px 46px; height: 70vh; }
  .rows-container { padding: 0 18px 104px; }
  .modal-inner { padding: 0 18px 22px; margin-top: -70px; }
  .modal-poster { width: 96px; }
  .modal-synopsis-grid { grid-template-columns: 1fr; gap: 16px; }
  .card { flex: 0 0 128px; }
}
