:root {
    --bg: #0f1117;
    --card-bg: #1a1d27;
    --card-hover: #232735;
    --border: #2a2e3d;
    --text: #e0e0e0;
    --text-dim: #999;
    --green: #4ade80;
    --red: #f87171;
    --blue: #60a5fa;
    --yellow: #fbbf24;
    --radius: 14px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Full-width container */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 2rem 3rem;
}

header {
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Server stats: grid of large cards */
.server-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}

.stat-card:hover {
    border-color: var(--blue);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.stat-card .stat-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    flex-shrink: 0;
}

.stat-card .stat-label {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.2;
}

.stat-card .stat-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.stat-card .stat-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.stat-card .stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stat-bar-fill.low { background: var(--green); }
.stat-bar-fill.mid { background: var(--yellow); }
.stat-bar-fill.high { background: var(--red); }

/* Summary badges */
.summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 1rem;
    color: var(--text-dim);
}

.summary .badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.summary .badge.up { color: var(--green); border-color: var(--green); }
.summary .badge.down { color: var(--red); border-color: var(--red); }

.group {
    margin-bottom: 2.5rem;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.group-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.group-header .group-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-left: auto;
}

/* Service cards grid: full width, responsive */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    background: var(--card-hover);
    border-color: var(--blue);
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.card .icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
}

.card .info {
    flex: 1;
    min-width: 0;
}

.card .name {
    font-size: 1.15rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.card .desc {
    font-size: 0.9rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card .status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
}

.card .status-dot.up {
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.card .status-dot.down {
    background: var(--red);
    box-shadow: 0 0 10px var(--red);
}

.card .status-dot.checking {
    background: var(--yellow);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.loading-section {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

footer {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

@media (max-width: 700px) {
    .container {
        padding: 1.5rem 1rem;
    }
    .server-stats {
        grid-template-columns: 1fr 1fr;
    }
    .grid {
        grid-template-columns: 1fr;
    }
    header h1 {
        font-size: 1.8rem;
    }
}

@media (min-width: 1600px) {
    .container {
        padding: 2rem 4rem;
    }
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
    .server-stats {
        grid-template-columns: repeat(6, 1fr);
    }
}
