*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f2f2f0;
    color: #1a1a1a;
    min-height: 100vh;
}

.container {
    max-width: 540px;
    margin: 0 auto;
    padding: 4rem 1.25rem 3rem;
}

h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #111;
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Loading */

.loading {
    font-size: 0.95rem;
    color: #aaa;
    text-align: center;
    margin-top: 3rem;
}

/* Results list */

.results {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    counter-reset: rank;
    animation: fade-in 0.25s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    counter-increment: rank;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: #fff;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s, transform 0.2s;
    will-change: transform;
}

.result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

/* Rank number */

.result-item::before {
    content: counter(rank);
    font-size: 0.75rem;
    font-weight: 600;
    color: #ccc;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

/* Logo */

.result-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.result-item img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Name + progress */

.result-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.result-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.result-progress {
    font-size: 0.7rem;
    color: #c0c0c0;
    line-height: 1;
}

/* Latency badge */

.result-badge {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    transition: background 0.3s, color 0.3s;
    background: #f0f0ee;
    color: #aaa;
}

.result-badge[data-status="up"] {
    background: #eaf6ef;
    color: #2d8a55;
}

.result-badge[data-status="down"] {
    background: #fdf0f0;
    color: #c03535;
}

.result-item.winner {
    background: #f0faf4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(45, 138, 85, 0.2);
    transition: background 0.6s ease, box-shadow 0.6s ease, transform 0.2s;
}
