:root {
  --bg: #09090b;
  --panel: #141418;
  --panel-2: #1c1d22;
  --panel-3: #25262d;
  --text: #f8fafc;
  --muted: #a6adbb;
  --line: rgba(255, 255, 255, 0.1);
  --pink: #ff4f8b;
  --pink-strong: #e11d48;
  --teal: #2dd4bf;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 64px;
  background: rgba(9, 9, 11, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.logo span {
  color: #fff;
}

.logo strong {
  color: var(--pink);
  font-style: normal;
}

.logo em {
  margin-left: 1px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.main-nav a,
.icon-button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dce3ee;
  padding: 9px 10px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.main-nav a:hover,
.icon-button:hover {
  color: #fff;
  background: rgba(255, 79, 139, 0.14);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-search {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 24px;
  text-align: center;
}

.hero-search h1 {
  margin: 0 0 22px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-search h1 span {
  color: var(--pink);
}

.search-form {
  width: min(620px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.search-form input {
  min-height: 48px;
  min-width: 0;
  border: 0;
  padding: 0 16px;
  color: #111827;
  outline: 0;
}

.search-form button {
  border: 0;
  background: var(--pink-strong);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.search-form button:hover {
  background: var(--pink);
}

.content-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.video-section {
  margin: 28px 0 34px;
}

.section-heading,
.listing-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading h2,
.listing-header h1 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading h2 {
  font-size: 22px;
}

.listing-header h1 {
  font-size: 30px;
  line-height: 1.15;
}

.listing-header span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.listing-search {
  width: min(520px, 100%);
  margin: 0;
}

.section-more {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.section-more:hover {
  color: var(--pink);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.video-card {
  min-width: 0;
}

.thumb-link {
  display: block;
}

.thumb-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111827;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.video-card:hover .thumb-frame {
  transform: scale(1.018);
  filter: brightness(1.08);
  border-color: rgba(255, 79, 139, 0.42);
}

.video-thumb {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  background: #111827;
}

.thumb-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: rgba(255, 255, 255, 0.58);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.18), transparent 42%),
    linear-gradient(145deg, #17171d, #27232a 54%, #121318);
}

.thumb-frame.placeholder .thumb-fallback,
.watch-poster-frame.placeholder .thumb-fallback,
.recommended-thumb-frame.placeholder .thumb-fallback {
  display: grid;
}

.thumb-frame.placeholder .video-thumb,
.watch-poster-frame.placeholder .video-thumb,
.recommended-thumb-frame.placeholder img {
  display: none;
}

.badge-on-thumb {
  position: absolute;
  z-index: 2;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.7);
}

.category-badge {
  left: 8px;
  background: rgba(225, 29, 72, 0.88);
}

.duration-badge {
  right: 8px;
}

.card-title {
  display: block;
  margin-top: 8px;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title:hover {
  color: var(--pink);
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  min-width: 0;
}

.keyword-tag {
  max-width: 100%;
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 79, 139, 0.12);
  color: #ff4f8b;
  font-size: 12px;
  line-height: 1.25;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-tag:hover {
  background: rgba(255, 79, 139, 0.22);
  color: #fff;
}

.category-shell,
.search-shell {
  margin-top: 28px;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
}

.page-link,
.page-ellipsis {
  min-width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #f8fafc;
  font-weight: 800;
  font-size: 13px;
}

.page-link {
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.page-link:hover,
.pagination .active {
  border-color: rgba(225, 29, 72, 0.9);
  background: #e11d48;
  color: #fff;
}

.page-link.disabled {
  color: #5d6470;
  pointer-events: none;
}

.page-ellipsis {
  color: var(--muted);
}

.empty-state {
  width: min(1180px, calc(100% - 32px));
  margin: 36px auto;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--panel);
}

.ad-zone {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 22px auto;
  min-height: 90px;
  overflow: hidden;
}

.ad-zone-728x90 {
  width: 728px;
  max-width: 100%;
  min-height: 90px;
  margin: 24px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  overflow: hidden;
}

.watch-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 820px) 300px;
  gap: 24px;
  align-items: start;
}

.watch-top-ad {
  margin-top: 0;
}

.player-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

#player {
  width: 100%;
  height: 100%;
  background: #000;
}

.embed-player {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player-message {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.server-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.server-button,
.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: #f8fafc;
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 800;
}

.server-button:hover,
.server-button.active,
.tab:hover,
.tab.active {
  border-color: rgba(255, 79, 139, 0.82);
  background: #e11d48;
  color: #fff;
}

.server-empty {
  color: var(--muted);
}

.watch-title {
  margin: 16px 0 12px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  color: #dbe4ef;
}

.watch-poster-frame {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111827;
}

.watch-poster {
  border-radius: 6px;
}

.detail-grid {
  display: grid;
  gap: 10px;
}

.detail-grid div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.detail-grid div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-grid span:first-child {
  color: var(--muted);
}

.detail-grid strong {
  min-width: 0;
}

.watch-sidebar {
  display: grid;
  gap: 16px;
}

.sidebar-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.sidebar-list h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.recommended-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.recommended-card:last-child {
  border-bottom: 0;
}

.recommended-thumb-frame {
  position: relative;
  width: 120px;
  height: 68px;
  border-radius: 6px;
  overflow: hidden;
  background: #111827;
}

.recommended-thumb-frame img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  background: #111827;
  display: block;
}

.recommended-card-title {
  display: block;
  min-width: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recommended-card-category {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer {
  margin-top: 50px;
  border-top: 1px solid var(--line);
  background: #070709;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-links {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--pink);
}

.copyright {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.compact-footer {
  margin-top: 36px;
}

@media (max-width: 1120px) {
  .main-nav {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

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

@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .main-nav {
    order: 3;
    width: 100%;
  }

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

  .listing-header {
    display: grid;
    align-items: stretch;
  }

  .watch-shell {
    display: block;
  }

  .watch-sidebar {
    margin-top: 20px;
  }
}

@media (max-width: 768px) {
  .ad-zone {
    min-height: 70px;
    margin: 16px auto;
  }
}

@media (max-width: 560px) {
  .video-grid,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    display: grid;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

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

  .recommended-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .recommended-thumb-frame,
  .recommended-thumb-frame img {
    width: 96px;
    height: 54px;
  }
}
