/* ============================================================
   KrizPlay Clone - Stylesheet
   Dark-mode streaming UI: sidebar + main content + right info panel
   ============================================================ */

:root {
  --bg: #0f0f0f;
  --bg-1: #1a1a1a;
  --bg-2: #242424;
  --bg-3: #2a2a2a;
  --bg-4: #333333;
  --border: #2a2a2a;
  --text: #ffffff;
  --text-2: #b3b3b3;
  --text-3: #71717a;
  --text-4: #52525b;
  --accent: #ffffff;
  --accent-2: #e5e5e5;
  --gold: #fbbf24;
  --green: #22c55e;
  --green-d: #16a34a;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #a855f7;
  --sidebar-w: 240px;
  --info-w: 340px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .4);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

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

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ===== App shell ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ===== Left Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.brand {
  padding: 22px 22px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #ffffff 0%, #b3b3b3 100%);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #000;
  font-weight: 800;
  font-size: 18px;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-name span {
  color: var(--text-3);
}

.nav {
  padding: 0 12px 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 18px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 1px;
  transition: background .15s var(--ease), color .15s var(--ease);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg-3);
  color: var(--text);
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-item.active .icon {
  opacity: 1;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  font-size: 11px;
  color: var(--text-4);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* ===== Main content area ===== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15, 15, 15, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 40;
}

.topbar-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s var(--ease);
}

.topbar-back:hover {
  background: var(--bg-3);
}

.topbar-back .icon {
  width: 18px;
  height: 18px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.search-pill {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  gap: 10px;
  flex: 1;
  max-width: 420px;
  transition: border-color .15s var(--ease);
}

.search-pill:focus-within {
  border-color: #555;
}

.search-pill .icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.search-pill input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  flex: 1;
  min-width: 0;
}

.search-pill input::placeholder {
  color: var(--text-3);
}

.content {
  padding: 0;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  height: 540px;
  margin-bottom: 0;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.55);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 15, 15, .35) 0%, rgba(15, 15, 15, .65) 50%, var(--bg) 100%),
    linear-gradient(90deg, rgba(15, 15, 15, .85) 0%, rgba(15, 15, 15, 0) 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  padding: 80px 48px 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-2);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero-badge .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.hero-title {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .5);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-2);
}

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

.hero-meta .rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-weight: 600;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: #fff;
  color: #000;
}

.btn-primary:hover {
  background: #e5e5e5;
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border-color: rgba(255, 255, 255, .2);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .18);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: #404040;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, .08);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.btn-icon:hover {
  background: var(--bg-3);
}

.btn-icon .icon {
  width: 18px;
  height: 18px;
}

/* ===== Carousel Section ===== */
.section {
  padding: 28px 28px 4px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-sub {
  font-size: 13px;
  color: var(--text-3);
  flex: 1;
}

.section-arrows {
  display: flex;
  gap: 6px;
}

.arrow-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s var(--ease);
}

.arrow-btn:hover {
  background: var(--bg-3);
}

.arrow-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.arrow-btn .icon {
  width: 16px;
  height: 16px;
}

.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 6px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.carousel-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* ===== Movie / Show Card ===== */
.card {
  flex: 0 0 auto;
  width: 160px;
  cursor: pointer;
  transition: transform .18s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
}

.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s var(--ease);
}

.card:hover .card-poster img {
  transform: scale(1.05);
}

.card-rating {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, .78);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(2px);
}

.card-rating .star {
  color: var(--gold);
  font-size: 11px;
}

.card-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: all .2s var(--ease);
}

.card:hover .card-play {
  opacity: 1;
}

.card-play .circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  color: #fff;
  transition: transform 0.2s var(--ease);
}

.card-play .circle:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.25);
}

.card-play .icon {
  width: 22px;
  height: 22px;
  margin-left: 3px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.card-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, .78);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ===== Page header (titles) ===== */
.page-header {
  padding: 36px 28px 18px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.page-sub {
  font-size: 14px;
  color: var(--text-3);
}

/* ===== Big search bar ===== */
.big-search {
  display: flex;
  gap: 10px;
  padding: 0 28px 24px;
}

.big-search .search-pill {
  max-width: none;
  flex: 1;
  border-radius: var(--radius);
  padding: 12px 18px;
}

.btn-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.btn-filter:hover {
  background: var(--bg-3);
}

.btn-filter .icon {
  width: 16px;
  height: 16px;
}

/* ===== Grid layout (search/browse/list pages) ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 0 28px 32px;
}

.grid .card {
  width: 100%;
}

/* ===== Watch Page Layout ===== */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr var(--info-w);
  gap: 24px;
  padding: 24px 28px 32px;
  align-items: start;
}

.watch-main {
  min-width: 0;
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.player-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
  color: var(--text-2);
  text-align: center;
  padding: 24px;
}

.player-placeholder .icon {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  opacity: 0.4;
}

.player-placeholder h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.player-placeholder p {
  font-size: 13px;
  color: var(--text-3);
}

.now-playing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 8px;
  flex-wrap: wrap;
  gap: 12px;
}

.now-playing-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.now-playing-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.now-playing-title {
  font-size: 18px;
  font-weight: 700;
}

.now-playing-actions {
  display: flex;
  gap: 8px;
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(251, 191, 36, .08);
  border: 1px solid rgba(251, 191, 36, .18);
  border-radius: var(--radius-sm);
  margin: 6px 0 18px;
  font-size: 13px;
  color: var(--text-2);
}

.banner .icon {
  width: 16px;
  height: 16px;
  color: var(--gold);
  flex-shrink: 0;
}

/* Server selection grid */
.servers-block {
  margin-top: 18px;
}

.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s var(--ease);
}

.server-card:hover {
  background: var(--bg-3);
  border-color: #444;
}

.server-card.active {
  background: var(--bg-3);
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.server-flag {
  width: 22px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, #1e40af 0%, #1e3a8a 50%, #b91c1c 50%, #991b1b 100%);
  flex-shrink: 0;
  position: relative;
}

.server-flag.us {
  background: linear-gradient(180deg, #b91c1c 0%, #f3f4f6 33%, #1e3a8a 66%, #f3f4f6 100%);
}

.server-flag.uk {
  background: #1e3a8a;
  position: relative;
}

.server-flag.uk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%), linear-gradient(-45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%);
  background-size: 8px 8px;
  opacity: .3;
}

.server-flag.fr {
  background: linear-gradient(90deg, #1e3a8a 33%, #fff 33%, #fff 66%, #b91c1c 66%);
}

.server-flag.es {
  background: linear-gradient(180deg, #b91c1c 25%, #fbbf24 25%, #fbbf24 75%, #b91c1c 75%);
}

.server-flag.ru {
  background: linear-gradient(180deg, #fff 33%, #1e3a8a 33%, #1e3a8a 66%, #b91c1c 66%);
}

.server-flag.it {
  background: linear-gradient(90deg, #16a34a 33%, #fff 33%, #fff 66%, #b91c1c 66%);
}

.server-flag.de {
  background: linear-gradient(180deg, #000 33%, #b91c1c 33%, #b91c1c 66%, #fbbf24 66%);
}

.server-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: lowercase;
}

.server-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

.server-status.busy {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.server-status.off {
  background: var(--text-4);
  box-shadow: none;
}

.server-badge {
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* TV episode picker on watch page */
.season-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.season-pill {
  padding: 8px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s var(--ease);
}

.season-pill:hover {
  background: var(--bg-3);
}

.season-pill.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.episodes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 14px;
  max-height: 380px;
  overflow-y: auto;
}

.episode-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s var(--ease);
}

.episode-card:hover {
  background: var(--bg-3);
}

.episode-card.active {
  border-color: var(--green);
  background: var(--bg-3);
}

.episode-thumb {
  width: 100px;
  height: 56px;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.episode-num {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: 2px;
}

.episode-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* Right info panel */
.info-panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 80px;
}

.info-poster-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  aspect-ratio: 2 / 3;
  background: var(--bg-2);
}

.info-poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-poster-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, .85);
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}

.info-poster-rating .icon {
  width: 14px;
  height: 14px;
}

.info-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.info-meta-row {
  display: flex;
  gap: 8px;
}

.info-meta-label {
  color: var(--text-3);
  font-weight: 600;
  min-width: 80px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-meta-val {
  color: var(--text);
  flex: 1;
}

.info-tagline {
  font-size: 13px;
  font-style: italic;
  color: var(--text-2);
  margin-bottom: 14px;
  line-height: 1.5;
}

.info-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.genre-chip {
  padding: 5px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .15s var(--ease);
}

.genre-chip:hover {
  background: var(--bg-3);
}

.info-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-section-title a {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.trailer-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 18px;
  transition: all .15s var(--ease);
}

.trailer-btn:hover {
  background: var(--bg-3);
}

.trailer-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trailer-btn .label {
  font-size: 13px;
  font-weight: 600;
}

.trailer-btn .icon {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.cast-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cast-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cast-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-3);
  overflow: hidden;
  flex-shrink: 0;
}

.cast-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.cast-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cast-role {
  font-size: 12px;
  color: var(--text-3);
}

/* ===== Browse page ===== */
.browse-hero {
  position: relative;
  padding: 56px 48px 40px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at top, rgba(99, 102, 241, .08), transparent 60%),
    linear-gradient(180deg, #161616, var(--bg));
}

.browse-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-2);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.browse-hero-badge .icon {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.browse-hero-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
  max-width: 620px;
}

.browse-hero-sub {
  font-size: 15px;
  color: var(--text-2);
  max-width: 560px;
  margin-bottom: 22px;
}

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

.genre-toggle {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}

.genre-toggle button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.genre-toggle button.active {
  background: #fff;
  color: #000;
}

.genre-toggle .icon {
  width: 14px;
  height: 14px;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 24px 28px;
}

.genre-card {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  transition: transform .18s var(--ease);
}

.genre-card:hover {
  transform: translateY(-3px);
}

.genre-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .78) 100%);
}

.genre-card-name {
  position: relative;
  z-index: 2;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

.genre-card-explore {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  font-size: 12px;
  color: rgba(255, 255, 255, .85);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.networks-row,
.studios-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 28px 28px;
}

.network-card {
  flex: 1 1 120px;
  min-width: 120px;
  max-width: 180px;
  height: 80px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s var(--ease);
}

.network-card:hover {
  transform: translateY(-2px);
}

.network-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  text-align: center;
  padding: 0 10px;
}

.studio-card {
  flex: 1 1 160px;
  min-width: 160px;
  max-width: 200px;
  height: 80px;
  background: #fff;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s var(--ease);
}

.studio-card:hover {
  transform: translateY(-2px);
}

.studio-name {
  font-size: 13px;
  font-weight: 800;
  color: #000;
  text-align: center;
  padding: 0 10px;
}

/* ===== Anime Schedule ===== */
.schedule-days {
  display: flex;
  gap: 8px;
  padding: 0 28px 18px;
  overflow-x: auto;
}

.day-pill {
  flex: 0 0 auto;
  padding: 12px 16px;
  min-width: 70px;
  text-align: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s var(--ease);
}

.day-pill:hover {
  background: var(--bg-3);
}

.day-pill.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.day-pill .dow {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
}

.day-pill.active .dow {
  color: #666;
}

.day-pill .day {
  font-size: 18px;
  font-weight: 800;
}

.day-pill .today {
  font-size: 9px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.day-pill.active .today {
  color: var(--red);
}

.schedule-list {
  padding: 0 28px 32px;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.schedule-thumb {
  width: 56px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-2);
  flex-shrink: 0;
}

.schedule-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.schedule-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.schedule-meta {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  align-items: center;
}

.schedule-ep {
  color: var(--purple);
  font-weight: 700;
}

.schedule-countdown {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
}

/* ===== Manga cards (cover-based) ===== */
.card-manga .card-poster {
  aspect-ratio: 3 / 4;
}

/* ===== Footer ===== */
.foot {
  margin-top: auto;
  padding: 28px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-4);
  line-height: 1.6;
}

.foot a {
  color: var(--text-3);
}

.foot a:hover {
  color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .info-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .hero-title {
    font-size: 30px;
  }

  .hero-content {
    padding: 40px 24px 0;
  }

  .section,
  .page-header,
  .grid,
  .browse-hero {
    padding-left: 18px;
    padding-right: 18px;
  }

  .big-search {
    padding-left: 18px;
    padding-right: 18px;
  }

  .watch-layout {
    padding: 18px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .card {
    width: 100%;
  }
}

/* Empty / loading state */
.empty {
  padding: 80px 28px;
  text-align: center;
  color: var(--text-3);
}

.empty .icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  opacity: 0.4;
}

.empty h3 {
  font-size: 18px;
  margin-bottom: 6px;
  color: var(--text-2);
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 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;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow);
  z-index: 100;
  opacity: 0;
  transform: translateY(20px);
  transition: all .25s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.modal-content iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.modal-close .icon {
  width: 16px;
  height: 16px;
}