/* ==========================================================================
   CoDServers.net — Tactical Ops Console
   Design system: dark graphite surfaces, amber signal accent,
   Space Grotesk display / Inter UI / JetBrains Mono data.
   ========================================================================== */

:root {
    --bg: #08090c;
    --bg-2: #0c0e13;
    --surface: #11141b;
    --surface-2: #161a24;
    --surface-3: #1d222f;
    --border: rgba(255, 255, 255, 0.07);
    --border-2: rgba(255, 255, 255, 0.13);

    --text: #e9ebf1;
    --text-2: #a6aec0;
    --text-3: #667089;

    --accent: #ffb224;
    --accent-2: #ff8a3c;
    --accent-soft: rgba(255, 178, 36, 0.12);
    --accent-border: rgba(255, 178, 36, 0.35);
    --accent-ink: #1a1204;

    --green: #3ddc84;
    --green-soft: rgba(61, 220, 132, 0.12);
    --red: #ff5c5c;
    --red-soft: rgba(255, 92, 92, 0.12);
    --blue: #60a5fa;

    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.5), 0 20px 48px -16px rgba(0, 0, 0, 0.7);

    --topbar-h: 60px;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }

body {
    margin: 0;
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 500px at 15% -8%, rgba(255, 178, 36, 0.055), transparent 60%),
        radial-gradient(900px 480px at 90% -12%, rgba(96, 165, 250, 0.05), transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
    background-size: auto, auto, 44px 44px, 44px 44px;
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffc85e; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--accent); color: var(--accent-ink);
    padding: 10px 18px; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

.icon {
    width: 18px; height: 18px;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
    flex: 0 0 auto;
    vertical-align: middle;
}

::selection { background: rgba(255, 178, 36, 0.28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 5px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: #2a3142; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------- Top bar ---------- */

.topbar {
    position: sticky; top: 0; z-index: 100;
    height: var(--topbar-h);
    background: rgba(8, 9, 12, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1320px; margin: 0 auto; height: 100%;
    padding: 0 24px;
    display: flex; align-items: center; gap: 28px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }

.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-ink);
    box-shadow: 0 0 0 1px rgba(255, 178, 36, 0.35), 0 4px 14px -4px rgba(255, 138, 60, 0.5);
}
.brand-mark .icon { width: 20px; height: 20px; stroke-width: 2.2; }

.brand-word {
    font-family: var(--font-display);
    font-weight: 700; font-size: 1.02rem; letter-spacing: 1.5px;
}
.brand-word em { font-style: normal; color: var(--accent); }

.top-nav { display: flex; align-items: center; gap: 6px; margin-right: auto; }

.top-nav-link {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--text-2); font-weight: 500; font-size: 0.92rem;
    padding: 8px 13px; border-radius: 9px;
    transition: background 0.15s ease, color 0.15s ease;
}
.top-nav-link:hover { color: var(--text); background: var(--surface-2); }
.top-nav-link .icon { width: 15px; height: 15px; }

.top-nav-api {
    color: var(--accent);
    border: 1px solid var(--accent-border);
    background: var(--accent-soft);
}
.top-nav-api:hover { color: #ffc85e; background: rgba(255, 178, 36, 0.18); }

.live-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 13px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border-2);
    font-size: 0.78rem; white-space: nowrap;
}
.live-label { font-family: var(--font-display); font-weight: 700; letter-spacing: 2px; color: var(--green); }
.live-updated { color: var(--text-3); font-family: var(--font-mono); font-size: 0.72rem; }

.live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5);
    animation: live-ping 2.4s ease-out infinite;
    flex: 0 0 auto;
}
@keyframes live-ping {
    0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5); }
    70% { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* ---------- Layout ---------- */

main { max-width: 1320px; margin: 0 auto; padding: 0 24px 64px; }

/* ---------- Hero ---------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 40px;
    padding: 52px 0 40px;
}

.hero-kicker {
    display: inline-flex; align-items: center; gap: 9px;
    margin: 0 0 14px;
    font-family: var(--font-mono);
    font-size: 0.72rem; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--accent);
}
.hero-kicker .icon { width: 15px; height: 15px; }

.hero h1 {
    margin: 0 0 14px;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.6vw, 2.9rem);
    font-weight: 700; line-height: 1.12; letter-spacing: -0.5px;
}

.hero-grad {
    background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

.hero-sub { margin: 0; color: var(--text-2); font-size: 1.02rem; max-width: 52ch; }
.hero-sub a { border-bottom: 1px solid var(--accent-border); }

.stat-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}

.stat-card {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-1);
    position: relative; overflow: hidden;
    min-height: 84px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.stat-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
    opacity: 0.7;
}
.stat-card:hover { border-color: var(--border-2); transform: translateY(-2px); }

.stat-icon {
    width: 42px; height: 42px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--stat-color, var(--accent)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--stat-color, var(--accent)) 38%, transparent);
    color: var(--stat-color, var(--accent));
}
.stat-icon .icon { width: 20px; height: 20px; }

.stat-servers-card { --stat-color: var(--accent); }
.stat-players-card { --stat-color: var(--green); }
.stat-active-card { --stat-color: var(--blue); }
.stat-countries-card { --stat-color: #c084fc; }

.stat-body { display: flex; flex-direction: column; min-width: 0; }

.stat-value {
    font-family: var(--font-display);
    font-size: 1.65rem; font-weight: 700; line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.stat-value.bump { animation: stat-bump 0.5s ease; }
@keyframes stat-bump { 40% { transform: scale(1.08); color: var(--accent); } }

.stat-label {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.6px;
    color: var(--text-3); font-weight: 600;
}

/* ---------- Game tabs ---------- */

.game-tabs {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 14px;
}

.game-tab {
    --hue: var(--accent);
    appearance: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    padding: 13px 16px 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-2);
    font-family: var(--font-body);
    text-align: left;
    position: relative; overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.game-tab::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--hue); opacity: 0.25; transition: opacity 0.18s ease;
}
.game-tab:hover { border-color: var(--border-2); background: var(--surface-2); transform: translateY(-1px); }
.game-tab:hover::before { opacity: 0.6; }

.game-tab[aria-selected="true"] {
    background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
    border-color: color-mix(in srgb, var(--hue) 45%, transparent);
    color: var(--text);
    box-shadow: 0 0 24px -8px color-mix(in srgb, var(--hue) 35%, transparent), var(--shadow-1);
}
.game-tab[aria-selected="true"]::before { opacity: 1; }

.gt-name {
    font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
    color: inherit; letter-spacing: 0.2px;
}
.game-tab[aria-selected="true"] .gt-name { color: var(--text); }

.gt-year {
    position: absolute; top: 11px; right: 14px;
    font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-3);
}

.gt-meta { font-size: 0.76rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.gt-meta b { color: var(--hue); font-weight: 600; }

/* ---------- Toolbar ---------- */

.toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-1);
}

.toolbar-main { display: flex; align-items: center; gap: 10px; }

.search-wrap { position: relative; flex: 1; min-width: 0; }

.search-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); width: 16px; height: 16px; pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-body); font-size: 0.92rem;
    padding: 10px 38px 10px 38px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.12);
}
.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    appearance: none; background: none; border: none; cursor: pointer;
    color: var(--text-3); padding: 4px; border-radius: 6px; display: inline-flex;
}
.search-clear:hover { color: var(--text); background: var(--surface-3); }
.search-clear .icon { width: 14px; height: 14px; }

.btn {
    appearance: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-body); font-size: 0.88rem; font-weight: 500;
    border-radius: 10px; padding: 9px 14px;
    border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }
.btn .icon { width: 15px; height: 15px; }
.btn-icon { padding: 9px; }

.sort-wrap { display: flex; align-items: center; gap: 8px; }

.field-label {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--text-3); font-weight: 600; white-space: nowrap;
}

.select-wrap { position: relative; min-width: 0; }

.select-wrap select {
    appearance: none; width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-body); font-size: 0.88rem;
    padding: 9px 32px 9px 12px;
    cursor: pointer; outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select-wrap select:hover { border-color: var(--border-2); }
.select-wrap select:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.12); }
.select-wrap select option, .select-wrap select optgroup { background: var(--surface-2); color: var(--text); }

.select-arrow {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}

.filters-toggle { display: none; }

.filter-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.filter-reset { align-self: end; }

/* ---------- List shell ---------- */

.list-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}

/* Shared row grid */
.list-head, .server-row {
    display: grid;
    grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.2fr) 72px 150px 76px 96px 44px;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}

.list-head {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border-2);
    min-height: 42px;
    position: relative;
    z-index: 1;
}

.lh-col {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--text-3);
    background: none; border: none; padding: 0; font-family: var(--font-body);
    min-width: 0;
}
.lh-col .icon { width: 13px; height: 13px; }
.lh-sort { opacity: 0; transition: opacity 0.15s ease; }
.lh-col.sortable { cursor: pointer; }
.lh-col.sortable:hover { color: var(--text-2); }
.lh-col.sortable:hover .lh-sort { opacity: 0.7; }
.lh-col.sorted { color: var(--accent); }
.lh-col.sorted .lh-sort { opacity: 1; }

.lh-mode, .lh-players, .lh-ping, .lh-ver, .lh-lock { justify-content: center; }

/* ---------- Server rows ---------- */

.server-list { min-height: 320px; }

.server-row {
    min-height: 58px;
    padding-top: 8px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: background 0.13s ease;
    content-visibility: auto;
    contain-intrinsic-size: auto 58px;
}
.server-row:hover { background: var(--surface-2); }
.server-row:focus-visible { outline: 2px solid var(--accent-border); outline-offset: -2px; }

.server-row.expanded {
    background: var(--surface-2);
    border-bottom-color: transparent;
    box-shadow: inset 3px 0 0 var(--accent);
}

.sr-name-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }

.sr-flag {
    width: 24px; height: 17px; border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 5px rgba(0, 0, 0, 0.5);
    flex: 0 0 auto; object-fit: cover;
}

.sr-name-stack { display: flex; flex-direction: column; min-width: 0; gap: 1px; }

.sr-hostname {
    font-size: 0.95rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.35;
}

.sr-address {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: inline-flex; align-items: center; gap: 7px;
}

.sr-modtag {
    display: inline-block;
    color: var(--accent-2);
    max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}

.sr-map, .sr-mode {
    font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sr-mode { text-align: center; text-transform: uppercase; font-size: 0.74rem; color: var(--text-3); }

.sr-players { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }

.sr-players-num {
    font-family: var(--font-mono); font-size: 0.86rem; font-weight: 600;
    font-variant-numeric: tabular-nums;
    display: inline-flex; align-items: baseline; gap: 3px;
    position: relative;
}
.sr-players-num .max { color: var(--text-3); font-weight: 400; font-size: 0.72rem; }

.p-empty { color: var(--text-3); }
.p-low { color: var(--green); }
.p-mid { color: var(--accent); }
.p-full { color: var(--red); }

.sr-players-bar {
    width: 72px; height: 3px; border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.sr-players-bar i {
    display: block; height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, var(--green), var(--accent));
    transition: width 0.5s ease;
}

/* Player count delta chip */
.delta {
    position: absolute;
    left: calc(100% + 6px); top: 50%; transform: translateY(-50%);
    font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
    padding: 1px 6px; border-radius: 999px;
    pointer-events: none; white-space: nowrap;
    animation: delta-life 4s ease forwards;
}
.delta.up { color: var(--green); background: var(--green-soft); border: 1px solid rgba(61, 220, 132, 0.3); }
.delta.down { color: var(--red); background: var(--red-soft); border: 1px solid rgba(255, 92, 92, 0.3); }
@keyframes delta-life {
    0% { opacity: 0; transform: translateY(calc(-50% + 6px)); }
    8% { opacity: 1; transform: translateY(-50%); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(calc(-50% - 4px)); }
}

.sr-ping {
    font-family: var(--font-mono); font-size: 0.8rem; text-align: center;
    font-variant-numeric: tabular-nums;
}
.ping-good { color: var(--green); }
.ping-ok { color: var(--accent); }
.ping-bad { color: var(--red); }

.sr-ver { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.sr-ver-num { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2); }

.badge {
    display: inline-flex; align-items: center;
    font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.5px;
    padding: 1px 7px; border-radius: 999px;
    border: 1px solid; white-space: nowrap;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.badge-ext { color: #c084fc; border-color: rgba(192, 132, 252, 0.35); background: rgba(192, 132, 252, 0.1); }
.badge-mod { color: var(--accent-2); border-color: rgba(255, 138, 60, 0.35); background: rgba(255, 138, 60, 0.1); }

.sr-lock { display: flex; justify-content: center; }
.sr-lock .icon { width: 15px; height: 15px; }
.lock-on { color: var(--red); }
.lock-off { color: var(--text-3); opacity: 0.45; }

/* ---------- Row details panel ---------- */

.row-details {
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    box-shadow: inset 0 12px 24px -18px rgba(0, 0, 0, 0.9), inset 3px 0 0 var(--accent);
    animation: details-open 0.22s ease;
    overflow: hidden;
}
@keyframes details-open {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.details-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 24px;
    padding: 22px;
}

.details-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.map-frame {
    position: relative; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow-1);
    background: var(--surface-2);
}
.map-frame img {
    display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
}
.map-frame .map-label {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 20px 12px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    font-family: var(--font-mono); font-size: 0.78rem; color: #fff;
    display: flex; align-items: center; gap: 7px;
}
.map-frame .map-label .icon { width: 13px; height: 13px; color: var(--accent); }

.connect-card {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, rgba(255, 178, 36, 0.1), rgba(255, 138, 60, 0.05));
    border: 1px solid var(--accent-border);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    min-width: 0;
}
.connect-card:hover { background: rgba(255, 178, 36, 0.16); transform: translateY(-1px); }
.connect-card .icon { color: var(--accent); }
.connect-card code {
    font-family: var(--font-mono); font-size: 0.85rem; color: #ffe1ad;
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.connect-card .copy-btn { margin-left: auto; }

.details-links { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }

.dlink {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem; color: var(--text-2);
    background: var(--surface);
    min-width: 0;
}
.dlink:last-child { border-bottom: none; }
.dlink > .icon { width: 16px; height: 16px; color: var(--text-3); }
.dlink.dlink-admin > .icon { color: var(--green); }
.dlink.dlink-mod > .icon { color: #c084fc; }
.dlink.dlink-api > .icon { color: var(--accent); }
.dlink.dlink-discord > .icon { color: #5865f2; }
.dlink.dlink-web > .icon { color: var(--blue); }
.dlink .dlink-label {
    font-size: 0.66rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--text-3); width: 58px; flex: 0 0 auto;
}
.dlink .dlink-value {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dlink a.dlink-value { color: var(--text); }
.dlink a.dlink-value:hover { color: var(--accent); }
.dlink .dlink-value.mono { font-family: var(--font-mono); font-size: 0.76rem; }

.details-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.info-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}

.info-cell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 9px 12px;
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0;
}
.info-cell .ic-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.62rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--text-3);
}
.info-cell .ic-label .icon { width: 12px; height: 12px; color: var(--info-icon, var(--text-3)); }
.info-cell .ic-value {
    font-size: 0.85rem; color: var(--text);
    display: inline-flex; align-items: center; gap: 7px;
    min-width: 0;
}
.info-cell .ic-value > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-cell .ic-value.mono { font-family: var(--font-mono); font-size: 0.78rem; }
.info-cell .ic-value .sr-flag { width: 20px; height: 14px; }
.ic-yes { color: var(--green); }
.ic-no { color: var(--red); }
.ic-warn { color: var(--red); }

.ic-gamepad, .ic-server, .ic-hash, .ic-map, .ic-terminal { --info-icon: var(--accent); }
.ic-pin, .ic-globe, .ic-network, .ic-gauge { --info-icon: var(--blue); }
.ic-users, .ic-activity, .ic-user { --info-icon: var(--green); }
.ic-zap, .ic-puzzle { --info-icon: #c084fc; }
.ic-lock { --info-icon: var(--red); }
.ic-shield, .ic-shield-check { --info-icon: #8b5cf6; }
.info-cell:has(.ic-yes) { --info-icon: var(--green); }
.info-cell:has(.ic-warn) { --info-icon: var(--red); }
.info-cell:has(.ic-no) { --info-icon: var(--red); }
.info-cell.ic-shield:has(.ic-no),
.info-cell.ic-shield-check:has(.ic-no) { --info-icon: #8b5cf6; }

.details-section-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0;
    font-family: var(--font-display); font-size: 0.86rem; font-weight: 600;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-2);
}
.details-section-title .icon { width: 15px; height: 15px; color: var(--accent); }
.details-section-title .count-chip {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3);
    border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
}

/* Players table */
.players-table { width: 100%; border-collapse: collapse; }
.players-table th {
    text-align: left;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase;
    color: var(--text-3);
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-2);
    background: var(--surface);
}
.players-table th .icon { width: 12px; height: 12px; vertical-align: -2px; margin-right: 5px; }
.players-table th:nth-child(1) .icon { color: var(--green); }
.players-table th:nth-child(2) .icon { color: var(--accent); }
.players-table th:nth-child(3) .icon { color: var(--blue); }
.players-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.86rem;
}
.players-table td.num { font-family: var(--font-mono); font-size: 0.78rem; text-align: center; font-variant-numeric: tabular-nums; }
.players-table th.num { text-align: center; }
.players-table tr:hover td { background: var(--surface); }

.players-empty-state {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 34px 20px; text-align: center;
    border: 1px dashed var(--border-2); border-radius: 10px;
    color: var(--text-3);
}
.players-empty-state .icon { width: 28px; height: 28px; opacity: 0.6; }
.players-empty-state b { color: var(--text-2); font-weight: 600; }
.players-empty-state span { font-size: 0.82rem; }

/* Raw settings */
.raw-settings { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.raw-settings summary {
    cursor: pointer; list-style: none;
    display: flex; align-items: center; gap: 9px;
    padding: 11px 14px;
    background: var(--surface);
    font-size: 0.8rem; font-weight: 600; color: var(--text-2);
    user-select: none;
}
.raw-settings summary::-webkit-details-marker { display: none; }
.raw-settings summary .icon { width: 14px; height: 14px; color: var(--text-3); }
.raw-settings summary .chev { margin-left: auto; transition: transform 0.2s ease; }
.raw-settings[open] summary .chev { transform: rotate(180deg); }
.raw-settings summary:hover { color: var(--text); }

.raw-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--border);
}
.raw-kv {
    display: flex; gap: 10px; align-items: baseline;
    padding: 5px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.76rem;
    min-width: 0;
}
.raw-kv:nth-child(odd) { border-right: 1px solid var(--border); }
.raw-kv .k { font-family: var(--font-mono); color: var(--text-3); flex: 0 0 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.raw-kv .v { font-family: var(--font-mono); color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Copy button */
.copy-btn {
    appearance: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 7px;
    background: transparent; border: 1px solid transparent;
    color: var(--text-3);
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    flex: 0 0 auto;
}
.copy-btn:hover { color: var(--text); background: var(--surface-3); border-color: var(--border-2); }
.copy-btn .icon { width: 14px; height: 14px; }
.copy-btn.copied {
    color: var(--accent);
    border-color: var(--accent-border);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(255, 178, 36, 0.08);
}

/* ---------- List footer ---------- */

.list-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 11px 16px;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    font-size: 0.78rem; color: var(--text-3);
}
.lf-count { font-variant-numeric: tabular-nums; }
.lf-updated { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.72rem; }

/* ---------- Empty & skeleton states ---------- */

.list-empty {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 70px 24px; text-align: center; color: var(--text-3);
}
.list-empty .icon { width: 40px; height: 40px; opacity: 0.5; stroke-width: 1.5; }
.list-empty h3 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; color: var(--text-2); font-weight: 600; }
.list-empty p { margin: 0; font-size: 0.86rem; max-width: 40ch; }
.list-empty .btn { margin-top: 6px; }

.skel-row {
    display: grid;
    grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.2fr) 72px 150px 76px 96px 44px;
    gap: 12px; align-items: center;
    min-height: 58px; padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}
.skel {
    height: 12px; border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 45%, var(--surface-2) 65%);
    background-size: 200% 100%;
    animation: skel-wave 1.4s ease infinite;
}
@keyframes skel-wave { to { background-position: -200% 0; } }
.skel-row .skel:nth-child(1) { width: 72%; height: 14px; }
.skel-row .skel:nth-child(2) { width: 80%; }
.skel-row .skel:nth-child(3) { width: 60%; justify-self: center; }
.skel-row .skel:nth-child(4) { width: 65%; justify-self: center; }
.skel-row .skel:nth-child(5) { width: 55%; justify-self: center; }
.skel-row .skel:nth-child(6) { width: 70%; justify-self: center; }
.skel-row .skel:nth-child(7) { width: 100%; justify-self: center; }

/* ---------- Toasts ---------- */

.toast-root {
    position: fixed; bottom: 22px; right: 22px; z-index: 300;
    display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}

.toast {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-3);
    border: 1px solid var(--accent-border);
    color: var(--text);
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 0.86rem; font-weight: 500;
    box-shadow: var(--shadow-2);
    animation: toast-in 0.25s cubic-bezier(0.21, 1.02, 0.73, 1);
}
.toast .icon { width: 16px; height: 16px; color: var(--accent); }
.toast.leaving { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    margin-top: 24px;
}

.footer-grid {
    max-width: 1320px; margin: 0 auto;
    padding: 40px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
}

.footer-about p { color: var(--text-3); font-size: 0.86rem; max-width: 46ch; margin: 14px 0 0; }
.footer-fine { font-size: 0.74rem !important; opacity: 0.8; }

.footer-col h3 {
    margin: 4px 0 14px;
    font-family: var(--font-display); font-size: 0.78rem; font-weight: 600;
    letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-2);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col li a { color: var(--text-3); font-size: 0.86rem; transition: color 0.15s ease; }
.footer-col li a:hover { color: var(--accent); }

/* ==========================================================================
   API documentation page
   ========================================================================== */

.docs-main { max-width: 1000px; }

.docs-hero { padding: 52px 0 12px; }
.docs-hero h1 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 700; line-height: 1.15;
}
.docs-hero .hero-sub { max-width: 64ch; }

.docs-section { margin-top: 40px; }
.docs-section > h2 {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 6px;
    font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
}
.docs-section > h2 .icon { width: 19px; height: 19px; color: var(--accent); }
.docs-section > p { color: var(--text-2); margin: 6px 0 18px; max-width: 76ch; }
.docs-section h3 { font-family: var(--font-display); font-size: 0.98rem; margin: 22px 0 10px; }

.base-url-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.base-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
    display: flex; flex-direction: column; gap: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    text-align: left; font-family: var(--font-body); color: var(--text);
}
.base-card:hover { border-color: var(--border-2); }
.base-card.active { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(255, 178, 36, 0.1); }
.base-card .bc-tag {
    align-self: flex-start;
    font-size: 0.64rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
    padding: 2px 9px; border-radius: 999px;
    color: var(--text-3); border: 1px solid var(--border-2);
}
.base-card.active .bc-tag { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.base-card .bc-url { display: flex; align-items: center; gap: 8px; min-width: 0; }
.base-card .bc-url code {
    font-family: var(--font-mono); font-size: 0.86rem; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.base-card .bc-note { font-size: 0.78rem; color: var(--text-3); margin: 0; }

.code-block {
    position: relative;
    background: #0a0c11;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 10px 0 0;
    overflow: hidden;
}
.code-block pre {
    margin: 0; padding: 15px 52px 15px 16px;
    overflow-x: auto;
    font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.6;
    color: #cdd6e4;
}
.code-block .copy-btn { position: absolute; top: 8px; right: 8px; background: var(--surface); border-color: var(--border); }
.code-block .cb-lang {
    position: absolute; top: 9px; right: 44px;
    font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-3);
}
.tok-k { color: #ff8a3c; } .tok-s { color: #9ece6a; } .tok-c { color: #565f89; } .tok-n { color: #7aa2f7; }

.code-tabs { display: flex; gap: 6px; margin-top: 14px; }
.code-tab {
    appearance: none; cursor: pointer;
    font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600;
    padding: 6px 13px; border-radius: 8px;
    background: var(--bg-2); border: 1px solid var(--border); color: var(--text-3);
}
.code-tab:hover { color: var(--text-2); }
.code-tab.active { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.code-pane { display: none; }
.code-pane.active { display: block; }

.endpoint-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 10px;
}
.endpoint-line { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.method {
    font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 1px;
    color: var(--green); border: 1px solid rgba(61, 220, 132, 0.4); background: var(--green-soft);
    padding: 2px 9px; border-radius: 6px;
}
.endpoint-line code.ep-path {
    font-family: var(--font-mono); font-size: 0.85rem; color: var(--text);
    flex: 1; min-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ep-actions { display: inline-flex; gap: 6px; align-items: center; }
.ep-try {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.74rem; font-weight: 600; color: var(--accent);
    border: 1px solid var(--accent-border); border-radius: 7px; padding: 4px 10px;
    background: var(--accent-soft);
}
.ep-try .icon { width: 12px; height: 12px; }
.ep-try:hover { background: rgba(255, 178, 36, 0.2); color: #ffc85e; }
.endpoint-card .ep-desc { margin: 8px 0 0; font-size: 0.84rem; color: var(--text-2); }

.docs-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.docs-table th {
    text-align: left; background: var(--surface);
    font-size: 0.68rem; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase;
    color: var(--text-3); padding: 9px 13px; border-bottom: 1px solid var(--border-2);
}
.docs-table td { padding: 9px 13px; border-bottom: 1px solid var(--border); font-size: 0.84rem; color: var(--text-2); vertical-align: top; }
.docs-table td:first-child code { color: var(--accent); }
.docs-table code { font-family: var(--font-mono); font-size: 0.78rem; background: var(--bg-2); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); }
.docs-table tr:last-child td { border-bottom: none; }

.docs-note {
    display: flex; gap: 11px;
    background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
    border-radius: 10px; padding: 13px 16px; margin: 14px 0;
    font-size: 0.86rem; color: var(--text-2);
}
.docs-note .icon { width: 17px; height: 17px; color: var(--accent); margin-top: 2px; }
.docs-note p { margin: 0; }
.docs-note code { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); }

/* ---------- SEO landing pages ---------- */

.seo-main {
    padding-bottom: 72px;
}

.seo-hero {
    border-bottom: 1px solid var(--border);
}

.seo-hero h1 {
    max-width: 760px;
}

.seo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.seo-grid > div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.seo-grid h3 {
    margin-top: 0;
}

.seo-grid p {
    margin-bottom: 0;
    color: var(--text-2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
    .list-head, .server-row, .skel-row {
        grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.1fr) 130px 70px 40px;
    }
    .lh-mode, .sr-mode, .lh-ver, .sr-ver { display: none; }
    .skel-row .skel:nth-child(3), .skel-row .skel:nth-child(6) { display: none; }
    .filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filter-reset { grid-column: 3; justify-self: end; }
    .details-grid { grid-template-columns: 300px minmax(0, 1fr); }
    .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; gap: 28px; padding: 36px 0 30px; }
    .game-tabs { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; }
    .live-updated { display: none; }
}

@media (max-width: 720px) {
    main { padding: 0 12px 48px; }
    .topbar-inner { padding: 0 14px; gap: 14px; }
    .top-nav-link:not(.top-nav-api) { display: none; }
    .brand-word { font-size: 0.9rem; }

    .toolbar-main { flex-wrap: wrap; }
    .search-wrap { flex: 1 1 100%; order: -1; }
    .filters-toggle { display: inline-flex; }
    .sort-wrap { margin-left: auto; }
    .sort-wrap .field-label { display: none; }

    .filter-row { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-row.open { display: grid; }
    .filter-reset { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }

    .list-head, .server-row, .skel-row {
        grid-template-columns: minmax(0, 1fr) 108px 34px;
        gap: 8px; padding: 0 12px;
    }
    .server-row, .skel-row { padding-top: 8px; padding-bottom: 8px; }
    .lh-map, .sr-map, .lh-ping, .sr-ping { display: none; }
    .skel-row .skel:nth-child(2), .skel-row .skel:nth-child(5) { display: none; }
    .sr-players-bar { width: 56px; }
    .delta { left: auto; right: 0; top: -12px; transform: none; }
    @keyframes delta-life {
        0% { opacity: 0; transform: translateY(5px); }
        8% { opacity: 1; transform: none; }
        80% { opacity: 1; }
        100% { opacity: 0; transform: translateY(-4px); }
    }

    .details-grid { grid-template-columns: 1fr; padding: 14px; gap: 16px; }
    .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .raw-grid { grid-template-columns: 1fr; }
    .raw-kv:nth-child(odd) { border-right: none; }
    .stat-grid { gap: 8px; }
    .stat-card { padding: 12px 14px; min-height: 70px; gap: 10px; }
    .stat-value { font-size: 1.3rem; }
    .stat-icon { width: 36px; height: 36px; }

    .base-url-grid { grid-template-columns: 1fr; }
    .seo-grid { grid-template-columns: 1fr; }
    .toast-root { left: 12px; right: 12px; align-items: stretch; }
}

@media (max-width: 420px) {
    .game-tabs { grid-template-columns: 1fr; }
    .gt-year { display: none; }
}
