:root {
  --bg: #0f1115;
  --bg-soft: #151922;
  --card: #171a21;
  --card-hover: #1e232d;
  --line: #262b36;
  --text: #e6e8eb;
  --muted: #8b93a1;
  --accent: #e50914;
  --accent-2: #ffc107;
  --radius: 10px;
}

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

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

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

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

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.logo__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #0f1115;
  font-size: 14px;
}

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

.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
  background: var(--bg-soft);
}

.search {
  margin-left: auto;
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  outline: none;
  transition: border 0.15s;
}

.search input:focus {
  border-color: var(--accent);
}

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.btn-fav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-fav svg {
  width: 17px;
  height: 17px;
}

.btn-fav:hover {
  color: var(--text);
  border-color: #3a4150;
}

.btn-fav.is-on {
  background: rgba(229, 9, 20, 0.14);
  border-color: var(--accent);
  color: #fff;
}

.btn-fav.is-on svg {
  color: var(--accent);
}

.btn-fav__count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* ---------- Category chips ---------- */
.cats {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.cats__inner {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 20px;
  scrollbar-width: none;
}

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

.chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s;
  cursor: pointer;
}

.chip:hover {
  color: var(--text);
  border-color: #3a4150;
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Banner ---------- */
.banner {
  padding: 18px 0 4px;
}

.banner__link {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.banner__link img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.banner__link:hover img {
  transform: scale(1.03);
}

.banner__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 32px 38px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    rgba(0, 0, 0, 0) 82%
  );
}

.banner__title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.banner__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.banner__list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e9ecef;
  font-size: 14px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.banner__list li::before {
  content: "\25B8";
  color: var(--accent-2);
  font-size: 12px;
}

@media (max-width: 760px) {
  .banner__link img {
    aspect-ratio: 16 / 9;
  }
  .banner__overlay {
    padding: 20px;
    background: linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.88) 30%,
      rgba(0, 0, 0, 0.4) 75%,
      rgba(0, 0, 0, 0) 100%
    );
  }
  .banner__title {
    font-size: 18px;
  }
  .banner__list li {
    font-size: 12.5px;
  }
}

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 18px;
}

.section-head h2 {
  font-size: 20px;
  font-weight: 700;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulse 1.4s infinite;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(229, 9, 20, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 9, 20, 0);
  }
}

/* ---------- Video grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px 18px;
}

.grid-loader {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 80px 0;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  animation: tipSpin 0.8s linear infinite;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 15px;
}

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.card__thumb img {
  height: 100%;
  object-fit: cover;
  opacity: var(--cover-opacity, 1);
  transition: transform 0.35s ease, opacity 1s linear;
}

body.is-loading {
  --cover-opacity: 0;
}

.card__censor {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 74%;
  transform: translate(-50%, -50%);
  z-index: 2;
  border-radius: 6px;
  background: rgba(15, 17, 21, 0.16);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  pointer-events: none;
}

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

.card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55));
  opacity: 0;
  z-index: 4;
  transition: opacity 0.2s;
}

.card:hover .card__play {
  opacity: 1;
}

.card__play svg {
  width: 46px;
  height: 46px;
  color: var(--accent-2);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.card__duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.78);
  font-size: 12px;
  font-weight: 600;
  z-index: 3;
}

.card__fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.15s, background 0.15s, transform 0.15s;
}

.card:hover .card__fav {
  opacity: 1;
}

.card__fav:hover {
  transform: scale(1.12);
  background: rgba(0, 0, 0, 0.75);
}

.card__fav svg {
  width: 16px;
  height: 16px;
}

.card__fav.is-on {
  opacity: 1;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.6);
}

.card__body {
  padding: 10px 2px 0;
  display: flex;
  gap: 10px;
}

.card__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #3a4150, #2a2f3a);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}

.card:hover .card__title {
  color: var(--accent-2);
}

.card__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Pagination ---------- */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 40px 0 60px;
}

.pager button {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pager button:hover:not(:disabled) {
  color: var(--text);
  border-color: #3a4150;
}

.pager button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 12px;
}

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

.footer__copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  max-width: 720px;
}

/* ---------- Loading tip ---------- */
.loading-tip {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(600px, calc(100% - 32px));
  padding: 16px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1b1f28, #14171e);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  animation: tipIn 0.4s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.loading-tip.is-hidden {
  opacity: 0;
  transform: translate(-50%, -14px);
  pointer-events: none;
}

.loading-tip.is-warn {
  border-color: var(--accent);
  background: linear-gradient(135deg, #2a1113, #1c0d0e);
  box-shadow: 0 18px 60px rgba(229, 9, 20, 0.5);
  animation: tipWarn 0.5s ease;
}

.loading-tip.is-warn .loading-tip__title {
  background: linear-gradient(90deg, #ff6b6b, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.loading-tip.is-warn .loading-tip__text {
  color: #ffb3b3;
  font-weight: 600;
}

.loading-tip.is-warn .loading-tip__count b {
  color: #ff6b6b;
}

@keyframes tipWarn {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  20% {
    transform: translate(calc(-50% - 7px), 0);
  }
  40% {
    transform: translate(calc(-50% + 7px), 0);
  }
  60% {
    transform: translate(calc(-50% - 5px), 0);
  }
  80% {
    transform: translate(calc(-50% + 5px), 0);
  }
}

.loading-tip__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.loading-tip__title {
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.loading-tip__count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}

.loading-tip__count b {
  color: var(--accent-2);
  font-size: 15px;
}

.loading-tip__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  animation: tipSpin 0.8s linear infinite;
}

.loading-tip__text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@keyframes tipSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tipIn {
  from {
    opacity: 0;
    transform: translate(-50%, -14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 760px) {
  .nav {
    display: none;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px 12px;
  }
  .card__avatar {
    display: none;
  }

  .header__inner {
    gap: 10px;
    height: 56px;
  }
  .logo {
    font-size: 16px;
  }
  .logo__mark {
    width: 24px;
    height: 24px;
  }
  .search input {
    height: 38px;
    padding: 0 14px 0 36px;
    font-size: 16px;
  }
  .search__icon {
    left: 12px;
  }
  .btn-fav {
    height: 38px;
    padding: 0 12px;
    gap: 6px;
  }
  .btn-fav__label {
    display: none;
  }
  .loading-tip {
    top: 66px;
  }
}
