* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: #0b1220;
  color: #e5e7eb;
}

header {
  padding: 24px;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
}

.container {
  width: 90%;
  max-width: 1400px;
  margin: auto;
}

/* ===============================
   LINHA PRINCIPAL
================================ */
.link-row {
  position: relative;
  margin: 18px 0;
  height: 100px;
  border-radius: 14px;
  background: #111827;
  overflow: hidden;
}

/* ===============================
   BARRA (APENAS VISUAL)
================================ */
.link-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 14px;
  transition: width 0.8s ease;
  z-index: 1;
}

/* ===============================
   CONTEÚDO (SEMPRE 100%)
================================ */
.link-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 28px;
}

/* ===============================
   RANK
================================ */
.rank {
  font-size: 24px;
  font-weight: 700;
  min-width: 55px;
}

/* ===============================
   INFO
================================ */
.info {
  min-width: 280px;
}

.info .dns {
  font-size: 26px;
  font-weight: 700;
}

.info .ip {
  font-size: 15px;
  opacity: 0.85;
}

/* ===============================
   MÉTRICAS
================================ */
.metrics {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 17px;
}

.metric {
  text-align: center;
  min-width: 100px;
}

.metric span {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.metric small {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}

/* ===============================
   CORES FIXAS POR RANK
================================ */
.rank-1 {
  background: linear-gradient(90deg, #033816, #16a34a);
}

.rank-2 {
  background: linear-gradient(90deg, #032d3f, #0284c7);
}

.rank-3 {
  background: linear-gradient(90deg, #352b02, #eab308);
  color: #111;
}

.rank-4 {
  background: linear-gradient(90deg, #440808, #b91c1c);
}


/* ===============================
   LOADING OVERLAY
================================ */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#loading.hide {
  opacity: 0;
  visibility: hidden;
}

.loader-box {
  text-align: center;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255,255,255,0.15);
  border-top: 6px solid #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 18px;
}

.loading-text {
  font-size: 18px;
  opacity: 0.9;
}


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

/* ===============================
   RESPONSIVO - MOBILE
================================ */
@media (max-width: 768px) {

  .container {
    width: 95%;
  }

  .link-row {
    height: auto;
    padding-bottom: 14px;
  }

  .link-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .rank {
    font-size: 20px;
  }

  .info {
    min-width: unset;
  }

  .info .dns {
    font-size: 20px;
  }

  .info .ip {
    font-size: 13px;
  }

  .metrics {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    font-size: 14px;
  }

  .metric {
    min-width: unset;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 6px;
  }

  .metric span {
    font-size: 15px;
  }

  .metric small {
    font-size: 11px;
  }
}

.dns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #cbd5f5;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.copy-btn:active {
  transform: scale(0.95);
}
