﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0c10;
    --surface: #111318;
    --card: #161921;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.14);
    --text: #e8eaf0;
    --muted: #6b7280;
    --dim: #3d4350;
    --blue: #3b8df5;
    --blue-g: #5ba3ff;
    --green: #22c97a;
    --amber: #f5a623;
    --red: #f05252;
    --mono: 'Space Mono', monospace;
    --sans: 'Sora', sans-serif;
}

html, body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
}

    /* ── GRID BACKGROUND ── */
    body::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 0;
        background-image: linear-gradient(rgba(59,141,245,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(59,141,245,0.03) 1px, transparent 1px);
        background-size: 40px 40px;
        pointer-events: none;
    }

/* ── GLOW ORBS ── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(59,141,245,0.08);
    top: -200px;
    left: -150px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(34,201,122,0.05);
    bottom: -100px;
    right: -100px;
}

.wrapper {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

/* ── HEADER ── */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 10px var(--blue);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%,100% {
        opacity: 1
    }

    50% {
        opacity: 0.3
    }
}

h1 {
    font-size: clamp(28px, 5vw, 46px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 10px;
}

    h1 span {
        color: var(--blue);
    }

.subtitle {
    font-size: 14px;
    color: var(--muted);
    font-weight: 300;
    letter-spacing: 0.01em;
}

/* ── START BUTTON ── */
.btn-wrap {
    display: flex;
    justify-content: center;
    margin: 2.5rem 0 2rem;
}

.start-btn {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.btn-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--border2);
    transition: border-color 0.3s;
}

.btn-ring-2 {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid rgba(59,141,245,0.15);
}

.btn-ring-3 {
    position: absolute;
    inset: -22px;
    border-radius: 50%;
    border: 1px solid rgba(59,141,245,0.06);
}

.btn-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,141,245,0.12) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.start-btn:hover .btn-glow {
    opacity: 1;
}

.start-btn:hover .btn-ring {
    border-color: rgba(59,141,245,0.5);
}

.start-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-icon {
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 1;
}

    .btn-icon svg {
        width: 100%;
        height: 100%;
    }

.btn-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
    position: relative;
    z-index: 1;
    font-weight: 700;
}

/* Pulse animation when testing */
.start-btn.testing .btn-ring-2 {
    animation: ripple 1.6s infinite;
}

.start-btn.testing .btn-ring-3 {
    animation: ripple 1.6s 0.5s infinite;
}

@keyframes ripple {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* ── SERVER CARDS ── */
.servers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 560px) {
    .servers {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: border-color 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}

    .card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    }

    .card.active {
        border-color: rgba(59,141,245,0.4);
        box-shadow: 0 0 30px rgba(59,141,245,0.08), inset 0 0 30px rgba(59,141,245,0.03);
    }

    .card.done {
        border-color: rgba(34,201,122,0.3);
        box-shadow: 0 0 20px rgba(34,201,122,0.05);
    }

    .card.error {
        border-color: rgba(240,82,82,0.3);
    }

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.flag {
    font-size: 26px;
    line-height: 1;
}

.card-meta {
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.card-region {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    letter-spacing: 0.05em;
}

/* Speed display */
.speed-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}

.speed-num {
    font-family: var(--mono);
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    transition: color 0.3s;
    letter-spacing: -0.03em;
}

.card.active .speed-num {
    color: var(--blue-g);
}

.card.done .speed-num {
    color: var(--green);
}

.card.error .speed-num {
    color: var(--red);
    font-size: 20px;
}

.speed-unit {
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
}

/* Progress bar */
.progress-track {
    height: 3px;
    background: rgba(255,255,255,0.05);
    border-radius: 99px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--blue), var(--blue-g));
    transition: width 0.12s linear;
}

.card.done .progress-fill {
    background: linear-gradient(90deg, #16a85e, var(--green));
}

.card.error .progress-fill {
    background: var(--red);
    width: 100% !important;
}

/* Stats row */
.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.latency {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

    .latency span {
        color: var(--amber);
    }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 99px;
}

.badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.badge-wait {
    background: rgba(255,255,255,0.04);
    color: var(--dim);
}

    .badge-wait .badge-dot {
        background: var(--dim);
    }

.badge-test {
    background: rgba(59,141,245,0.1);
    color: var(--blue-g);
}

    .badge-test .badge-dot {
        background: var(--blue);
        animation: blink 0.8s infinite;
    }

.badge-done {
    background: rgba(34,201,122,0.1);
    color: var(--green);
}

    .badge-done .badge-dot {
        background: var(--green);
    }

.badge-err {
    background: rgba(240,82,82,0.1);
    color: var(--red);
}

    .badge-err .badge-dot {
        background: var(--red);
    }

/* ── SUMMARY ── */
.summary {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    display: none;
    animation: fadeIn 0.4s ease;
}

    .summary.show {
        display: block;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.summary-title {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.sum-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.sum-label {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.sum-val {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.sum-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

/* ── LOG ── */
.log-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.log-dot-1 {
    background: #f05252;
}

.log-dot-2 {
    background: #f5a623;
}

.log-dot-3 {
    background: #22c97a;
}

.log-title {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    margin-left: 4px;
    letter-spacing: 0.08em;
}

.log-body {
    padding: 12px 16px;
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.9;
    max-height: 160px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--dim) transparent;
}

.log-line {
    display: block;
}

.log-time {
    color: var(--dim);
}

.log-info {
    color: var(--blue-g);
}

.log-ok {
    color: var(--green);
}

.log-warn {
    color: var(--amber);
}

.log-err {
    color: var(--red);
}

/* ── FOOTER ── */
footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 12px;
    color: var(--dim);
    font-family: var(--mono);
}
