/**
 * VittSpeedTest — estilos (tema Vitt Host: dark navy + gold).
 * Palette: bg #0a0e1a / #0d1120, brand #f5b800 → #fcd34d.
 * Prefixo .st- para nao colidir com estilos do site.
 */

.st-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.st-head {
    text-align: center;
    margin-bottom: 32px;
}
.st-head h1 {
    font-size: clamp(28px, 4vw, 40px);
    margin: 0 0 10px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #ffffff;
}
.st-head h1 .st-brand {
    background: linear-gradient(135deg, #f5b800 0%, #fcd34d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.st-head p {
    color: #a8b0cc;
    font-size: 16px;
    margin: 0;
}

/* Gauge */
.st-gauge-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px auto 32px;
}
.st-gauge {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1 / 0.9;
}
.st-gauge-center {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

/* ── Resumo do fim do teste ────────────────────────────────────────────────
   Fica por cima do ponteiro, ocupando a mesma caixa. O canvas continua no
   fluxo com visibility:hidden em vez de display:none justamente para o bloco
   nao mudar de altura na troca — nada salta na tela. */
.st-resumo {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 10px;
}
.st-gauge-wrap.mostrando-resumo .st-gauge,
.st-gauge-wrap.mostrando-resumo .st-gauge-center {
    visibility: hidden;
}
.st-gauge-wrap.mostrando-resumo .st-resumo {
    display: flex;
    animation: st-actions-in .35s ease both;
}
.st-resumo-ping {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1;
}
.st-resumo-num {
    font-size: clamp(44px, 9vw, 68px);
    font-weight: 900;
    letter-spacing: -2px;
    color: #ffffff;
}
.st-resumo-un {
    font-size: clamp(16px, 2.6vw, 20px);
    font-weight: 700;
    color: #a8b0cc;
}
.st-resumo-rotulo {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #7d86a3;
}
.st-resumo-veredito {
    margin-top: 12px;
    font-size: clamp(15px, 2.4vw, 18px);
    font-weight: 800;
    color: #f5b800;
    line-height: 1.3;
    max-width: 330px;
}
.st-resumo-texto {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #a8b0cc;
    max-width: 330px;
}
.st-resumo-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}
.st-resumo-links .st-action-btn {
    padding: 9px 16px;
    font-size: 13px;
}
.st-resumo-fonte {
    margin: 12px 0 0;
    font-size: 11px;
    color: #626a85;
    max-width: 300px;
    line-height: 1.45;
}
.st-gauge-value {
    font-size: clamp(38px, 8vw, 62px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}
.st-gauge-unit {
    font-size: 14px;
    color: #a8b0cc;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}
.st-gauge-phase {
    display: inline-block;
    margin-top: 12px;
    padding: 5px 14px;
    background: rgba(245, 184, 0, .12);
    border: 1px solid rgba(245, 184, 0, .35);
    color: #f5b800;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    min-height: 26px;
    opacity: 0;
    transition: opacity .3s;
}
.st-gauge-phase.active { opacity: 1; }
.st-gauge-phase.error {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
    color: #f87171;
}

/* Botao start (gold gradient tipo Area do Cliente) */
.st-start-wrap {
    text-align: center;
    margin: 8px 0 32px;
}
.st-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 44px;
    background: linear-gradient(135deg, #f5b800 0%, #fcd34d 100%);
    color: #0a0e1a;
    font-size: 16px;
    font-weight: 800;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(245, 184, 0, .28);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    letter-spacing: .3px;
}
.st-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(245, 184, 0, .38);
    color: #0a0e1a;
}
.st-start-btn:active { transform: translateY(0); }
.st-start-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.st-start-btn i { font-size: 16px; }

/* Grid de resultados */
.st-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (max-width: 640px) {
    .st-results { grid-template-columns: repeat(2, 1fr); }

    /* No celular a caixa do ponteiro encolhe junto com a largura (aspect-ratio
       1/0.9), mas o texto do resumo quebra em mais linhas — media pouco mais
       de 300px contra uma caixa de 302. Apertar os respiros devolve folga em
       vez de deixar a letra miuda encostar no botao de refazer. */
    .st-resumo-veredito { margin-top: 8px; }
    .st-resumo-texto    { margin-top: 6px; font-size: 12.5px; }
    .st-resumo-links    { margin-top: 12px; gap: 8px; }
    .st-resumo-links .st-action-btn { padding: 8px 14px; font-size: 12.5px; }
    .st-resumo-fonte    { margin-top: 9px; }
}

.st-card {
    background: linear-gradient(180deg, #0d1120 0%, #0a0e1a 100%);
    border: 1px solid #1e2740;
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.st-card.active {
    border-color: rgba(245, 184, 0, .55);
    box-shadow: 0 0 0 3px rgba(245, 184, 0, .12);
}
.st-card-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: rgba(245, 184, 0, .10);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f5b800;
    font-size: 18px;
}
.st-card-label {
    font-size: 11px;
    color: #a8b0cc;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    font-weight: 600;
}
.st-card-value {
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    color: #ffffff;
}
.st-card-value small {
    font-size: 11px;
    color: #a8b0cc;
    font-weight: 500;
    margin-left: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Info do teste */
.st-info {
    background: #0d1120;
    border: 1px solid #1e2740;
    border-radius: 12px;
    padding: 20px 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}
.st-info-item {
    font-size: 14px;
    color: #a8b0cc;
    display: flex;
    align-items: center;
    gap: 10px;
}
.st-info-item i {
    color: #f5b800;
    font-size: 16px;
    width: 20px;
}
.st-info-item strong {
    color: #ffffff;
    font-weight: 600;
    word-break: break-word;
}

/* Share/Repeat area apos o teste */
/* Os botoes so existem depois que o teste termina.
   Antes era opacity:0, que esconde mas CONTINUA OCUPANDO o espaco: no celular
   os tres botoes quebravam em tres linhas e deixavam um vao morto de ~200px
   entre o resultado e o resto da pagina. display:none resolve. */
.st-actions {
    margin-top: 24px;
    display: none;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.st-actions.visible {
    display: flex;
    animation: st-actions-in .3s ease both;
}
@keyframes st-actions-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.st-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid #1e2740;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
}
.st-action-btn:hover {
    background: rgba(245, 184, 0, .08);
    border-color: rgba(245, 184, 0, .5);
    color: #ffffff;
    text-decoration: none;
}
.st-action-btn.primary {
    background: linear-gradient(135deg, #f5b800 0%, #fcd34d 100%);
    border-color: transparent;
    color: #0a0e1a;
}
.st-action-btn.primary:hover {
    transform: translateY(-1px);
    color: #0a0e1a;
    background: linear-gradient(135deg, #fcd34d 0%, #f5b800 100%);
}

/* Global ping section */
.st-globalping {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid #1e2740;
}
.st-globalping-head {
    text-align: center;
    margin-bottom: 20px;
}
.st-globalping-head h2 {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 800;
    margin: 0 0 8px;
    color: #ffffff;
    letter-spacing: -.3px;
}
.st-globalping-head p {
    color: #a8b0cc;
    font-size: 14px;
    margin: 0;
}
/* Explica que a latencia tem um piso fisico, para o rotulo "Alto" nas regioes
   distantes ser lido como distancia e nao como defeito da conexao. */
.st-globalping-nota {
    max-width: 640px;
    margin: 10px auto 0 !important;
    font-size: 13px !important;
    color: #7d86a3 !important;
    line-height: 1.55;
}
.st-globalping-actions {
    text-align: center;
    margin: 18px 0 24px;
}
.st-globalping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.st-region {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #0d1120 0%, #0a0e1a 100%);
    border: 1px solid #1e2740;
    border-radius: 10px;
    transition: border-color .2s, transform .2s;
}
.st-region.testing {
    border-color: rgba(245, 184, 0, .5);
}
/* Selo com o codigo do pais.
   Substitui o emoji de bandeira, que o Windows nao tem fonte para desenhar e
   renderizava como duas letras soltas. Assim sai igual em todo sistema. */
.st-region-code {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 28px;
    padding: 0 7px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #e6b800;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.st-region.testing .st-region-code {
    border-color: rgba(230, 184, 0, .45);
    background: rgba(230, 184, 0, .1);
}
.st-region-info {
    flex: 1;
    min-width: 0;
}
.st-region-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-region-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.st-region-ms {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}
.st-region-quality {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.st-region-quality.na        { background: rgba(148, 163, 184, .12); color: #94a3b8; }
.st-region-quality.excellent { background: rgba(16, 185, 129, .15);  color: #10b981; }
.st-region-quality.good      { background: rgba(59, 178, 115, .15);  color: #3bb273; }
.st-region-quality.regular   { background: rgba(245, 184, 0, .15);   color: #f5b800; }
.st-region-quality.bad       { background: rgba(251, 146, 60, .15);  color: #fb923c; }
.st-region-quality.terrible  { background: rgba(239, 68, 68, .15);   color: #f87171; }

/* Ping bar visual (animacao de teste em progresso) */
.st-ping-inline {
    display: inline-flex;
    gap: 3px;
    align-items: end;
    height: 14px;
    vertical-align: middle;
}
.st-ping-inline span {
    width: 3px;
    background: #f5b800;
    border-radius: 1px;
    animation: st-ping-pulse 1.2s ease-in-out infinite;
}
.st-ping-inline span:nth-child(1) { height: 30%;  animation-delay: 0s;   }
.st-ping-inline span:nth-child(2) { height: 60%;  animation-delay: .2s;  }
.st-ping-inline span:nth-child(3) { height: 100%; animation-delay: .4s;  }
.st-ping-inline span:nth-child(4) { height: 60%;  animation-delay: .6s;  }
.st-ping-inline span:nth-child(5) { height: 30%;  animation-delay: .8s;  }
@keyframes st-ping-pulse {
    0%, 100% { opacity: .3; }
    50%      { opacity: 1;  }
}

/* Faq / info abaixo */
.st-footer-note {
    margin-top: 40px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}
.st-footer-note a { color: #f5b800; }
.st-footer-note a:hover { color: #fcd34d; }
