:root {
    color-scheme: dark;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #f4f0f8;
    background: #15121b;
    --surface: #211b2b;
    --border: #3a3045;
    --muted: #c6bdcf;
    --accent: #e0c4ff;
    --radius: 0.9rem;
    line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.24em; }
a:hover { color: #fff; }
button { font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
    outline: 2px solid #e4caff;
    outline-offset: 4px;
}

:where(section, details, .game-panel)[id] { scroll-margin-top: 1.25rem; }

.layout {
    width: min(74rem, calc(100% - 3rem));
    margin-inline: auto;
}

.skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus {
    position: absolute;
    z-index: 1;
    inset: 0.65rem auto auto 0.65rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border-radius: 0.4rem;
}

.site-header {
    background: #191420;
    border-bottom: 1px solid #332840;
}

.header-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1.5rem;
    min-height: 4.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 750;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #68498a;
    border-radius: 0.65rem;
    background: #3c2753;
    color: var(--accent);
    font-size: 0.9rem;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.4rem 0.65rem;
    border-radius: 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.main-nav .stats-link { color: var(--accent); }
.main-nav a:hover { background: #33273f; color: #fff; }

.hero {
    border-bottom: 1px solid #40304e;
    background:
        linear-gradient(90deg, #1c1427 0%, #21142de8 31%, #21142d59 77%, #1c142762 100%),
        url("../../images/bg.jpg") center 51% / cover;
}

.hero-content {
    padding-block: clamp(3.15rem, 5.65vw, 5rem);
}

.hero h1 {
    max-width: 14ch;
    color: #fffcff;
    font-size: clamp(2.65rem, 6.4vw, 5.1rem);
    line-height: 1.03;
    font-weight: 780;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.hero p {
    max-width: 39ch;
    margin-top: 1.1rem;
    color: #e0d4e9;
    font-size: clamp(1rem, 2vw, 1.13rem);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.62rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.6rem;
    color: #fff;
    font-weight: 650;
    text-decoration: none;
}

.button-discord { background: #4054d6; }
.button-discord:hover { background: #4b60e5; }
.button-secondary { border-color: #7a668d; background: #21182b; }
.button-secondary:hover { background: #392648; }

.section { padding-top: clamp(2.4rem, 5vw, 4.5rem); }
#servers { padding-top: clamp(2.1rem, 4.5vw, 3.6rem); }

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1.15rem;
}

.section h2 {
    font-size: clamp(1.65rem, 3vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.server-tools {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.text-button {
    min-height: 44px;
    padding: 0.15rem 0.3rem;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.text-button:hover { text-decoration: underline; }
.text-button[aria-disabled="true"] { opacity: 0.65; cursor: wait; }

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.game-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.game-card-body {
    display: grid;
    align-content: start;
    flex: 1;
    gap: 0.55rem;
    padding: 1rem;
}

.game-card h3 { font-size: 1.1rem; line-height: 1.28; }

.game-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.8rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.game-meta [data-server-status] {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.game-meta [data-state="online"] { color: #9ee6c3; }
.game-meta [data-state="offline"] { color: #ffc1cc; }

.game-meta [data-state]::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    flex: none;
    border-radius: 50%;
    background: currentColor;
}

.game-card .text-link { justify-self: start; }
.text-link { font-size: 0.93rem; font-weight: 650; }
.section-note { margin-top: 1rem; font-size: 0.9rem; }

.server-browser,
.cod-servers {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.server-browser { padding: 1rem; }

.steam-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.steam-tabs button {
    min-height: 44px;
    padding: 0.45rem 0.8rem;
    border: 1px solid #5a4968;
    border-radius: 0.5rem;
    background: transparent;
    color: #f1eaf8;
    cursor: pointer;
}

.steam-tabs button:hover { background: #382a46; }
.steam-tabs button[aria-selected="true"] { background: #442956; border-color: #9c75bb; }

.game-panel { padding-top: 1rem; }
.game-panel > h3 { margin-bottom: 0.65rem; font-size: 1rem; }

.server-list { display: grid; gap: 0.45rem; }

.server-card {
    background: #191520;
    border: 1px solid #43374e;
    border-radius: 0.55rem;
}

.server-card > summary {
    display: grid;
    grid-template-columns: 0.8rem minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: baseline;
    padding: 0.65rem 0.8rem;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.server-card > summary::before { content: "+"; color: var(--accent); }
.server-card[open] > summary::before { content: "−"; }
.server-online { color: #9ee6c3; }
.server-offline { color: #ffc1cc; }

.server-fields {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.25rem 0.85rem;
    margin: 0.2rem 0.8rem 0.7rem;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
}

.server-fields dt { color: var(--muted); }
.server-fields dd { margin: 0; }
.copy-address { margin-inline: 0.65rem; }
.copy-feedback { display: inline-block; margin: 0 0.8rem 0.6rem; color: var(--muted); font-size: 0.9rem; }
.copy-feedback:empty { margin: 0; }

.cod-servers { padding: 0.75rem 1rem; }
.cod-servers > summary { cursor: pointer; font-weight: 650; }
.cod-servers .server-list { margin-top: 0.8rem; max-height: 27rem; overflow: auto; padding: 0.25rem; }

.client-heading { margin: 1.3rem 0 0.6rem; font-size: 1rem; }
.client-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.client-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.65rem;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.client-list span { color: var(--muted); font-size: 0.9rem; }

.community-layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.community-layout section {
    padding: clamp(1rem, 3vw, 1.6rem);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.community-layout p { margin-block: 0.65rem; color: var(--muted); }

.support-panel {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem 1.5rem;
}

.support-panel p { margin-bottom: 0; }
.support-panel .actions { margin-top: 0; }

.site-footer {
    border-top: 1px solid var(--border);
    background: #191420;
}

.footer-layout {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
    color: var(--muted);
    padding-block: 1.35rem;
    font-size: 0.9rem;
}

@media (max-width: 62rem) {
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
    .header-layout { flex-direction: column; align-items: start; padding-block: 0.8rem; }
    .main-nav { gap: 0.05rem 0.3rem; }
    .main-nav a { padding-inline: 0.45rem; }
    .hero {
        background:
            linear-gradient(90deg, #1c1427f5 0%, #21142dc2 42%, #21142d60 100%),
            url("../../images/bg.jpg") center / cover;
    }
}

@media (max-width: 34rem) {
    .layout { width: calc(100% - 1.65rem); }
    .game-grid, .community-layout { gap: 0.7rem; }
    .game-card-body { padding: 0.7rem; }
    .game-card h3 { font-size: 1rem; }
    .game-meta { column-gap: 0.55rem; }
    .community-layout, .client-list { grid-template-columns: minmax(0, 1fr); }
    .server-browser { padding: 0.7rem; }
}

@media (max-width: 22rem) {
    .game-grid { grid-template-columns: minmax(0, 1fr); }
}
