:root {
  --default: #8c52ff;
  --highlight: #ff25ab;
  --emphasis: #ffd500;
}

body {
  background: var(--default);
  padding: 20px;
  text-align: center;
  font-family: Arial, sans-serif;
}

h1 {
  margin-bottom: 20px;
  color: white;
}

.tabs {
  margin-bottom: 20px;
}

.tabs button {
  padding: 10px 20px;
  width: 220px;
  max-width: 100%;
  border: none;
  background: #ccc;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.tabs button.active {
  background: var(--highlight);
  color: white;
}

/* FILTROS */
.filtros {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 25px;
}

.filtros label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: white;
}

.filtros input[type="date"],
.filtros input[type="month"] {
  padding: 10px 14px;
  width: 220px;
  max-width: 100%;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.filtros input[type="date"]:focus,
.filtros input[type="month"]:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 6px var(--highlight);
}

/* Busca com botão limpar */
.busca-container {
  position: relative;
  width: 220px;
  max-width: 100%;
}

.busca-container input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.busca-container input:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 6px var(--highlight);
}

#limpar-busca {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #eee;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #444;
  transition: background 0.2s, color 0.2s;
}

#limpar-busca:hover {
  color: var(--highlight);
}

/* LISTA */

.carregandoRanking {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  font-size: 1.2em;
  color: white;
  width: 100%;
  margin-top: 10px;
}

/* spinner branco */
.carregandoRanking::before {
  content: "";
  width: 1.2em;
  height: 1.2em;
  border: .18em solid rgba(255, 255, 255, .25);
  border-top-color: white;
  border-radius: 50%;
  animation: carrega-spin .9s linear infinite;
}

@keyframes carrega-spin {
  to {
    transform: rotate(360deg);
  }
}

.aviso-ranking {
  color: white;
  font-size: 1.1em;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
}

.user {
  background: white;
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.user .name {
  font-weight: bold;
  flex: 1;
  text-align: left;
}

.user.first-place {
  background-color: gold;
  font-weight: bold;
  border: 2px solid #d4af37;
}

.user.second-place {
  background-color: silver;
  font-weight: bold;
  border: 2px solid #aaa;
}

.user.third-place {
  background-color: #cd7f32;
  font-weight: bold;
  border: 2px solid #b87333;
}

/* RESPONSIVO */
@media (max-width: 600px) {
  .user {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .user .name {
    text-align: center;
  }

  .tabs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .tabs button {
    width: 90%;
    max-width: 300px;
    box-sizing: border-box;
  }

  .filtros {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 15px;
  }

  .filtros input[type="date"],
  .filtros input[type="month"],
  .busca-container {
    width: 100%;
    max-width: 340px;
    min-width: 240px;
    box-sizing: border-box;
  }

  .busca-container input {
    padding: 8px 36px 8px 14px;
    font-size: 16px;
  }
}

/* ANIMAÇÕES */
@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

@keyframes bounce {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.likes.updated {
  animation: pulse 0.4s ease;
  color: var(--highlight);
}

.user.updated-position {
  animation: bounce 0.5s ease;
}