/* =====================================================================
   Test de velocidad — velocímetro y resultados
   Mismo lenguaje visual que Game Boost / Crosshair (paneles azul noche).
   ===================================================================== */
.st-wrap {
  --st-panel: linear-gradient(160deg, rgba(18,18,20,.96) 0%, rgba(13,13,14,.96) 58%, rgba(10,10,11,.96) 100%);
  --st-border: rgba(200,200,205,.13);
  --st-border-soft: rgba(200,200,205,.08);
  --st-text: #f2f2f3; --st-muted: rgba(245,245,247,.78); --st-dim: rgba(245,245,247,.55);
  --st-down: #22d3ee; --st-down-2: #f5f5f5; --st-up: #c084fc; --st-up-2: #f5f5f5; --st-ping: #f5f5f5;
  display: flex; flex-direction: column; gap: 14px; color: var(--st-text);
}
.st-wrap [hidden] { display: none !important; }
.st-free {
  display: inline-flex; align-items: center; background: rgba(52,211,153,.12); color: #34d399;
  border: 1px solid rgba(52,211,153,.35); border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.st-main, .st-card {
  position: relative; background: var(--st-panel); border: 1px solid var(--st-border); border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -28px 60px rgba(0,0,0,.5), 0 18px 44px rgba(0,0,0,.5);
}
.st-main::before, .st-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, transparent, rgba(245,245,245,.32), transparent); pointer-events: none;
}

/* ── Bloque principal ─────────────────────────────────────────────────── */
.st-main { display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); gap: 22px; align-items: center; padding: 12px 22px; overflow: hidden; }
.st-main::after {
  content: ''; position: absolute; width: 520px; height: 520px; left: -140px; top: -200px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(34,211,238,.10), transparent 62%); transition: background .5s ease;
}
.st-main[data-phase="upload"]::after { background: radial-gradient(circle, rgba(192,132,252,.12), transparent 62%); }
@media (max-width: 900px) { .st-main { grid-template-columns: minmax(0, 1fr); justify-items: center; } .st-side { width: 100%; } }

/* Velocímetro */
.st-gauge { position: relative; z-index: 1; width: 100%; max-width: 240px; aspect-ratio: 1; }
.st-gauge-svg { width: 100%; height: 100%; overflow: visible; }
.st-arc-bg { fill: none; stroke: rgba(200,200,205,.12); stroke-width: 16; stroke-linecap: round; }
.st-arc { fill: none; stroke-width: 16; stroke-linecap: round; stroke-dasharray: 0 1000; transition: stroke-dasharray .35s ease-out; }
.st-tick { stroke: rgba(245,245,247,.25); stroke-width: 2; stroke-linecap: round; }
.st-tick-label { fill: rgba(245,245,247,.5); font: 600 13px var(--font); text-anchor: middle; dominant-baseline: middle; }
.st-needle { transform-origin: 150px 150px; transition: transform .35s ease-out; }
.st-needle-body { fill: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,.5)); }
.st-hub { fill: #0d0d0e; stroke: #fff; stroke-width: 3; }
.st-main.is-idle .st-needle, .st-main.is-idle .st-hub { opacity: 0; }
.st-needle, .st-hub { transition: transform .35s ease-out, opacity .3s ease; }

.st-readout {
  position: absolute; left: 0; right: 0; top: 63%; text-align: center; pointer-events: none; transition: opacity .25s ease;
}
.st-main.is-idle .st-readout { opacity: 0; }
.st-phase { font-size: 9.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--st-dim); }
.st-main[data-phase="download"] .st-phase { color: var(--st-down); }
.st-main[data-phase="upload"] .st-phase { color: var(--st-up); }
.st-value { font-size: 32px; font-weight: 800; line-height: 1.05; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.st-unit { font-size: 12px; font-weight: 600; color: var(--st-dim); }

/* Botón INICIAR */
.st-go {
  position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  background: radial-gradient(circle at 50% 35%, rgba(245,245,245,.35), rgba(10,10,11,.95) 70%);
  box-shadow: inset 0 0 0 2px rgba(34,211,238,.7), 0 0 40px rgba(34,211,238,.25), inset 0 0 30px rgba(34,211,238,.15);
  transition: transform .2s var(--ease, ease), box-shadow .2s ease, opacity .25s ease;
}
.st-go:hover { transform: translate(-50%, -50%) scale(1.04); box-shadow: inset 0 0 0 2px #22d3ee, 0 0 60px rgba(34,211,238,.4), inset 0 0 40px rgba(34,211,238,.25); }
.st-go:active { transform: translate(-50%, -50%) scale(.97); }
.st-go:focus-visible { outline: 2px solid #22d3ee; outline-offset: 6px; }
.st-go-txt { font-size: 16px; font-weight: 800; letter-spacing: 2px; text-shadow: 0 0 14px rgba(34,211,238,.7); }
.st-go-ring { position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgba(34,211,238,.45); animation: stRing 2.4s ease-out infinite; }
@keyframes stRing { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.st-main:not(.is-idle) .st-go { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.6); }

/* Métricas */
.st-side { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-metric {
  position: relative; padding: 11px 13px 10px; border-radius: 13px; overflow: hidden;
  background: rgba(0,0,0,.45); border: 1px solid var(--st-border-soft); transition: border-color .25s ease, background .25s ease, transform .25s ease;
  --c: var(--st-down);
}
.st-metric[data-m="ping"] { --c: var(--st-ping); }
.st-metric[data-m="upload"] { --c: var(--st-up); }
.st-metric.is-active { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 7%, rgba(0,0,0,.45)); transform: translateY(-2px); box-shadow: 0 8px 24px color-mix(in srgb, var(--c) 15%, transparent); }
.st-metric-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--st-muted); }
.st-metric-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.st-metric-val { display: flex; align-items: baseline; gap: 5px; margin-top: 6px; }
.st-metric-val b { font-size: 24px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.st-metric.is-done .st-metric-val b, .st-metric.is-active .st-metric-val b { color: #fff; }
.st-metric-val small { font-size: 11.5px; font-weight: 600; color: var(--st-dim); }
.st-metric-sub { font-size: 11.5px; color: var(--st-dim); margin-top: 2px; }
.st-metric-sub b { color: var(--st-muted); font-variant-numeric: tabular-nums; }
.st-metric-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(200,200,205,.08); }
.st-metric-bar i { display: block; height: 100%; width: 0; background: var(--c); box-shadow: 0 0 10px var(--c); transition: width .3s ease; }
@media (max-width: 1100px) { .st-metric-val b { font-size: 20px; } }

.st-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; }
.st-info { flex: 1; min-width: 0; display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 12px; color: var(--st-dim); }
.st-info span { display: inline-flex; align-items: center; gap: 6px; }
.st-info b { color: var(--st-muted); font-weight: 600; }

.st-verdict {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; animation: stIn .35s var(--ease, ease);
  --v: #34d399; background: color-mix(in srgb, var(--v) 8%, transparent); border: 1px solid color-mix(in srgb, var(--v) 30%, transparent);
}
.st-verdict.is-good { --v: #22d3ee; } .st-verdict.is-ok { --v: #f5f5f5; } .st-verdict.is-bad { --v: #ff6b6b; }
.st-verdict-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; color: var(--v); background: color-mix(in srgb, var(--v) 14%, transparent); }
.st-verdict-txt { flex: 1; min-width: 0; }
.st-verdict .st-btn { flex-shrink: 0; }
.st-verdict-k { font-size: 13px; font-weight: 600; }
.st-verdict-k b { color: var(--v); }
.st-verdict-d { font-size: 12px; color: var(--st-muted); margin-top: 2px; }
@keyframes stIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.st-actions { display: flex; gap: 8px; justify-content: flex-end; margin-left: auto; }
.st-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  padding: 8px 14px; border-radius: 9px; font: 650 12.5px var(--font); color: var(--st-text);
  background: rgba(200,200,205,.08); border: 1px solid var(--st-border); transition: all .15s ease;
}
.st-btn:hover { border-color: rgba(245,245,245,.4); background: rgba(245,245,245,.12); }
.st-btn-primary { background: linear-gradient(135deg, #22d3ee, #f5f5f5); border-color: transparent; color: #0f0f0f; box-shadow: 0 4px 16px rgba(34,211,238,.3); }
.st-btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, #22d3ee, #f5f5f5); }
.st-btn-ghost { background: none; color: var(--st-muted); padding: 6px 10px; }

/* ── Historial ────────────────────────────────────────────────────────── */
.st-card { padding: 16px; }
.st-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.st-card-title { font-size: 14px; font-weight: 700; }
.st-card-sub { font-size: 12px; color: var(--st-dim); margin-top: 2px; }
.st-empty { font-size: 12.5px; color: var(--st-dim); padding: 16px; text-align: center; border: 1px dashed var(--st-border); border-radius: 12px; }
.st-table { display: flex; flex-direction: column; }
.st-tr { position: relative; isolation: isolate; display: grid; grid-template-columns: 1.2fr 1.3fr 1fr .8fr .8fr 1.2fr; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; font-size: 12.5px; }
.st-tr:not(.st-th):nth-child(even) { background: rgba(200,200,205,.04); }
.st-th { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--st-dim); }
.st-num { font-weight: 700; font-variant-numeric: tabular-nums; position: relative; }
.st-num small { font-weight: 600; color: var(--st-dim); font-size: 10.5px; }
.st-c-down { color: var(--st-down); } .st-c-up { color: var(--st-up); }
.st-c-down i { position: absolute; left: -6px; top: 50%; height: 22px; width: var(--w); transform: translateY(-50%); border-radius: 6px; background: linear-gradient(90deg, rgba(34,211,238,.14), transparent); z-index: -1; }
.st-dim { color: var(--st-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .st-tr { grid-template-columns: 1fr 1fr 1fr .8fr; } .st-tr > :nth-child(5), .st-tr > :nth-child(6) { display: none; } }

/* ── Monitor de ping en vivo ──────────────────────────────────────────── */
.st-mon-body { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 14px; align-items: stretch; }
@media (max-width: 760px) { .st-mon-body { grid-template-columns: minmax(0, 1fr); } }
.st-mon-chart { position: relative; height: 130px; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.5); border: 1px solid var(--st-border-soft); }
.st-mon-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-mon-line { fill: none; stroke: var(--st-ping); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(245,245,245,.5)); }
.st-mon-gridline { stroke: rgba(200,200,205,.10); stroke-width: 1; vector-effect: non-scaling-stroke; }
.st-mon-gridtxt { fill: rgba(245,245,247,.35); font: 600 9px var(--font); }
.st-mon-lossline { stroke: rgba(255,82,82,.55); stroke-width: 3; vector-effect: non-scaling-stroke; }
.st-mon-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; color: var(--st-dim); }
.st-mon-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; }
.st-mon-stat { padding: 7px 9px; border-radius: 9px; background: rgba(0,0,0,.45); border: 1px solid var(--st-border-soft); }
.st-mon-stat:last-child { grid-column: 1 / -1; }
.st-mon-stat span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--st-dim); }
.st-mon-stat b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.st-mon-stat small { font-size: 10.5px; color: var(--st-dim); margin-left: 3px; }
.st-mon:not(.is-off) .st-mon-stat b[data-mon="now"] { color: var(--st-ping); }
.st-mon-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 9px 12px; border-radius: 10px;
  font-size: 12.5px; color: var(--st-muted); background: rgba(255,107,107,.07); border: 1px solid rgba(255,107,107,.28); animation: stIn .3s ease;
}

@media (prefers-reduced-motion: reduce) { .st-go-ring { animation: none; } }

/* ── DNS (comparativa y cambio) ── */
.dnx-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.dnx-row { display: grid; grid-template-columns: 22px minmax(0, 1.2fr) minmax(0, 2fr) 92px 70px; align-items: center; gap: 16px; padding: 11px 10px; border-radius: 10px; }
.dnx-row:hover { background: rgba(255,255,255,.03); }
.dnx-rank { font-size: 12px; color: rgba(245,245,247,.35); font-variant-numeric: tabular-nums; text-align: center; }
.dnx-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.dnx-name b { font-size: 13.5px; font-weight: 600; }
.dnx-name small { flex-basis: 100%; font-size: 11.5px; color: rgba(245,245,247,.45); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dnx-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: #f5f5f5; color: #0a0a0a; }
.dnx-tag.is-cur { background: transparent; color: rgba(245,245,247,.7); border: 1px solid rgba(255,255,255,.18); }
.dnx-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.dnx-bar i { display: block; height: 100%; border-radius: 3px; background: rgba(245,245,247,.35); transition: width .5s ease; }
.dnx-row.is-best .dnx-bar i { background: #f5f5f5; }
.dnx-ms { text-align: right; font-size: 12px; color: rgba(245,245,247,.55); font-variant-numeric: tabular-nums; line-height: 1.2; }
.dnx-ms b { font-size: 16px; color: #f5f5f5; font-weight: 700; }
.dnx-ms small { display: block; font-size: 10.5px; color: rgba(245,245,247,.35); }
.dnx-fail { font-size: 12px; color: rgba(245,245,247,.4); }
.dnx-act { text-align: right; }
.dnx-use { padding: 6px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: transparent; color: #f5f5f5; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.dnx-use:hover { border-color: rgba(255,255,255,.32); }
.dnx-row.is-best .dnx-use { background: #f5f5f5; color: #0a0a0a; border-color: transparent; }
.dnx-use:disabled { opacity: .5; cursor: default; }
.dnx-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11.5px; color: rgba(245,245,247,.4); }
@media (max-width: 900px) { .dnx-row { grid-template-columns: 18px minmax(0, 1fr) 80px 64px; } .dnx-bar { display: none; } }
.dnx .st-btn:disabled { opacity: .55; cursor: default; }
