/* Top page — filters, ranking layout */

.top-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(10px, 2vw, 14px);
  width: min(100%, 560px);
  margin: 0 auto clamp(14px, 2.8vw, 22px);
  padding: clamp(10px, 2vw, 14px);
  border: 2px solid #111;
  border-radius: 10px;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.16) 0 10%, transparent 11%),
    linear-gradient(180deg, rgba(28, 40, 58, 0.96) 0%, rgba(10, 18, 34, 0.98) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    0 4px 0 #111,
    0 12px 22px rgba(0, 0, 0, 0.28);
  text-align: left;
}

.top-filter {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.top-filter > span {
  color: #50e62f;
  font-family: "Luckiest Guy", Impact, Haettenschweiler, "Arial Narrow Bold", Arial, sans-serif;
  font-size: clamp(0.78rem, 2vw, 0.92rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111;
}

.top-page .top-filter select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 2.2rem 0.55rem 0.7rem;
  border: 2px solid #111;
  border-radius: 8px;
  background-color: #d8e8f8;
  background-image:
    linear-gradient(180deg, #f7fbff 0%, #c5d8ef 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2306113b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, calc(100% - 12px) 50%;
  background-size: 100% 100%, 12px 8px;
  color: #06113b;
  font: 700 0.9rem Arial, Helvetica, sans-serif;
  line-height: 1.2;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    0 3px 0 #111;
  cursor: pointer;
}

.top-page .top-filter select:focus {
  outline: 2px solid #50e62f;
  outline-offset: 2px;
}

.top-page .top-filter select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.top-ranking {
  position: relative;
  z-index: 4;
  width: 100%;
  margin-top: 0.25rem;
}

.top-ranking-context {
  margin: 0 auto clamp(10px, 2vw, 16px);
  max-width: 660px;
  color: #ffd700;
  font-size: clamp(0.72rem, 1.7vw, 0.88rem);
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111;
}

.top-ranking .top-podium-card {
  position: relative;
  left: auto;
  top: auto;
  width: min(100%, 768px);
  margin: 0 auto clamp(14px, 2.5vw, 22px);
  transform: none;
  pointer-events: auto;
  aspect-ratio: auto;
}

.top-ranking .top-podium-art {
  aspect-ratio: 763 / 327;
  overflow: visible;
}

.top-ranking .top-podium-base {
  display: block;
}

.top-ranking .top-podium-medal {
  display: grid;
}

.top-ranking-list-title {
  max-width: 660px;
  margin: 0 auto 0.55rem;
  color: #fff;
  font-family: "Luckiest Guy", Impact, Haettenschweiler, "Arial Narrow Bold", Arial, sans-serif;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  text-transform: uppercase;
  text-align: left;
  text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111;
}

.top-ranking-table-wrap {
  width: min(100%, 720px);
  margin: 0 auto;
}

.top-ranking-table-scroll {
  overflow-x: auto;
  border: 2px solid #111;
  border-radius: 10px;
  box-shadow: 0 4px 0 #111, 0 12px 22px rgba(0, 0, 0, 0.28);
}

.top-ranking-table {
  width: 100%;
  border-collapse: collapse;
  background: linear-gradient(180deg, rgba(28, 40, 58, 0.98) 0%, rgba(10, 18, 34, 0.99) 100%);
  font-size: 0.88rem;
}

.top-ranking-table thead th {
  padding: 0.65rem 0.75rem;
  border-bottom: 2px solid #111;
  background: rgba(80, 230, 47, 0.18);
  color: #50e62f;
  font-family: "Luckiest Guy", Impact, Haettenschweiler, "Arial Narrow Bold", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  text-align: left;
  text-transform: uppercase;
}

.top-ranking-table tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  vertical-align: middle;
}

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

.top-ranking-table-rank {
  width: 3rem;
  font-weight: 900;
  color: #ffd700;
}

.top-ranking-table-time {
  font-weight: 900;
  white-space: nowrap;
}

.top-ranking-table-status {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.top-ranking-table-row--podium-1 .top-ranking-table-rank,
.top-ranking-table-row--podium-2 .top-ranking-table-rank,
.top-ranking-table-row--podium-3 .top-ranking-table-rank {
  color: #ff82c8;
}

.top-ranking-table-row--eliminated {
  opacity: 0.72;
  background: rgba(130, 164, 198, 0.12);
}

.top-eliminated-table-wrap {
  margin-top: clamp(14px, 2.5vw, 22px);
}

.top-eliminated-list-title {
  color: #ffb4c8;
}

.top-empty-state {
  max-width: 520px;
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  border: 2px solid #111;
  border-radius: 8px;
  background: rgba(6, 17, 59, 0.82);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
}

.top-avatar-card--eliminated {
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 255, 255, 0.42) 0 8%, transparent 9%),
    linear-gradient(180deg, rgba(214, 228, 240, 0.94) 0%, rgba(130, 164, 198, 0.88) 100%);
}

.top-avatar-card--eliminated .top-avatar-rank {
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.5) 0 9%, transparent 10%),
    linear-gradient(180deg, #96d8f6 0%, #4fa4d8 52%, #236aa8 100%);
}

.top-page--ranking-active .top-stage {
  padding-top: clamp(72px, 8vw, 104px) !important;
}

.top-page--ranking-active .top-kicker,
.top-page--ranking-active .top-rollers-title,
.top-page--ranking-active .top-lead {
  display: block !important;
}

@media (min-width: 701px) {
  .top-ranking .top-podium-card {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: min(100%, 768px) !important;
    aspect-ratio: auto !important;
    margin: 0 auto clamp(14px, 2.5vw, 22px) !important;
    transform: none !important;
    pointer-events: auto !important;
    box-shadow:
      0 6px 0 rgba(6, 17, 59, 0.26),
      0 18px 30px rgba(6, 17, 59, 0.32) !important;
  }

  .top-ranking .top-podium-art {
    aspect-ratio: 763 / 327 !important;
  }

  .top-ranking .top-podium-base {
    display: block !important;
  }

  .top-ranking .top-podium-medal {
    display: grid !important;
  }
}
