:root {
  --bg: #0a0a0d;
  --panel: #121218;
  --panel-strong: #1a1a22;
  --text: #f7f7fb;
  --muted: #9999aa;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff5a7d;
  --accent-soft: rgba(255, 90, 125, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(125, 73, 255, 0.13), transparent 28rem),
    radial-gradient(circle at 82% 34%, rgba(255, 90, 125, 0.09), transparent 30rem),
    var(--bg);
}

button, select, input { font: inherit; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 13, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  font-weight: 720;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff8a72, var(--accent));
  box-shadow: 0 8px 30px rgba(255, 90, 125, 0.23);
  font-size: 12px;
  font-weight: 850;
}

.main-nav { display: flex; gap: 6px; }

.main-nav a {
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.main-nav a:hover, .main-nav a.active { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.locale-picker {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

select {
  padding: 8px 30px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel-strong);
}

main { padding: 44px 28px 70px; }

.page { width: min(1160px, 100%); margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 70px;
  align-items: center;
  min-height: 430px;
  padding: 54px 5%;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 90, 125, 0.025));
}

.hero h1, .page-heading h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-copy, .page-heading > p:last-child {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.button {
  display: inline-flex;
  min-height: 44px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.button.primary { border-color: transparent; background: var(--accent); color: #18070b; }

.hero-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 7, 10, 0.42);
}

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stat-grid > div {
  display: flex;
  flex-direction: column;
  min-height: 112px;
  padding: 16px;
  justify-content: flex-end;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.stat-grid strong { font-size: 34px; letter-spacing: -0.04em; }
.stat-grid small { margin-top: 4px; color: var(--muted); }

.content-section { margin-top: 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 28px; }
.section-heading a, .back-link { color: #ff9fb4; text-decoration: none; }

.page-heading { padding: 34px 0 38px; }
.page-heading h1 { font-size: clamp(40px, 6vw, 62px); }

.catalog-toolbar {
  position: sticky;
  z-index: 5;
  top: 68px;
  display: grid;
  gap: 13px;
  padding: 15px 0 20px;
  background: linear-gradient(var(--bg) 78%, transparent);
}

#search {
  width: min(430px, 100%);
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: var(--panel);
}

#search:focus { border-color: rgba(255, 90, 125, 0.65); }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }

.filter-chip {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  cursor: pointer;
}

.filter-chip.active { border-color: rgba(255, 90, 125, 0.5); color: var(--text); background: var(--accent-soft); }

.video-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 25px 16px; }
.video-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.video-card { min-width: 0; }

.poster {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  aspect-ratio: 9 / 13;
  background: linear-gradient(145deg, #5d2846, #17131e 55%, #28234b);
}

.poster[data-seed="1"] { background: linear-gradient(145deg, #335c67, #10191d 55%, #2b293f); }
.poster[data-seed="2"] { background: linear-gradient(145deg, #604a27, #1d1710 55%, #41283b); }
.poster[data-seed="3"] { background: linear-gradient(145deg, #3c366d, #161321 55%, #24454b); }

.poster::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.poster-mark { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.58); font-size: 28px; font-weight: 850; letter-spacing: -0.08em; }
.duration { position: absolute; right: 9px; bottom: 9px; padding: 4px 7px; border-radius: 6px; color: white; background: rgba(0, 0, 0, 0.68); font-size: 11px; }
.card-body { padding: 13px 3px 0; }
.card-body h2 { overflow: hidden; margin: 0; font-size: 17px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.card-body h2 a { color: var(--text); text-decoration: none; }
.card-tags { overflow: hidden; margin: 7px 0; color: #b9b9c4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { color: var(--muted); font-size: 11px; }
.empty-copy { padding: 60px 0; color: var(--muted); text-align: center; }

.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.category-card { display: grid; min-height: 160px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; color: var(--text); background: rgba(255, 255, 255, 0.025); text-decoration: none; transition: 160ms ease; }
.category-card:hover { border-color: rgba(255, 90, 125, 0.45); transform: translateY(-2px); background: rgba(255, 90, 125, 0.06); }
.category-card span { color: var(--accent); font-size: 11px; }
.category-card strong { align-self: end; font-size: 25px; letter-spacing: -0.03em; }
.category-card small { margin-top: 5px; color: var(--muted); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-card { min-height: 250px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, 0.025); }
.info-card > span { color: var(--accent); font-size: 12px; font-weight: 800; }
.info-card h2 { margin: 65px 0 12px; font-size: 25px; }
.info-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.back-link { display: inline-block; margin: 0 0 24px; }

.intro {
  width: min(1080px, 100%);
  margin: 0 auto 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.intro h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.intro > p:last-child {
  max-width: 720px;
  margin: 17px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 560px) minmax(260px, 370px);
  gap: 28px;
  width: min(1080px, 100%);
  margin: 0 auto;
  align-items: start;
}

.stage {
  position: relative;
  display: flex;
  justify-content: center;
}

.video-shell {
  position: relative;
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  aspect-ratio: 9 / 16;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 35%),
    linear-gradient(145deg, #24202e, #111118 55%, #21141a);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.empty-state[hidden] { display: none; }

.empty-state strong { margin-top: 22px; }
.empty-state small { margin-top: 8px; color: var(--muted); line-height: 1.5; }

.pulse {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 0 16px rgba(255, 90, 125, 0.04);
}

.caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 80px 24px 24px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  pointer-events: none;
}

.caption h1 { margin: 0; font-size: 23px; letter-spacing: -0.03em; }
.caption p { margin: 7px 0 0; color: #ccccd6; font-size: 14px; }

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: center;
  margin-left: 15px;
}

.controls button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--panel-strong);
  cursor: pointer;
}

.controls button:hover { border-color: rgba(255, 255, 255, 0.32); }

.details { display: grid; gap: 14px; }

.detail-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(18, 18, 24, 0.84);
}

.label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.chip {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #e9e9ef;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  text-transform: uppercase;
}

.chip.primary { border-color: rgba(255, 90, 125, 0.45); background: var(--accent-soft); }

.segment-list { display: grid; gap: 8px; }

.segment-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.segment-index { color: var(--muted); }
.segment-status { color: #f1b2c0; font-size: 12px; }
.notice p { margin: 11px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

@media (max-width: 780px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .brand > span:last-child { display: none; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .main-nav a { flex: 0 0 auto; }
  .locale-picker > span { display: none; }
  main { padding: 28px 16px 50px; }
  .hero { grid-template-columns: 1fr; gap: 35px; padding: 38px 24px; }
  .video-grid, .video-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid, .info-grid { grid-template-columns: 1fr; }
  .catalog-toolbar { top: 116px; }
  .workspace { grid-template-columns: 1fr; }
  .stage { padding-right: 48px; }
  .controls { position: absolute; right: 0; }
}

@media (max-width: 420px) {
  .video-grid, .video-grid.compact { gap: 20px 10px; }
  .card-body h2 { font-size: 15px; }
  .stat-grid strong { font-size: 28px; }
}
