body.dark-theme .rank-card {
  background: linear-gradient(180deg, #162338, #101b2b);
  border-color: rgba(147, 167, 199, 0.12);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

body.dark-theme .rank-no {
  color: #eaf3ff;
  text-shadow:
    -2px -2px 0 rgba(73, 144, 214, 0.95),
    2px -2px 0 rgba(73, 144, 214, 0.95),
    -2px 2px 0 rgba(73, 144, 214, 0.95),
    2px 2px 0 rgba(73, 144, 214, 0.95),
    0 16px 30px rgba(0, 0, 0, 0.3);
}

body.dark-theme .rank-media {
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.32);
}

body.dark-theme .rank-title {
  color: #edf4ff;
}

body.dark-theme .card-new-badge {
  background: rgba(14, 106, 168, 0.24);
  color: #9ddcff;
}

.h-scroll,
.news-strip {
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding-bottom: 6px;
}

.h-scroll::-webkit-scrollbar,
.news-strip::-webkit-scrollbar {
  display: none;
}

.h-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 250px);
  gap: 18px;
}

.poster-card,
.news-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(45, 97, 146, 0.12);
}

.poster-card {
  min-height: 380px;
}

.news-card {
  min-height: 270px;
}

.poster-card-shell {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

.poster-image,
.news-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-card::after,
.news-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(13, 22, 38, 0.82) 100%);
  pointer-events: none;
}

.poster-meta,
.news-meta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  color: #fff;
}

.trending-card .poster-meta {
  pointer-events: none;
}

.poster-meta span,
.news-meta span {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
}

.poster-meta small {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 22, 38, 0.78);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.18);
  backdrop-filter: blur(8px);
  text-transform: none;
  opacity: 1;
}

.trending-part-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 10px;
  text-decoration: none;
  pointer-events: auto;
}

.poster-meta small .part-accent {
  gap: 0.28em;
}

.poster-meta small .part-accent-prefix {
  color: #ff9d23;
  font-size: 0.86em;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.poster-meta small .part-accent-number {
  color: #fff4e4;
  font-size: 1.18em;
  text-shadow: 0 6px 18px rgba(255, 186, 105, 0.24);
}

.poster-meta h3,
.news-meta h3 {
  margin: 8px 0 0;
  font-size: 1.16rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.poster-meta h3 {
  -webkit-line-clamp: 2;
  min-height: 2.5em;
}

.card-new-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(234, 247, 255, 0.94);
  color: #0e6aa8;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.14);
  backdrop-filter: blur(8px);
}

.poster-card.trending-card .card-new-badge {
  left: auto;
  right: 16px;
  top: 56px;
}

.card-live-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18, 29, 45, 0.42);
  color: rgba(244, 248, 255, 0.9);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.card-live-badge i {
  color: rgba(173, 220, 255, 0.84);
}

.trending-card .card-live-badge,
.trending-card .card-new-badge {
  pointer-events: none;
}

.top-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding-bottom: 6px;
}

.top-grid::-webkit-scrollbar {
  display: none;
}

.rank-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 12px 12px;
  padding: 16px 16px 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #edf7ff);
  min-height: 100%;
  border: 1px solid rgba(59, 167, 248, 0.12);
  box-shadow: 0 12px 30px rgba(45, 97, 146, 0.1);
}

.rank-copy {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding-top: 8px;
}

.rank-no {
  font-family: var(--font-display, "Baloo 2", cursive);
  font-size: 3.7rem;
  line-height: 0.82;
  font-weight: 800;
  color: #ffffff;
  text-shadow:
    -2px -2px 0 rgba(31, 111, 181, 0.9),
    2px -2px 0 rgba(31, 111, 181, 0.9),
    -2px 2px 0 rgba(31, 111, 181, 0.9),
    2px 2px 0 rgba(31, 111, 181, 0.9),
    0 16px 30px rgba(59, 167, 248, 0.28);
}

.rank-title {
  grid-column: 1 / span 2;
  grid-row: 2;
  font-weight: 700;
  line-height: 1.25;
  min-height: 2.5em;
  padding: 4px 4px 0;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rank-media {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 13 / 18;
  border-radius: 18px;
  overflow: hidden;
  justify-self: stretch;
}

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

.news-title-link,
.news-image-link {
  color: inherit;
  text-decoration: none;
}

.news-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 250px);
  gap: 20px;
}

.news-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
  pointer-events: auto;
}

.news-title {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 2.5em;
}

.news-submeta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.84rem;
  font-weight: 700;
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.news-submeta .parts-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(13, 22, 38, 0.78);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.18);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.popular-part-link {
  display: inline-flex;
  width: fit-content;
  text-decoration: none;
  pointer-events: auto;
  position: relative;
  z-index: 5;
}

.news-title-link {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.news-submeta .parts-badge .part-accent {
  gap: 0.32em;
}

.news-submeta .parts-badge .part-accent-prefix {
  color: #ffcf93;
  font-size: 0.82em;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.news-submeta .parts-badge .part-accent-number {
  color: #fff4e4;
  font-size: 1.16em;
  text-shadow: 0 6px 18px rgba(255, 186, 105, 0.24);
}

.news-card-shell {
  display: block;
  position: relative;
  min-height: 100%;
}

.genre-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.random-btn {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blue-500), var(--rose-500));
  box-shadow: 0 12px 28px rgba(59, 167, 248, 0.18);
}

.genre-tag {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--blue-700);
  font-weight: 700;
}

.genre-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 250px);
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding-bottom: 6px;
}

.genre-rail::-webkit-scrollbar {
  display: none;
}

.genre-card {
  position: relative;
  min-height: 390px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(45, 97, 146, 0.12);
}

.genre-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(13, 22, 38, 0.84) 100%);
}

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

.genre-card-copy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  color: #fff;
}

.genre-card-copy span {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.genre-card-copy h3 {
  margin: 0 0 8px;
  font-size: 1.22rem;
  line-height: 1.24;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 2.5em;
}

.genre-card-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 3.2em;
}

@media (max-width: 767.98px) {
  .genre-header-actions {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
  }

  .genre-tag {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .random-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
  }

  .top-grid {
    grid-auto-columns: minmax(210px, 72vw);
  }

  .genre-rail {
    grid-auto-columns: minmax(220px, 78vw);
  }
}
