:root {
    --bg-color: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(148, 163, 184, 0.1);
    --accent-rust: #ef4444;
    --accent-zomboid: #10b981;
    --accent-arma: #64748b;
    --glow-color: rgba(56, 189, 248, 0.15);
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

.background-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

.container {
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    font-weight: 300;
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.server-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    justify-content: space-between;
}

.server-card.active:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.2);
}

.status-indicator.online {
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.status-indicator.offline {
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.ping {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    margin-right: 0.5rem;
    box-shadow: 0 0 10px currentColor;
    animation: pulse 2s infinite;
}

.player-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.25rem 0.5rem;
    /* Reduced horizontal padding */
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    align-self: flex-start;
    /* Align to start of flex column */
    margin-top: auto;
    /* Push to bottom of available space before icon if flex grows, or just regular margin */
    display: inline-flex;
    align-items: center;
}

.player-count .count {
    color: var(--text-primary);
    font-weight: 700;
    margin-left: 2px;
}

.server-card h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.server-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.server-icon {
    font-size: 3rem;
    margin-top: 2rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.server-card:hover .server-icon {
    transform: scale(1.1);
}

.server-card.inactive {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.6);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.server-card:hover .card-glow {
    opacity: 1;
}

.footer {
    margin-top: 4rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0.6;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 600px;
    width: 100%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-right: 3rem;
}

.modal-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--card-border);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.detail-value {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

.connect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.4);
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(2, 132, 199, 0.5);
    background: linear-gradient(135deg, #7dd3fc 0%, #0369a1 100%);
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .server-grid {
        grid-template-columns: 1fr;
    }
}