/* ================= Homepage: Trending now — featured showcase + ranked picker ================= */
.trend {
  --tc: 163, 255, 18; /* active game colour, set per slide by trending.js */
  position: relative;
  padding: 64px 0 72px;
  overflow: hidden;
  isolation: isolate;
}
.trend::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  z-index: -1;
  background:
    radial-gradient(45% 55% at 30% 45%, rgba(var(--tc), 0.16), transparent 70%),
    radial-gradient(35% 45% at 85% 70%, rgba(168, 85, 247, 0.12), transparent 70%);
  transition: background 0.8s ease;
  pointer-events: none;
  /* fade out before the section edges, or the clipped glow shows as a hard line */
  -webkit-mask-image: linear-gradient(to bottom, transparent 14%, #000 32%, #000 68%, transparent 86%);
  mask-image: linear-gradient(to bottom, transparent 14%, #000 32%, #000 68%, transparent 86%);
}

/* ---------- heading ---------- */
.trend__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.trend__kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 10px/1 "Press Start 2P", monospace;
  letter-spacing: 1px;
  color: #fdba74;
  margin-bottom: 12px;
}
.trend__fire {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f97316;
}
.trend__fire::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #f97316;
  animation: trendPing 1.6s ease-out infinite;
}
@keyframes trendPing {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(2.6); opacity: 0; }
}
.trend__title {
  margin: 0;
  font-family: "Russo One", system-ui, sans-serif;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1;
  color: #fff;
}
.trend__title span {
  background: linear-gradient(90deg, #fb923c, #f43f5e 45%, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.trend__all {
  flex: none;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, background 0.2s;
}
.trend__all:hover { border-color: #fb923c; background: rgba(249, 115, 22, 0.12); }

/* ---------- layout: stage + ranked list ---------- */
.trend__wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

/* ---------- the stage ---------- */
.trend__stage {
  position: relative;
  min-height: 500px;
  border-radius: 22px;
  overflow: hidden;
  background: #07070b;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 60px rgba(var(--tc), 0.18);
  transition: box-shadow 0.8s ease;
}
.trend__slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 40px 44px;
  isolation: isolate;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}
.trend__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.7s ease, visibility 0s;
}

/* blurred poster backdrop, slowly drifting */
.trend__bg {
  position: absolute;
  inset: -8%;
  z-index: -2;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(28px) saturate(1.5) brightness(0.55);
  transform: scale(1.1);
}
.trend__slide.is-active .trend__bg { animation: trendDrift 14s ease-in-out infinite alternate; }
@keyframes trendDrift {
  from { transform: scale(1.1) translate(-2%, -1%); }
  to { transform: scale(1.18) translate(2%, 1%); }
}
.trend__slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 5, 10, 0.92) 0%, rgba(5, 5, 10, 0.72) 45%, rgba(5, 5, 10, 0.15) 100%),
    linear-gradient(0deg, rgba(5, 5, 10, 0.7), transparent 40%);
}
/* faint scanlines for a screen feel */
.trend__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

/* copy */
.trend__copy { position: relative; max-width: 520px; }
.trend__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.trend__badge {
  font: 9px/1 "Press Start 2P", monospace;
  letter-spacing: 0.5px;
  padding: 7px 9px;
  border-radius: 4px;
  color: #fff;
  background: #dc2626;
}
.trend__badge--top { color: #1a1300; background: linear-gradient(90deg, #fde047, #f59e0b); }
.trend__tag {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.trend__logo {
  display: block;
  width: auto;
  max-width: min(100%, 440px);
  height: 120px;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 14px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
}
.trend__logo--tall { height: 150px; }
.trend__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.trend__lead {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(240, 240, 250, 0.88);
}
.trend__lead b { color: #fff; }
.trend__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.trend__chips li {
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  color: rgb(var(--sc));
  background: rgba(var(--sc), 0.1);
  border: 1px solid rgba(var(--sc), 0.35);
}
.trend__cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.trend__buy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  color: #0b0b10;
  text-decoration: none;
  background: rgb(var(--sc));
  box-shadow: 0 10px 30px rgba(var(--sc), 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.trend__buy:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(var(--sc), 0.5), inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.trend__buy span { padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.82); color: #fff; font-size: 13px; }
.trend__more {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, background 0.2s;
}
.trend__more:hover { border-color: rgb(var(--sc)); background: rgba(var(--sc), 0.1); }

/* poster on the right */
.trend__art {
  position: relative;
  width: 250px;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(var(--sc), 0.6), 0 0 50px rgba(var(--sc), 0.3);
  transform: perspective(900px) rotateY(-8deg) rotateX(2deg);
}
.trend__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trend__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 48%, transparent 60%);
  transform: translateX(-100%);
}
.trend__slide.is-active .trend__art::after { animation: trendShine 4.5s ease-in-out 0.6s infinite; }
@keyframes trendShine {
  0%, 60% { transform: translateX(-100%); }
  85%, 100% { transform: translateX(100%); }
}

/* slide-in of the content when a slide becomes active */
.trend__slide.is-active .trend__copy > * { animation: trendUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.trend__slide.is-active .trend__copy > :nth-child(2) { animation-delay: 0.06s; }
.trend__slide.is-active .trend__copy > :nth-child(4) { animation-delay: 0.12s; }
.trend__slide.is-active .trend__copy > :nth-child(5) { animation-delay: 0.18s; }
.trend__slide.is-active .trend__copy > :nth-child(6) { animation-delay: 0.24s; }
.trend__slide.is-active .trend__art { animation: trendPoster 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes trendUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes trendPoster {
  from { opacity: 0; transform: perspective(900px) rotateY(-24deg) translateX(40px); }
  to { opacity: 1; transform: perspective(900px) rotateY(-8deg) rotateX(2deg); }
}

/* ---------- ranked list ---------- */
.trend__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.trend__list li { flex: 1; display: flex; }
.trend__pick {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: 54px 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px 12px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
}
.trend__pick:hover { background: rgba(255, 255, 255, 0.06); transform: translateX(-3px); }
.trend__pick.is-active {
  border-color: rgba(var(--sc), 0.6);
  background: linear-gradient(90deg, rgba(var(--sc), 0.16), rgba(var(--sc), 0.03));
  box-shadow: 0 0 30px rgba(var(--sc), 0.15);
}
.trend__num {
  font-family: "Russo One", system-ui, sans-serif;
  font-size: 58px;
  line-height: 1;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.4);
  transition: -webkit-text-stroke-color 0.3s, color 0.3s;
}
.trend__pick.is-active .trend__num { color: rgb(var(--sc)); -webkit-text-stroke-color: rgb(var(--sc)); text-shadow: 0 0 24px rgba(var(--sc), 0.6); }
.trend__thumb {
  width: 64px;
  height: 88px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.trend__pick-txt { min-width: 0; }
.trend__pick-txt b { display: block; font-family: "Russo One", system-ui, sans-serif; font-weight: 400; font-size: 18px; line-height: 1.15; }
.trend__pick-txt small { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.35; color: rgba(233, 233, 245, 0.65); }
.trend__pick-txt em { display: inline-block; margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 800; color: rgb(var(--sc)); }
/* countdown bar on the active pick */
.trend__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgb(var(--sc));
  transform-origin: left;
  transform: scaleX(0);
}
.trend__pick.is-active .trend__bar { animation: trendBar var(--dur, 7s) linear forwards; }
.trend.is-paused .trend__pick.is-active .trend__bar { animation-play-state: paused; }
@keyframes trendBar { to { transform: scaleX(1); } }

/* per-game colours */
.trend [data-game="1up"] { --sc: 163, 255, 18; }
.trend [data-game="drop"] { --sc: 244, 114, 182; }
.trend [data-game="blockout"] { --sc: 56, 189, 248; }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .trend__wrap { grid-template-columns: 1fr; }
  .trend__list { flex-direction: row; }
  .trend__pick { grid-template-columns: 40px 52px minmax(0, 1fr); padding: 10px; gap: 10px; }
  .trend__num { font-size: 42px; }
  .trend__thumb { width: 52px; height: 72px; }
  .trend__pick-txt small { display: none; }
  .trend__pick:hover { transform: translateY(-2px); }
}

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .trend { padding: 44px 0 52px; }
  .trend__head { flex-direction: column; align-items: flex-start; }
  .trend__stage { min-height: 0; display: grid; }
  .trend__slide {
    grid-area: 1 / 1;
    position: relative;
    inset: auto;
    grid-template-columns: 1fr;
    padding: 0 18px 22px;
    gap: 0;
  }
  .trend__slide::before { background: linear-gradient(0deg, rgba(5, 5, 10, 0.96) 35%, rgba(5, 5, 10, 0.4) 70%, rgba(5, 5, 10, 0.1)); }
  .trend__art {
    order: -1;
    width: 150px;
    margin: 24px auto 18px;
    transform: none;
  }
  .trend__slide.is-active .trend__art { animation: trendUp 0.6s ease both; }
  .trend__copy { max-width: none; }
  .trend__logo { height: 70px; max-width: 100%; margin-inline: auto; object-position: center; }
  .trend__logo--tall { height: 100px; }
  .trend__meta, .trend__chips, .trend__cta { justify-content: center; }
  .trend__lead { font-size: 14.5px; text-align: center; }
  .trend__chips { margin-bottom: 18px; }
  .trend__chips li:nth-child(n + 3) { display: none; }
  .trend__cta { flex-direction: column; align-items: stretch; }
  .trend__buy, .trend__more { justify-content: center; text-align: center; }
  .trend__list { gap: 8px; }
  .trend__pick { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 10px 6px 12px; gap: 6px; }
  .trend__num { display: none; }
  .trend__thumb { width: 100%; height: auto; aspect-ratio: 3 / 4; }
  .trend__pick-txt b { font-size: 13px; }
  .trend__pick-txt em { display: none; }
  .trend__pick::before {
    content: attr(data-rank);
    position: absolute;
    top: 14px;
    left: 12px;
    z-index: 1;
    font: 10px/1 "Press Start 2P", monospace;
    padding: 5px 6px;
    border-radius: 4px;
    color: #0b0b10;
    background: rgb(var(--sc));
  }
}

@media (prefers-reduced-motion: reduce) {
  .trend__fire::after,
  .trend__slide.is-active .trend__bg,
  .trend__slide.is-active .trend__art::after,
  .trend__slide.is-active .trend__copy > *,
  .trend__slide.is-active .trend__art { animation: none; }
  .trend__slide { transition: opacity 0.4s ease, visibility 0s linear 0.4s; }
  .trend__slide.is-active { transition: opacity 0.4s ease, visibility 0s; }
}
/* "NEW!" heading in the same style as the MINECRAFT hero word: white, cyan outline, grey 3D edge, cyan glow */
.trend__title--new {
  font-size: clamp(40px, 6vw, 68px);
  letter-spacing: 0.02em;
}
.trend__title--new span {
  display: inline-block;
  background: none;
  color: #f3f4f6;
  -webkit-text-stroke: 2px #06b6d4;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #6b7280, 0 7px 0 #374151, 0 0 30px rgba(34, 211, 238, 0.6);
}