.ranking-page {
  max-width: 1400px;
  margin: 0 auto;
  padding-block: 2rem;
}


.ranking-header {
  text-align: center;
}

.year-title {
  font-size: 1.75rem;
  font-weight: bold;
  color: #22a5e5;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.server-title {
  font-size: 2rem;
  font-weight: 900;
  color: #ffbd30;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(255, 189, 48, 0.5);
  margin: 0.5rem auto 0;
  display: block;
  text-align: center !important;
  width: 100%;
}

.server-selection {
  margin-top: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.server-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.server-btn {
  padding: 0.625rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
}

.server-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.server-btn.active {
  background: linear-gradient(135deg, rgba(34, 165, 229, 0.9), rgba(34, 165, 229, 0.6));
  border-color: rgba(34, 165, 229, 0.8);
  box-shadow: 0 8px 20px rgba(34, 165, 229, 0.4);
}

.search-section {
  margin-top: 0;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.search-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 600px;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.search-input::placeholder {
  color: #9ca3af;
  font-weight: 500;
  text-transform: uppercase;
}

.search-input:focus {
  border-color: #22a5e5;
  box-shadow: 0 0 0 3px rgba(34, 165, 229, 0.2);
}

.search-btn {
  padding: 0.625rem 1.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(135deg, #22a5e5, #1e90c8);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(34, 165, 229, 0.4);
}

.info-section {
  margin: 0 0 1.5rem 0;
}

.info-box {
  background: linear-gradient(135deg, rgba(34, 165, 229, 0.15), rgba(34, 165, 229, 0.08));
  border-left: 4px solid #22a5e5;
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  color: #e5e7eb;
  line-height: 1.4;
  text-align: left;
  font-size: 0.8125rem;
}

.info-box p {
  margin: 0 0 0.25rem 0;
}

.info-box p:last-child {
  margin-bottom: 0;
}

.forum-link {
  color: #22a5e5;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forum-link:hover {
  color: #34d399;
  text-decoration: underline;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
}

.loading-spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(34, 165, 229, 0.3);
  border-top-color: #22a5e5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.rankings-grid {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  text-align: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

/* Esconder cards que não correspondem à busca */
.ranking-card.hidden {
  display: none;
}

.ranking-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border-radius: 12px;
  padding: 0.625rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 320px;
  flex: 1 1 320px;
  max-width: 450px;
}

.card-header {
  text-align: center;
  margin-bottom: 0.625rem;
  padding: 0;
  border-bottom: 2px solid rgba(34, 165, 229, 0.3);
  height: clamp(150px, 20vw, 190px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 31, 46, 0.9), rgba(12, 44, 66, 0.8));
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #22a5e5;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-title-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
}

.players-header {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.5rem;
  background: linear-gradient(135deg, rgba(34, 165, 229, 0.2), rgba(34, 165, 229, 0.1));
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #22a5e5;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.header-pos {
  text-align: center;
}

.header-nick {
  text-align: left;
}

.header-val {
  text-align: right;
}

.player-row {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* Podium */
.player-row.first {
  background: linear-gradient(135deg, rgba(255, 189, 48, 0.30), rgba(255, 189, 48, 0.18));
  border: 1px solid rgba(255, 189, 48, 0.5);
}

.player-row.second {
  background: linear-gradient(135deg, rgba(212, 212, 212, 0.30), rgba(212, 212, 212, 0.18));
  border: 1px solid rgba(212, 212, 212, 0.5);
}

.player-row.third {
  background: linear-gradient(135deg, rgba(187, 95, 48, 0.30), rgba(187, 95, 48, 0.18));
  border: 1px solid rgba(187, 95, 48, 0.5);
}

/* Linha de nick highlighted na busca */
.player-row.search-match {
  outline: 2px solid #22a5e5;
}

.pos-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-number {
  font-weight: 700;
  font-size: 0.875rem;
  color: #e5e7eb;
}

.nick-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-nick {
  font-weight: 600;
  font-size: 0.8125rem;
  color: #fff;
}

.val-cell {
  text-align: right;
}

.player-value {
  font-weight: 700;
  font-size: 0.875rem;
  color: #34d399;
}

.empty {
  color: rgba(255, 255, 255, 0.3);
}

/* ===================== RESPONSIVO ===================== */

@media (max-width: 992px) {
  .year-title {
    font-size: 1.75rem;
  }

  .server-title {
    font-size: 2rem;
  }

  .server-btn {
    padding: 0.75rem 1.75rem;
    font-size: 0.875rem;
  }

  .search-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .search-btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .ranking-page {
    padding: 1rem 0.75rem;
  }

  .year-title {
    font-size: 1.5rem;
  }

  .server-title {
    font-size: 1.75rem;
  }

  .server-btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.8125rem;
  }

  .search-input {
    font-size: 0.8125rem;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
  }

  .search-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.8125rem;
  }

  .ranking-card {
    padding: 0.875rem;
    min-width: 100%;
    flex: 1 1 100%;
    max-width: 100%;
  }

  .players-header {
    grid-template-columns: 50px 1fr auto;
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
  }

  .player-row {
    grid-template-columns: 50px 1fr auto;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .pos-number {
    font-size: 0.875rem;
  }

  .player-nick {
    font-size: 0.875rem;
  }

  .player-value {
    font-size: 0.875rem;
  }

  .info-box {
    padding: 1rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 576px) {
  .ranking-page {
    padding: 0.875rem 0.5rem;
  }

  .year-title {
    font-size: 1.25rem;
  }

  .server-title {
    font-size: 1.5rem;
  }

  .server-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
  }

  .search-icon {
    font-size: 0.875rem;
    left: 0.75rem;
  }

  .search-input {
    padding: 0.625rem 0.75rem 0.625rem 2.25rem;
    font-size: 0.75rem;
  }

  .search-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.75rem;
  }

  .ranking-card {
    padding: 0.75rem;
  }

  .card-header {
    height: 150px;
    margin-bottom: 0.5rem;
  }

  .card-title-img {
    width: 100%;
    height: 100%;
  }

  .players-header {
    grid-template-columns: 45px 1fr auto;
    padding: 0.3rem 0.5rem;
    font-size: 0.625rem;
  }

  .player-row {
    grid-template-columns: 45px 1fr auto;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
  }

  .players-list {
    gap: 0.375rem;
  }

  .info-box {
    padding: 0.875rem;
  }
}

/* iPad 768px–1024px */
@media (min-width: 768px) and (max-width: 1024px) {
  .rankings-grid {
    justify-content: center;
  }

  .ranking-card {
    min-width: 340px;
    flex: 1 1 340px;
    max-width: 480px;
  }

  .search-form {
    flex-direction: row;
    gap: 0.75rem;
  }

  .search-btn {
    width: auto;
  }
}

/* Ultra-small ≤360px */
@media (max-width: 360px) {
  .ranking-page {
    padding: 0.5rem 0.25rem;
  }

  .year-title {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .server-title {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }

  .server-btn {
    padding: 0.4rem 0.875rem;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
  }

  .search-input {
    padding: 0.5rem 0.625rem 0.5rem 2rem;
    font-size: 0.7rem;
  }

  .search-btn {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
  }

  .ranking-card {
    padding: 0.5rem;
  }

  .card-header {
    height: 124px;
  }

  .card-title-img {
    height: 100%;
  }

  .players-header {
    grid-template-columns: 35px 1fr auto;
    padding: 0.25rem 0.375rem;
    font-size: 0.575rem;
  }

  .player-row {
    grid-template-columns: 35px 1fr auto;
    gap: 0.25rem;
    padding: 0.3rem 0.375rem;
  }

  .pos-number {
    font-size: 0.75rem;
  }

  .player-nick {
    font-size: 0.72rem;
  }

  .player-value {
    font-size: 0.75rem;
  }

  .info-box {
    padding: 0.625rem;
    font-size: 0.75rem;
  }

  /* Estilo para os ícones do Pódio */
  .podium-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
  }

  /* 1º Lugar - Dourado */
  .player-row.first .podium-icon {
    color: #ffd700;
    /* Gold */
  }

  .player-row.first .player-nick {
    color: #ffd700;
    font-weight: bold;
  }

  /* 2º Lugar - Prata */
  .player-row.second .podium-icon {
    color: #c0c0c0;
    /* Silver */
  }

  .player-row.second .player-nick {
    color: #e0e0e0;
  }

  /* 3º Lugar - Bronze */
  .player-row.third .podium-icon {
    color: #cd7f32;
    /* Bronze */
  }

  /* Ajuste na célula da posição para centralizar os ícones */
  .pos-cell {
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
  }

  /* Efeito de destaque na linha do Top 1 */
  .player-row.first {
    background: rgba(255, 215, 0, 0.05);
    border-left: 3px solid #ffd700;
  }

  .my-position-highlight {
    background: rgba(255, 189, 48, 0.15) !important;
    border-left: 3px solid #ffbd30;
  }
}