/* ke1th.streams - Netflix-inspired streaming UI */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-card: #1a1a1a;
  --surface: #232323;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e5e5e5;
  --text-bright: #ffffff;
  --text-muted: #808080;
  --brand: #e50914;
  --brand-hover: #f40612;
  --accent: #46d369;
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  --radius: 6px;
  --radius-lg: 12px;
  --poster-w: 180px;
  --landscape-w: 380px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Skeleton Loader */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 1.2em;
  margin-bottom: 0.5em;
  width: 80%;
}

.skeleton-text.short {
  width: 50%;
}

.skeleton-card {
  flex: 0 0 var(--poster-w);
  width: var(--poster-w);
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-card.card-landscape {
  flex: 0 0 var(--landscape-w);
  width: var(--landscape-w);
  aspect-ratio: 16/9;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

.hidden { display: none !important; }

/* ─── Topbar (Apple Liquid Island) ─── */
.topbar {
  position: fixed;
  top: 24px;
  left: 0;
  right: 0;
  z-index: 100;
  pointer-events: none; /* Let clicks pass through empty space */
  display: flex;
  justify-content: center;
  transition: top 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.topbar.scrolled {
  top: 12px;
}

.topbar-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 8px 20px;
  width: auto;
  gap: 32px;
  background: rgba(24, 24, 24, 0.55);
  backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
  -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.28);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  border-radius: 40px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.topbar.scrolled .topbar-inner {
  background: rgba(15, 15, 15, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--brand);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.brand:hover {
  transform: scale(1.02);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--brand);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.4);
}

.brand-play {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #fff;
  margin-left: 2px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-bright);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-family: inherit;
  cursor: pointer;
  z-index: 2;
}

.nav-link:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.nav-active {
  color: var(--text-bright);
  background: rgba(229, 9, 20, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

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

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-bright);
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.action-btn:active {
  transform: scale(0.95);
}

/* ─── Hero ─── */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: flex-end;
  padding: 0 48px 120px;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(10, 10, 10, 0.92) 0%, rgba(10, 10, 10, 0.4) 50%, rgba(10, 10, 10, 0.2) 100%),
    linear-gradient(to top, rgba(10, 10, 10, 1) 0%, rgba(10, 10, 10, 0) 40%);
  z-index: 1;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 20%, transparent 50%, rgba(10, 10, 10, 0.4) 100%);
  z-index: 2;
}

.hero-fade-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  z-index: 3;
}

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

.hero-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}

#heroTitle {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-bright);
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-meta .rating {
  color: var(--accent);
  font-weight: 700;
}

.hero-meta .separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.hero-meta .tag {
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
}

.hero-overview {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-play {
  background: var(--text-bright);
  color: #000;
}

.btn-play:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.02);
}

.btn-info {
  background: rgba(109, 109, 110, 0.6);
  color: var(--text-bright);
  backdrop-filter: blur(8px);
}

.btn-info:hover {
  background: rgba(109, 109, 110, 0.45);
}

/* ─── Search ─── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  justify-content: center;
  padding-top: 80px;
}

.search-container {
  width: 100%;
  max-width: 680px;
  padding: 0 24px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: rgba(255, 255, 255, 0.2);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-bright);
  font-size: 1.15rem;
  font-weight: 500;
  font-family: var(--font);
}

.search-bar input::-webkit-search-cancel-button,
.search-bar input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: color var(--transition);
}

.search-close:hover {
  color: var(--text-bright);
}

.search-results {
  margin-top: 16px;
  max-height: 65vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
}

.search-results::-webkit-scrollbar { width: 6px; }
.search-results::-webkit-scrollbar-track { background: transparent; }
.search-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.search-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text);
}

.search-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.search-item-poster {
  width: 52px;
  height: 78px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface);
  flex-shrink: 0;
}

.search-item-info {
  flex: 1;
  min-width: 0;
}

.search-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Rows ─── */
.rows-section {
  position: relative;
  z-index: 10;
  margin-top: -80px;
  padding-bottom: 60px;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: 1920px;
  margin: 0 auto;
}

.row {
  padding: 0 48px;
}

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

.row-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.row-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  display: flex;
  align-items: center;
}

.row-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 0.9em;
  background-color: var(--brand);
  margin-right: 8px;
  border-radius: 2px;
}

.row-tabs {
  display: flex;
  gap: 24px;
}

.row-tab {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--transition);
  font-family: var(--font);
  padding: 4px 0;
  position: relative;
}

.row-tab:hover {
  color: var(--text-bright);
}

.row-tab.active {
  color: var(--text-bright);
}

.row-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--brand);
}

/* ─── Dropdown Picker ─── */
.genre-picker {
  position: relative;
  display: inline-block;
  margin-left: 12px;
}

.genre-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-bright);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}

.genre-toggle:hover {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.2);
}

.genre-chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}

.genre-picker.open .genre-chevron {
  transform: rotate(180deg);
}

.genre-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 200px;
  z-index: 50;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  max-height: 400px;
  overflow-y: auto;
}

.genre-menu::-webkit-scrollbar {
  width: 4px;
}
.genre-menu::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.genre-option {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 12px;
  text-align: left;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
  width: 100%;
}

.provider-logo {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.genre-option:hover {
  background: var(--surface);
  color: var(--text-bright);
}

.genre-option.active {
  background: rgba(229, 9, 20, 0.15);
  color: var(--brand);
}

.row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Card Rail ─── */
.rail-container {
  position: relative;
  margin: 0 -48px;
  padding: 0 48px;
}

.row-arrow {
  position: absolute;
  top: 0;
  width: 48px;
  height: calc(100% - 50px);
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(2px);
  color: var(--text-bright);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 20;
}

.rail-arrow-left {
  left: 0;
  background: linear-gradient(to right, rgba(10, 10, 10, 0.8) 0%, rgba(10, 10, 10, 0) 100%);
}

.rail-arrow-right {
  right: 0;
  background: linear-gradient(to left, rgba(10, 10, 10, 0.8) 0%, rgba(10, 10, 10, 0) 100%);
}

.rail-container:hover .row-arrow {
  opacity: 1;
}

.row-arrow:hover {
  background: rgba(20, 20, 20, 0.8);
}

.row-arrow:disabled {
  opacity: 0 !important;
  cursor: default;
  pointer-events: none;
}

.card-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0;
  margin: -16px 0;
  scrollbar-width: none;
}

.card-rail::-webkit-scrollbar { display: none; }

/* ─── Cards ─── */
.card {
  flex: 0 0 var(--poster-w);
  width: var(--poster-w);
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  text-align: left;
  font-family: inherit;
}

.card:hover {
  transform: scale(1.05);
  z-index: 5;
}

.card-landscape {
  flex: 0 0 var(--landscape-w);
  width: var(--landscape-w);
}

.continue-card {
  position: relative;
  flex: 0 0 var(--landscape-w);
  min-width: 0;
  scroll-snap-align: start;
}

.continue-card .card:hover {
  transform: none;
  z-index: auto;
}

.continue-status,
.continue-card .remove-continue {
  position: absolute;
  top: 7px;
  z-index: 2;
  color: #fff;
  --glisse-tint: rgba(12, 12, 16, 0.66);
}

.continue-status {
  left: 7px;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 650;
}

.continue-card .remove-continue {
  right: 7px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  cursor: pointer;
}

.continue-progress {
  position: absolute;
  inset: auto 8px 6px;
  height: 3px;
  z-index: 2;
  border-radius: 999px;
  background: linear-gradient(to right, #ed252f var(--progress), rgba(255,255,255,.3) var(--progress));
}

.card-img-wrap {
  position: relative;
}

.card-poster .card-image {
  aspect-ratio: 2/3;
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface);
  display: block;
}

.card-landscape .card-image {
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface);
  display: block;
}

.card-rank {
  position: absolute;
  left: -8px;
  bottom: 0;
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--bg);
  -webkit-text-stroke: 3px var(--text-muted);
  text-stroke: 3px var(--text-muted);
  pointer-events: none;
  z-index: -1;
}

.card-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  overflow: hidden;
}

.card:hover .card-overlay,
.card:focus .card-overlay,
.card.active-overlay .card-overlay {
  opacity: 1;
}

.card-overlay-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 100%;
}

.card-overlay-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-overlay-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  flex-wrap: wrap;
}

.card-overlay-meta .genres {
  color: #ccc;
  font-weight: 500;
}

.card-overlay-desc {
  font-size: 0.75rem;
  color: #aaa;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
}

.card-info {
  padding: 8px 4px 0;
}

.card-info-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.card-info-meta {
  display: block;
  font-size: 0.75rem;
  color: #b3b3b3;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* ─── Loading ─── */
.row-loading {
  opacity: 0.5;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--bg-card) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Genre Picker ─── */
.genre-picker {
  position: relative;
}

.genre-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.genre-toggle:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.genre-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
  color: var(--text-muted);
}

.genre-picker.open .genre-chevron {
  transform: rotate(180deg);
  color: var(--text-bright);
}

.genre-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 6px;
}

.genre-menu::-webkit-scrollbar { width: 6px; }
.genre-menu::-webkit-scrollbar-track { background: transparent; }
.genre-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.genre-option {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.genre-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-bright);
}

.genre-option.active {
  color: var(--brand);
  font-weight: 700;
}

/* ─── Modal ─── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  contain: layout style paint;
}

.modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  contain: layout style paint;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: all var(--transition);
  z-index: 510;
  pointer-events: auto;
}

.modal-close:hover {
  color: var(--text-bright);
  background: rgba(0, 0, 0, 0.9);
}

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: layout style paint;
}

.video-container iframe {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 2;
  pointer-events: auto;
  contain: layout style paint;
}

@media (max-width: 768px) and (orientation: portrait) {
  .video-container iframe {
    height: 56.25vw;
    max-height: 100%;
  }
}

/* ─── Server Selector ─── */
.player-hover-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
}

.modal-content.ui-hidden .player-hover-zone {
  pointer-events: auto;
}

.player-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  z-index: 510;
  min-height: 44px;
  width: 100%;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.modal-content.ui-hidden .player-toolbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.server-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.server-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  display: none;
}

@media (min-width: 480px) {
  .server-label {
    display: inline;
  }
}

.server-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.server-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.4);
  color: var(--text-bright);
  padding: 4px 26px 4px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

.server-select:hover,
.server-select:focus {
  background: rgba(229, 9, 20, 0.25);
  border-color: var(--brand);
}

.server-select option {
  background: #1a1a1a;
  color: var(--text-bright);
}

.server-select-wrap .select-chevron {
  position: absolute;
  right: 7px;
  pointer-events: none;
  color: var(--text-muted);
}

.player-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.modal-close-btn:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.15);
}

/* Fullscreen overrides */
.modal:-webkit-full-screen,
.modal:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: #000;
}

.modal:-webkit-full-screen .modal-content,
.modal:fullscreen .modal-content {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

.modal:-webkit-full-screen .video-container,
.modal:fullscreen .video-container {
  width: 100vw;
  height: 100vh;
}

.modal:-webkit-full-screen .modal-close,
.modal:fullscreen .modal-close {
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Mobile Dock ─── */
.mobile-dock {
  display: none;
}

/* ─── Footer ─── */
.site-footer {
  padding: 40px 24px 32px;
  max-width: 1920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.site-footer a {
  transition: opacity var(--transition);
}
.site-footer a:hover {
  opacity: 0.8;
}

/* ─── Category Modal ─── */
.cat-opt-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.cat-opt-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}
.cat-opt-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-bright);
}

/* ─── Disclaimer Modal ─── */
.disclaimer-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.disclaimer-modal.hidden {
  display: none;
}

.disclaimer-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
}

.disclaimer-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: disclaimer-in 0.3s ease;
}

@keyframes disclaimer-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(229, 9, 20, 0.05);
}

.disclaimer-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.4);
  flex-shrink: 0;
}

.disclaimer-play {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 12px solid #fff;
  margin-left: 3px;
}

.disclaimer-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.disclaimer-body {
  padding: 20px 24px;
}

.disclaimer-notice {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.disclaimer-recommend {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.disclaimer-recommend strong {
  color: var(--text);
}

.disclaimer-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.disclaimer-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.option-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent);
}

.option-icon.brave-icon {
  color: #fb542b;
}

.option-icon.ios-icon {
  color: #a2aaad;
}

.option-info {
  flex: 1;
  min-width: 0;
}

.option-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 2px;
}

.option-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.option-desc a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.option-desc a:hover {
  text-decoration: underline;
}

.disclaimer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.disclaimer-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.disclaimer-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.disclaimer-btn {
  padding: 10px 28px;
  background: var(--brand);
  color: var(--text-bright);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.disclaimer-btn:hover {
  background: var(--brand-hover);
  transform: scale(1.02);
}

@media (max-width: 480px) {
  .disclaimer-modal {
    padding: 8px;
  }
  .disclaimer-content {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 10px;
  }
  .disclaimer-header {
    padding: 14px 16px;
  }
  .disclaimer-title {
    font-size: 1.05rem;
  }
  .disclaimer-body {
    padding: 14px 16px;
  }
  .disclaimer-notice {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }
  .disclaimer-options {
    gap: 8px;
  }
  .disclaimer-option {
    padding: 10px;
    gap: 10px;
  }
  .option-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
  }
  .option-icon svg {
    width: 18px;
    height: 18px;
  }
  .option-title {
    font-size: 0.8rem;
  }
  .option-desc {
    font-size: 0.75rem;
  }
  .disclaimer-footer {
    padding: 12px 16px;
    gap: 8px;
  }
  .disclaimer-checkbox {
    font-size: 0.78rem;
  }
  .disclaimer-btn {
    padding: 8px 18px;
    font-size: 0.82rem;
  }
}

/* ─── Search UI Overhaul ─── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
}

.search-container {
  width: 100%;
  max-width: 600px;
  margin: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.search-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.search-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-filter-btn {
  background: rgba(18, 18, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ddd;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.search-close-modal {
  background: rgba(18, 18, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaa;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.search-close-modal:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.search-bar {
  /* Liquid glass visual properties come from .liquid-glass-input class */
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: 12px;
  position: relative;
  transition: all 0.3s ease;
}

.search-icon {
  color: #888;
}

#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  padding: 0 16px;
  outline: none;
}

#searchInput::placeholder {
  color: #666;
}

.search-clear {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
}

.search-clear:hover {
  color: #fff;
}

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px 0;
  background: rgba(18, 18, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.search-results:empty {
  display: none;
}

/* Recent Searches */
.recent-searches-container {
  padding: 0 20px;
}
.recent-searches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.recent-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #666;
  letter-spacing: 0.05em;
}
.recent-clear-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.recent-clear-btn:hover {
  color: #fff;
}
.recent-search-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  color: #ccc;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s;
}
.recent-search-item:hover {
  color: #fff;
}

/* Search Items */
.search-item {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  width: 100%;
}

.search-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.search-item-header {
  display: flex;
  align-items: center;
  width: 100%;
}

.search-item-poster {
  width: 50px;
  height: 75px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 16px;
}

.search-item-info {
  flex: 1;
}

.search-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.search-item-meta {
  font-size: 0.8rem;
  color: #888;
}
.search-item-meta span {
  color: #f5c518;
  font-weight: 600;
}

.search-item-chevron {
  color: #666;
  transition: transform 0.2s;
}

.search-item.expanded .search-item-chevron {
  transform: rotate(180deg);
}

/* Expanded Content */
.search-item-details {
  display: none;
  padding-top: 12px;
  padding-left: 66px;
}

.search-item.expanded .search-item-details {
  display: block;
}

.search-item-desc {
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-item-actions {
  display: flex;
  gap: 12px;
}

.search-play-btn {
  background: #fff;
  color: #000;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.search-play-btn:hover {
  background: #e6e6e6;
}

.search-more-btn {
  background: #2a2a2a;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.search-more-btn:hover {
  background: #333;
}

/* ─── Mobile Dock Default (Hidden on Desktop) ─── */
.mobile-dock-wrapper {
  display: none;
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  :root {
    --poster-w: 160px;
    --landscape-w: 340px;
  }
}

@media (max-width: 980px) {
  :root {
    --poster-w: 150px;
    --landscape-w: 300px;
  }

  .topbar {
    padding: 0;
    top: 0;
  }

  .topbar.scrolled {
    top: 0;
  }

  .topbar-inner,
  .topbar.scrolled .topbar-inner {
    width: 100%;
    padding: 16px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: 75vh;
    padding: 0 24px 100px;
  }

  .hero-content {
    max-width: 480px;
  }

  #heroTitle {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
  }

  .hero-overview {
    -webkit-line-clamp: 2;
  }

  .rows-section {
    margin-top: -60px;
  }

  .row {
    padding: 0 24px;
  }

  .rail-container {
    margin: 0 -24px;
    padding: 0 24px;
  }

  .site-footer {
    padding: 32px 24px 100px;
  }



  .mobile-dock-wrapper {
    --dock-height: clamp(58px, 16vw, 66px);
    --dock-inset: 5px;
    --dock-tab-height: calc(var(--dock-height) - 2 * var(--dock-inset));
    --dock-gap: 8px;
    --dock-tab-width: clamp(44px, calc((100vw - var(--dock-height) - var(--dock-gap) - 2 * var(--dock-inset) - 32px) / 4), 76px);
    position: fixed;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: var(--dock-gap);
  }

  .mobile-dock {
    padding: var(--dock-inset);
  }

  .mobile-dock .glass-content::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--dock-tab-width);
    border-radius: 999px;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
  }

  .mobile-dock .glass-content:has(.dock-active)::after {
    opacity: 1;
    transform: translateX(calc(var(--active-tab, 0) * var(--dock-tab-width)));
  }

  .mobile-dock .glass-content:has(.dock-btn:nth-child(2).dock-active) { --active-tab: 1; }
  .mobile-dock .glass-content:has(.dock-btn:nth-child(3).dock-active) { --active-tab: 2; }
  .mobile-dock .glass-content:has(.dock-btn:nth-child(4).dock-active) { --active-tab: 3; }

  .dock-search-btn {
    display: grid;
    place-items: center;
    width: var(--dock-height);
    height: var(--dock-height);
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    color: var(--text-bright);
    cursor: pointer;
    transition: transform 160ms ease;
  }

  .dock-search-btn svg {
    width: 25px;
    height: 25px;
    stroke-width: 2.2;
    position: relative;
    z-index: 2;
  }

  .dock-search-btn:active svg {
    transform: scale(0.9);
  }

  .dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none !important;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font);
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    width: var(--dock-tab-width);
    min-width: 44px;
    height: var(--dock-tab-height);
    text-decoration: none;
    border-radius: 20px;
    transition: color 0.3s ease, transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: none !important;
    flex-shrink: 0;
  }

  .dock-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
    transition: color 0.3s ease, transform 0.2s ease;
  }

  .dock-btn:active svg {
    transform: scale(0.85);
  }

  .dock-btn.dock-active {
    color: var(--brand);
  }

  .dock-btn.dock-active svg {
    color: var(--brand);
  }

  .dock-btn span {
    font-size: 0.625rem;
    letter-spacing: 0.02em;
  }
}

@media (max-width: 640px) {
  :root {
    --poster-w: 130px;
    --landscape-w: 260px;
  }

  .topbar-inner {
    padding: 16px;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .hero {
    min-height: 65vh;
    padding: 0 16px 80px;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-overview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    font-size: 0.85rem;
    margin-bottom: 16px;
  }

  .hero-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .rows-section {
    margin-top: -40px;
  }

  .row {
    padding: 0 16px;
  }

  .rail-container {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .row-title {
    font-size: 1.15rem;
  }

  .row-arrow {
    display: none;
  }

  .site-footer {
    padding: 24px 16px 90px;
  }

  .modal-content {
    width: 100vw;
    border-radius: 0;
  }

  .modal-close {
    top: -40px;
    right: 4px;
  }
}

@media (max-width: 400px) {
  :root {
    --poster-w: 115px;
    --landscape-w: 220px;
  }
}
@media (max-width: 980px) { .topbar-actions > #openSearchBtn { display: none !important; } }
