:root {
  --bg: #090d17;
  --bg-soft: #0e1421;
  --panel: #11192b;
  --panel-soft: rgba(17, 25, 43, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f6ff;
  --muted: #9dacd1;
  --primary: #ff4f98;
  --primary-strong: #ff2b83;
  --accent: #7aa2ff;
  --success: #48d1a0;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shell-width: min(1380px, calc(100% - 32px));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(255, 79, 152, 0.16), transparent 24%),
    linear-gradient(180deg, #070b13 0%, #0a0f1a 48%, #0a0f18 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

.hidden {
  display: none !important;
}

.app-shell {
  width: var(--shell-width);
  margin: 0 auto;
  padding: 18px 0 60px;
}

.topbar,
.hero-banner,
.toolbar-panel,
.content-section,
.detail-dialog,
.panel-block,
.video-card {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-radius: 20px;
  position: sticky;
  top: 12px;
  z-index: 10;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.brand-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

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

.nav-link,
.ghost-button,
.tag-button,
.chip-button,
.episode-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover,
.ghost-button:hover,
.tag-button:hover,
.chip-button:hover,
.episode-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.nav-link.active,
.chip-button.active,
.episode-button.active,
.tag-button.active,
.ghost-button.active {
  background: rgba(122, 162, 255, 0.18);
  border-color: rgba(122, 162, 255, 0.35);
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
}

.top-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(460px, 100%);
}

.top-search input,
.filter-controls select {
  width: 100%;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0 16px;
}

.main-layout {
  display: grid;
  gap: 20px;
  margin-top: 18px;
}

.hero-banner {
  position: relative;
  min-height: 430px;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: end;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 13, 23, 0.86) 0%, rgba(9, 13, 23, 0.62) 42%, rgba(9, 13, 23, 0.82) 100%),
    linear-gradient(180deg, rgba(8, 10, 16, 0.16) 0%, rgba(8, 10, 16, 0.85) 100%);
}

.hero-poster {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 430px;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 40px 40px 34px;
  display: grid;
  gap: 14px;
}

.hero-kicker {
  color: #ff8fbf;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  max-width: 760px;
}

.hero-meta,
.hero-summary,
.section-subtitle,
.status-text,
.loading-state,
.empty-state,
.detail-summary,
.player-placeholder {
  color: var(--muted);
  line-height: 1.75;
}

.hero-summary {
  margin: 0;
  max-width: 760px;
}

.hero-actions,
.toolbar-head,
.toolbar-row,
.filter-controls,
.quick-actions,
.section-header,
.pagination-bar,
.player-toolbar,
.panel-heading,
.chip-list,
.meta-list {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-panel,
.content-section {
  border-radius: 24px;
  padding: 22px;
}

.toolbar-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title,
.section-header h2 {
  margin: 0;
  font-size: 24px;
}

.section-subtitle {
  margin: 6px 0 0;
}

.toolbar-row {
  align-items: flex-start;
}

.toolbar-row + .toolbar-row {
  margin-top: 14px;
}

.toolbar-label {
  width: 96px;
  flex: 0 0 96px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-top: 12px;
}

.chip-track,
.filter-controls,
.quick-actions {
  flex: 1;
}

.chip-track,
.quick-actions {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.chip-track::-webkit-scrollbar,
.quick-actions::-webkit-scrollbar {
  height: 6px;
}

.chip-track::-webkit-scrollbar-thumb,
.quick-actions::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.status-banner {
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(122, 162, 255, 0.2);
  background: rgba(122, 162, 255, 0.08);
}

.section-header {
  justify-content: space-between;
  margin-bottom: 18px;
}

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

.video-card {
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
}

.video-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.card-poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, rgba(255, 79, 152, 0.18), rgba(122, 162, 255, 0.18));
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

.card-body {
  padding: 14px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.45;
}

.tag,
.info-tag,
.source-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.source-pill {
  background: rgba(72, 209, 160, 0.12);
  border-color: rgba(72, 209, 160, 0.18);
  color: #94ffd8;
}

.card-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  min-height: 72px;
}

.loading-state,
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
  text-align: center;
}

.pagination-bar {
  justify-content: center;
  margin-top: 24px;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.76);
  backdrop-filter: blur(10px);
}

.detail-dialog {
  position: relative;
  width: min(1260px, calc(100% - 18px));
  max-height: calc(100vh - 18px);
  margin: 9px auto;
  padding: 20px;
  border-radius: 26px;
  overflow: auto;
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 24px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.player-panel,
.detail-content {
  display: grid;
  gap: 16px;
}

.player-shell {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #000;
}

.media-player,
.player-placeholder {
  width: 100%;
  min-height: 100%;
  aspect-ratio: 16 / 9;
}

.media-player {
  border: 0;
  background: #000;
}

.player-placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.detail-head {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
}

.detail-poster {
  width: 100%;
  border-radius: 16px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(255, 79, 152, 0.18), rgba(122, 162, 255, 0.18));
}

.detail-info h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 36px);
}

.panel-block {
  border-radius: 18px;
  padding: 18px;
}

.compact-block {
  background: rgba(255, 255, 255, 0.03);
}

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

@media (max-width: 1100px) {
  .hero-banner,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    max-height: 420px;
  }

  .hero-content {
    padding-top: 0;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-block,
  .topnav,
  .top-search {
    width: 100%;
  }

  .brand-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-label {
    width: auto;
    flex: none;
    padding-top: 0;
  }

  .detail-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 16px, 1380px);
    padding-top: 12px;
  }

  .topbar,
  .toolbar-panel,
  .content-section,
  .detail-dialog {
    padding: 16px;
    border-radius: 20px;
  }

  .hero-banner {
    min-height: auto;
  }

  .hero-content {
    padding: 18px 16px 18px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-title {
    font-size: 15px;
  }
}

