/* ══════════════════════════════════════════════
   BSU 万圣节复仇战神榜 — Design System & Styles
   ══════════════════════════════════════════════ */

/* ─── CSS Variables / Theme ─── */
:root, .dark {
  /* Brand Hue & Ember palette */
  --brand-hue: 35;
  --background: oklch(0.08 0.012 20);
  --surface-l1: var(--background);
  --surface-l2: oklch(0.11 0.015 25);
  --surface-l3: oklch(0.15 0.018 30);

  /* Foreground text colors */
  --foreground: oklch(0.95 0.012 60);
  --foreground-2: oklch(0.8 0.01 50);
  --foreground-3: oklch(0.56 0.008 40);

  /* Primary Accent & Glow */
  --primary: oklch(0.72 0.22 42);
  --primary-hl: oklch(0.8 0.2 52);
  --primary-soft: oklch(0.86 0.14 58);
  --primary-foreground: oklch(0.1 0.02 30);
  --ember-wash: oklch(0.72 0.22 42 / 0.18);

  /* Borders */
  --border: oklch(1 0 0 / 0.07);
  --border-strong: oklch(1 0 0 / 0.14);

  /* Rank glow colors (RV in Vibe source) */
  --rank1-bg: oklch(0.76 0.22 48);
  --rank1-text: oklch(0.15 0.04 30);
  --rank1-glow: oklch(0.72 0.22 42 / 0.30);

  --rank2-bg: oklch(0.55 0.18 300);
  --rank2-text: oklch(0.92 0.02 290);
  --rank2-glow: oklch(0.55 0.18 300 / 0.22);

  --rank3-bg: oklch(0.88 0.03 85);
  --rank3-text: oklch(0.20 0.03 40);
  --rank3-glow: oklch(0.82 0.05 80 / 0.18);

  /* Typography: Geist & Geist Mono & Noto Sans SC */
  --font-sans: 'Geist', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Top Nav Bar ─── */
.top-nav-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  padding: 1rem 1.5rem;
  background: linear-gradient(to bottom, rgba(10, 5, 3, 0.8), transparent);
}

.top-nav-container {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-brand {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground-2);
  letter-spacing: 0.5px;
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFF;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.25s ease;
}

.top-nav-link:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--ember-wash);
}

.top-nav-link .nav-arrow {
  transition: transform 0.2s ease;
}

.top-nav-link:hover .nav-arrow {
  transform: translateX(3px);
}

/* ─── Utility ─── */
.container {
  max-width: 80rem;
  margin: 0 auto;
  width: 100%;
}

/* ─── Section Tag (monospace labels) ─── */
.section-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}

/* ─── Section Title ─── */
.section-title {
  margin-top: 0.75rem;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--foreground);
}

.section-desc {
  margin-top: 1rem;
  font-size: 15px;
  color: var(--foreground-3);
  max-width: 52ch;
}

.section-header {
  margin-bottom: 2rem;
}

/* ═══════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════ */
.hero-section {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 1.5rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 10rem 4rem;
  }
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 800px 600px at 50% 38%, var(--ember-wash), transparent 70%);
  z-index: 1;
}

/* Floating emojis */
.floating-emoji {
  position: absolute;
  z-index: 10;
  animation: floatBob 6s ease-in-out infinite;
}

.emoji-pumpkin {
  font-size: 64px;
  top: 5rem;
  right: 2.5rem;
  opacity: 0.6;
  transform: rotate(-8deg);
  animation-delay: 0s;
}

.emoji-bat {
  font-size: 40px;
  top: 10rem;
  left: 2rem;
  opacity: 0.45;
  transform: rotate(12deg);
  animation-delay: -2s;
}

.emoji-ghost {
  font-size: 36px;
  bottom: 8rem;
  right: 4rem;
  opacity: 0.35;
  animation-delay: -4s;
}

@media (min-width: 768px) {
  .emoji-pumpkin { top: 7rem; right: 6rem; }
  .emoji-bat { top: 14rem; left: 5rem; }
  .emoji-ghost { bottom: 10rem; right: 8rem; }
}

@media (min-width: 1024px) {
  .emoji-pumpkin { top: 8rem; right: 10rem; }
  .emoji-bat { top: 16rem; left: 8rem; }
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0) rotate(var(--rotate, -8deg)); }
  50% { transform: translateY(-12px) rotate(var(--rotate, -8deg)); }
}

.emoji-pumpkin { --rotate: -8deg; }
.emoji-bat { --rotate: 12deg; }
.emoji-ghost { --rotate: 0deg; }

/* Hero content */
.hero-content {
  position: relative;
  z-index: 20;
  max-width: 80rem;
  margin: 0 auto;
  width: 100%;
}

.hero-title {
  margin-top: 1.5rem;
  font-size: clamp(44px, 8vw, 88px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 20ch;
  color: var(--primary-hl);
  text-shadow:
    0 0 40px oklch(0.72 0.22 42 / 0.4),
    0 0 80px oklch(0.60 0.20 35 / 0.2);
}

.hero-desc {
  margin-top: 2rem;
  max-width: 52ch;
  font-size: clamp(16px, 1.5vw, 18px);
  font-weight: 400;
  line-height: 1.625;
  color: var(--foreground-3);
}

.hero-stat {
  margin-top: 4rem;
}

.stat-label-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--foreground-3);
  margin-bottom: 0.75rem;
}

.stat-display {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-display .counter {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.9;
  color: var(--primary);
  font-feature-settings: "tnum", "lnum";
}

.stat-suffix-display {
  font-size: clamp(20px, 3vw, 40px);
  font-weight: 500;
  color: var(--primary-hl);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
}

.scroll-text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--foreground-3);
}

.scroll-line {
  margin-top: 0.75rem;
  margin-left: auto;
  margin-right: auto;
  width: 1px;
  height: 2.5rem;
  background: var(--primary);
  transform-origin: top;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ═══════════════════════════════════
   STATS SECTION
   ═══════════════════════════════════ */
.stats-section {
  padding: 6rem 1.5rem;
  background: var(--surface-l1);
}

@media (min-width: 768px) {
  .stats-section {
    padding: 10rem 4rem;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--surface-l2);
}

@media (min-width: 768px) {
  .stat-card {
    padding: 2rem;
  }
}

.stat-card .stat-label-mono {
  margin-bottom: 1rem;
}

.stat-value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-feature-settings: "tnum", "lnum";
}

.stat-value .counter {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.9;
  color: var(--primary);
}

.stat-suffix {
  font-size: clamp(16px, 2vw, 28px);
  font-weight: 500;
  color: var(--primary-hl);
}

.stat-value-text {
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--primary);
  font-feature-settings: "tnum", "lnum";
}

/* ─── Tactical Intel Rounded Card ─── */
.intel-card {
  margin-top: 2rem;
  padding: 1.75rem 2rem;
  border-radius: 16px;
  background: var(--surface-l2);
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.intel-card:hover {
  border-color: rgba(255, 120, 40, 0.3);
}

.intel-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.intel-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.intel-icon {
  font-size: 20px;
}

.intel-main-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-hl);
  text-transform: uppercase;
}

.intel-bounty-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FBBF24;
  padding: 0.4rem 0.95rem;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.1);
}

.bounty-coin {
  font-size: 14px;
}

.intel-card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.intel-text {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--foreground-2);
}

.intel-hl-orange {
  color: var(--primary);
  font-weight: 600;
}

.intel-hl-tag {
  display: inline-block;
  padding: 1px 7px;
  background: rgba(255, 100, 30, 0.18);
  border: 1px solid rgba(255, 100, 30, 0.4);
  color: #FFA559;
  border-radius: 4px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.intel-tip-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #EF4444;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #FCA5A5;
}

/* ═══════════════════════════════════
   LEADERBOARD SECTION
   ═══════════════════════════════════ */
.leaderboard-section {
  padding: 6rem 1.5rem;
  background: var(--surface-l1);
}

@media (min-width: 768px) {
  .leaderboard-section {
    padding: 10rem 4rem;
  }
}

/* Sync Status Badge */
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  margin-top: 1rem;
  background: var(--surface-l2);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 12px;
  color: var(--foreground-2);
  font-family: var(--font-mono);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2.2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Month Filter */
.month-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.month-btn {
  padding: 0.5rem 1rem;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 1px solid var(--border);
  background: var(--surface-l2);
  color: var(--foreground-2);
}

.month-btn:hover {
  background: var(--surface-l3);
}

.month-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Ranking List */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Rank Card */
.rank-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--surface-l2);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlideIn 0.6s ease forwards;
}

.rank-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .rank-card {
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

.rank-card.rank-top {
  border-color: transparent;
}

.rank-card.rank-1 {
  background: var(--rank1-glow);
  border-color: oklch(0.76 0.22 48 / 0.19);
}

.rank-card.rank-2 {
  background: var(--rank2-glow);
  border-color: oklch(0.55 0.18 300 / 0.19);
}

.rank-card.rank-3 {
  background: var(--rank3-glow);
  border-color: oklch(0.88 0.03 85 / 0.19);
}

/* Rank badge */
.rank-badge {
  flex-shrink: 0;
  width: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--foreground-3);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  user-select: none;
}

@media (min-width: 768px) {
  .rank-badge {
    width: 2.75rem;
    font-size: 18px;
  }
}

.rank-1 .rank-badge {
  font-size: 28px;
  filter: drop-shadow(0 0 10px rgba(255, 107, 0, 0.65));
}

.rank-2 .rank-badge {
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(180, 80, 255, 0.55));
}

.rank-3 .rank-badge {
  font-size: 24px;
  filter: drop-shadow(0 0 8px rgba(230, 230, 230, 0.45));
}

/* Name & title */
.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--foreground);
}

@media (min-width: 768px) {
  .rank-name {
    font-size: 18px;
  }
}

.rank-top .rank-name {
  color: var(--primary-hl);
}

.rank-title {
  font-size: 13px;
  margin-top: 0.25rem;
  color: var(--foreground-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Points & Bounty (1:1 Vibe Card Geometry) */
.rank-points {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.rank-points-num {
  display: inline-flex;
  align-items: baseline;
}

.rank-points-value {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum", "lnum";
  color: var(--foreground);
}

@media (min-width: 768px) {
  .rank-points-value {
    font-size: 26px;
  }
}

.rank-top .rank-points-value {
  color: var(--primary);
}

.rank-points-suffix {
  font-size: 13px;
  margin-left: 0.25rem;
  font-weight: 400;
  color: var(--foreground-3);
}

.rank-bounty-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 9999px;
  padding: 1px 7px;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-bounty-tag:hover {
  border-color: rgba(245, 158, 11, 0.6);
  transform: scale(1.03);
}

.rank-bounty-tag .bounty-coin {
  font-size: 10px;
}

/* Extra info (desktop) */
.rank-extra {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
  width: 10rem;
}

@media (min-width: 1024px) {
  .rank-extra {
    display: flex;
  }
}

.rank-month {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--foreground-3);
}

.rank-id {
  font-size: 12px;
  color: var(--foreground-3);
}

/* Pagination */
.pagination {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--surface-l2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.page-summary {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.page-total {
  font-size: 13px;
  color: var(--foreground-3);
}

.page-total strong {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.page-size-selector {
  display: inline-flex;
  align-items: center;
  background: var(--surface-l3);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 2px 4px;
  gap: 3px;
}

.page-size-label {
  font-size: 11px;
  color: var(--foreground-3);
  padding-left: 6px;
}

.page-size-btn {
  background: transparent;
  border: none;
  color: var(--foreground-3);
  font-size: 11px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.page-size-btn:hover {
  color: var(--foreground);
}

.page-size-btn.active {
  background: var(--accent-primary);
  color: #000;
  font-weight: 600;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-btn {
  padding: 0.45rem 1rem;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: 9999px;
  background: var(--surface-l3);
  color: var(--foreground-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: var(--border);
  color: var(--foreground);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-current {
  padding: 0 0.5rem;
  font-size: 13px;
  color: var(--foreground-2);
  font-feature-settings: "tnum", "lnum";
}

/* ═══════════════════════════════════
   FOOTER CTA SECTION
   ═══════════════════════════════════ */
.footer-cta-section {
  padding: 8rem 1.5rem;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .footer-cta-section {
    padding: 10rem 4rem;
  }
}

.footer-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 600px 400px at 50% 50%, var(--ember-wash), transparent 70%);
}

.footer-cta-content {
  text-align: center;
  position: relative;
  z-index: 10;
}

.footer-cta-title {
  margin-top: 1rem;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.03em;
  max-width: 20ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--foreground);
}

.footer-cta-desc {
  margin-top: 1.5rem;
  font-size: 15px;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--foreground-3);
}

/* Divider ornament */
.footer-divider {
  margin-top: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.divider-line {
  display: block;
  height: 1px;
  width: 8rem;
  background: var(--primary);
  opacity: 0;
  transform: scaleX(0);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

.divider-left {
  transform-origin: right;
}

.divider-right {
  transform-origin: left;
}

@media (min-width: 768px) {
  .divider-line {
    width: 10rem;
  }
}

.divider-diamond {
  display: block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  opacity: 0;
  transform: rotate(0deg);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s, opacity 0.8s ease 0.2s;
}

.footer-divider.visible .divider-line {
  opacity: 1;
  transform: scaleX(1);
}

.footer-divider.visible .divider-diamond {
  opacity: 1;
  transform: rotate(45deg);
}

/* ═══════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════ */

/* Initial animations for hero */
.animate-in {
  opacity: 0;
  transform: translateY(36px);
  animation: heroFadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  opacity: 0;
  animation: simpleFadeIn 1.5s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes simpleFadeIn {
  to { opacity: 1; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Rank card entrance */
@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: rgba(200, 160, 120, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 160, 120, 0.35);
}

/* Selection */
::selection {
  background: oklch(0.76 0.22 48 / 0.3);
  color: var(--foreground);
}

/* ═══════════════════════════════════
   PLAYER AVATARS (Dark Lava Cyberpunk)
   ═══════════════════════════════════ */
.player-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  background: var(--surface-l2);
  border: 1px solid rgba(255, 107, 0, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  user-select: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.player-avatar-wrap:hover {
  transform: scale(1.08);
  border-color: rgba(255, 107, 0, 0.85);
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.4);
}

.player-avatar-wrap.size-sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.player-avatar-wrap.size-md {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

.player-avatar-wrap.size-lg {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 107, 0, 0.55);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 10px rgba(255, 107, 0, 0.25);
}

@media (max-width: 640px) {
  .player-avatar-wrap.size-lg {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }
}

/* 三甲卡片专属头像光环 */
.rank-1 .player-avatar-wrap {
  border-color: #ff8400;
  box-shadow: 0 0 20px rgba(255, 119, 0, 0.5), inset 0 0 8px rgba(255, 119, 0, 0.3);
}

.rank-2 .player-avatar-wrap {
  border-color: #b05cff;
  box-shadow: 0 0 20px rgba(176, 92, 255, 0.45), inset 0 0 8px rgba(176, 92, 255, 0.25);
}

.rank-3 .player-avatar-wrap {
  border-color: #e2e8f0;
  box-shadow: 0 0 16px rgba(226, 232, 240, 0.35), inset 0 0 6px rgba(226, 232, 240, 0.2);
}

.player-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition: transform 0.25s ease;
}

.player-avatar-wrap:hover .player-avatar-img {
  transform: scale(1.06);
}

.player-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.22), rgba(20, 15, 10, 0.9));
  color: #ff9922;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 22px;
  border-radius: inherit;
  text-shadow: 0 0 8px rgba(255, 107, 0, 0.5);
}

@media (max-width: 640px) {
  .player-avatar-fallback {
    font-size: 18px;
  }
}

.rank-card .rank-info-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.rank-card .rank-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ─── 移动端卡片：两行网格（名字独占一行，赏金保留在第二行） ─── */
@media (max-width: 480px) {
  .rank-card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "badge avatar info num"
      "badge avatar bounty bounty";
    align-items: center;
    column-gap: 8px;
    row-gap: 3px;
    padding: 10px 12px;
  }

  .rank-card .rank-badge {
    grid-area: badge;
    align-self: center;
    width: 28px;
    font-size: 13px;
  }

  .rank-card.rank-1 .rank-badge { font-size: 24px; }
  .rank-card.rank-2 .rank-badge { font-size: 22px; }
  .rank-card.rank-3 .rank-badge { font-size: 20px; }

  .rank-card .rank-info-wrap {
    display: contents;
  }

  .rank-card .player-avatar-wrap.size-lg {
    grid-area: avatar;
    align-self: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .rank-card .rank-info {
    grid-area: info;
    min-width: 0;
  }

  .rank-card .rank-points {
    display: contents;
  }

  .rank-card .rank-points-num {
    grid-area: num;
    justify-self: end;
    align-self: end;
  }

  .rank-card .rank-points-value { font-size: 18px; }
  .rank-card .rank-points-suffix { font-size: 11px; }

  .rank-card .rank-bounty-tag {
    grid-area: bounty;
    justify-self: end;
    align-self: start;
    min-width: 60px;
    justify-content: center;
    margin-top: 2px;
    font-size: 9.5px;
    padding: 1px 5px;
    letter-spacing: 0;
  }

  .rank-card .rank-bounty-tag .bounty-coin { font-size: 8px; }

  .rank-card .rank-name { font-size: 14px; }
  .rank-card .rank-title { font-size: 11px; margin-top: 1px; }
}
