.container {
  width: 100%;
}

.loading,
.error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 1rem;
}

.loading {
  font-size: 1.2rem;
  color: var(--accent-2);
}

.error {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: 12px;
  padding: 2rem;
}

.error h2 {
  color: #ff3b30;
  margin-bottom: 0.5rem;
}

.error button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms;
}

.error button:hover {
  background: var(--accent-2);
}

.controls {
  margin: 1.5rem 0;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.6), rgba(30, 41, 59, 0.4));
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-group-label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.controls select {
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 200ms;
}

.controls select:hover {
  border-color: var(--accent-2);
}

.search-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
}

.search-box input {
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--text);
  flex: 1;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-2);
}

.search-box button {
  padding: 0.5rem 0.9rem;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 150ms ease;
}

.search-box button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.search-box button:hover:not(:disabled) {
  background: var(--accent-2);
}

.btn-sugerir {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(96, 165, 250, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 150ms ease;
  white-space: nowrap;
}

.btn-sugerir:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(96, 165, 250, 0.2));
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-1px);
}

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

.pagination button {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: all 150ms ease;
  font-size: 0.9rem;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent-2);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0 0.5rem;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .controls {
    gap: 0.75rem;
  }

  .search-box {
    min-width: 100%;
    order: 10;
  }
}

.ranking-list {
  display: flex;
  flex-direction: column;
}

.ranking-card.highlight {
  box-shadow: 0 0 0 2px var(--accent-2);
}

footer {
  text-align: center;
  margin-top: 2.4rem;
  padding: 1.4rem 0 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--stroke);
  font-size: 0.9rem;
}

footer p + p {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.manual-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 200ms ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.manual-link:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.selecao-flutuante {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 70, 229, 0.2);
  z-index: 999;
  backdrop-filter: blur(12px);
  animation: slideUp 300ms ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.selecao-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.selecao-nome {
  background: rgba(79, 70, 229, 0.2);
  color: var(--accent-2);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.selecao-acoes {
  display: flex;
  gap: 0.6rem;
}

.btn-limpar {
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 150ms ease;
}

.btn-limpar:hover {
  background: rgba(255, 59, 48, 0.2);
  border-color: rgba(255, 59, 48, 0.4);
}

.btn-comparar {
  padding: 0.55rem 1.25rem;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 150ms ease;
}

.btn-comparar:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-comparar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .selecao-flutuante {
    left: 1rem;
    right: 1rem;
    transform: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .selecao-info {
    flex-wrap: wrap;
    justify-content: center;
  }

  .selecao-acoes {
    width: 100%;
    justify-content: center;
  }
}
