/* ==========================================================================
   PiguinL · 两页版视觉统一
   首页 / 我的世界速通 + B 站视频 + 鲫鱼速通入口
   ========================================================================== */

/* 顶部品牌：头像只做标识，文字才是按钮 ------------------------------- */

.brand {
  gap: 12px;
}

.brand-icon {
  cursor: default;
  pointer-events: none;
}

.brand-button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 6px 10px 6px 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ivory);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.brand-button strong {
  grid-column: 1;
  grid-row: 1;
  color: var(--ivory);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: color 0.18s ease;
}

.brand-button span {
  grid-column: 1;
  grid-row: 2;
  margin-top: 3px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: color 0.18s ease;
}

.brand-button .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 11px;
  height: 11px;
  color: var(--gold);
  fill: currentColor;
  stroke: none;
  opacity: 0.7;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.brand-button:hover,
.brand-button:focus-visible {
  border-color: rgba(214, 161, 59, 0.4);
  background: rgba(214, 161, 59, 0.06);
  outline: none;
}

.brand-button:hover strong,
.brand-button:focus-visible strong {
  color: var(--gold-light);
}

.brand-button:hover span,
.brand-button:focus-visible span {
  color: var(--muted);
}

.brand-button:hover .icon,
.brand-button:focus-visible .icon {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* 首页 PIGUINL：与中文名、简介同一套出现动画 --------------------------- */

.hero.is-intro .hero-latin {
  animation: heroIntro 720ms cubic-bezier(0.16, 0.84, 0.44, 1) 150ms backwards;
}

.page.is-upcoming .hero-latin {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}

.page.is-revealing .hero-latin {
  animation: textRise 620ms cubic-bezier(0.22, 0.61, 0.36, 1) 40ms backwards;
}

/* 第二页：速通与视频 ------------------------------------------------------ */

.section-tutorials {
  background: #080b0b;
}

.section-tutorials .section-bg {
  background:
    radial-gradient(circle at 78% 18%, rgba(214, 161, 59, 0.09), transparent 34%),
    linear-gradient(90deg, rgba(7, 9, 9, 0.95), rgba(7, 9, 9, 0.76) 58%, rgba(7, 9, 9, 0.94)),
    url("../img/blocks/polished_blackstone_bricks.png");
  background-size: auto, auto, 112px 112px;
  opacity: 0.85;
}

.speedrun-head {
  align-items: center;
  gap: clamp(24px, 4vw, 52px);
  margin-bottom: 22px;
}

.page-head-copy {
  min-width: 0;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.section-kicker::before {
  width: 22px;
  height: 1px;
  background: var(--gold);
  content: "";
  opacity: 0.7;
}

.speedrun-head h2 {
  font-size: clamp(2.5rem, 4.1vw, 3.9rem);
}

.page-sub {
  max-width: 460px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* 排行榜：大按钮 --------------------------------------------------------- */

.leaderboard-button {
  display: inline-flex;
  min-width: 300px;
  min-height: 68px;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  padding: 11px 17px;
  border: 1px solid rgba(214, 161, 59, 0.62);
  background:
    linear-gradient(135deg, rgba(214, 161, 59, 0.16), rgba(214, 161, 59, 0.03) 55%),
    rgba(12, 15, 14, 0.86);
  color: var(--ivory);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.leaderboard-button:hover,
.leaderboard-button:focus-visible {
  border-color: var(--gold-light);
  background:
    linear-gradient(135deg, rgba(214, 161, 59, 0.24), rgba(214, 161, 59, 0.05) 55%),
    rgba(16, 20, 18, 0.95);
  outline: none;
  transform: translateY(-2px);
}

.leaderboard-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(214, 161, 59, 0.55);
  color: var(--gold-light);
}

.leaderboard-icon .icon {
  width: 15px;
  height: 15px;
}

.leaderboard-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.leaderboard-copy small {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.leaderboard-copy strong {
  color: var(--ivory);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* 三期视频 --------------------------------------------------------------- */

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

.video-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(214, 161, 59, 0.18);
  background: #0c1010;
  color: var(--ivory);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.video-card::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent 70%);
  content: "";
  opacity: 0.45;
}

.video-card:hover,
.video-card:focus-visible {
  border-color: rgba(214, 161, 59, 0.7);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
  outline: none;
  transform: translateY(-4px);
}

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a0d0c;
}

.video-thumb::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 38%, rgba(0, 0, 0, 0.38)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 52%);
  content: "";
  pointer-events: none;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.06);
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.video-card:hover .video-thumb img,
.video-card:focus-visible .video-thumb img {
  transform: scale(1.045);
}

.video-rank {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 2;
  display: inline-flex;
  height: 25px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(214, 161, 59, 0.65);
  background: rgba(7, 9, 8, 0.8);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.video-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 3px 7px;
  background: rgba(5, 7, 7, 0.78);
  color: var(--ivory);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(240, 220, 176, 0.65);
  background: rgba(6, 8, 8, 0.6);
  color: var(--ivory);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.video-play .icon {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  fill: currentColor;
  stroke: none;
}

.video-card:hover .video-play,
.video-card:focus-visible .video-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px 15px;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.video-meta b {
  color: var(--gold-light);
  font-weight: 700;
}

.video-meta i {
  display: inline-block;
  width: 3px;
  height: 3px;
  background: var(--gold);
  opacity: 0.7;
}

.video-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 43px;
  color: var(--ivory);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.video-cta .icon {
  width: 10px;
  height: 10px;
  transition: transform 0.18s ease;
}

.video-card:hover .video-cta .icon,
.video-card:focus-visible .video-cta .icon {
  transform: translate(2px, -2px);
}

/* 视频区底部 ------------------------------------------------------------- */

.speedrun-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 17px;
  padding-top: 12px;
  border-top: 1px solid rgba(236, 233, 221, 0.1);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.speedrun-foot a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
}

.speedrun-foot a:hover {
  color: var(--gold-light);
}

.speedrun-foot .icon {
  width: 10px;
  height: 10px;
}

/* 第二页卡片错峰出现 ----------------------------------------------------- */

.page.is-upcoming .video-card,
.page.is-upcoming .leaderboard-button,
.page.is-upcoming .speedrun-foot {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}

.page.is-revealing .leaderboard-button,
.page.is-revealing .video-card,
.page.is-revealing .speedrun-foot {
  animation: textRise 620ms cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}

.page.is-revealing .video-card:nth-child(1) {
  animation-delay: 70ms;
}

.page.is-revealing .video-card:nth-child(2) {
  animation-delay: 130ms;
}

.page.is-revealing .video-card:nth-child(3) {
  animation-delay: 190ms;
}

.page.is-revealing .speedrun-foot {
  animation-delay: 240ms;
}

/* 移动端：两页版不强行整页翻页，视频改为单列 --------------------------- */

@media (max-width: 1100px) {
  .leaderboard-button {
    min-width: 270px;
  }

  .video-grid {
    gap: 14px;
  }

  .video-title {
    font-size: 14px;
  }
}

@media (max-width: 920px) {
  .brand-button {
    padding-right: 4px;
  }

  .brand-button strong {
    font-size: 12px;
  }

  .speedrun-head {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
  }

  .leaderboard-button {
    width: 100%;
    min-height: 62px;
    margin-left: 0;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-card {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .video-thumb {
    height: 100%;
    aspect-ratio: auto;
  }

  .video-title {
    min-height: 0;
    font-size: 14px;
  }

  .video-play {
    display: none;
  }

  .speedrun-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .video-card {
    display: flex;
  }

  .video-thumb {
    aspect-ratio: 16 / 9;
  }

  .brand-button span {
    display: none;
  }

  .brand-button {
    grid-template-rows: auto;
    padding-block: 4px;
  }

  .brand-button .icon {
    grid-row: 1;
  }
}

/* 国内高版本排行榜 ------------------------------------------------------- */

.section-leaderboard {
  justify-content: flex-start;
  background: #080b0b;
}

.section-leaderboard .section-bg {
  background:
    radial-gradient(circle at 75% 12%, rgba(214, 161, 59, 0.1), transparent 35%),
    linear-gradient(90deg, rgba(7, 9, 9, 0.96), rgba(7, 9, 9, 0.8) 55%, rgba(7, 9, 9, 0.95)),
    url("../img/blocks/polished_blackstone_bricks.png");
  background-size: auto, auto, 112px 112px;
  opacity: 0.86;
}

.section-leaderboard .page-inner {
  display: flex;
  height: calc(100svh - var(--header-h) - 82px);
  flex-direction: column;
}

.leaderboard-head {
  flex: 0 0 auto;
  align-items: flex-end;
  margin-bottom: 16px;
}

.leaderboard-head h2 {
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  line-height: 1;
}

.leaderboard-head .page-sub {
  max-width: 560px;
}

.leaderboard-source {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: rgba(12, 15, 13, 0.82);
  border: 1px solid rgba(214, 161, 59, 0.5);
  transition: border-color 160ms ease, background 160ms ease;
}

.leaderboard-source:hover,
.leaderboard-source:focus-visible {
  background: rgba(54, 43, 22, 0.92);
  border-color: var(--gold-light);
  outline: none;
}

.leaderboard-source .icon {
  width: 12px;
  height: 12px;
}

.leaderboard-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(20, 24, 20, 0.96), rgba(10, 13, 11, 0.98));
  border: 1px solid rgba(214, 161, 59, 0.26);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.leaderboard-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 0 16px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(214, 161, 59, 0.16);
  background: rgba(255, 255, 255, 0.018);
}

.leaderboard-updated,
.leaderboard-count,
.leaderboard-scroll-hint {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.leaderboard-count {
  color: rgba(236, 233, 221, 0.66);
}

.leaderboard-scroll-hint {
  margin-left: auto;
}

.leaderboard-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(214, 161, 59, 0.42) transparent;
  scrollbar-width: thin;
}

.leaderboard-scroll::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.leaderboard-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.leaderboard-scroll::-webkit-scrollbar-thumb {
  background: rgba(214, 161, 59, 0.38);
  border-radius: 8px;
}

.leaderboard-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
}

.leaderboard-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  background: #101410;
  border-bottom: 1px solid rgba(214, 161, 59, 0.26);
}

.leaderboard-table th:nth-child(1) {
  width: 68px;
}

.leaderboard-table th:nth-child(2) {
  width: 24%;
}

.leaderboard-table th:nth-child(3) {
  width: 96px;
}

.leaderboard-table th:nth-child(4) {
  width: 25%;
}

.leaderboard-table th:nth-child(5) {
  width: 90px;
}

.leaderboard-table th:nth-child(6) {
  width: 86px;
}

.leaderboard-table td {
  padding: 11px 14px;
  color: rgba(236, 233, 221, 0.82);
  font-size: 14px;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
}

.leaderboard-table td:first-child {
  white-space: nowrap;
}

.leaderboard-table tbody tr:hover td {
  background: rgba(214, 161, 59, 0.045);
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.lb-rank {
  display: inline-block;
  color: rgba(236, 233, 221, 0.42);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.lb-medal {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  vertical-align: middle;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.lb-rank.is-podium {
  color: var(--gold-light);
}

.lb-rank[data-rank="1"] {
  color: #f6d177;
}

.lb-rank[data-rank="2"] {
  color: #d8d7c7;
}

.lb-rank[data-rank="3"] {
  color: #d9a56f;
}

.lb-player {
  min-width: 0;
}

.lb-player strong {
  display: block;
  overflow: hidden;
  color: var(--ivory);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-player small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-time {
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lb-ms {
  margin-left: 3px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 400;
}

.lb-seed {
  overflow: hidden;
  color: rgba(236, 233, 221, 0.66);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-version {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  color: rgba(236, 233, 221, 0.78);
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.lb-video {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.lb-video:hover,
.lb-video:focus-visible {
  color: var(--gold-light);
  outline: none;
}

.lb-video .icon {
  width: 10px;
  height: 10px;
}

.lb-empty {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
}

.leaderboard-loading td {
  padding: 28px 14px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
}

.leaderboard-note {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 16px;
  color: rgba(236, 233, 221, 0.4);
  font-size: 10px;
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.leaderboard-note a {
  color: rgba(214, 161, 59, 0.72);
  text-decoration: none;
}

.leaderboard-note a:hover {
  color: var(--gold-light);
}

@media (max-width: 920px) {
  .section-leaderboard {
    min-height: 100svh;
    overflow: hidden;
    padding-top: calc(var(--header-h) + 30px);
    padding-bottom: 32px;
  }

  .section-leaderboard .page-inner {
    height: auto;
    min-height: calc(100svh - var(--header-h) - 62px);
  }

  .leaderboard-head {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .leaderboard-head h2 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .leaderboard-head .page-sub {
    max-width: 34em;
  }

  .leaderboard-panel {
    min-height: 0;
  }

  .leaderboard-scroll {
    max-height: 62svh;
  }

  .leaderboard-table {
    min-width: 800px;
  }

  .leaderboard-scroll-hint {
    display: inline;
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .leaderboard-meta {
    gap: 9px;
    padding: 0 11px;
  }

  .leaderboard-updated,
  .leaderboard-count {
    font-size: 8px;
  }

  .leaderboard-source {
    min-height: 34px;
    padding: 0 10px;
    font-size: 9px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding-right: 10px;
    padding-left: 10px;
  }

  .leaderboard-note {
    padding: 8px 11px;
  }
}
