:root {
  --bg: #050b16;
  --surface: #0b1526;
  --surface-2: #101e35;
  --border: #1e3a5f;
  --border-soft: #14263f;

  --text: #eaf3ff;
  --text-muted: #9db4d0a8;
  --text-muted-solido: #9db4d0;
  --text-faint: #5f7a99;

  --rust: #3da9ff;
  --rust-forte: #1e8fe8;
  --rust-fundo: rgba(61, 169, 255, 0.12);
  --ambar: #7cc7ff;
  --vermelho: #e2919a;
  --vermelho-fundo: rgba(226, 145, 154, 0.1);

  --fonte-display: 'Space Grotesk', system-ui, sans-serif;
  --fonte-corpo: 'Inter', system-ui, sans-serif;
  --fonte-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --raio: 16px;
  --raio-pequeno: 10px;
  --sombra-cartao: 0 20px 60px -20px rgba(0, 0, 0, 0.75);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--fonte-corpo);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(5, 11, 22, 0.88), rgba(5, 11, 22, 0.94)),
    url('assets/udxkr_wallpaper.png') center / cover fixed no-repeat,
    var(--bg);
}

.fundo-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 420px at 20% -5%, rgba(61, 169, 255, 0.14), transparent 60%),
    radial-gradient(560px 380px at 85% 10%, rgba(124, 199, 255, 0.08), transparent 60%);
}

/* Anéis concêntricos subtis, ecoando o motivo do logótipo uDxkr */
.fundo-anel {
  position: fixed;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  width: 900px;
  height: 900px;
  border-radius: 50%;
  border: 1px solid rgba(61, 169, 255, 0.1);
  box-shadow:
    0 0 0 60px rgba(61, 169, 255, 0.025),
    0 0 0 120px rgba(61, 169, 255, 0.015);
}

.pagina {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 24px 64px;
}

.a-carregar-msg {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 24px;
  text-align: center;
  color: var(--text-muted-solido);
  font-family: var(--fonte-mono);
  font-size: 14px;
}

/* ---------- Cabeçalho ---------- */

.cabecalho {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 6px rgba(61, 169, 255, 0.06), 0 20px 50px -20px rgba(30, 143, 232, 0.45);
  margin: 0 auto 18px;
}

.banner {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--raio);
  border: 1px solid var(--border);
  box-shadow: var(--sombra-cartao);
  margin-bottom: 22px;
}

.crachá {
  display: inline-block;
  font-family: var(--fonte-mono);
  font-size: 12px;
  letter-spacing: 0.58em;
  color: var(--rust);
  background: var(--rust-fundo);
  border: 1px solid rgba(255, 140, 61, 0.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-top: -10px;
  margin-bottom: 20px;
}

.cabecalho h1 {
  font-family: var(--fonte-display);
  font-weight: 600;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.subtitulo {
  color: var(--text-muted-solido);
  font-size: 15px;
  margin: 0;
}

/* ---------- Formulário ---------- */

.form-consulta { margin-bottom: 36px; }

.campo-endereco {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.campo-endereco:focus-within {
  border-color: rgba(255, 140, 61, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 140, 61, 0.1);
}

#input-endereco {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--fonte-mono);
  font-size: 14px;
  padding: 12px 14px;
}

#input-endereco::placeholder { color: var(--text-faint); }

#btn-consultar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--rust), var(--rust-forte));
  color: #1a0e04;
  font-family: var(--fonte-corpo);
  font-weight: 600;
  font-size: 14px;
  padding: 0 20px;
  border-radius: calc(var(--raio) - 6px);
  transition: filter 0.15s ease, transform 0.1s ease;
}

#btn-consultar:hover { filter: brightness(1.08); }
#btn-consultar:active { transform: scale(0.98); }
#btn-consultar:disabled { opacity: 0.7; cursor: default; }

.spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(26, 14, 4, 0.3);
  border-top-color: #1a0e04;
  border-radius: 50%;
}

#btn-consultar.a-carregar .texto-btn { display: none; }
#btn-consultar.a-carregar .spinner {
  display: inline-block;
  animation: girar 0.7s linear infinite;
}

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

.seletor-tipo {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
}

.opcao-tipo {
  position: relative;
  cursor: pointer;
}

.opcao-tipo input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opcao-tipo span {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted-solido);
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.opcao-tipo input:checked + span {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}

/* ---------- Resultado: cartão base ---------- */

.area-resultado { min-height: 4px; }

.cartao {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 24px;
  box-shadow: var(--sombra-cartao);
  animation: aparecer 0.35s ease both;
}

@keyframes aparecer {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.cartao-topo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.icone-slot {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.icone-servidor {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.icone-generico {
  font-family: var(--fonte-display);
  font-size: 20px;
  color: var(--text-faint);
}

.ponto-status {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 3px solid var(--surface);
}

.ponto-status--online {
  background: var(--rust);
  box-shadow: 0 0 0 0 rgba(255, 140, 61, 0.6);
  animation: pulsar 2s ease-out infinite;
}

.ponto-status--offline { background: var(--text-faint); }

@keyframes pulsar {
  0% { box-shadow: 0 0 0 0 rgba(255, 140, 61, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(255, 140, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 140, 61, 0); }
}

.cartao-titulo { flex: 1; min-width: 0; }

.hostname {
  font-family: var(--fonte-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endereco-ip {
  font-family: var(--fonte-mono);
  font-size: 12.5px;
  color: var(--text-muted-solido);
  margin: 0;
}

.etiqueta-estado {
  font-family: var(--fonte-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.etiqueta-estado--online { background: var(--rust-fundo); color: var(--rust); }
.etiqueta-estado--offline { background: var(--surface-2); color: var(--text-muted-solido); }

/* ---------- MOTD ---------- */

.motd-caixa {
  background: #0a0704;
  border: 1px solid var(--border-soft);
  border-radius: var(--raio-pequeno);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.motd-linha {
  font-family: var(--fonte-mono);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Grelha de info ---------- */

.grelha-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.info-bloco {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--raio-pequeno);
  padding: 12px 14px;
}

.info-rotulo {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.info-valor {
  font-family: var(--fonte-mono);
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* ---------- Lista de jogadores ---------- */

.lista-jogadores-wrap { margin-bottom: 4px; }

.lista-jogadores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-jogador {
  font-family: var(--fonte-mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-muted-solido);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- Detalhes técnicos ---------- */

.debug-detalhes {
  margin-top: 18px;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}

.debug-detalhes summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted-solido);
  list-style: none;
}

.debug-detalhes summary::-webkit-details-marker { display: none; }

.debug-detalhes summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
  color: var(--rust);
}

.debug-detalhes[open] summary::before { transform: rotate(90deg); }

.debug-grelha {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  font-family: var(--fonte-mono);
  font-size: 12.5px;
}

.debug-grelha dt { color: var(--text-faint); }
.debug-grelha dd { margin: 0; color: var(--text-muted-solido); word-break: break-all; }

/* ---------- Estados offline / erro ---------- */

.mensagem-offline {
  color: var(--text-muted-solido);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
}

.cartao--erro { border-color: rgba(226, 145, 154, 0.3); background: var(--vermelho-fundo); }
.mensagem-erro { color: var(--vermelho); font-size: 14px; margin: 0; }

/* ---------- Rodapé ---------- */

.rodape {
  text-align: center;
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--fonte-mono);
  font-size: 12.5px;
  color: var(--rust);
  background: var(--rust-fundo);
  border: 1px solid rgba(61, 169, 255, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.telegram-link:hover { filter: brightness(1.15); }

.linha-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.rodape p {
  font-size: 12.5px;
  color: var(--text-faint);
  margin: 0;
}

.rodape p a { color: var(--text-muted-solido); }

/* ---------- Responsivo ---------- */

@media (max-width: 480px) {
  .pagina { padding: 48px 16px 40px; }
  .campo-endereco { flex-direction: column; }
  #btn-consultar { padding: 12px; }
  .grelha-info { grid-template-columns: 1fr; }
  .logo { width: 96px; height: 96px; }
}

/* ---------- Acessibilidade: reduzir movimento ---------- */

@media (prefers-reduced-motion: reduce) {
  .cartao, .ponto-status--online, .spinner { animation: none !important; }
}

/* Foco visível para navegação por teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

/* ---------- Acoes bgp.tools ---------- */
.acoes-rede {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.btn-rede {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fonte-mono);
  font-size: 12.5px;
  color: var(--rust);
  background: var(--rust-fundo);
  border: 1px solid rgba(61, 169, 255, 0.3);
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn-rede:hover { filter: brightness(1.15); }
.btn-rede:active { transform: scale(0.98); }
.btn-rede--ip { color: var(--text); }
.cartao--offline .acoes-rede { margin-top: 16px; margin-bottom: 0; }
@media (max-width: 480px) {
  .acoes-rede { flex-direction: column; }
  .btn-rede { justify-content: center; }
}

