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

body {
  font-family: 'Roboto', sans-serif;
  background: #f9f9f9;
  color: #030303;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  height: 56px;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo svg {
  height: 20px;
  width: 140px;
}

.region-selector select {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.region-selector select:focus {
  border-color: #065fd4;
}

/* ── Category Nav ── */
.category-nav {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 56px;
  z-index: 99;
}

.category-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #606060;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.1s, border-color 0.1s;
}

.tab:hover {
  color: #030303;
}

.tab.active {
  color: #030303;
  border-bottom-color: #ff0000;
}

.tab-icon {
  font-size: 16px;
}

/* ── Main ── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #030303;
}

.section-subtitle {
  font-size: 12px;
  color: #606060;
  margin-top: 4px;
}

/* ── Loading ── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 0;
  color: #606060;
  gap: 16px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e5e5;
  border-top-color: #ff0000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Error ── */
.error {
  text-align: center;
  padding: 60px 0;
  color: #606060;
}

.error button {
  margin-top: 12px;
  padding: 8px 20px;
  background: #ff0000;
  color: #fff;
  border: none;
  border-radius: 2px;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ── Trailers Section ── */
.trailers-section {
  margin-bottom: 32px;
}

.trailers-title {
  font-size: 18px;
  font-weight: 700;
  color: #030303;
  margin-bottom: 14px;
}

.trailers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.trailer-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.trailer-card:hover .trailer-title {
  color: #065fd4;
}

.trailer-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.trailer-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.trailer-title {
  font-size: 13px;
  font-weight: 500;
  color: #030303;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 3px;
}

.trailer-channel {
  font-size: 12px;
  color: #606060;
}

/* ── Video List ── */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Video Card ── */
.video-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e5e5;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.video-card:hover .video-title {
  color: #065fd4;
}

.video-rank {
  font-size: 20px;
  font-weight: 700;
  color: #030303;
  min-width: 36px;
  text-align: right;
  padding-top: 6px;
  flex-shrink: 0;
  line-height: 1;
}

.video-rank.top-three {
  color: #ff0000;
}

/* ── Thumbnail ── */
.thumbnail-wrap {
  position: relative;
  flex-shrink: 0;
  width: 320px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.thumbnail-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.duration-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1.4;
}

/* ── Video Info ── */
.video-info {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.video-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: #030303;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-channel {
  font-size: 13px;
  color: #606060;
  margin-bottom: 4px;
}

.video-meta {
  font-size: 13px;
  color: #606060;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.meta-dot {
  color: #ccc;
}

.video-views {
  font-weight: 500;
  color: #030303;
}

.trending-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: #ff0000;
  background: #fff0f0;
  border-radius: 12px;
  padding: 2px 8px;
  margin-top: 8px;
}

/* ── Live Counter ── */
.live-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #606060;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #00c853;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .thumbnail-wrap {
    width: 240px;
  }
  .video-title {
    font-size: 14px;
  }
  .video-rank {
    min-width: 28px;
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  .main {
    padding: 16px 12px 48px;
  }
  .header-inner {
    padding: 0 12px;
  }
  .category-nav-inner {
    padding: 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .category-nav-inner::-webkit-scrollbar {
    display: none;
  }
  .video-card {
    gap: 10px;
  }
  .video-rank {
    display: none;
  }
  .thumbnail-wrap {
    width: 160px;
  }
  .video-title {
    font-size: 13px;
  }
  .video-meta {
    font-size: 12px;
  }
}
