:root{
    --primary:#8b0f24;
    --primary-dark:#6e0c1c;
    --bg:#121212;
    --surface:#1e1e1e;
    --surface-2:#232323;
    --text:#ffffff;
    --muted:#aaaaaa;
    --success:#28c76f;
    --error:#ea5455;
    --shadow:0 10px 30px rgba(0,0,0,.55);
}

*{ box-sizing:border-box; }

/* Sticky footer layout */
html, body{ height:100%; }

body{
    margin:0;
    font-family:'Roboto',sans-serif;
    background:var(--bg);
    color:var(--text);

    min-height:100vh;
    display:flex;
    flex-direction:column;
}

/* ===== Topbar (logo left, menu centered) ===== */
.topbar{
    position: sticky;
    top: 0;
    z-index: 100;

    width: 100%;
    background: var(--primary);
    box-shadow: 0 4px 18px rgba(0,0,0,.45);
}

/* IMPORTANT: the layout must be on .topbar-inner (your HTML wrapper) */
.topbar-inner{
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 22px;

    display: grid;
    grid-template-columns: 1fr auto 1fr; /* left / center / right spacer */
    align-items: center;
    gap: 16px;
}

.brand{
    grid-column: 1;
    justify-self: start;

    display:flex;
    align-items:center;
    text-decoration:none;

    background:transparent !important;
    border:0 !important;
    padding:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
}

.brand img{
    height:42px;
    width:auto;
    display:block;
}

/* Menu */
.nav-right{
    grid-column: 2;
    justify-self: center;

    display:flex;
    align-items:center;
    gap:10px;
}

.nav-right a{
    display:inline-flex;
    align-items:center;
    gap:8px;

    padding:10px 12px;
    border-radius:10px;

    color:#fff;
    text-decoration:none;
    font-weight:600;
    font-size:13px;

    opacity:.95;
    transition: background .15s ease, opacity .15s ease, transform .05s ease;
}

.nav-right a:hover{
    opacity:1;
    background: rgba(255,255,255,.12);
}

.nav-right a:active{
    transform: translateY(1px);
}

.nav-right a.active{
    opacity:1;
    background: rgba(0,0,0,.18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.nav-right a .mi{
    width:18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

/* Mobile */
@media (max-width: 768px){
    .topbar-inner{
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        justify-items: start;
    }

    .brand{ grid-column: 1; }
    .nav-right{
        grid-column: 1;
        justify-self: start;
        width: 100%;
        flex-wrap: wrap;
    }
}


/* Main container */
.container{
    padding:34px 22px 60px;
    flex:1; /* pushes footer down */
}

/* Titles */
.page-title{
    margin:10px auto 22px;
    font-size:28px;
    font-weight:700;
    text-align:center;
}

.subtitle{
    margin:0 auto 28px;
    text-align:center;
    color:var(--muted);
    max-width:900px;
    line-height:1.45;
}

/* Cards grid */
.cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
    gap:26px;
    max-width:1200px;
    margin:0 auto;
}

.card{
    background:var(--surface);
    border-radius:14px;
    box-shadow:var(--shadow);
    overflow:hidden;
    display:flex;
    flex-direction:column;
    transform:translateZ(0);
}

.card:hover{
    box-shadow:0 14px 38px rgba(0,0,0,.65);
}

.card-image{
    height:170px;
    background-size:cover;
    background-position:center;
    position:relative;
}

.card-image::after{
    content:'';
    position:absolute;
    inset:0;
    background:linear-gradient(to bottom, rgba(0,0,0,.05), rgba(0,0,0,.60));
}

.card-body{
    padding:18px 18px 0;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.card-title{
    margin:0;
    font-size:18px;
    font-weight:700;
}

.card-desc{
    margin:0;
    color:var(--muted);
    font-size:13px;
    line-height:1.45;
    min-height:36px;
}

/* Buttons */
.card-actions{
    display:flex;
    gap:10px;
    padding:16px 18px 18px;
    margin-top:auto;
}

.card-actions .btn{
    height:44px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
}

.btn{
    flex:1;
    display:inline-flex;
    justify-content:center;
    align-items:center;
    gap:8px;
    padding:12px 12px;
    border-radius:10px;
    text-decoration:none;
    font-weight:700;
    font-size:13px;
    cursor:pointer;
    user-select:none;
    border:1px solid transparent;
}

.btn.primary{
    background:var(--primary);
    color:#fff;
}

.btn.primary:hover{
    background:var(--primary-dark);
}

.btn.ghost{
    background:transparent;
    color:#fff;
    border-color:#2f2f2f;
}

.btn.ghost:hover{
    background:var(--surface-2);
}

/* Material Icons helper */
.mi{
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    vertical-align: middle;
    user-select: none;
    opacity: .9;
}

.mi.small{ font-size: 16px; opacity: .85; }
.mi.tiny{ font-size: 14px; opacity: .8; }

.btn .mi{ font-size: 18px; }

/* ===== Meta line (Online / Players / Ping) ===== */
.meta-line{
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
    margin:12px 18px 0;
}

.meta-pill{
    display:inline-flex;
    align-items:center;
    gap:6px;
    white-space:nowrap;
    font-size:12px;
    color:#aaa;
}

.meta-pill strong{
    font-weight:700;
    letter-spacing:.2px;
}

.meta-pill .mi{
    width:16px;
    height:16px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:16px;
    opacity:.95;
}

/* Online / Offline colors */
.meta-pill.is-online .material-icons,
.meta-pill.is-online strong{
    color: var(--success);
}

.meta-pill.is-offline .material-icons,
.meta-pill.is-offline strong{
    color: var(--error);
}

/* Ping colors */
.ping-good{ color: var(--success); font-weight:700; }
.ping-ok{ color: #f0b429; font-weight:700; }
.ping-bad{ color: var(--error); font-weight:700; }
.ping-na{ color: #888; font-weight:700; }

/* Footer (sticky bottom when page is short) */
.footer{
    margin-top:auto;
    padding:30px 18px;
    background:#0f0f0f;
    border-top:1px solid #222;
    color:#aaa;
    font-size:13px;
    text-align:center;
}

.footer-text p{ margin:6px 0; }

.footer-socials{ margin-top:16px; }

.footer-socials a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:36px;
    height:36px;
    margin:0 8px;
    background:#1e1e1e;
    color:#ccc;
    border-radius:10px;
    font-size:14px;
    text-decoration:none;
    transition:.2s;
}

.footer-socials a:hover{
    background:#2a2a2a;
    color:#fff;
}

/* ===== Card "More details" toggle ===== */
.card-more{
    padding:0 18px 18px;
    display:flex;
    justify-content:flex-end;
}

.details-btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-radius:10px;
    border:1px solid #2f2f2f;
    background:transparent;
    color:#fff;
    font-weight:600;
    font-size:12px;
    cursor:pointer;
    opacity:.95;
    transition:.15s ease;
}

.details-btn:hover{
    opacity:1;
    background:rgba(255,255,255,.06);
}

.card-details{
    overflow:hidden;
    max-height:0;
    transition:max-height .25s ease;
}

.card-details.open{
    max-height:520px;
}

.card-details-inner{
    padding:0 18px 18px;
    color:#aaa;
    font-size:12px;
}

.details-title{
    display:flex;
    align-items:center;
    gap:8px;
    color:#fff;
    font-weight:700;
    margin-top:6px;
}

.mods-list{
    margin:10px 0 0;
    padding-left:18px;
}

.mods-list li{ margin:6px 0; }

.mods-empty{
    margin-top:10px;
    color:#888;
}

