/**
 * Hytale Server List - Gaming UI Theme
 * Modern game launcher aesthetic with controlled minimalism
 */

/* === CSS RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === PERFORMANCE: CLS Prevention === */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Reserve space for lazy-loaded content */
.server-banner-img {
    content-visibility: auto;
}

/* GPU-accelerated animations only */
.gpu-accelerated {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* === CSS VARIABLES - GAMING PALETTE === */
:root {
    /* Background gradient */
    --bg-dark: #0a0f14;
    --bg-primary: #0d1117;
    --bg-secondary: #151b23;
    --bg-card: #1a222c;
    --bg-card-hover: #1f2937;
    --bg-elevated: #242d3a;
    
    /* Accent - Cyan/Teal (Primary) */
    --accent: #00d4aa;
    --accent-light: #00ffc8;
    --accent-dark: #00a88a;
    --accent-glow: rgba(0, 212, 170, 0.15);
    --accent-glow-strong: rgba(0, 212, 170, 0.3);
    
    /* Text - WCAG AA Compliant Contrast */
    --text: #e6edf3;
    --text-secondary: #a1aab4; /* Improved from #8b949e for better contrast */
    --text-muted: #8b949e; /* Improved from #6e7681 */
    --text-dim: #6e7681;
    
    /* Borders & Lines */
    --border: #30363d;
    --border-light: #3d444d;
    --border-accent: var(--accent);
    --glow-line: rgba(0, 212, 170, 0.5);
    
    /* Status Colors */
    --success: #3fb950;
    --warning: #d29922;
    --error: #f85149;
    --info: #58a6ff;
    
    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
    
    /* Radius */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Rajdhani', 'Orbitron', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* === GLOBAL STYLES === */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); }

p { color: var(--text-secondary); max-width: 65ch; }

a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover { 
    color: var(--accent-light); 
    text-decoration-color: var(--accent-light);
}

/* Navigation and button links - no underline */
.nav-link,
.btn,
.logo,
.server-name,
.footer-links a,
.nav-menu a,
.server-banner-link {
    text-decoration: none;
}

small { font-size: 0.8125rem; color: var(--text-muted); }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-elevated);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

/* === LAYOUT === */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .container { padding: 0 1.5rem; }
}

.main {
    min-height: calc(100vh - 64px - 200px);
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

/* === HEADER === */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glow-line), transparent);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.logo:hover { color: var(--accent); }

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--radius);
    font-size: 1.25rem;
    box-shadow: 0 0 12px var(--accent-glow);
}

.nav-menu {
    display: none;
}

/* Desktop menu - inside header - CLS fix */
.nav-menu-desktop {
    visibility: hidden;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 769px) {
    .nav-menu-desktop {
        visibility: visible;
        position: static;
        opacity: 1;
        pointer-events: auto;
        display: flex;
        flex-direction: row;
        background: none;
        padding: 0;
        align-items: center;
        gap: 1.5rem;
    }
}

/* Mobile menu - outside header, full overlay */
.nav-menu-mobile {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    padding: 1.5rem;
    gap: 1.5rem;
    z-index: 9999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-menu-mobile.active { 
    display: flex;
}

@media (min-width: 769px) {
    .nav-menu-mobile {
        display: none !important;
    }
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-menu-desktop .nav-links {
    flex-direction: row;
    gap: 0.25rem;
}

.nav-menu-mobile .nav-links {
    flex-direction: column;
    gap: 0.5rem;
}

.nav-menu-mobile .nav-links a {
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    border-radius: var(--radius);
    background: var(--bg-card);
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg-card);
}

.nav-links a.active { color: var(--accent); }

.nav-auth {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-menu-desktop .nav-auth {
    flex-direction: row;
    margin-left: 1rem;
}

.nav-menu-mobile .nav-auth {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.nav-menu-mobile .nav-auth .btn {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.25rem;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    z-index: 1001;
    transition: var(--transition);
    position: relative;
}

.mobile-menu-btn:hover { border-color: var(--accent); }

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (min-width: 768px) {
    .mobile-menu-btn { display: none; }
}

/* Mobile menu backdrop */
.nav-menu-mobile::before {
    content: '';
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

@media (min-width: 768px) {
    .nav-menu-mobile::before {
        display: none;
    }
}

/* Body scroll lock when menu is open */
body.menu-open {
    overflow: hidden;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.1), transparent);
    transition: height var(--transition);
}

.btn:hover::before { height: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-dark);
    border-color: var(--accent);
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--accent-glow-strong);
    transform: translateY(-1px);
    color: var(--bg-dark);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text);
}

.btn-discord {
    background: #5865F2;
    color: white;
    border-color: #5865F2;
}

.btn-discord:hover {
    background: #4752C4;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
    color: white;
}

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* === HERO SECTION === */
.hero {
    text-align: center;
    padding: 3rem 1rem 4rem;
    position: relative;
    min-height: 300px; /* CLS prevention - match critical CSS */
    contain: layout style paint;
    overflow: hidden;
}

/* Decorative glow - GPU accelerated, no layout impact */
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    will-change: opacity;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 10px var(--accent-glow);
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-definition {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    min-height: 64px; /* CLS prevention */
}

.hero-stat { text-align: center; }

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* === SERVER LIST === */
.servers-section { 
    margin-top: 2rem;
    min-height: 200px;
    contain: layout style;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    min-height: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title h2 { font-size: 1.25rem; }

.section-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

select, input[type="text"], input[type="search"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    min-height: 40px;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Server List */
.servers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.server-row {
    display: grid;
    grid-template-columns: 48px auto 1fr auto;
    grid-template-rows: auto;
    grid-template-areas: "rank banner info votes";
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    min-height: 82px;
}

.server-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    opacity: 0;
}

.server-row:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.server-row:hover::before { opacity: 1; }

.server-rank {
    grid-area: rank;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    min-width: 48px;
}

.server-row:nth-child(1) .server-rank { color: #ffd700; }
.server-row:nth-child(2) .server-rank { color: #c0c0c0; }
.server-row:nth-child(3) .server-rank { color: #cd7f32; }

.server-banner-link {
    grid-area: banner;
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
}

.server-banner-img {
    display: block;
    width: 100%;
    max-width: 468px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--bg-secondary);
}

.server-info {
    grid-area: info;
    flex: 1;
    min-width: 0;
    min-height: 44px;
}

.server-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
    min-height: 24px;
}

.server-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.server-name:hover { color: var(--accent); }

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--accent);
    color: var(--bg-dark);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.status-badge.status-dev { color: var(--warning); background: rgba(210, 153, 34, 0.15); }
.status-badge.status-alpha { color: var(--info); background: rgba(88, 166, 255, 0.15); }
.status-badge.status-ready { color: var(--success); background: rgba(63, 185, 80, 0.15); }
.status-badge.status-planned { color: var(--text-muted); }
.status-badge.status-recruiting { color: #a855f7; background: rgba(168, 85, 247, 0.15); }

.server-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    min-height: 20px;
}

.meta-sep { opacity: 0.3; }

/* Server types tags */
.server-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.type-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    padding: 0.1875rem 0.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 9999px;
    color: var(--text-secondary);
}

/* Votes and Vote button - combined area */
.server-votes {
    grid-area: votes;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 0.5rem;
}

.server-votes-inner {
    text-align: center;
}

.votes-count {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.votes-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.server-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Mobile layout */
@media (max-width: 768px) {
    .server-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "banner"
            "info"
            "votes";
        gap: 0.75rem;
        padding: 1rem;
        min-height: auto;
    }
    
    .server-rank {
        display: none;
    }
    
    .server-banner-link { 
        width: 100%;
    }
    
    .server-banner-img {
        max-width: 100%;
        height: auto;
        aspect-ratio: 468/60;
    }
    
    .server-info {
        width: 100%;
        min-height: auto;
    }
    
    .server-title-row {
        flex-wrap: wrap;
        min-height: auto;
    }
    
    .server-name {
        font-size: 1rem;
    }
    
    .server-meta {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
        min-height: auto;
    }
    
    /* Votes row - horizontal on mobile */
    .server-votes {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.75rem;
        background: var(--bg-elevated);
        border-radius: var(--radius);
        gap: 1rem;
    }
    
    .server-votes-inner {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .votes-count {
        font-size: 1.25rem;
    }
    
    .votes-label {
        font-size: 0.75rem;
    }
    
    .server-actions {
        flex-direction: row;
    }
    
    .server-actions .btn {
        padding: 0.5rem 1.25rem;
    }
}

/* === PAGINATION === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-numbers { display: flex; gap: 0.25rem; }

.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.page-num:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-num.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-dark);
    font-weight: 600;
}

.page-dots { color: var(--text-muted); padding: 0 0.25rem; }

/* === FACT BLOCKS === */
.fact-block {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.fact-card {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--accent);
}

.fact-card h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.fact-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === CTA SECTION === */
.cta-section {
    text-align: center;
    padding: 3rem 1.5rem;
    margin: 3rem 0;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.cta-content h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.cta-content p { margin: 0 auto 1.5rem; max-width: 500px; }

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.cta-note { font-size: 0.8125rem; color: var(--text-muted); }

/* === FOOTER === */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glow-line), transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.25rem 0;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--accent);
    padding-left: 0.25rem;
}

.footer-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.footer-disclaimer { font-size: 0.75rem; color: var(--text-muted); }

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 auto;
}

/* === SEO FOOTER === */
.seo-footer {
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-top: 2rem;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.seo-block h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.seo-block p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === FORMS === */
.form-page { max-width: 800px; margin: 0 auto; }

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h2 { font-size: 1.125rem; margin-bottom: 0.5rem; }

.section-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Game Types Grid */
.game-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.type-checkbox { cursor: pointer; }
.type-checkbox input { display: none; }

.type-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    transition: var(--transition);
}

.type-checkbox:hover .type-badge { border-color: var(--type-color, var(--accent)); }

.type-checkbox input:checked + .type-badge {
    background: var(--type-color, var(--accent));
    border-color: var(--type-color, var(--accent));
    color: white;
}

.type-icon { font-size: 1rem; }

.selected-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 2.5rem;
}

.selected-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: var(--accent);
}

.types-counter {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.types-counter.limit-reached { color: var(--warning); }

/* === AUTH PAGES === */
body.auth-page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.auth-page-wrapper .main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container { width: 100%; max-width: 480px; }

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    border-radius: 0 0 3px 3px;
}

.auth-icon { font-size: 3rem; margin-bottom: 1rem; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--text-secondary); margin-bottom: 2rem; }

.auth-notice {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    text-align: left;
    padding: 1rem;
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid rgba(210, 153, 34, 0.25);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.notice-icon { font-size: 1.25rem; flex-shrink: 0; }
.notice-content strong { display: block; color: var(--warning); margin-bottom: 0.25rem; }
.notice-content p { font-size: 0.8125rem; margin: 0; color: var(--text-secondary); }

.auth-help {
    text-align: left;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.auth-help h3 { font-size: 0.875rem; margin-bottom: 0.75rem; }
.auth-help ol { margin: 0; padding-left: 1.25rem; font-size: 0.8125rem; color: var(--text-secondary); }
.auth-help li { margin-bottom: 0.5rem; line-height: 1.5; }
.auth-help code { font-size: 0.75rem; word-break: break-all; }

/* === DASHBOARD === */
.dashboard { max-width: 1000px; margin: 0 auto; }

.dashboard-header { margin-bottom: 1.5rem; }
.dashboard-header h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.dashboard-header p { color: var(--text-secondary); }

.dashboard-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.dashboard-nav a {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.dashboard-nav a:hover { border-color: var(--accent); color: var(--accent); }

.dashboard-nav a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-dark);
}

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: var(--transition);
}

.server-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.server-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--bg-secondary);
}

.card-title h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.card-meta { font-size: 0.8125rem; color: var(--text-muted); }
.card-actions { display: flex; gap: 0.5rem; }

/* === VOTE PAGE === */
.vote-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}

.vote-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    max-width: 450px;
    width: 100%;
}

.vote-card h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.vote-card h2 { font-size: 1.25rem; margin: 1rem 0; }
.vote-card p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.success-icon, .cooldown-icon { font-size: 4rem; margin-bottom: 1rem; }

.cooldown-timer {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 1rem 0 1.5rem;
}

/* === ALERTS === */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.alert-success {
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.25);
    color: var(--success);
}

.alert-error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.25);
    color: var(--error);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

.alert-close:hover { opacity: 1; }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.empty-state p { margin: 0 auto 1.5rem; max-width: 400px; }

/* === ERROR PAGE === */
.error-page { text-align: center; padding: 4rem 2rem; }
.error-page h1 { font-family: var(--font-display); font-size: 6rem; color: var(--accent); margin-bottom: 1rem; }
.error-page p { font-size: 1.25rem; margin: 0 auto 2rem; }

/* === CONTENT PAGES === */
.content-page { max-width: 800px; margin: 0 auto; }

.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 { margin-bottom: 0.5rem; }
.content-section { margin-bottom: 2rem; }

.content-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.content-section ul, .content-section ol {
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.content-section li { margin-bottom: 0.5rem; line-height: 1.6; }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
    color: var(--accent);
}

.faq-item summary:hover { background: var(--bg-card-hover); }

.faq-content {
    padding: 0 1.25rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* === SERVER DETAIL === */
.server-detail { max-width: 900px; margin: 0 auto; }

.server-hero {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
}

.server-hero-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.server-logo-large {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--bg-secondary);
}

.server-hero-info { flex: 1; min-width: 250px; }
.server-hero-info h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }

.server-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 1rem;
}

/* === ADMIN === */
.admin-page { max-width: 1200px; margin: 0 auto; }

.admin-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.admin-nav a {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.admin-nav a:hover, .admin-nav a.active {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-card-hover); }

/* === UTILITIES === */
@media (max-width: 767px) { .hide-mobile { display: none !important; } }
@media (min-width: 768px) { .hide-desktop { display: none !important; } }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Selection */
::selection { background: var(--accent); color: var(--bg-dark); }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Print */
@media print {
    .header, .footer, .nav-auth, .btn { display: none !important; }
    body { background: white; color: black; }
}

/* === SEARCH SECTION === */
.search-section {
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    overflow: hidden;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    color: var(--text);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    box-shadow: none;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border: none;
    color: var(--bg-dark);
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--accent-light);
}

.filters-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--border-light);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
}

.clear-filters {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.clear-filters:hover {
    border-color: var(--error);
    color: var(--error);
}

@media (max-width: 767px) {
    .filter-select {
        flex: 1 1 calc(50% - 0.5rem);
        max-width: none;
    }
    
    .search-btn {
        width: 56px;
    }
}

/* === ACCESSIBILITY === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible styles */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Improved contrast for links */
a {
    color: var(--accent-light);
}

a:hover {
    color: var(--accent);
}

/* Better text contrast */
.text-muted,
.meta-sep,
.footer-desc,
.section-meta {
    color: #9ca3af; /* Improved from #6e7681 for WCAG AA */
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: #555;
        --text-secondary: #ccc;
        --text-muted: #aaa;
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .nav,
    .btn,
    .search-section {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .server-row {
        page-break-inside: avoid;
    }
}

/* === ANNOUNCEMENT BANNER (Early Access 2026) === */
.announcement-banner {
    background: linear-gradient(90deg, rgba(0, 212, 170, 0.15) 0%, rgba(88, 166, 255, 0.15) 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 0 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    height: 52px; /* Fixed height for CLS prevention */
    contain: strict;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.25);
}

.announcement-banner .announcement-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.announcement-banner strong {
    color: var(--accent-light);
}

/* Removed pulse-glow animation - causes unnecessary repaints */

@media (max-width: 640px) {
    .announcement-banner {
        height: auto;
        min-height: 52px;
        flex-wrap: wrap;
        text-align: center;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

/* AI SEO Data Attributes - Hidden from users, visible to crawlers */
[data-ai-fact] {
    /* Semantic markers for AI systems */
}

[data-ai-anchor] {
    /* Attention anchors for embeddings */
}

/* Visually hidden but accessible */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
