:root {
  --rk-primary: #ffcc00;
  --rk-primary-dark: #e6b800;
  --rk-dark: #0a0a0a;
  --rk-dark-card: #111111;
  --rk-dark-soft: #1a1a1a;
  --rk-gray: #2a2a2a;
  --rk-gray-light: #f5f5f5;
  --rk-gray-border: #e8e8e8;
  --rk-white: #ffffff;
  --rk-text: #333333;
  --rk-text-muted: #999999;
  --rk-gold: #ffd700;
  --rk-silver: #c0c0c0;
  --rk-bronze: #cd7f32;
  --rk-green: #00c853;
  --rk-blue: #2979ff;
  --rk-red: #ff1744;
  --rk-radius: 16px;
  --rk-radius-sm: 10px;
  --rk-radius-xs: 8px;
  --rk-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  --rk-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
  --rk-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ranking-page {
  width: 100%;
  min-height: 100vh;
  background: var(--rk-gray-light);
  overflow-x: hidden;
}
.ranking-hero {
  position: relative;
  background: linear-gradient(135deg, #0a0a0a 0, #1a1a2e 50%, #0a0a0a 100%);
  padding: 110px 20px 70px;
  text-align: center;
  overflow: hidden;
}
.ranking-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      circle at 30% 40%,
      rgba(255, 204, 0, 0.08) 0,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(255, 204, 0, 0.05) 0,
      transparent 50%
    );
  animation: rkHeroGlow 8s ease-in-out infinite alternate;
}
@keyframes rkHeroGlow {
  0% {
    transform: translate(-2%, -2%);
  }
  100% {
    transform: translate(2%, 2%);
  }
}
.ranking-hero-overlay {
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><circle cx="40" cy="40" r="1" fill="rgba(255,204,0,0.06)"/></svg>')
    repeat;
  background-size: 80px 80px;
  opacity: 0.5;
}
.ranking-hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}
.ranking-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rk-primary);
  color: var(--rk-dark);
  padding: 7px 22px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 22px;
}
.ranking-hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--rk-white);
  letter-spacing: 4px;
  margin: 0 0 15px;
  line-height: 1.1;
  text-shadow: 0 0 30px rgba(255, 204, 0, 0.2);
}
.ranking-hero-content p {
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--rk-text-muted);
  margin: 0 0 30px;
}
.ranking-stats-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}
.stat-hero {
  text-align: center;
}
.stat-hero-num {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--rk-primary);
  line-height: 1;
}
.stat-hero-label {
  font-size: 0.72rem;
  color: var(--rk-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
  display: block;
}
.stat-hero-sep {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
}
.ranking-body {
  padding: 40px 20px 70px;
}
.ranking-container {
  max-width: 1100px;
  margin: 0 auto;
}
.ranking-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.ranking-search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
  display: flex;
  align-items: center;
}
.ranking-search-box i {
  position: absolute;
  left: 16px;
  color: var(--rk-text-muted);
  font-size: 0.9rem;
}
.ranking-search-box input {
  width: 100%;
  padding: 14px 45px 14px 46px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 2px solid var(--rk-gray-border);
  border-radius: 50px;
  background: var(--rk-white);
  color: var(--rk-text);
  outline: 0;
  transition: var(--rk-transition);
}
.ranking-search-box input:focus {
  border-color: var(--rk-primary);
  box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.1);
}
.search-clear {
  position: absolute;
  right: 14px;
  background: 0 0;
  border: none;
  color: var(--rk-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 5px;
}
.ranking-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 12px 20px;
  border: 2px solid var(--rk-gray-border);
  border-radius: 50px;
  background: var(--rk-white);
  color: var(--rk-text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--rk-transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.filter-btn:hover {
  border-color: var(--rk-primary);
  background: rgba(255, 204, 0, 0.05);
}
.filter-btn.active {
  background: var(--rk-dark);
  color: var(--rk-primary);
  border-color: var(--rk-dark);
}
.podium-section {
  margin-bottom: 30px;
}
.podium-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}
.podium-card {
  background: var(--rk-dark-card);
  border-radius: var(--rk-radius);
  padding: 30px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--rk-transition);
  animation: rkFadeUp 0.5s ease forwards;
  opacity: 0;
}
.podium-card:nth-child(1) {
  animation-delay: 0.1s;
}
.podium-card:nth-child(2) {
  animation-delay: 0s;
}
.podium-card:nth-child(3) {
  animation-delay: 0.2s;
}
@keyframes rkFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.podium-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.podium-card.gold {
  border-top: 4px solid var(--rk-gold);
  order: 2;
}
.podium-card.gold .podium-medal {
  background: linear-gradient(135deg, gold, #fa0);
}
.podium-card.silver {
  border-top: 4px solid var(--rk-silver);
  order: 1;
}
.podium-card.silver .podium-medal {
  background: linear-gradient(135deg, silver, #a0a0a0);
}
.podium-card.bronze {
  border-top: 4px solid var(--rk-bronze);
  order: 3;
}
.podium-card.bronze .podium-medal {
  background: linear-gradient(135deg, #cd7f32, #b06a28);
}
.podium-medal {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--rk-dark);
  margin: 0 auto 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.podium-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--rk-white);
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}
.podium-crew {
  font-size: 0.75rem;
  color: var(--rk-primary);
  margin-bottom: 12px;
  font-weight: 600;
}
.podium-points {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--rk-primary);
  line-height: 1;
}
.podium-points-label {
  font-size: 0.7rem;
  color: var(--rk-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
  display: block;
}
.podium-location {
  font-size: 0.72rem;
  color: var(--rk-text-muted);
  margin-top: 10px;
}
.clasificacion-info {
  margin-bottom: 25px;
}
.clasif-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.2);
  border-radius: var(--rk-radius-xs);
  font-size: 0.85rem;
  color: var(--rk-text);
}
.clasif-badge i {
  color: var(--rk-primary-dark);
  font-size: 1rem;
}
.ranking-table-card {
  background: var(--rk-white);
  border-radius: var(--rk-radius);
  overflow: hidden;
  box-shadow: var(--rk-shadow-lg);
  border-top: 4px solid var(--rk-primary);
}
.ranking-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 30px;
  border-bottom: 1px solid var(--rk-gray-border);
}
.ranking-table-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--rk-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ranking-table-header h2 i {
  color: var(--rk-primary-dark);
}
.ranking-count {
  font-size: 0.82rem;
  color: var(--rk-text-muted);
  background: var(--rk-gray-light);
  padding: 6px 14px;
  border-radius: 50px;
  font-weight: 600;
}
.ranking-loading {
  text-align: center;
  padding: 60px 20px;
}
.loading-spinner {
  width: 45px;
  height: 45px;
  border: 4px solid var(--rk-gray-border);
  border-top-color: var(--rk-primary);
  border-radius: 50%;
  animation: rkSpin 0.8s linear infinite;
  margin: 0 auto 15px;
}
@keyframes rkSpin {
  to {
    transform: rotate(360deg);
  }
}
.ranking-loading p {
  color: var(--rk-text-muted);
  font-size: 0.9rem;
}
.ranking-error {
  text-align: center;
  padding: 60px 20px;
}
.ranking-error i {
  font-size: 2.5rem;
  color: var(--rk-red);
  margin-bottom: 15px;
}
.ranking-error p {
  color: var(--rk-text-muted);
  margin-bottom: 15px;
}
.ranking-error button {
  padding: 10px 25px;
  background: var(--rk-dark);
  color: var(--rk-white);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}
.ranking-table-wrap {
  overflow-x: auto;
}
.ranking-table {
  width: 100%;
  border-collapse: collapse;
}
.ranking-table thead th {
  background: var(--rk-dark);
  color: var(--rk-primary);
  padding: 14px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.th-rank {
  width: 60px;
  text-align: center !important;
}
.th-puntos {
  width: 100px;
  text-align: center !important;
}
.th-barra {
  width: 200px;
}
.ranking-table tbody tr {
  border-bottom: 1px solid var(--rk-gray-border);
  transition: var(--rk-transition);
}
.ranking-table tbody tr:hover {
  background: rgba(255, 204, 0, 0.04);
}
.ranking-table tbody tr.top8 {
  background: rgba(255, 204, 0, 0.03);
}
.ranking-table tbody tr.top8:hover {
  background: rgba(255, 204, 0, 0.08);
}
.ranking-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--rk-text);
  vertical-align: middle;
}
.td-rank {
  text-align: center;
  font-weight: 900;
  font-size: 1rem;
}
.td-rank .rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 900;
}
.rank-gold {
  background: linear-gradient(135deg, gold, #fa0);
  color: #000;
}
.rank-silver {
  background: linear-gradient(135deg, silver, #a0a0a0);
  color: #000;
}
.rank-bronze {
  background: linear-gradient(135deg, #cd7f32, #b06a28);
  color: #fff;
}
.rank-number {
  color: var(--rk-text-muted);
  font-weight: 800;
  font-size: 0.95rem;
}
.td-nombre {
  font-weight: 700;
  color: var(--rk-dark);
  white-space: nowrap;
}
.td-puntos {
  text-align: center;
  font-weight: 800;
  color: var(--rk-dark);
  font-size: 1rem;
}
.td-ubicacion {
  color: var(--rk-text-muted);
  font-size: 0.82rem;
}
.td-crew {
  font-size: 0.82rem;
  color: var(--rk-primary-dark);
  font-weight: 600;
}
.crew-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.2);
  border-radius: 50px;
  font-size: 0.75rem;
  white-space: nowrap;
}
.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--rk-gray-border);
  border-radius: 50px;
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--rk-primary), var(--rk-primary-dark));
  transition: width 1s ease;
  min-width: 2px;
}
.progress-bar.top3 {
  background: linear-gradient(90deg, gold, #fa0);
}
.ranking-empty {
  text-align: center;
  padding: 60px 20px;
}
.ranking-empty i {
  font-size: 2.5rem;
  color: var(--rk-gray-border);
  margin-bottom: 15px;
}
.ranking-empty p {
  color: var(--rk-text-muted);
}
@media (max-width: 900px) {
  .podium-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
  .podium-card.gold {
    order: 0;
  }
  .podium-card.silver {
    order: 1;
  }
  .podium-card.bronze {
    order: 2;
  }
}
@media (max-width: 600px) {
  .ranking-hero {
    padding: 80px 15px 50px;
  }
  .ranking-body {
    padding: 25px 12px 50px;
  }
  .ranking-controls {
    flex-direction: column;
  }
  .ranking-search-box {
    min-width: 100%;
  }
  .ranking-filters {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
  }
  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 0.78rem;
  }
  .ranking-table-header {
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    text-align: center;
  }
  .ranking-table td {
    padding: 12px 10px;
    font-size: 0.82rem;
  }
  .td-barra-cell,
  .th-barra {
    display: none;
  }
  .td-ubicacion,
  .th-ubicacion {
    display: none;
  }
  .stat-hero-num {
    font-size: 1.5rem;
  }
  .stat-hero-sep {
    height: 30px;
  }
}
@media (max-width: 400px) {
  .ranking-hero-content h1 {
    letter-spacing: 2px;
  }
  .podium-points {
    font-size: 1.4rem;
  }
  .podium-name {
    font-size: 0.95rem;
  }
}
