/* Use the final dark page color from the very first paint. */
html.dark-preload,
html.dark-preload body {
    background: #171719 !important;
    color: #ededed !important;
}
html.dark-preload #top-bar {
    background: rgba(17, 14, 23, 0.96) !important;
    border-color: #28232f !important;
}
html.dark-preload button {
    background: #15121c !important;
    color: #c8c2d0 !important;
    border-color: #292532 !important;
}
html.dark-preload .client-tab,
html.dark-preload .game-pill {
    background: #15121b !important;
    color: #d5d0dc !important;
}
html.dark-preload #status { color: #9993a5 !important; }
html.dark-preload .search-container input {
    background: #15121c !important;
    color: #e8e5ee !important;
    border-color: #302a39 !important;
}
html.dark-preload .game {
    background: transparent !important;
    border-color: transparent !important;
}

html.dark-preload .pagination-container {
    background: #111419 !important;
    border-color: #292532 !important;
}
html.dark-preload .details-row {
    background: #100e16 !important;
    border-color: #292532 !important;
}
html.dark-preload th {
    background: #14111a !important;
    border-color: #292431 !important;
}
html.dark-preload td { border-color: #25212c !important; }

:root {
    --bg: #0b0d10;
    --surface: #111419;
    --surface2: #151922;
    --border: #232733;
    --text: #e7e9ed;
    --muted: #8c939e;
    --light-bg: #f4f6f9;
    --light-surface: #ffffff;
    --light-surface2: #eef3f7;
    --light-border: #d0d7de;
    --light-text: #1f2328;
    --light-muted: #656d76;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 20px;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    background: var(--light-bg);
    color: var(--light-text);
}

/* TOP BAR */
#top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.85);
    margin: -20px -20px 24px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--light-border);
    backdrop-filter: blur(12px);
}

.top-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand-container { display: flex; align-items: center; gap: 12px; }
.brand-home-link {
    display: inline-flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    text-decoration: none;
}
.brand-icon { width: 28px; height: 28px; border-radius: 6px; }
.brand-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
#status { margin: 2px 0 0; font-size: 12px; color: var(--light-muted); }

#top-buttons { display: flex; gap: 8px; align-items: center; }
#top-buttons button {
    position: relative;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 8px;
}

.fav-toggle-btn {
    font-size: 15px;
    background: #ffffff;
    border: 1px solid var(--light-border);
}

.fav-toggle-btn.active {
    background: #fef3c7;
    border-color: #f59e0b;
}

.fav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.search-toggle-btn {
    color: var(--light-text);
}

.search-toggle-btn.active {
    background: var(--light-surface2);
    border-color: #abb4be;
}

.search-icon, .theme-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}

/* TOP SEARCH BAR */
.top-search-bar {
    width: 100%;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--light-border);
    border-radius: 10px;
    padding: 6px 8px 6px 12px;
}

.top-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input-icon {
    width: 18px;
    height: 18px;
    color: var(--light-muted);
    flex-shrink: 0;
}

.top-search-input-wrap input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--light-text);
}

.top-search-submit-btn {
    background: #d946ef;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.top-search-submit-btn:hover {
    background: #c026d3;
}

/* SEARCH RESULTS BANNER */
.search-results-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(192, 38, 211, 0.08);
    border: 1.5px solid #d946ef;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
}

.search-results-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--light-text);
}

.search-banner-icon {
    width: 18px;
    height: 18px;
    color: #d946ef;
    flex-shrink: 0;
}

.banner-clear-btn {
    background: #374151;
    color: #f3f4f6;
    border: 1px solid #4b5563;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.banner-clear-btn:hover {
    background: #4b5563;
    color: #ffffff;
}

/* MOBILE CONNECT LABEL */
.connect-mobile-label {
    display: none;
}

button {
    padding: 8px 14px;
    cursor: pointer;
    background: #ffffff;
    color: var(--light-text);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}
button:hover { background: #eef3f8; }

/* HERO BANNER */
.hero-banner {
    text-align: center;
    max-width: 860px;
    margin: 20px auto 30px;
    padding: 0 16px;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -1px;
    line-height: 1.15;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--light-text);
}

.hero-stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #22c55e;
    display: inline-block;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.hero-stat-players {
    color: #ec4899;
    font-size: 32px;
    font-weight: 800;
}

.hero-stat-servers {
    font-size: 32px;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 14px;
    line-height: 1.6;
    color: var(--light-muted);
    margin: 0 auto;
    max-width: 720px;
}

.client-link-inline {
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.client-link-inline:hover { text-decoration: underline; opacity: 0.85; }

.client-plutonium { color: #f97316; }
.client-iw4x { color: #38bdf8; }
.client-alterware { color: #a855f7; }
.client-aurora { color: #ec4899; }
.client-horizonmw { color: #2dd4bf; }
.client-cod4x { color: #22c55e; }
.client-s2x { color: #eab308; }

/* CLIENT TABS */
.client-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--light-border);
}

.client-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--light-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.client-tab:hover {
    color: var(--light-text);
    background: transparent;
}

.client-tab.active {
    color: var(--light-text);
    font-weight: 700;
    border-bottom-color: var(--client-color, #f97316);
}

/* GAME SUB-PILLS */
.sub-game-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.game-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid var(--light-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--light-text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.game-pill:hover {
    background: var(--light-surface2);
    border-color: #abb4be;
}

.game-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--dot-color, #8c939e);
    display: inline-block;
    flex-shrink: 0;
}

.game-pill-code { font-weight: 600; }
.game-pill-count { color: var(--light-muted); font-size: 12px; }

.game-pill.active {
    border-color: var(--dot-color, #f97316);
    box-shadow: 0 0 0 1px var(--dot-color, #f97316);
    background: rgba(249, 115, 22, 0.08);
}

/* SORT & FILTER TOOLBAR */
.sort-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--light-border);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
}

.sort-filter-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.sort-label, .filter-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--light-muted);
}

.sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.sort-pill {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--light-text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sort-pill:hover {
    background: var(--light-surface2);
}

.sort-pill.active {
    background: rgba(192, 38, 211, 0.1);
    border-color: #c026d3;
    color: #c026d3;
    font-weight: 700;
}

.sort-arrow {
    display: inline-block;
    margin-left: 2px;
    font-size: 12px;
}

.filter-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    border: 1px solid var(--light-border);
    border-radius: 6px;
    padding: 5px 28px 5px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--light-text);
    font-family: inherit;
    cursor: pointer;
}

.filter-select-wrapper .select-arrow {
    position: absolute;
    right: 10px;
    pointer-events: none;
    font-size: 10px;
    color: var(--light-muted);
}

.trickshot-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--light-border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--light-muted);
}

.trickshot-btn.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.eye-slash-icon {
    width: 14px;
    height: 14px;
}

body.dark-mode .sort-filter-bar {
    background: var(--surface);
    border-color: var(--border);
}

body.dark-mode .sort-label,
body.dark-mode .filter-label {
    color: #8c939e;
}

body.dark-mode .sort-pill {
    color: #d1d5db;
}

body.dark-mode .sort-pill:hover {
    background: #1c202d;
}

body.dark-mode .sort-pill.active {
    background: rgba(192, 38, 211, 0.15);
    border-color: #d946ef;
    color: #f472b6;
}

body.dark-mode .filter-select {
    background: #151821;
    border-color: var(--border);
    color: #d1d5db;
}

body.dark-mode .trickshot-btn {
    background: #151821;
    border-color: var(--border);
    color: #8c939e;
}

body.dark-mode .trickshot-btn:hover {
    color: #ffffff;
}

/* SEARCH & QUICK FILTERS */
.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-container input {
    flex: 1;
    min-width: 200px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--light-border);
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-container input:focus {
    outline: 0;
    border-color: #387096;
    box-shadow: 0 0 0 3px rgba(56, 112, 150, 0.15);
}

.search-container button {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.fav-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fav-filter-btn.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

/* GAME & TABLES */
.game {
    background: #ffffff;
    border: 1px solid var(--light-border);
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.game-title {
    scroll-margin-top: 70px;
    padding: 14px 18px;
    margin: 0;
    border-bottom: 1px solid var(--light-border);
    background: var(--light-surface2);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-title-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.game-title-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.game-title-name { font-weight: 700; color: var(--light-text); }

.game-title-stats {
    font-weight: 400;
    font-size: 13px;
    color: var(--light-muted);
}

.game-title-client {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    margin-left: 4px;
    transition: opacity 0.15s ease;
}
.game-title-client:hover { opacity: 0.8; text-decoration: underline; }

.game-title-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    font-size: 12px;
    font-weight: 400;
    color: var(--light-muted);
}

body.dark-mode .game-title-updated {
    color: #8c939e;
}

.updated-time-text {
    font-size: 12px;
    color: inherit;
}

.inline-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--light-muted);
    background: transparent;
    border: 1px solid var(--light-border);
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease;
}

.inline-refresh-btn:hover {
    color: var(--light-text);
    background: var(--light-surface2);
}

body.dark-mode .inline-refresh-btn {
    color: #8c939e;
    border-color: #2e3545;
    background: transparent;
}

body.dark-mode .inline-refresh-btn:hover {
    color: #ffffff;
    background: #1c202d;
}

.refresh-arrows-icon {
    width: 12px;
    height: 12px;
    display: inline-block;
    vertical-align: middle;
}

.country-cell {
    font-weight: 600;
    font-size: 12px;
    color: var(--light-muted);
    letter-spacing: 0.5px;
}

body.dark-mode .country-cell {
    color: #9ca3af;
}

.external-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
}

.external-icon-sm {
    width: 12px;
    height: 12px;
    display: inline-block;
    vertical-align: -1px;
}

.table-container { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 700px; border-collapse: collapse; }

th {
    background: var(--light-surface2);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--light-border);
    cursor: pointer;
    color: var(--light-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    transition: background 0.15s ease;
}
th:hover { background: #e2e8f0; }
th.sorted { color: #387096; font-weight: 700; }

td {
    padding: 11px 14px;
    border-bottom: 1px solid #eef1f5;
    font-size: 13px;
    vertical-align: middle;
}

.server-row { cursor: pointer; }
.server-row:hover { background: rgba(56, 112, 150, 0.08); }
.server-name {
    font-weight: bold;
    font-size: 15px;
}
.players-count { white-space: nowrap; }

/* PLAYERS & PING BADGES */
.player-box {
    display: inline-block;
    min-width: 64px;
    padding: 4px 8px;
    text-align: center;
    border: 1px solid;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
}
.player-empty { color: #6b7280; border-color: #d1d5db; background: #f3f4f6; }
.player-low { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.player-medium { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.player-full { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

.ping-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}
.ping-good { color: #22c55e; }
.ping-medium { color: #eab308; }
.ping-high { color: #ef4444; }

/* COLUMN LAYOUTS */
.col-rank-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.rank-num {
    color: var(--light-muted);
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
}
.country-code-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--light-muted);
}
body.dark-mode .rank-num,
body.dark-mode .country-code-text {
    color: #9ca3af;
}

.ip-text {
    font-family: monospace;
    font-size: 12px;
    color: var(--light-text);
}
body.dark-mode .ip-text {
    color: #d1d5db;
}

/* DESKTOP TABLE COLUMNS */
@media(min-width: 601px) {
    table { table-layout: fixed; min-width: 800px; }
    th.col-server, td.col-server-cell { width: 35%; }
    th.col-map, td.col-map-cell { width: 22%; }
    th.col-players, td.col-players-cell { width: 18%; }
    th.col-client, td.col-client-cell { width: 10%; }
    th.col-connect, td.col-connect-cell { width: 15%; }
}

.server-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.server-title-text {
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-mode-text {
    font-size: 13px;
    color: var(--light-muted);
}

body.dark-mode .map-mode-text {
    color: #9ca3af;
}

.player-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-num-box {
    font-weight: 700;
    font-size: 13px;
    min-width: 42px;
}

.player-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(127, 127, 127, 0.2);
    border-radius: 2px;
    overflow: hidden;
    max-width: 80px;
}

.player-progress-fill {
    height: 100%;
    border-radius: 2px;
}

.player-progress-fill.player-full { background: #f59e0b; }
.player-progress-fill.player-medium { background: #22c55e; }
.player-progress-fill.player-low { background: #22c55e; }
.player-progress-fill.player-empty { background: #6b7280; }

.player-num-box.player-full { color: #f59e0b; }
.player-num-box.player-medium { color: #22c55e; }
.player-num-box.player-low { color: #22c55e; }

.player-status-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 1px 4px;
    border-radius: 3px;
    color: #f59e0b;
}

.client-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(249, 115, 22, 0.15);
    color: var(--client-color, #f97316);
}

.connect-action-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
}

body.dark-mode .connect-action-box {
    background: #151821;
}

.connect-str {
    font-size: 12px;
    color: var(--light-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode .connect-str {
    color: #9ca3af;
}

/* COUNTRY FLAGS */
.country-flag {
    width: 28px;
    height: 19px;
    object-fit: cover;
    border-radius: 3px;
    vertical-align: middle;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
.flag-placeholder {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
    width: 28px;
    text-align: center;
}

/* FAVORITE & EXPAND BUTTONS */
.fav-button {
    background: transparent;
    border: 0;
    padding: 2px 4px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    color: #9ca3af;
    transition: transform 0.15s ease, color 0.15s ease;
    vertical-align: middle;
    margin-right: 4px;
}
.fav-button:hover { background: transparent; transform: scale(1.2); color: #f59e0b; }
.fav-button.is-favorite { color: #f59e0b; }

.expand-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: -3px;
    color: inherit;
}
.expand-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* DETAILS ROW */
.details-row { background: var(--light-surface2); }
.details {
    padding: 14px 18px;
    border-left: 3px solid #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.details p { margin: 2px 0; font-size: 13px; }
.details-connect-mobile { display: none; }

/* COPY BUTTON & INLINE TOAST */
.copy-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}
.copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: 5px;
    background: transparent;
    color: inherit;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
    opacity: 0.65;
    transition: opacity 0.15s ease, background 0.15s ease;
}
.copy-button:hover { background: rgba(127, 127, 127, 0.12); opacity: 1; }

.copy-toast {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0e1f14;
    color: #7cd987;
    border: 1px solid #2e6b38;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}
.copy-toast.show { opacity: 1; transform: scale(1); }

/* STATUS BADGES */
.status-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}
.status-online { background: #dcfce7; color: #15803d; }
.status-offline { background: #fee2e2; color: #b91c1c; }

/* PAGINATION & FEEDBACK */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: var(--light-surface2);
    border-top: 1px solid var(--light-border);
    flex-wrap: wrap;
    gap: 10px;
}
.pagination-buttons { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pagination-button { padding: 5px 10px; font-size: 12px; }
.pagination-button.active {
    background: rgba(127, 127, 127, 0.15);
    border-color: rgba(127, 127, 127, 0.35);
    font-weight: bold;
}
.pagination-ellipsis { padding: 0 4px; color: var(--light-muted); font-size: 12px; }
.no-results { padding: 24px; text-align: center; color: var(--light-muted); }

.refresh-button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 18px;
}
.refresh-button .refresh-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    line-height: 1;
    text-align: center;
    transform-origin: center;
}
.refresh-button.is-refreshing .refresh-icon {
    animation: refresh-spin 0.8s linear infinite;
}
@keyframes refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* TOAST NOTIFICATION */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffffff;
    color: var(--light-text);
    border: 1px solid var(--light-border);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* DARK MODE */
body.dark-mode { background: var(--bg); color: var(--text); }
body.dark-mode #top-bar {
    background: rgba(17, 20, 25, 0.85);
    border-color: var(--border);
}

body.dark-mode button {
    background: #151821;
    color: #c7ccd3;
    border-color: var(--border);
}
body.dark-mode button:hover { background: #1c202c; }

body.dark-mode .hero-stats { color: #f3f4f6; }
body.dark-mode .hero-subtitle { color: #9ca3af; }

body.dark-mode .client-tabs { border-color: var(--border); }
body.dark-mode .client-tab { color: #9ca3af; }
body.dark-mode .client-tab:hover { color: #f3f4f6; }
body.dark-mode .client-tab.active { color: #ffffff; }

body.dark-mode .game-pill {
    background: #151821;
    border-color: #282d3a;
    color: #d1d5db;
}
body.dark-mode .game-pill:hover {
    background: #1c202d;
    border-color: #3b4254;
}
body.dark-mode .game-pill-count { color: #8c939e; }

body.dark-mode .top-search-bar {
    background: #111419;
    border-color: var(--border);
}

body.dark-mode .top-search-input-wrap input {
    color: #e7e9ed;
}

body.dark-mode .search-results-banner {
    background: rgba(192, 38, 211, 0.12);
    border-color: #d946ef;
}

body.dark-mode .search-results-info {
    color: #e7e9ed;
}

body.dark-mode .banner-clear-btn {
    background: #1f242d;
    color: #d1d5db;
    border-color: #292f39;
}

body.dark-mode .banner-clear-btn:hover {
    background: #282e3a;
    color: #ffffff;
}

body.dark-mode .fav-toggle-btn.active {
    background: #451a03;
    border-color: #b45309;
}

body.dark-mode .game {
    background: var(--surface);
    border-color: var(--border);
}

body.dark-mode .game-title,
body.dark-mode th,
body.dark-mode .pagination-container {
    background: #111419;
    border-color: var(--border);
}

body.dark-mode .game-title-name { color: #f3f4f6; }
body.dark-mode .game-title-stats { color: #8c939e; }

body.dark-mode td { border-color: #1a1e27; }
body.dark-mode .server-row:hover { background: #181c26; }
body.dark-mode .details-row { background: #0f1217; }
body.dark-mode .details { border-color: #333a48; }

body.dark-mode .player-empty { color: #9ca3af; border-color: #374151; background: #1f2937; }
body.dark-mode .player-low { color: #fde047; border-color: #713f12; background: #2e1a08; }
body.dark-mode .player-medium { color: #4ade80; border-color: #14532d; background: #082f14; }
body.dark-mode .player-full { color: #f87171; border-color: #7f1d1d; background: #360f0f; }

body.dark-mode .status-online { background: #082f14; color: #4ade80; }
body.dark-mode .status-offline { background: #360f0f; color: #f87171; }

body.dark-mode .toast {
    background: var(--surface);
    color: #c7ccd3;
    border-color: var(--border);
}

body.dark-mode .search-toggle-btn {
    background: #151821;
    color: #c7ccd3;
    border-color: var(--border);
}

body.dark-mode .search-toggle-btn.active {
    background: #1c202d;
    color: #ffffff;
    border-color: #3b4254;
}


/* COD COLOR CODES */
.cod-color-0 { color: #000000; }
.cod-color-1 { color: #ff0000; }
.cod-color-2 { color: #00ff00; }
.cod-color-3 { color: #ffff00; }
.cod-color-4 { color: #0000ff; }
.cod-color-5 { color: #00ffff; }
.cod-color-6 { color: #ff00ff; }
.cod-color-7 { color: #ffffff; }
.cod-color-8 { color: #ff7f00; }
.cod-color-9 { color: #7f7f7f; }

body:not(.dark-mode) .cod-color-7 { color: inherit; }
body:not(.dark-mode) .cod-color-0 { color: #111827; }

/* FLAG WRAPPER */
.flag-wrap {
    display: inline-flex;
    width: 28px;
    height: 19px;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

/* MOBILE RESPONSIVE CARD VIEW */
@media (max-width: 600px) {
    body { padding: 10px; }
    .hero-title { font-size: 26px; }
    .hero-stats { font-size: 14px; }
    .hero-stat-players, .hero-stat-servers { font-size: 22px; }

    #top-bar {
        margin: -10px -10px 15px;
        padding: 10px 12px;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container input {
        width: 100% !important;
        height: 38px !important;
        padding: 4px 12px !important;
        font-size: 13px;
        box-sizing: border-box;
    }

    .table-container { overflow-x: visible; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }

    .server-row {
        position: relative;
        padding: 12px 14px;
        border-bottom: 1px solid var(--light-border);
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    body.dark-mode .server-row {
        border-bottom-color: var(--border);
    }

    .server-row td {
        padding: 0;
        border: none;
    }

    /* Row 1 on mobile: Rank, Flag, Code & Fav Button */
    .col-rank-cell {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Row 2 on mobile: Star, Arrow and Server Title */
    .col-server-cell {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 15px;
        font-weight: 700;
        word-break: break-word;
    }

    /* Row 3: IP Address & Copy button */
    .col-ip-cell {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
    }

    .connect-mobile-label {
        display: inline;
        font-size: 12px;
        font-weight: 600;
        color: var(--light-muted);
        margin-right: 4px;
    }
    body.dark-mode .connect-mobile-label {
        color: #9ca3af;
    }

    /* Row 4: Map + Players + Ping in horizontal bar */
    .col-map-cell {
        font-size: 12px;
        color: var(--light-muted);
    }
    body.dark-mode .col-map-cell {
        color: #9ca3af;
    }

    .col-players-cell, .col-ping-cell {
        display: inline-block;
        margin-right: 12px;
    }
}

@media (max-width: 600px) {
    .brand-title,
    #status {
        display: none;
    }
}

/* Compact mobile server cards; the rest of the mobile page stays unchanged. */
.col-mobile-meta,
.connect-command {
    display: none;
}
.mobile-fav-button { display: none; }

@media (max-width: 600px) {
    table {
        width: 100%;
        min-width: 0;
    }

    .server-row {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 20px 18px 22px 24px;
        gap: 8px 14px;
        padding: 12px 14px 14px;
        border: 0;
        border-bottom: 1px solid #25222d;
    }

    .server-row td {
        min-width: 0;
        padding: 0;
    }

    .col-server-cell {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center;
        min-width: 0;
        gap: 0;
    }

    .server-title-container {
        display: flex;
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        gap: 0;
    }

    .server-title-container > .flag-wrap,
    .server-title-container > .flag-placeholder {
        display: none;
    }

    .server-title-text {
        flex: 1 1 auto;
        max-width: 100%;
        min-width: 0;
        font-size: 15px;
        line-height: 20px;
    }

    .mobile-fav-button {
        display: inline-flex;
        flex: 0 0 28px;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        margin: 0 0 0 8px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #8f8a9c;
        font-size: 22px;
        line-height: 1;
    }

    .mobile-fav-button.is-favorite { color: #f2bd56; }

    .col-map-cell {
        grid-column: 1;
        grid-row: 2;
        padding-left: 0 !important;
        overflow: hidden;
        font-size: 13px;
        line-height: 18px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .col-players-cell,
    .col-client-cell {
        display: none !important;
    }

    .col-mobile-meta {
        grid-column: 1;
        grid-row: 3;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 22px;
        padding-left: 0 !important;
        overflow: hidden;
    }

    .mobile-player-group {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .mobile-player-group .player-num-box {
        display: inline-flex;
        align-items: baseline;
        min-width: 0;
        padding: 0;
        border: 0;
        background: transparent;
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
    }

    .mobile-player-group .player-num-box.player-empty span:first-child {
        color: #85808e;
    }

    .mobile-player-group .player-num-box.player-low span:first-child,
    .mobile-player-group .player-num-box.player-medium span:first-child {
        color: #40d99b;
    }

    .mobile-player-group .player-num-box.player-full span:first-child,
    .mobile-player-group .player-status-tag.player-full {
        color: #f2bd56;
    }

    .mobile-player-divider,
    .mobile-player-group .player-num-box span:last-child {
        color: #9690a7;
        font-weight: 500;
    }

    .mobile-player-bar {
        width: 56px;
        height: 4px;
        max-width: none;
        flex: 0 0 56px;
        background: #24212e;
        border-radius: 999px;
    }

    .mobile-player-bar .player-progress-fill {
        border-radius: inherit;
    }

    .mobile-player-bar .player-progress-fill.player-full {
        background: #f2bd56;
    }

    .mobile-player-bar .player-progress-fill.player-medium,
    .mobile-player-bar .player-progress-fill.player-low {
        background: #40d99b;
    }

    .mobile-player-bar .player-progress-fill.player-empty {
        background: #77717f;
    }

    .col-mobile-meta .client-pill {
        flex: 0 0 auto;
        padding: 3px 7px;
        border-radius: 5px;
        background: rgba(249, 115, 22, 0.15);
        background: color-mix(in srgb, var(--client-color, #f97316) 16%, transparent);
        font-size: 11px;
        line-height: 14px;
    }

    .col-mobile-meta .flag-wrap,
    .col-mobile-meta .flag-placeholder {
        display: inline-flex;
        flex: 0 0 24px;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 16px;
    }

    .col-mobile-meta .country-flag {
        width: 24px;
        height: 16px;
        border-radius: 3px;
    }

    .col-connect-cell {
        grid-column: 1;
        grid-row: 4;
        width: 100%;
        margin-top: 2px;
    }

    .connect-action-box {
        width: 100%;
        min-width: 0;
        min-height: 22px;
        padding: 1px 6px 1px 7px;
        gap: 4px;
        border: 1px solid #d5dbe4;
        border-radius: 7px;
        background: #f1f3f7;
        color: #3e4651;
        font-size: 11px;
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }

    body.dark-mode .connect-action-box {
        border-color: #24212c;
        background: #09080d;
        color: #b8b3c5;
    }

    .connect-action-box .copy-container {
        flex: 1 1 auto;
        min-width: 0;
        gap: 4px;
    }

    .connect-mobile-label {
        display: inline;
        flex: 0 0 auto;
        margin: 0;
        color: #a49db5;
        font: inherit;
    }

    .connect-command {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        color: #3e4651;
        text-overflow: ellipsis;
        white-space: nowrap;
        font: inherit;
    }

    body.dark-mode .connect-command {
        color: #b8b3c5;
    }

    .connect-mobile-label {
        color: #626b78;
    }

    body.dark-mode .connect-mobile-label {
        color: #a49db5;
    }

    .connect-action-box .copy-button {
        flex: 0 0 17px;
        width: 17px;
        height: 17px;
        margin: 0;
        color: #66707c;
        border: 0;
        background: transparent;
        font-size: 15px;
        opacity: 0.9;
    }

    body.dark-mode .connect-action-box .copy-button { color: #aaa4bd; }

    .connect-action-box > .fav-button {
        display: none;
    }
}

@media (min-width: 601px) {
/* Screenshot-matched dark presentation. Existing controls and behavior stay intact. */
body.dark-mode {
    --bg: #0b0911;
    --surface: #100e16;
    --surface2: #15121c;
    --border: #292532;
    --text: #e8e5ee;
    --muted: #9993a5;
    padding: 0 16px 24px;
    background:
        radial-gradient(ellipse at 50% 0, rgba(39, 22, 49, 0.2), transparent 48%),
        #0b0911;
    color: #e8e5ee;
}

body.dark-mode #top-bar {
    margin: 0 -16px 25px;
    padding: 4px 0;
    background: rgba(17, 14, 23, 0.96);
    border-bottom: 1px solid #28232f;
    backdrop-filter: blur(12px);
}

body.dark-mode .top-bar-row {
    width: min(96vw, 1600px);
    min-height: 28px;
    margin: 0 auto;
}

body.dark-mode .brand-icon {
    width: 24px;
    height: 24px;
}

body.dark-mode .brand-title,
body.dark-mode #status {
    display: none;
}

body.dark-mode #top-buttons {
    gap: 5px;
}

body.dark-mode #top-buttons button {
    width: 27px;
    height: 27px;
    min-width: 27px;
    border-radius: 6px;
    font-size: 12px;
}

body.dark-mode #top-buttons .search-icon,
body.dark-mode #top-buttons .theme-icon {
    width: 15px;
    height: 15px;
}

body.dark-mode .fav-toggle-btn {
    filter: grayscale(1);
    opacity: 0.82;
}

body.dark-mode .top-search-bar {
    width: min(96vw, 1600px);
    margin: 8px auto 2px;
    background: #15121c;
    border-color: #302a39;
    border-radius: 7px;
}

body.dark-mode .hero-banner,
body.dark-mode .client-tabs,
body.dark-mode .sub-game-pills,
body.dark-mode .search-results-banner,
body.dark-mode .sort-filter-bar,
body.dark-mode #servers {
    width: min(96vw, 1600px);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

body.dark-mode .hero-banner {
    margin-top: 0;
    margin-bottom: 25px;
    padding: 0 4px;
}

body.dark-mode .hero-title {
    max-width: 320px;
    margin: 0 auto 8px;
    font-size: 32px;
    line-height: 1.08;
    letter-spacing: -0.8px;
}

body.dark-mode .hero-stats {
    gap: 5px;
    margin-bottom: 8px;
    color: #ded9e6;
    font-size: 13px;
    font-weight: 400;
}

body.dark-mode .hero-stat-dot {
    width: 4px;
    height: 4px;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.55);
}

body.dark-mode .hero-stat-players,
body.dark-mode .hero-stat-servers {
    font-size: 27px;
    line-height: 1;
}

body.dark-mode .hero-stat-players {
    color: #e879d5;
}

body.dark-mode .hero-subtitle {
    max-width: 550px;
    color: #9993a5;
    font-size: 10px;
    line-height: 1.55;
}

body.dark-mode .client-tabs {
    gap: 7px;
    margin-bottom: 6px;
    padding: 0 5px 4px;
    border-bottom-color: #211d29;
}

body.dark-mode .client-tab {
    padding: 5px 7px;
    border-bottom-width: 2px;
    font-size: 10px;
    line-height: 1.2;
}

body.dark-mode .client-tab.active {
    color: #e879d5;
    border-bottom-color: #d946ef;
}

body.dark-mode .sub-game-pills {
    gap: 4px;
    margin-bottom: 9px;
    padding: 0 4px;
}

body.dark-mode .game-pill {
    gap: 4px;
    padding: 4px 7px;
    border-color: #2a2532;
    border-radius: 5px;
    background: #15121b;
    color: #d5d0dc;
    font-size: 9px;
    line-height: 1.2;
}

body.dark-mode .game-pill-dot {
    width: 4px;
    height: 4px;
}

body.dark-mode .game-pill-count {
    color: #a29baa;
    font-size: 9px;
}

body.dark-mode .sort-filter-bar {
    min-height: 31px;
    margin-bottom: 10px;
    padding: 3px 7px;
    gap: 8px;
    border-color: #302a39;
    border-radius: 7px;
    background: #15121b;
}

body.dark-mode .sort-filter-left {
    gap: 5px;
}

body.dark-mode .sort-label {
    color: #aaa3b4;
    font-size: 9px;
    letter-spacing: 0.8px;
}

body.dark-mode .sort-buttons {
    gap: 2px;
}

body.dark-mode .sort-pill {
    padding: 5px 8px;
    border-radius: 5px;
    color: #c8c2d0;
    font-size: 10px;
}

body.dark-mode .sort-pill:hover {
    background: #211b29;
}

body.dark-mode .sort-pill.active {
    border-color: #a92bb1;
    background: rgba(190, 45, 195, 0.18);
    color: #e477df;
}

body.dark-mode .sort-arrow {
    font-size: 10px;
}

body.dark-mode .search-results-banner {
    margin-bottom: 10px;
}

body.dark-mode .game {
    margin-bottom: 15px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.dark-mode .game-title {
    min-height: 0;
    margin: 0;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: #a9a2b4;
    font-size: 10px;
    line-height: 1.1;
}

body.dark-mode .game-title-left {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
}

body.dark-mode .game-title-dot,
body.dark-mode .game-title-name,
body.dark-mode .game-title-client {
    display: none;
}

body.dark-mode .game-title-stats {
    margin-right: auto;
    color: #b5aebd;
    font-size: 10px;
    text-transform: uppercase;
}

body.dark-mode .game-title-updated {
    gap: 6px;
    margin-left: auto;
    color: #938c9f;
    font-size: 9px;
}

body.dark-mode .inline-refresh-btn {
    gap: 3px;
    padding: 2px 5px;
    border-color: #2b2633;
    border-radius: 4px;
    color: #938c9f;
    font-size: 9px;
}

body.dark-mode .refresh-arrows-icon {
    width: 10px;
    height: 10px;
}

body.dark-mode .table-container {
    overflow-x: auto;
    border: 1px solid #2d2835;
    border-radius: 8px;
    background: #100e16;
}

body.dark-mode table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
}

body.dark-mode th {
    padding: 8px 9px;
    border-bottom-color: #292431;
    background: #14111a;
    color: #9f98aa;
    font-size: 9px;
    letter-spacing: 0.65px;
}

body.dark-mode th:hover {
    background: #1a1621;
}

body.dark-mode th.sorted {
    color: #e879d5;
}

body.dark-mode td {
    padding: 9px 9px;
    border-bottom-color: #25212c;
    font-size: 10px;
}

body.dark-mode .server-row:hover {
    background: #17131d;
}

body.dark-mode .server-title-container {
    gap: 7px;
    min-width: 0;
}

body.dark-mode .server-title-text {
    min-width: 0;
    font-size: 12px;
    line-height: 1.25;
}

body.dark-mode .country-flag,
body.dark-mode .flag-wrap {
    width: 15px;
    height: 11px;
    flex: 0 0 15px;
}

body.dark-mode .country-flag {
    border-radius: 2px;
}

body.dark-mode .flag-placeholder {
    width: 15px;
    font-size: 11px;
}

body.dark-mode .map-mode-text {
    color: #9e97a9;
    font-size: 10px;
}

body.dark-mode .player-bar-container {
    gap: 5px;
}

body.dark-mode .player-num-box {
    min-width: 38px;
    font-size: 10px;
}

body.dark-mode .player-progress-bar {
    max-width: 60px;
    height: 4px;
}

body.dark-mode .player-status-tag {
    font-size: 9px;
}

body.dark-mode .client-pill {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 9px;
}

body.dark-mode .connect-action-box {
    min-width: 0;
    gap: 3px;
    padding: 3px 5px;
    border: 1px solid #292431;
    border-radius: 5px;
    background: #0c0a11;
    font-size: 9px;
}

body.dark-mode .connect-str {
    min-width: 0;
    color: #aaa3b2;
    font-size: 9px;
}

body.dark-mode .connect-action-box .fav-button {
    margin-right: 0;
    font-size: 13px;
}

@media (min-width: 601px) {
    body.dark-mode .expand-icon {
        display: none;
    }

    body.dark-mode .connect-mobile-label {
        display: inline;
        color: #aaa3b2;
        font-size: 9px;
    }

    body.dark-mode .connect-command {
        display: block;
        min-width: 0;
        overflow: hidden;
        color: #aaa3b2;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 9px;
    }

    body.dark-mode .connect-action-box .copy-button {
        width: 14px;
        height: 14px;
        margin: 0;
        font-size: 11px;
    }

    body.dark-mode th.col-server,
    body.dark-mode td.col-server-cell { width: 37%; }
    body.dark-mode th.col-map,
    body.dark-mode td.col-map-cell { width: 24%; }
    body.dark-mode th.col-players,
    body.dark-mode td.col-players-cell { width: 11%; }
    body.dark-mode th.col-client,
    body.dark-mode td.col-client-cell { width: 9%; }
    body.dark-mode th.col-connect,
    body.dark-mode td.col-connect-cell { width: 19%; }
}

@media (max-width: 600px) {
    body.dark-mode {
        padding: 0 10px 16px;
    }

    body.dark-mode #top-bar {
        margin: 0 -10px 18px;
        padding: 4px 0;
    }

    body.dark-mode .top-bar-row {
        width: calc(100% - 20px);
    }

    body.dark-mode .top-search-bar {
        width: 100%;
    }

    body.dark-mode .hero-banner,
    body.dark-mode .client-tabs,
    body.dark-mode .sub-game-pills,
    body.dark-mode .search-results-banner,
    body.dark-mode .sort-filter-bar,
    body.dark-mode #servers {
        width: 100%;
        max-width: 100%;
    }

    body.dark-mode .hero-banner {
        margin-bottom: 20px;
    }

    body.dark-mode .hero-title {
        max-width: 360px;
        font-size: 26px;
    }

    body.dark-mode .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 10px;
    }

    body.dark-mode .hero-stat-players,
    body.dark-mode .hero-stat-servers {
        font-size: 21px;
    }

    body.dark-mode .client-tabs {
        gap: 3px;
    }

    body.dark-mode .client-tab {
        padding: 4px;
        font-size: 9px;
    }

    body.dark-mode .sub-game-pills {
        gap: 4px;
    }

    body.dark-mode .game-title {
        padding: 0 3px 6px;
    }
}

/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
    body.dark-mode .top-bar-row {
        min-height: 34px;
    }

    body.dark-mode #top-buttons button {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 7px;
        font-size: 16px;
    }

    body.dark-mode #top-buttons .search-icon,
    body.dark-mode #top-buttons .theme-icon {
        width: 18px;
        height: 18px;
    }

    body.dark-mode .hero-title {
        max-width: 380px;
        margin-bottom: 10px;
        font-size: 38px;
        line-height: 1.08;
        letter-spacing: -1px;
    }

    body.dark-mode .hero-stats {
        gap: 6px;
        margin-bottom: 10px;
        font-size: 15px;
    }

    body.dark-mode .hero-stat-dot {
        width: 5px;
        height: 5px;
    }

    body.dark-mode .hero-stat-players,
    body.dark-mode .hero-stat-servers {
        font-size: 32px;
    }

    body.dark-mode .hero-subtitle {
        max-width: 650px;
        font-size: 12px;
        line-height: 1.55;
    }

    body.dark-mode .client-tabs {
        gap: 9px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    body.dark-mode .client-tab {
        padding: 6px 9px;
        font-size: 12px;
    }

    body.dark-mode .sub-game-pills {
        gap: 5px;
        margin-bottom: 11px;
    }

    body.dark-mode .game-pill {
        gap: 5px;
        padding: 5px 9px;
        font-size: 11px;
    }

    body.dark-mode .game-pill-dot {
        width: 5px;
        height: 5px;
    }

    body.dark-mode .game-pill-count {
        font-size: 10px;
    }

    body.dark-mode .sort-filter-bar {
        min-height: 39px;
        margin-bottom: 12px;
        padding: 4px 9px;
    }

    body.dark-mode .sort-filter-left {
        gap: 7px;
    }

    body.dark-mode .sort-label {
        font-size: 10px;
    }

    body.dark-mode .sort-buttons {
        gap: 3px;
    }

    body.dark-mode .sort-pill {
        padding: 5px 10px;
        font-size: 12px;
    }

    body.dark-mode .sort-arrow {
        font-size: 12px;
    }

    body.dark-mode .game-title {
        font-size: 12px;
    }

    body.dark-mode .game-title-stats {
        font-size: 12px;
    }

    body.dark-mode .game-title-updated {
        font-size: 11px;
    }

    body.dark-mode .inline-refresh-btn {
        padding: 3px 7px;
        font-size: 11px;
    }

    body.dark-mode .refresh-arrows-icon {
        width: 12px;
        height: 12px;
    }

    body.dark-mode th {
        padding: 10px 10px;
        font-size: 10px;
    }

    body.dark-mode td {
        padding: 11px 10px;
        font-size: 12px;
    }

    body.dark-mode .server-title-container {
        gap: 8px;
    }

    body.dark-mode .server-title-text {
        font-size: 14px;
    }

    body.dark-mode .country-flag,
    body.dark-mode .flag-wrap {
        width: 18px;
        height: 14px;
        flex-basis: 18px;
    }

    body.dark-mode .country-flag {
        border-radius: 2px;
    }

    body.dark-mode .flag-placeholder {
        width: 18px;
        font-size: 14px;
    }

    body.dark-mode .map-mode-text {
        font-size: 12px;
    }

    body.dark-mode .player-bar-container {
        gap: 6px;
    }

    body.dark-mode .player-num-box {
        min-width: 42px;
        font-size: 12px;
    }

    body.dark-mode .player-progress-bar {
        max-width: 72px;
        height: 4px;
    }

    body.dark-mode .player-status-tag {
        font-size: 10px;
    }

    body.dark-mode .client-pill {
        padding: 4px 7px;
        font-size: 10px;
    }

    body.dark-mode .connect-action-box {
        gap: 4px;
        padding: 4px 6px;
        font-size: 10px;
    }

    body.dark-mode .connect-mobile-label,
    body.dark-mode .connect-command,
    body.dark-mode .connect-str {
        font-size: 10px;
    }

    body.dark-mode .connect-action-box .copy-button {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        font-size: 12px;
    }
}

/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
    body.dark-mode #top-bar {
        margin-bottom: 35px;
    }

    body.dark-mode .top-bar-row,
    body.dark-mode .top-search-bar {
        width: min(calc(100% - 24px), 860px);
    }

    body.dark-mode #top-buttons button {
        width: 27px;
        height: 27px;
        min-width: 27px;
        border-radius: 6px;
    }

    body.dark-mode #top-buttons .search-icon,
    body.dark-mode #top-buttons .theme-icon {
        width: 15px;
        height: 15px;
    }

    body.dark-mode .hero-banner,
    body.dark-mode .client-tabs,
    body.dark-mode .sub-game-pills,
    body.dark-mode .search-results-banner,
    body.dark-mode .sort-filter-bar,
    body.dark-mode #servers {
        width: 100%;
        max-width: 860px;
    }

    body.dark-mode .hero-banner {
        margin-bottom: 35px;
    }

    body.dark-mode .hero-title {
        max-width: 320px;
        margin-bottom: 8px;
        font-size: 32px;
        line-height: 1.08;
        letter-spacing: -0.8px;
    }

    body.dark-mode .hero-stats {
        gap: 5px;
        margin-bottom: 8px;
        font-size: 13px;
    }

    body.dark-mode .hero-stat-players,
    body.dark-mode .hero-stat-servers {
        font-size: 27px;
    }

    body.dark-mode .hero-subtitle {
        max-width: 560px;
        font-size: 10px;
        line-height: 1.55;
    }

    body.dark-mode .client-tabs {
        gap: 7px;
        margin-bottom: 6px;
        padding: 0 5px 4px;
    }

    body.dark-mode .client-tab {
        padding: 4px 6px;
        font-size: 10px;
    }

    body.dark-mode .sub-game-pills {
        gap: 4px;
        margin-bottom: 9px;
    }

    body.dark-mode .game-pill {
        gap: 4px;
        padding: 3px 6px;
        border-color: #292431;
        border-radius: 5px;
        font-size: 9px;
    }

    body.dark-mode .game-pill-dot {
        width: 4px;
        height: 4px;
    }

    body.dark-mode .game-pill-count {
        font-size: 9px;
    }

    body.dark-mode .sort-filter-bar {
        min-height: 36px;
        margin-bottom: 10px;
        padding: 3px 7px;
        border-color: #292431;
        border-radius: 7px;
    }

    body.dark-mode .sort-filter-left {
        gap: 5px;
    }

    body.dark-mode .sort-label {
        font-size: 8px;
        letter-spacing: 0.8px;
    }

    body.dark-mode .sort-pill {
        padding: 4px 7px;
        font-size: 10px;
    }

    body.dark-mode .sort-arrow {
        font-size: 10px;
    }

    body.dark-mode .game-title {
        min-height: 0;
        padding: 0 4px 4px;
        font-size: 10px;
    }

    body.dark-mode .game-title-stats {
        font-size: 10px;
    }

    body.dark-mode .game-title-updated {
        font-size: 9px;
    }

    body.dark-mode .inline-refresh-btn {
        padding: 2px 5px;
        font-size: 9px;
    }

    body.dark-mode th {
        padding: 8px 9px;
        border-bottom-color: #292431;
        background: #14111a;
        font-size: 9px;
    }

    body.dark-mode td {
        padding: 9px 9px;
        border-bottom-color: #25212b;
        font-size: 10px;
    }

    body.dark-mode .server-title-text {
        font-size: 12px;
    }

    body.dark-mode .map-mode-text {
        font-size: 10px;
    }

    body.dark-mode .player-num-box {
        min-width: 38px;
        font-size: 10px;
    }

    body.dark-mode .player-progress-bar {
        max-width: 60px;
        height: 4px;
    }

    body.dark-mode .client-pill {
        padding: 3px 5px;
        font-size: 9px;
    }

    body.dark-mode .connect-action-box {
        gap: 3px;
        padding: 3px 5px;
        border-color: #292431;
        border-radius: 5px;
        font-size: 8px;
    }

    body.dark-mode .connect-mobile-label,
    body.dark-mode .connect-command,
    body.dark-mode .connect-str {
        font-size: 8px;
    }

    body.dark-mode td.col-server-cell,
    body.dark-mode th.col-server { width: 37%; }
    body.dark-mode td.col-map-cell,
    body.dark-mode th.col-map { width: 24%; }
    body.dark-mode td.col-players-cell,
    body.dark-mode th.col-players { width: 9%; }
    body.dark-mode td.col-client-cell,
    body.dark-mode th.col-client { width: 10%; }
    body.dark-mode td.col-connect-cell,
    body.dark-mode th.col-connect { width: 20%; }
}

body.dark-mode .table-container {
    border: 1px solid #292431;
    border-radius: 7px;
    box-shadow: none;
}

body.dark-mode td {
    border-bottom-color: #25212b;
}

/* Keep the confirmation visible even when the clicked row is near a page edge. */
body.dark-mode .copy-toast {
    position: fixed;
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 1100;
    max-width: calc(100vw - 24px);
    margin: 0;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.38);
    white-space: normal;
}

body.dark-mode .copy-toast.show {
    transform: translateY(0) scale(1);
}

/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
    body.dark-mode #top-bar {
        margin-bottom: 52px;
        padding: 8px 0;
    }

    body.dark-mode .top-bar-row,
    body.dark-mode .top-search-bar {
        width: min(calc(100% - 48px), 1232px);
    }

    body.dark-mode .top-bar-row {
        min-height: 48px;
    }

    body.dark-mode #top-buttons button {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 8px;
    }

    body.dark-mode #top-buttons .search-icon,
    body.dark-mode #top-buttons .theme-icon {
        width: 18px;
        height: 18px;
    }

    body.dark-mode .hero-banner,
    body.dark-mode .client-tabs,
    body.dark-mode .sub-game-pills,
    body.dark-mode .search-results-banner,
    body.dark-mode .sort-filter-bar,
    body.dark-mode #servers {
        width: 100%;
        max-width: 1232px;
    }

    body.dark-mode .hero-banner {
        margin-top: 0;
        margin-bottom: 40px;
    }

    body.dark-mode .hero-title {
        max-width: 480px;
        margin-bottom: 12px;
        font-size: 46px;
        line-height: 1.02;
        letter-spacing: -1.5px;
    }

    body.dark-mode .hero-stats {
        gap: 8px;
        margin-bottom: 14px;
        font-size: 16px;
    }

    body.dark-mode .hero-stat-dot {
        width: 7px;
        height: 7px;
    }

    body.dark-mode .hero-stat-players,
    body.dark-mode .hero-stat-servers {
        font-size: 40px;
    }

    body.dark-mode .hero-subtitle {
        max-width: 800px;
        font-size: 15px;
        line-height: 1.55;
    }

    body.dark-mode .client-tabs {
        gap: 0 34px;
        margin-bottom: 6px;
        padding: 0 4px 8px;
        border-bottom-color: #211d29;
    }

    body.dark-mode .client-tab {
        padding: 8px 2px;
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        background: transparent;
        color: #9e97a9;
        font-size: 13px;
    }

    body.dark-mode .client-tab:hover {
        background: transparent;
    }

    body.dark-mode .client-tab.active {
        border-bottom-color: #d946ef;
        color: #e879d5;
    }

    body.dark-mode .sub-game-pills {
        gap: 6px;
        margin-bottom: 15px;
    }

    body.dark-mode .game-pill {
        min-height: 28px;
        gap: 8px;
        padding: 4px 9px;
        border-color: #2a2532;
        border-radius: 6px;
        font-size: 12px;
    }

    body.dark-mode .game-pill-dot {
        width: 6px;
        height: 6px;
    }

    body.dark-mode .game-pill-count {
        font-size: 11px;
    }

    body.dark-mode .sort-filter-bar {
        min-height: 50px;
        margin-bottom: 15px;
        padding: 5px 12px;
        border-color: #292431;
        border-radius: 8px;
    }

    body.dark-mode .sort-filter-left {
        gap: 8px;
    }

    body.dark-mode .sort-label {
        font-size: 11px;
        letter-spacing: 1px;
    }

    body.dark-mode .sort-buttons {
        gap: 4px;
    }

    body.dark-mode .sort-pill {
        min-height: 28px;
        padding: 4px 9px;
        border-radius: 6px;
        font-size: 12px;
    }

    body.dark-mode .sort-arrow {
        font-size: 12px;
    }

    body.dark-mode .game-title {
        min-height: 0;
        padding: 0 6px;
        font-size: 13px;
    }

    body.dark-mode .game-title-stats {
        font-size: 13px;
    }

    body.dark-mode .game-title-updated {
        font-size: 11px;
    }

    body.dark-mode .inline-refresh-btn {
        padding: 3px 7px;
        font-size: 11px;
    }

    body.dark-mode .table-container {
        border-color: #292431;
        border-radius: 7px;
    }

    body.dark-mode th {
        padding: 9px 11px;
        border-bottom-color: #292431;
        background: #14111a;
        font-size: 11px;
        letter-spacing: 0.7px;
    }

    body.dark-mode td {
        padding: 16px 12px;
        border-bottom-color: #25212b;
        font-size: 16px;
        line-height: 1.2;
    }

    body.dark-mode .server-title-container {
        gap: 8px;
    }

    body.dark-mode .server-title-text {
        font-size: 16px;
    }

    body.dark-mode .country-flag,
    body.dark-mode .flag-wrap {
        width: 24px;
        height: 18px;
        flex-basis: 24px;
    }

    body.dark-mode .country-flag {
        border-radius: 2px;
    }

    body.dark-mode .flag-placeholder {
        width: 24px;
        font-size: 18px;
    }

    body.dark-mode .map-mode-text {
        font-size: 13px;
    }

    body.dark-mode .player-bar-container {
        gap: 8px;
    }

    body.dark-mode .player-num-box {
        min-width: 42px;
        font-size: 13px;
    }

    body.dark-mode .player-progress-bar {
        max-width: 80px;
        height: 5px;
    }

    body.dark-mode .player-status-tag {
        font-size: 11px;
    }

    body.dark-mode .client-pill {
        padding: 4px 7px;
        font-size: 12px;
    }

    body.dark-mode .connect-action-box {
        gap: 4px;
        padding: 4px 6px;
        border-color: #292431;
        border-radius: 5px;
        font-size: 13px;
    }

    body.dark-mode .connect-mobile-label,
    body.dark-mode .connect-command,
    body.dark-mode .connect-str {
        font-size: 13px;
    }

    body.dark-mode .connect-action-box .copy-button {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
        font-size: 14px;
    }

    body.dark-mode td.col-server-cell,
    body.dark-mode th.col-server { width: 38%; }
    body.dark-mode td.col-map-cell,
    body.dark-mode th.col-map { width: 19%; }
    body.dark-mode td.col-players-cell,
    body.dark-mode th.col-players { width: 11%; }
    body.dark-mode td.col-client-cell,
    body.dark-mode th.col-client { width: 9%; }
    body.dark-mode td.col-connect-cell,
    body.dark-mode th.col-connect { width: 23%; }

    body.dark-mode th.col-server {
        padding-left: 40px;
    }

    body.dark-mode td.col-server-cell {
        padding-left: 5px;
    }

    body.dark-mode .server-title-container {
        gap: 15px;
    }

    body.dark-mode .connect-action-box {
        gap: 6px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    body.dark-mode .connect-action-box > .copy-container {
        position: relative;
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
        gap: 5px;
        overflow: hidden;
        padding: 4px 7px;
        border: 1px solid #292431;
        border-radius: 5px;
        background: #0c0a11;
    }

    body.dark-mode .connect-action-box .connect-mobile-label {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    body.dark-mode .connect-action-box .connect-command {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.dark-mode .connect-action-box .copy-button {
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        margin: 0 0 0 auto;
    }

    body.dark-mode .connect-action-box > .fav-button {
        display: inline-flex;
        flex: 0 0 32px;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        min-width: 32px;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        font-size: 18px;
    }
}
}

/* The copied confirmation replaces the address inside its CONNECT field. */
body.dark-mode .connect-action-box .copy-container,
body.dark-mode .details-connect-copy {
    position: relative;
}

body.dark-mode .details-connect-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

body.dark-mode .details-connect-copy {
    display: inline-flex;
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    min-width: 0;
    gap: 6px;
    padding: 4px 7px;
    padding-right: calc(7px + 1cm);
    border: 1px solid #292431;
    border-radius: 5px;
    background: #0c0a11;
    color: #aaa3b2;
    font: 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    vertical-align: middle;
}

body.dark-mode .details-connect-copy .connect-command {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: inherit;
}

body.dark-mode .details-connect-copy .copy-button {
    flex: 0 0 24px;
    transform: translateX(1cm);
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
}

body.dark-mode .copy-toast {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 4px 8px;
    overflow: hidden;
    border: 1px solid #27875d;
    border-radius: 5px;
    background: #0d1913;
    color: #84dba5;
    font: 14px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    opacity: 0;
    visibility: hidden;
    transform: none;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0.16s ease;
    white-space: nowrap;
}

body.dark-mode .copy-toast::after {
    flex: 0 0 auto;
    margin-left: 8px;
    color: #42cf84;
    content: "✓";
    font: 14px/1 Arial, sans-serif;
}

body.dark-mode .copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}



/* Fix copy confirmation alignment in LIGHT MODE */
body:not(.dark-mode) .connect-action-box .copy-container,
body:not(.dark-mode) .details-connect-copy {
    position: relative;
    min-width: 0;
}

body:not(.dark-mode) .copy-toast {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 2px 6px;
    overflow: hidden;
    border: 1px solid #27875d;
    border-radius: 5px;
    background: #e5f8ec;
    color: #176b3a;
    font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    opacity: 0;
    visibility: hidden;
    transform: none;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0.16s ease;
    white-space: nowrap;
}

body:not(.dark-mode) .copy-toast::after {
    flex: 0 0 auto;
    margin-left: 5px;
    color: #21834b;
    content: "✓";
    font: 9px/1 Arial, sans-serif;
}

body:not(.dark-mode) .copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}






/* DARK MODE: match toast font and size to CONNECT box */
body.dark-mode .connect-action-box .copy-container,
body.dark-mode .details-connect-copy {
    position: relative;
    min-width: 0;
}

body.dark-mode .connect-action-box .copy-toast,
body.dark-mode .details-connect-copy .copy-toast {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 4px 7px;
    overflow: hidden;
    border: 1px solid #27875d;
    border-radius: 5px;
    background: #163b29;
    color: #a7f3c5;
    font: inherit;
    opacity: 0;
    visibility: hidden;
    transform: none;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0.16s ease;
    white-space: nowrap;
}

body.dark-mode .copy-toast::after {
    flex: 0 0 auto;
    margin-left: 5px;
    color: #69d99a;
    content: "✓";
    font: inherit;
}

body.dark-mode .copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}



/* FINAL FIX: toast exactly matches the CONNECT box */
body.dark-mode .connect-action-box > .copy-container > .copy-toast,
body.dark-mode .details-connect-copy > .copy-toast,
body:not(.dark-mode) .connect-action-box > .copy-container > .copy-toast,
body:not(.dark-mode) .details-connect-copy > .copy-toast {
    position: absolute !important;
inset: -2px -1px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-radius: 5px !important;
    transform: none !important;
    white-space: nowrap !important;
}









/* LIGHT MODE: same component layout and responsive styling, with a light palette. */
body:not(.dark-mode) .sort-filter-bar {
    background: var(--surface);
    border-color: var(--border);
}

body:not(.dark-mode) .sort-label,
body:not(.dark-mode) .filter-label {
    color: #656d76;
}

body:not(.dark-mode) .sort-pill {
    color: #1f2328;
}

body:not(.dark-mode) .sort-pill:hover {
    background: #f1eef5;
}

body:not(.dark-mode) .sort-pill.active {
    background: rgba(192, 38, 211, 0.08);
    border-color: #d946ef;
    color: #a21caf;
}

body:not(.dark-mode) .filter-select {
    background: #ffffff;
    border-color: var(--border);
    color: #1f2328;
}

body:not(.dark-mode) .trickshot-btn {
    background: #ffffff;
    border-color: var(--border);
    color: #656d76;
}

body:not(.dark-mode) .trickshot-btn:hover {
    color: #1f2328;
}

body:not(.dark-mode) .game-title-updated {
    color: #656d76;
}

body:not(.dark-mode) .inline-refresh-btn {
    color: #656d76;
    border-color: #d0d7de;
    background: transparent;
}

body:not(.dark-mode) .inline-refresh-btn:hover {
    color: #1f2328;
    background: #f1eef5;
}

body:not(.dark-mode) .country-cell {
    color: #656d76;
}

body:not(.dark-mode) .rank-num,
body:not(.dark-mode) .country-code-text {
    color: #656d76;
}

body:not(.dark-mode) .ip-text {
    color: #1f2328;
}

body:not(.dark-mode) .map-mode-text {
    color: #656d76;
}

body:not(.dark-mode) .connect-action-box {
    background: #ffffff;
}

body:not(.dark-mode) .connect-str {
    color: #656d76;
}

/* DARK MODE */
body:not(.dark-mode) {
    --bg: var(--light-bg);
    --surface: var(--light-surface);
    --surface2: var(--light-surface2);
    --border: var(--light-border);
    --text: var(--light-text);
    --muted: var(--light-muted);
    background: var(--light-bg);
    color: var(--light-text);
}

body:not(.dark-mode) #top-bar {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--border);
}

body:not(.dark-mode) button {
    background: #ffffff;
    color: #1f2328;
    border-color: var(--border);
}

body:not(.dark-mode) button:hover { background: #f1eef5; }

body:not(.dark-mode) .hero-stats { color: #1f2328; }

body:not(.dark-mode) .hero-subtitle { color: #656d76; }

body:not(.dark-mode) .client-tabs { border-color: var(--border); }

body:not(.dark-mode) .client-tab { color: #656d76; }

body:not(.dark-mode) .client-tab:hover { color: #1f2328; }

body:not(.dark-mode) .client-tab.active { color: #1f2328; }

body:not(.dark-mode) .game-pill {
    background: #ffffff;
    border-color: #e8e4ed;
    color: #1f2328;
}

body:not(.dark-mode) .game-pill:hover {
    background: #f1eef5;
    border-color: #d0d7de;
}

body:not(.dark-mode) .game-pill-count { color: #656d76; }

body:not(.dark-mode) .top-search-bar {
    background: #ffffff;
    border-color: var(--border);
}

body:not(.dark-mode) .top-search-input-wrap input {
    color: #1f2328;
}

body:not(.dark-mode) .search-results-banner {
    background: rgba(192, 38, 211, 0.08);
    border-color: #d946ef;
}

body:not(.dark-mode) .search-results-info {
    color: #1f2328;
}

body:not(.dark-mode) .banner-clear-btn {
    background: #f1eef5;
    color: #1f2328;
    border-color: #d0d7de;
}

body:not(.dark-mode) .banner-clear-btn:hover {
    background: #e8e4ed;
    color: #1f2328;
}

body:not(.dark-mode) .fav-toggle-btn.active {
    background: #fef3c7;
    border-color: #f59e0b;
}

body:not(.dark-mode) .game {
    background: var(--surface);
    border-color: var(--border);
}

body:not(.dark-mode) .game-title,
body:not(.dark-mode) th,
body:not(.dark-mode) .pagination-container {
    background: #ffffff;
    border-color: var(--border);
}

body:not(.dark-mode) .game-title-name { color: #1f2328; }

body:not(.dark-mode) .game-title-stats { color: #656d76; }

body:not(.dark-mode) td { border-color: #d0d7de; }

body:not(.dark-mode) .server-row:hover { background: #f1eef5; }

body:not(.dark-mode) .details-row { background: #f8f7fa; }

body:not(.dark-mode) .details { border-color: #d0d7de; }

body:not(.dark-mode) .player-empty { color: #656d76; border-color: #d1d5db; background: #f3f4f6; }

body:not(.dark-mode) .player-low { color: #92400e; border-color: #fcd34d; background: #fef3c7; }

body:not(.dark-mode) .player-medium { color: #15803d; border-color: #86efac; background: #dcfce7; }

body:not(.dark-mode) .player-full { color: #b91c1c; border-color: #fecaca; background: #fee2e2; }

body:not(.dark-mode) .status-online { background: #dcfce7; color: #15803d; }

body:not(.dark-mode) .status-offline { background: #fee2e2; color: #b91c1c; }

body:not(.dark-mode) .toast {
    background: var(--surface);
    color: #1f2328;
    border-color: var(--border);
}

body:not(.dark-mode) .search-toggle-btn {
    background: #ffffff;
    color: #1f2328;
    border-color: var(--border);
}

body:not(.dark-mode) .search-toggle-btn.active {
    background: #f1eef5;
    color: #1f2328;
    border-color: #d0d7de;
}

/* MOBILE RESPONSIVE CARD VIEW */
@media (max-width: 600px) {
body:not(.dark-mode) .server-row {
        border-bottom-color: var(--border);
    }
}

/* MOBILE RESPONSIVE CARD VIEW */
@media (max-width: 600px) {
body:not(.dark-mode) .connect-mobile-label {
        color: #656d76;
    }
}

/* MOBILE RESPONSIVE CARD VIEW */
@media (max-width: 600px) {
body:not(.dark-mode) .col-map-cell {
        color: #656d76;
    }
}

@media (max-width: 600px) {
body:not(.dark-mode) .connect-action-box {
        border-color: #d0d7de;
        background: #ffffff;
        color: #656d76;
    }
}

@media (max-width: 600px) {
body:not(.dark-mode) .connect-command {
        color: #656d76;
    }
}

@media (max-width: 600px) {
body:not(.dark-mode) .connect-mobile-label {
        color: #656d76;
    }
}

@media (max-width: 600px) {
body:not(.dark-mode) .connect-action-box .copy-button { color: #656d76; }
}

@media (min-width: 601px) {
/* Screenshot-matched dark presentation. Existing controls and behavior stay intact. */
body:not(.dark-mode) {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface2: #eef3f7;
    --border: #d0d7de;
    --text: #1f2328;
    --muted: #656d76;
    padding: 0 16px 24px;
    background:
        radial-gradient(ellipse at 50% 0, rgba(147, 51, 234, 0.06), transparent 48%),
        #f4f6f9;
    color: #1f2328;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) #top-bar {
    margin: 0 -16px 25px;
    padding: 4px 0;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #d0d7de;
    backdrop-filter: blur(12px);
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .top-bar-row {
    width: min(96vw, 1600px);
    min-height: 28px;
    margin: 0 auto;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .brand-icon {
    width: 24px;
    height: 24px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .brand-title,
body:not(.dark-mode) #status {
    display: none;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons {
    gap: 5px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons button {
    width: 27px;
    height: 27px;
    min-width: 27px;
    border-radius: 6px;
    font-size: 12px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons .search-icon,
body:not(.dark-mode) #top-buttons .theme-icon {
    width: 15px;
    height: 15px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .fav-toggle-btn {
    filter: grayscale(1);
    opacity: 0.82;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .top-search-bar {
    width: min(96vw, 1600px);
    margin: 8px auto 2px;
    background: #eef3f7;
    border-color: #d0d7de;
    border-radius: 7px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .hero-banner,
body:not(.dark-mode) .client-tabs,
body:not(.dark-mode) .sub-game-pills,
body:not(.dark-mode) .search-results-banner,
body:not(.dark-mode) .sort-filter-bar,
body:not(.dark-mode) #servers {
    width: min(96vw, 1600px);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .hero-banner {
    margin-top: 0;
    margin-bottom: 25px;
    padding: 0 4px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .hero-title {
    max-width: 320px;
    margin: 0 auto 8px;
    font-size: 32px;
    line-height: 1.08;
    letter-spacing: -0.8px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .hero-stats {
    gap: 5px;
    margin-bottom: 8px;
    color: #1f2328;
    font-size: 13px;
    font-weight: 400;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .hero-stat-dot {
    width: 4px;
    height: 4px;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.35);
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .hero-stat-players,
body:not(.dark-mode) .hero-stat-servers {
    font-size: 27px;
    line-height: 1;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .hero-stat-players {
    color: #a21caf;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .hero-subtitle {
    max-width: 550px;
    color: #656d76;
    font-size: 10px;
    line-height: 1.55;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .client-tabs {
    gap: 7px;
    margin-bottom: 6px;
    padding: 0 5px 4px;
    border-bottom-color: #f1eef5;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .client-tab {
    padding: 5px 7px;
    border-bottom-width: 2px;
    font-size: 10px;
    line-height: 1.2;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .client-tab.active {
    color: #a21caf;
    border-bottom-color: #d946ef;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sub-game-pills {
    gap: 4px;
    margin-bottom: 9px;
    padding: 0 4px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game-pill {
    gap: 4px;
    padding: 4px 7px;
    border-color: #d0d7de;
    border-radius: 5px;
    background: #eef3f7;
    color: #1f2328;
    font-size: 9px;
    line-height: 1.2;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game-pill-dot {
    width: 4px;
    height: 4px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game-pill-count {
    color: #656d76;
    font-size: 9px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sort-filter-bar {
    min-height: 31px;
    margin-bottom: 10px;
    padding: 3px 7px;
    gap: 8px;
    border-color: #d0d7de;
    border-radius: 7px;
    background: #eef3f7;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sort-filter-left {
    gap: 5px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sort-label {
    color: #656d76;
    font-size: 9px;
    letter-spacing: 0.8px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sort-buttons {
    gap: 2px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sort-pill {
    padding: 5px 8px;
    border-radius: 5px;
    color: #1f2328;
    font-size: 10px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sort-pill:hover {
    background: #f1eef5;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sort-pill.active {
    border-color: #86198f;
    background: rgba(190, 45, 195, 0.08);
    color: #a21caf;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .sort-arrow {
    font-size: 10px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .search-results-banner {
    margin-bottom: 10px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game {
    margin-bottom: 15px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game-title {
    min-height: 0;
    margin: 0;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: #656d76;
    font-size: 10px;
    line-height: 1.1;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game-title-left {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game-title-dot,
body:not(.dark-mode) .game-title-name,
body:not(.dark-mode) .game-title-client {
    display: none;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game-title-stats {
    margin-right: auto;
    color: #656d76;
    font-size: 10px;
    text-transform: uppercase;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .game-title-updated {
    gap: 6px;
    margin-left: auto;
    color: #656d76;
    font-size: 9px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .inline-refresh-btn {
    gap: 3px;
    padding: 2px 5px;
    border-color: #d0d7de;
    border-radius: 4px;
    color: #656d76;
    font-size: 9px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .refresh-arrows-icon {
    width: 10px;
    height: 10px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .table-container {
    overflow-x: auto;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #ffffff;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) th {
    padding: 8px 9px;
    border-bottom-color: #d0d7de;
    background: #ffffff;
    color: #656d76;
    font-size: 9px;
    letter-spacing: 0.65px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) th:hover {
    background: #f1eef5;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) th.sorted {
    color: #a21caf;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) td {
    padding: 9px 9px;
    border-bottom-color: #d0d7de;
    font-size: 10px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .server-row:hover {
    background: #f1eef5;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .server-title-container {
    gap: 7px;
    min-width: 0;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .server-title-text {
    min-width: 0;
    font-size: 12px;
    line-height: 1.25;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .country-flag,
body:not(.dark-mode) .flag-wrap {
    width: 15px;
    height: 11px;
    flex: 0 0 15px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .country-flag {
    border-radius: 2px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .flag-placeholder {
    width: 15px;
    font-size: 11px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .map-mode-text {
    color: #656d76;
    font-size: 10px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .player-bar-container {
    gap: 5px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .player-num-box {
    min-width: 38px;
    font-size: 10px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .player-progress-bar {
    max-width: 60px;
    height: 4px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .player-status-tag {
    font-size: 9px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .client-pill {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 9px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box {
    min-width: 0;
    gap: 3px;
    padding: 3px 5px;
    border: 1px solid #d0d7de;
    border-radius: 5px;
    background: #f8f7fa;
    font-size: 9px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .connect-str {
    min-width: 0;
    color: #656d76;
    font-size: 9px;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box .fav-button {
    margin-right: 0;
    font-size: 13px;
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) .expand-icon {
        display: none;
    }
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) .connect-mobile-label {
        display: inline;
        color: #656d76;
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) .connect-command {
        display: block;
        min-width: 0;
        overflow: hidden;
        color: #656d76;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box .copy-button {
        width: 14px;
        height: 14px;
        margin: 0;
        font-size: 11px;
    }
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) th.col-server,
    body:not(.dark-mode) td.col-server-cell { width: 37%; }
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) th.col-map,
    body:not(.dark-mode) td.col-map-cell { width: 24%; }
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) th.col-players,
    body:not(.dark-mode) td.col-players-cell { width: 11%; }
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) th.col-client,
    body:not(.dark-mode) td.col-client-cell { width: 9%; }
}
}

@media (min-width: 601px) {
@media (min-width: 601px) {
body:not(.dark-mode) th.col-connect,
    body:not(.dark-mode) td.col-connect-cell { width: 19%; }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) {
        padding: 0 10px 16px;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) #top-bar {
        margin: 0 -10px 18px;
        padding: 4px 0;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .top-bar-row {
        width: calc(100% - 20px);
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .top-search-bar {
        width: 100%;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .hero-banner,
    body:not(.dark-mode) .client-tabs,
    body:not(.dark-mode) .sub-game-pills,
    body:not(.dark-mode) .search-results-banner,
    body:not(.dark-mode) .sort-filter-bar,
    body:not(.dark-mode) #servers {
        width: 100%;
        max-width: 100%;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .hero-banner {
        margin-bottom: 20px;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .hero-title {
        max-width: 360px;
        font-size: 26px;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .hero-stat-players,
    body:not(.dark-mode) .hero-stat-servers {
        font-size: 21px;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .client-tabs {
        gap: 3px;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .client-tab {
        padding: 4px;
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .sub-game-pills {
        gap: 4px;
    }
}
}

@media (min-width: 601px) {
@media (max-width: 600px) {
body:not(.dark-mode) .game-title {
        padding: 0 3px 6px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .top-bar-row {
        min-height: 34px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons button {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 7px;
        font-size: 16px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons .search-icon,
    body:not(.dark-mode) #top-buttons .theme-icon {
        width: 18px;
        height: 18px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-title {
        max-width: 380px;
        margin-bottom: 10px;
        font-size: 38px;
        line-height: 1.08;
        letter-spacing: -1px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-stats {
        gap: 6px;
        margin-bottom: 10px;
        font-size: 15px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-stat-dot {
        width: 5px;
        height: 5px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-stat-players,
    body:not(.dark-mode) .hero-stat-servers {
        font-size: 32px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-subtitle {
        max-width: 650px;
        font-size: 12px;
        line-height: 1.55;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .client-tabs {
        gap: 9px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .client-tab {
        padding: 6px 9px;
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .sub-game-pills {
        gap: 5px;
        margin-bottom: 11px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill {
        gap: 5px;
        padding: 5px 9px;
        font-size: 11px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill-dot {
        width: 5px;
        height: 5px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill-count {
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-filter-bar {
        min-height: 39px;
        margin-bottom: 12px;
        padding: 4px 9px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-filter-left {
        gap: 7px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-label {
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-buttons {
        gap: 3px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-pill {
        padding: 5px 10px;
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-arrow {
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title {
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title-stats {
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title-updated {
        font-size: 11px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .inline-refresh-btn {
        padding: 3px 7px;
        font-size: 11px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .refresh-arrows-icon {
        width: 12px;
        height: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) th {
        padding: 10px 10px;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) td {
        padding: 11px 10px;
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .server-title-container {
        gap: 8px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .server-title-text {
        font-size: 14px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .country-flag,
    body:not(.dark-mode) .flag-wrap {
        width: 18px;
        height: 14px;
        flex-basis: 18px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .country-flag {
        border-radius: 2px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .flag-placeholder {
        width: 18px;
        font-size: 14px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .map-mode-text {
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .player-bar-container {
        gap: 6px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .player-num-box {
        min-width: 42px;
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .player-progress-bar {
        max-width: 72px;
        height: 4px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .player-status-tag {
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .client-pill {
        padding: 4px 7px;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box {
        gap: 4px;
        padding: 4px 6px;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-mobile-label,
    body:not(.dark-mode) .connect-command,
    body:not(.dark-mode) .connect-str {
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Desktop scale: keep labels and controls comfortably readable at the wider layout. */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box .copy-button {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) #top-bar {
        margin-bottom: 35px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .top-bar-row,
    body:not(.dark-mode) .top-search-bar {
        width: min(calc(100% - 24px), 860px);
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons button {
        width: 27px;
        height: 27px;
        min-width: 27px;
        border-radius: 6px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons .search-icon,
    body:not(.dark-mode) #top-buttons .theme-icon {
        width: 15px;
        height: 15px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-banner,
    body:not(.dark-mode) .client-tabs,
    body:not(.dark-mode) .sub-game-pills,
    body:not(.dark-mode) .search-results-banner,
    body:not(.dark-mode) .sort-filter-bar,
    body:not(.dark-mode) #servers {
        width: 100%;
        max-width: 860px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-banner {
        margin-bottom: 35px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-title {
        max-width: 320px;
        margin-bottom: 8px;
        font-size: 32px;
        line-height: 1.08;
        letter-spacing: -0.8px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-stats {
        gap: 5px;
        margin-bottom: 8px;
        font-size: 13px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-stat-players,
    body:not(.dark-mode) .hero-stat-servers {
        font-size: 27px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-subtitle {
        max-width: 560px;
        font-size: 10px;
        line-height: 1.55;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .client-tabs {
        gap: 7px;
        margin-bottom: 6px;
        padding: 0 5px 4px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .client-tab {
        padding: 4px 6px;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .sub-game-pills {
        gap: 4px;
        margin-bottom: 9px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill {
        gap: 4px;
        padding: 3px 6px;
        border-color: #d0d7de;
        border-radius: 5px;
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill-dot {
        width: 4px;
        height: 4px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill-count {
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-filter-bar {
        min-height: 36px;
        margin-bottom: 10px;
        padding: 3px 7px;
        border-color: #d0d7de;
        border-radius: 7px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-filter-left {
        gap: 5px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-label {
        font-size: 8px;
        letter-spacing: 0.8px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-pill {
        padding: 4px 7px;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-arrow {
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title {
        min-height: 0;
        padding: 0 4px 4px;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title-stats {
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title-updated {
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .inline-refresh-btn {
        padding: 2px 5px;
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) th {
        padding: 8px 9px;
        border-bottom-color: #d0d7de;
        background: #ffffff;
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) td {
        padding: 9px 9px;
        border-bottom-color: #d0d7de;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .server-title-text {
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .map-mode-text {
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .player-num-box {
        min-width: 38px;
        font-size: 10px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .player-progress-bar {
        max-width: 60px;
        height: 4px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .client-pill {
        padding: 3px 5px;
        font-size: 9px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box {
        gap: 3px;
        padding: 3px 5px;
        border-color: #d0d7de;
        border-radius: 5px;
        font-size: 8px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-mobile-label,
    body:not(.dark-mode) .connect-command,
    body:not(.dark-mode) .connect-str {
        font-size: 8px;
    }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-server-cell,
    body:not(.dark-mode) th.col-server { width: 37%; }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-map-cell,
    body:not(.dark-mode) th.col-map { width: 24%; }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-players-cell,
    body:not(.dark-mode) th.col-players { width: 9%; }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-client-cell,
    body:not(.dark-mode) th.col-client { width: 10%; }
}
}

@media (min-width: 601px) {
/* Match the supplied GameServe reference scale and spacing. */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-connect-cell,
    body:not(.dark-mode) th.col-connect { width: 20%; }
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .table-container {
    border: 1px solid #d0d7de;
    border-radius: 7px;
    box-shadow: none;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) td {
    border-bottom-color: #d0d7de;
}
}

@media (min-width: 601px) {
/* Keep the confirmation visible even when the clicked row is near a page edge. */
body:not(.dark-mode) .copy-toast {
    position: fixed;
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 1100;
    max-width: calc(100vw - 24px);
    margin: 0;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 5px 18px rgba(31, 35, 40, 0.12);
    white-space: normal;
}
}

@media (min-width: 601px) {
body:not(.dark-mode) .copy-toast.show {
    transform: translateY(0) scale(1);
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) #top-bar {
        margin-bottom: 52px;
        padding: 8px 0;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .top-bar-row,
    body:not(.dark-mode) .top-search-bar {
        width: min(calc(100% - 48px), 1232px);
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .top-bar-row {
        min-height: 48px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons button {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 8px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) #top-buttons .search-icon,
    body:not(.dark-mode) #top-buttons .theme-icon {
        width: 18px;
        height: 18px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-banner,
    body:not(.dark-mode) .client-tabs,
    body:not(.dark-mode) .sub-game-pills,
    body:not(.dark-mode) .search-results-banner,
    body:not(.dark-mode) .sort-filter-bar,
    body:not(.dark-mode) #servers {
        width: 100%;
        max-width: 1232px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-banner {
        margin-top: 0;
        margin-bottom: 40px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-title {
        max-width: 480px;
        margin-bottom: 12px;
        font-size: 46px;
        line-height: 1.02;
        letter-spacing: -1.5px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-stats {
        gap: 8px;
        margin-bottom: 14px;
        font-size: 16px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-stat-dot {
        width: 7px;
        height: 7px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-stat-players,
    body:not(.dark-mode) .hero-stat-servers {
        font-size: 40px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .hero-subtitle {
        max-width: 800px;
        font-size: 15px;
        line-height: 1.55;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .client-tabs {
        gap: 0 34px;
        margin-bottom: 6px;
        padding: 0 4px 8px;
        border-bottom-color: #f1eef5;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .client-tab {
        padding: 8px 2px;
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        background: transparent;
        color: #656d76;
        font-size: 13px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .client-tab:hover {
        background: transparent;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .client-tab.active {
        border-bottom-color: #d946ef;
        color: #a21caf;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .sub-game-pills {
        gap: 6px;
        margin-bottom: 15px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill {
        min-height: 28px;
        gap: 8px;
        padding: 4px 9px;
        border-color: #d0d7de;
        border-radius: 6px;
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill-dot {
        width: 6px;
        height: 6px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .game-pill-count {
        font-size: 11px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-filter-bar {
        min-height: 50px;
        margin-bottom: 15px;
        padding: 5px 12px;
        border-color: #d0d7de;
        border-radius: 8px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-filter-left {
        gap: 8px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-label {
        font-size: 11px;
        letter-spacing: 1px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-buttons {
        gap: 4px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-pill {
        min-height: 28px;
        padding: 4px 9px;
        border-radius: 6px;
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .sort-arrow {
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title {
        min-height: 0;
        padding: 0 6px;
        font-size: 13px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title-stats {
        font-size: 13px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .game-title-updated {
        font-size: 11px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .inline-refresh-btn {
        padding: 3px 7px;
        font-size: 11px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .table-container {
        border-color: #d0d7de;
        border-radius: 7px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) th {
        padding: 9px 11px;
        border-bottom-color: #d0d7de;
        background: #ffffff;
        font-size: 11px;
        letter-spacing: 0.7px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) td {
        padding: 16px 12px;
        border-bottom-color: #d0d7de;
        font-size: 16px;
        line-height: 1.2;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .server-title-container {
        gap: 8px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .server-title-text {
        font-size: 16px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .country-flag,
    body:not(.dark-mode) .flag-wrap {
        width: 24px;
        height: 18px;
        flex-basis: 24px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .country-flag {
        border-radius: 2px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .flag-placeholder {
        width: 24px;
        font-size: 18px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .map-mode-text {
        font-size: 13px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .player-bar-container {
        gap: 8px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .player-num-box {
        min-width: 42px;
        font-size: 13px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .player-progress-bar {
        max-width: 80px;
        height: 5px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .player-status-tag {
        font-size: 11px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .client-pill {
        padding: 4px 7px;
        font-size: 12px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box {
        gap: 4px;
        padding: 4px 6px;
        border-color: #d0d7de;
        border-radius: 5px;
        font-size: 13px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-mobile-label,
    body:not(.dark-mode) .connect-command,
    body:not(.dark-mode) .connect-str {
        font-size: 13px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box .copy-button {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
        font-size: 14px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-server-cell,
    body:not(.dark-mode) th.col-server { width: 38%; }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-map-cell,
    body:not(.dark-mode) th.col-map { width: 19%; }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-players-cell,
    body:not(.dark-mode) th.col-players { width: 11%; }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-client-cell,
    body:not(.dark-mode) th.col-client { width: 9%; }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-connect-cell,
    body:not(.dark-mode) th.col-connect { width: 23%; }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) th.col-server {
        padding-left: 40px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) td.col-server-cell {
        padding-left: 5px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .server-title-container {
        gap: 15px;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box {
        gap: 6px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box > .copy-container {
        position: relative;
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
        gap: 5px;
        overflow: hidden;
        padding: 4px 7px;
        border: 1px solid #d0d7de;
        border-radius: 5px;
        background: #f8f7fa;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box .connect-mobile-label {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box .connect-command {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box .copy-button {
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        margin: 0 0 0 auto;
    }
}
}

@media (min-width: 601px) {
/* Final desktop calibration from the supplied page snapshot (max-w-7xl / md sizing). */
@media (min-width: 601px) {
body:not(.dark-mode) .connect-action-box > .fav-button {
        display: inline-flex;
        flex: 0 0 32px;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        min-width: 32px;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        font-size: 18px;
    }
}
}

/* The copied confirmation replaces the address inside its CONNECT field. */
body:not(.dark-mode) .connect-action-box .copy-container,
body:not(.dark-mode) .details-connect-copy {
    position: relative;
}

body:not(.dark-mode) .details-connect-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

body:not(.dark-mode) .details-connect-copy {
    display: inline-flex;
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    min-width: 0;
    gap: 6px;
    padding: 4px 7px;
    padding-right: calc(7px + 1cm);
    border: 1px solid #d0d7de;
    border-radius: 5px;
    background: #f8f7fa;
    color: #656d76;
    font: 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    vertical-align: middle;
}

body:not(.dark-mode) .details-connect-copy .connect-command {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: inherit;
}

body:not(.dark-mode) .details-connect-copy .copy-button {
    flex: 0 0 24px;
    transform: translateX(1cm);
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
}

body:not(.dark-mode) .copy-toast {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 4px 8px;
    overflow: hidden;
    border: 1px solid #86efac;
    border-radius: 5px;
    background: #ecfdf3;
    color: #166534;
    font: 14px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    opacity: 0;
    visibility: hidden;
    transform: none;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0.16s ease;
    white-space: nowrap;
}

body:not(.dark-mode) .copy-toast::after {
    flex: 0 0 auto;
    margin-left: 8px;
    color: #15803d;
    content: "✓";
    font: 14px/1 Arial, sans-serif;
}

body:not(.dark-mode) .copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* DARK MODE: match toast font and size to CONNECT box */
body:not(.dark-mode) .connect-action-box .copy-container,
body:not(.dark-mode) .details-connect-copy {
    position: relative;
    min-width: 0;
}

body:not(.dark-mode) .connect-action-box .copy-toast,
body:not(.dark-mode) .details-connect-copy .copy-toast {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 4px 7px;
    overflow: hidden;
    border: 1px solid #86efac;
    border-radius: 5px;
    background: #ecfdf3;
    color: #166534;
    font: inherit;
    opacity: 0;
    visibility: hidden;
    transform: none;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0.16s ease;
    white-space: nowrap;
}

body:not(.dark-mode) .copy-toast::after {
    flex: 0 0 auto;
    margin-left: 5px;
    color: #15803d;
    content: "✓";
    font: inherit;
}

body:not(.dark-mode) .copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* FINAL FIX: toast exactly matches the CONNECT box */
body:not(.dark-mode) .connect-action-box > .copy-container > .copy-toast,
body:not(.dark-mode) .details-connect-copy > .copy-toast,
body:not(.dark-mode) .connect-action-box > .copy-container > .copy-toast,
body:not(.dark-mode) .details-connect-copy > .copy-toast {
    position: absolute !important;
inset: -2px -1px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-radius: 5px !important;
    transform: none !important;
    white-space: nowrap !important;
}

/* Mobile player indicator: only the current value is colored; slash and maximum stay gray. */
.mobile-player-group .player-num-box,
body:not(.dark-mode) .mobile-player-group .player-num-box {
    color: #656d76 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.dark-mode .mobile-player-group .player-num-box {
    color: #9690a7 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.mobile-player-group .player-num-box > span:not(:first-child) {
    color: #656d76 !important;
}
body.dark-mode .mobile-player-group .player-num-box > span:not(:first-child) {
    color: #9690a7 !important;
}

/* Light theme: current value follows its status color. */
body:not(.dark-mode) .mobile-player-group .player-num-box.player-full > span:first-child { color: #b91c1c !important; }
body:not(.dark-mode) .mobile-player-group .player-num-box.player-medium > span:first-child { color: #15803d !important; }
body:not(.dark-mode) .mobile-player-group .player-num-box.player-low > span:first-child { color: #b45309 !important; }
body:not(.dark-mode) .mobile-player-group .player-num-box.player-empty > span:first-child { color: #6b7280 !important; }

/* Dark theme: red full, reference mint green, yellow low, gray empty. */
body.dark-mode .mobile-player-group .player-num-box.player-full > span:first-child { color: #f87171 !important; }
body.dark-mode .mobile-player-group .player-num-box.player-medium > span:first-child { color: #40d99b !important; }
body.dark-mode .mobile-player-group .player-num-box.player-low > span:first-child { color: #f2bd56 !important; }
body.dark-mode .mobile-player-group .player-num-box.player-empty > span:first-child { color: #85808e !important; }

/* Progress fills keep distinct occupancy states. */
.player-progress-fill.player-full,
.mobile-player-bar .player-progress-fill.player-full { background: #b91c1c !important; }
.player-progress-fill.player-medium,
.mobile-player-bar .player-progress-fill.player-medium { background: #15803d !important; }
.player-progress-fill.player-low,
.mobile-player-bar .player-progress-fill.player-low { background: #b45309 !important; }
.player-progress-fill.player-empty,
.mobile-player-bar .player-progress-fill.player-empty { background: #6b7280 !important; }
body.dark-mode .player-progress-fill.player-full,
body.dark-mode .mobile-player-bar .player-progress-fill.player-full { background: #f87171 !important; }
body.dark-mode .player-progress-fill.player-medium,
body.dark-mode .mobile-player-bar .player-progress-fill.player-medium { background: #40d99b !important; }
body.dark-mode .player-progress-fill.player-low,
body.dark-mode .mobile-player-bar .player-progress-fill.player-low { background: #f2bd56 !important; }
body.dark-mode .player-progress-fill.player-empty,
body.dark-mode .mobile-player-bar .player-progress-fill.player-empty { background: #77717f !important; }


/* Expanded server details: use the existing dark-theme violet surface only. */
body.dark-mode .details-row,
body.dark-mode .details-row > td,
body.dark-mode .details-row .details {
    background-color: var(--surface) !important;
}


/* Player-count numbers: remove only their background box and outline. */
.player-num-box,
body.dark-mode .player-num-box,
body:not(.dark-mode) .player-num-box {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Keep the server expand/collapse arrow visible on desktop in both themes. */
@media (min-width: 601px) {
    body.dark-mode .expand-icon,
    body:not(.dark-mode) .expand-icon {
        display: inline-flex;
    }
}

/* Desktop-only header: domain and the persistent, reference-style search field. */
.desktop-domain,
.desktop-search-shortcut {
    display: none;
}

@media (min-width: 601px) {
    #top-bar .top-bar-row {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0;
    }

    #top-bar .brand-container {
        gap: 10px;
    }

    #top-bar .brand-container > div {
        display: none;
    }

    .desktop-domain {
        display: inline-block;
        margin-left: 0;
        color: inherit;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.1px;
        white-space: nowrap;
    }

    #top-bar #topSearchBar.top-search-bar {
        display: flex !important;
        flex: 1 1 calc(360px + 3cm);
        width: auto !important;
        min-width: 170px;
        max-width: calc(420px + 3cm);
        height: 38px;
        margin: 0 14px !important;
        padding: 0 10px;
        border-radius: 8px;
    }

    #topSearchBar .top-search-input-wrap {
        flex: 1 1 auto;
        min-width: 0;
        gap: 10px;
    }

    #topSearchBar .search-input-icon {
        width: 16px;
        height: 16px;
    }

    #topSearchBar .top-search-input-wrap input {
        min-width: 0;
        font-size: 13px;
    }

    #topSearchBar .top-search-input-wrap input::placeholder {
        color: #898494;
        opacity: 1;
    }

    .desktop-search-shortcut {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 22px;
        border: 1px solid #38383c;
        border-radius: 5px;
        background: #202023;
        color: #aaa3b2;
        font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }

    #topSearchBtn,
    #topSearchBar .top-search-submit-btn {
        display: none !important;
    }

    #top-buttons {
        margin-left: auto;
    }

    #topFavBtn {
        color: #f2bd56 !important;
        filter: none !important;
        opacity: 1 !important;
        font-size: 20px;
        line-height: 1;
    }

    #favBadge {
        background: #f97316 !important;
        color: #ffffff !important;
        filter: none !important;
    }

    .server-title-container > .flag-wrap,
    .server-title-container > .flag-placeholder {
        margin-left: 5mm;
    }

    body.dark-mode #top-bar #topSearchBar.top-search-bar {
        background: #15121c;
        border-color: #302a39;
    }

    body.dark-mode #topSearchBar .desktop-search-shortcut {
        border-color: #38383c;
        background: #202023;
        color: #aaa3b2;
    }

    body:not(.dark-mode) #top-bar #topSearchBar.top-search-bar {
        background: #f1eef5;
        border-color: #d7d2df;
    }

    body:not(.dark-mode) #topSearchBar .desktop-search-shortcut {
        border-color: #e1ddd7;
        background: #fffaf5;
        color: #656d76;
    }
}

/* Keep the existing mobile magnifier toggle and inset the country flag from the card edge. */
@media (max-width: 600px) {
    #top-bar .top-bar-row {
        flex-wrap: wrap;
    }

    #top-buttons {
        order: 2;
    }

    #top-bar #topSearchBar.top-search-bar {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        margin-top: 10px;
    }

    .col-mobile-meta > .flag-wrap,
    .col-mobile-meta > .flag-placeholder {
        margin-left: auto;
        margin-right: 5mm;
    }
}

/* Match the desktop dark-mode palette on phones without changing the mobile layout. */
@media (max-width: 600px) {
    body.dark-mode {
        --bg: #0b0911;
        --surface: #100e16;
        --surface2: #15121c;
        --border: #292532;
        --text: #e8e5ee;
        --muted: #9993a5;
        background:
            radial-gradient(ellipse at 50% 0, rgba(39, 22, 49, 0.2), transparent 48%),
            #0b0911;
        color: #e8e5ee;
    }

    body.dark-mode #top-bar {
        background: rgba(17, 14, 23, 0.96);
        border-color: #28232f;
        border-bottom-color: #28232f;
    }

    body.dark-mode button {
        background: #15121c;
        color: #c8c2d0;
        border-color: #292532;
    }

    body.dark-mode button:hover {
        background: #1c202c;
    }

    body.dark-mode .top-search-bar {
        background: #15121c;
        border-color: #302a39;
    }

    body.dark-mode .top-search-input-wrap input {
        color: #e8e5ee;
    }

    body.dark-mode .hero-stats {
        color: #ded9e6;
    }

    body.dark-mode .hero-stat-players {
        color: #e879d5;
    }

    body.dark-mode .hero-subtitle {
        color: #9993a5;
    }

    body.dark-mode .client-tabs {
        border-bottom-color: #211d29;
    }

    body.dark-mode .client-tab {
        color: #9e97a9;
    }

    body.dark-mode .client-tab:hover {
        color: #e8e5ee;
    }

    body.dark-mode .client-tab.active {
        color: #e879d5;
        border-bottom-color: #d946ef;
    }

    body.dark-mode .game-pill {
        border-color: #2a2532;
        background: #15121b;
        color: #d5d0dc;
    }

    body.dark-mode .game-pill:hover {
        border-color: #3b4254;
        background: #1c202d;
    }

    body.dark-mode .game-pill-count {
        color: #a29baa;
    }

    body.dark-mode .sort-filter-bar {
        border-color: #302a39;
        background: #15121b;
    }

    body.dark-mode .sort-label {
        color: #aaa3b4;
    }

    body.dark-mode .sort-pill {
        color: #c8c2d0;
    }

    body.dark-mode .sort-pill:hover {
        background: #211b29;
    }

    body.dark-mode .sort-pill.active {
        border-color: #a92bb1;
        background: rgba(190, 45, 195, 0.18);
        color: #e477df;
    }

    body.dark-mode .game {
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }

    body.dark-mode .game-title {
        border-color: transparent;
        background: transparent;
        color: #a9a2b4;
    }

    body.dark-mode .game-title-name {
        color: #a9a2b4;
    }

    body.dark-mode .game-title-stats {
        color: #b5aebd;
    }

    body.dark-mode .game-title-updated,
    body.dark-mode .inline-refresh-btn {
        color: #938c9f;
    }

    body.dark-mode .inline-refresh-btn {
        border-color: #2b2633;
    }

    body.dark-mode .table-container {
        border-color: #2d2835;
        background: #100e16;
    }

    body.dark-mode table {
        background: transparent;
    }

    body.dark-mode th {
        border-bottom-color: #292431;
        background: #14111a;
        color: #9f98aa;
    }

    body.dark-mode th:hover {
        background: #1a1621;
    }

    body.dark-mode th.sorted {
        color: #e879d5;
    }

    body.dark-mode td,
    body.dark-mode .server-row {
        border-bottom-color: #25212c;
    }

    body.dark-mode .server-row {
        background: transparent;
    }

    body.dark-mode .server-row:hover {
        background: #17131d;
    }

    body.dark-mode .map-mode-text,
    body.dark-mode .col-map-cell {
        color: #9e97a9;
    }

    body.dark-mode .connect-action-box {
        border-color: #292431;
        background: #0c0a11;
        color: #e8e5ee;
    }

    body.dark-mode .connect-str,
    body.dark-mode .connect-mobile-label,
    body.dark-mode .connect-command {
        color: #aaa3b2;
    }

    body.dark-mode #topFavBtn {
        color: #f2bd56;
        filter: none;
        opacity: 1;
    }

    body.dark-mode #favBadge {
        background: #f97316;
        color: #ffffff;
        filter: none;
    }

    body.dark-mode .mobile-fav-button {
        color: #9ca3af;
    }

    body.dark-mode .mobile-fav-button.is-favorite {
        color: #f59e0b;
    }

    body.dark-mode .mobile-player-group .player-num-box > span:not(:first-child) {
        color: #9ca3af !important;
    }

    body.dark-mode .mobile-player-group .player-num-box.player-full > span:first-child {
        color: #f87171 !important;
    }

    body.dark-mode .mobile-player-group .player-num-box.player-medium > span:first-child {
        color: #4ade80 !important;
    }

    body.dark-mode .mobile-player-group .player-num-box.player-low > span:first-child {
        color: #fde047 !important;
    }

    body.dark-mode .mobile-player-group .player-num-box.player-empty > span:first-child {
        color: #9ca3af !important;
    }

    body.dark-mode .mobile-player-bar {
        background: rgba(127, 127, 127, 0.2);
    }
}

/* In mobile server cards, stretch the copy confirmation across the whole CONNECT field. */
@media (max-width: 600px) {
    .connect-action-box {
        position: relative;
    }

    .connect-action-box > .copy-container {
        position: static !important;
    }

    .connect-action-box > .copy-container > .copy-toast {
        position: absolute !important;
        inset: 0 !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        border-radius: 6px !important;
    }
}

/* Prevent mobile browsers from flashing their blue tap highlight on a server card. */
@media (max-width: 600px) {
    .server-row,
    .server-row > td,
    .server-row .connect-action-box,
    .server-row .copy-button {
        -webkit-tap-highlight-color: transparent;
    }

    .server-row .copy-button {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Keep the mobile header favorite star yellow in light mode as well. */
@media (max-width: 600px) {
    body:not(.dark-mode) #topFavBtn {
        color: #f2bd56 !important;
        filter: none !important;
        opacity: 1 !important;
    }
}

/* Warm charcoal and copper palette, matching the supplied reference. */
:root {
    --bg: #171719;
    --surface: #202124;
    --surface2: #292a2d;
    --border: #3a3b3f;
    --text: #ededed;
    --muted: #a5a5a5;
    --light-bg: #f5f3f0;
    --light-surface: #ffffff;
    --light-surface2: #efedea;
    --light-border: #d8d3cd;
    --light-text: #292826;
    --light-muted: #6f6b66;
}

html.dark-preload,
html.dark-preload body,
body.dark-mode {
    background: #171719 !important;
    color: #ededed !important;
}

body:not(.dark-mode) {
    --bg: #f5f3f0;
    --surface: #ffffff;
    --surface2: #efedea;
    --border: #d8d3cd;
    --text: #292826;
    --muted: #6f6b66;
    background: #f5f3f0 !important;
    color: #292826 !important;
}

body.dark-mode #top-bar,
html.dark-preload #top-bar {
    background: rgba(27, 27, 29, 0.94) !important;
    border-color: #37383b !important;
}

body:not(.dark-mode) #top-bar {
    background: rgba(249, 247, 244, 0.95) !important;
    border-color: #d8d3cd !important;
}

#top-bar::before {
    display: none !important;
}

#top-bar::after {
    background: linear-gradient(90deg, rgba(190, 72, 22, 0.34) 0%, rgba(234, 98, 30, 0.72) 50%, rgba(190, 72, 22, 0.34) 100%) !important;
    box-shadow: 0 0 7px rgba(234, 98, 30, 0.22) !important;
}

body.dark-mode button,
html.dark-preload button {
    border-color: #3a3b3f;
    background-color: #252629;
    color: #e5e5e5;
}

body.dark-mode button:hover,
html.dark-preload button:hover {
    background-color: #303134;
}

body.dark-mode .client-tabs,
body:not(.dark-mode) .client-tabs {
    border-color: var(--border);
}

body.dark-mode .client-tab,
body:not(.dark-mode) .client-tab {
    color: var(--client-color, #f97316);
    border-bottom-color: transparent;
}

body.dark-mode .client-tab.active,
body:not(.dark-mode) .client-tab.active {
    color: var(--client-color, #f97316) !important;
    border-bottom-color: var(--client-color, #f97316) !important;
    background: color-mix(in srgb, var(--client-color, #f97316) 12%, transparent);
}

body.dark-mode .client-tab:hover,
body:not(.dark-mode) .client-tab:hover {
    color: var(--client-color, #f97316);
    background: color-mix(in srgb, var(--client-color, #f97316) 9%, transparent);
}

body.dark-mode .hero-stat-players,
body.dark-mode .hero-stat-servers,
body.dark-mode th.sorted,
body.dark-mode .sort-pill.active,
body:not(.dark-mode) .hero-stat-players,
body:not(.dark-mode) .hero-stat-servers,
body:not(.dark-mode) th.sorted,
body:not(.dark-mode) .sort-pill.active {
    color: #f97316 !important;
}

body.dark-mode .sort-filter-bar,
body.dark-mode .table-container,
body.dark-mode .details-row,
body.dark-mode .details-row > td,
body.dark-mode .details-row .details,
body.dark-mode .pagination-container {
    background-color: #202124 !important;
    border-color: #38393c !important;
}

body.dark-mode th {
    background: #252629 !important;
    color: #b9b9b9 !important;
    border-color: #38393c !important;
}

body.dark-mode td,
body.dark-mode .server-row,
body.dark-mode .server-row:hover {
    border-color: #343538 !important;
}

body.dark-mode .server-row:hover {
    background: rgba(255, 255, 255, 0.035) !important;
}

body:not(.dark-mode) .sort-filter-bar,
body:not(.dark-mode) .table-container,
body:not(.dark-mode) .game,
body:not(.dark-mode) .details-row,
body:not(.dark-mode) .pagination-container {
    background-color: #ffffff !important;
    border-color: #dedad5 !important;
}

body:not(.dark-mode) th {
    background: #efedea !important;
    color: #55514c !important;
    border-color: #dedad5 !important;
}

body:not(.dark-mode) td,
body:not(.dark-mode) .server-row {
    border-color: #e3dfda !important;
}

body.dark-mode .client-pill,
body:not(.dark-mode) .client-pill {
    border: 1px solid color-mix(in srgb, var(--client-color, #f97316) 35%, transparent);
    background: color-mix(in srgb, var(--client-color, #f97316) 16%, transparent) !important;
    color: var(--client-color, #f97316) !important;
}

.favorite-star-icon {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fav-button.is-favorite .favorite-star-icon,
#topFavBtn.active .favorite-star-icon {
    fill: currentColor;
}

.fav-button,
#topFavBtn {
    color: #888888;
}

.fav-button:hover,
.fav-button.is-favorite,
#topFavBtn,
#topFavBtn.active {
    color: #f97316 !important;
}

body.dark-mode #topFavBtn:not(.active),
body:not(.dark-mode) #topFavBtn:not(.active) {
    color: #888888 !important;
}

.game-pill-code {
    color: var(--dot-color, #f97316);
}

.game-title-dot,
body.dark-mode .game-title-dot,
body:not(.dark-mode) .game-title-dot {
    display: inline-block !important;
}

.game-title-name,
body.dark-mode .game-title-name,
body:not(.dark-mode) .game-title-name {
    display: inline-block !important;
    color: var(--dot-color, #f97316) !important;
}

body.dark-mode .game-title-client,
body:not(.dark-mode) .game-title-client {
    display: inline-flex !important;
}

.details-game-name {
    color: var(--game-color, #f97316);
    font-weight: 600;
}

.mobile-fav-button {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
    border: 1px solid #48494c !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, 0.025) !important;
}

body:not(.dark-mode) .mobile-fav-button {
    border-color: #d7d2cc !important;
    background: #faf9f7 !important;
}

.player-progress-bar,
.mobile-player-bar {
    background: #d4d4d4 !important;
}

body.dark-mode .player-progress-bar,
body.dark-mode .mobile-player-bar {
    background: #3a3a3c !important;
}

@media (min-width: 601px) {
    th.col-server, td.col-server-cell { width: 35%; }
    th.col-map, td.col-map-cell { width: 22%; }
    th.col-players, td.col-players-cell { width: 18%; }
    th.col-client, td.col-client-cell { width: 10%; }
    th.col-connect, td.col-connect-cell { width: 15%; }
}

@media (max-width: 600px) {
    #top-bar .desktop-domain {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        margin: 0 !important;
    }

    #top-bar .top-bar-row {
        flex-wrap: nowrap;
        min-height: 48px;
    }

    #top-buttons {
        flex: 0 0 auto;
        gap: 10px;
    }

    #top-buttons button {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 9px;
    }

    #top-buttons .favorite-star-icon {
        width: 19px;
        height: 19px;
    }

    .server-row {
        grid-template-rows: 20px 18px 22px !important;
    }

    .server-row .col-connect-cell {
        display: none !important;
    }

    body:not(.dark-mode) .mobile-player-bar {
        background: #d4d4d4 !important;
    }

    body.dark-mode .mobile-player-bar {
        background: #3a3a3c !important;
    }
}

#heroBanner {
    position: relative;
    isolation: isolate;
    overflow: visible;
    background: transparent !important;
}

#heroBanner::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    left: 50%;
    top: -60px;
    width: 100vw;
    height: calc(100% + 120px);
    transform: translateX(-50%);
    background: radial-gradient(ellipse 60% 130% at 50% 48%, rgba(132, 53, 18, 0.16) 0%, rgba(132, 53, 18, 0.06) 52%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 100%);
}

body:not(.dark-mode) #heroBanner::before {
    background: radial-gradient(ellipse 60% 130% at 50% 48%, rgba(210, 91, 31, 0.07) 0%, rgba(210, 91, 31, 0.025) 52%, transparent 100%);
}

@media (max-width: 600px) {
    .details-connect-mobile {
        display: block !important;
        overflow-wrap: anywhere;
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }
}

@media (min-width: 601px) {
    th.col-server,
    td.col-server-cell {
        width: 27% !important;
    }

    th.col-country,
    td.col-country-cell {
        width: 5% !important;
    }

    th.col-map,
    td.col-map-cell {
        width: 18% !important;
    }

    th.col-players,
    td.col-players-cell {
        width: 16% !important;
    }

    th.col-client,
    td.col-client-cell {
        width: 9% !important;
    }

    th.col-connect,
    td.col-connect-cell {
        width: 25% !important;
    }

    th.col-server {
        padding-left: 36px !important;
        text-align: left !important;
    }

    th.col-country,
    td.col-country-cell {
        text-align: center !important;
    }

    th.col-country {
        padding: 8px 0 !important;
        white-space: nowrap;
    }

    td.col-country-cell {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 600px) {
    .col-country,
    .col-country-cell {
        display: none !important;
    }
}

/* Let Android Chrome match its system navigation bar to the active page theme. */
html.dark-preload,
html.dark-preload body,
body.dark-mode {
    background-color: #171719 !important;
}

body:not(.dark-mode) {
    background-color: #f5f3f0 !important;
}

/* Desktop player count: keep the current count dynamic, with gray separator and capacity. */
@media (min-width: 601px) {
    .player-num-box > .player-divider,
    .player-num-box > .player-max {
        color: #656d76 !important;
        font-weight: 500;
    }

    body.dark-mode .player-num-box > .player-divider,
    body.dark-mode .player-num-box > .player-max {
        color: #9690a7 !important;
    }
}

/* Keep the dark page background solid, like light mode, while cards add surfaces. */
html.dark-preload body {
    background: #171719 !important;
}

body.dark-mode {
    background: #171719 !important;
}

body:not(.dark-mode) {
    background:
        radial-gradient(ellipse 78% 330px at 50% 66px, rgba(157, 79, 157, 0.05) 0%, rgba(157, 79, 157, 0.02) 38%, transparent 100%),
        var(--light-bg) !important;
}

#top-bar {
    position: sticky;
    isolation: isolate;
    overflow: visible;
    border: 0 !important;
    background: rgba(17, 14, 23, 0.64) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body:not(.dark-mode) #top-bar {
    background: rgba(255, 255, 255, 0.62) !important;
}

html.dark-preload #top-bar {
    background: rgba(17, 14, 23, 0.64) !important;
}

#top-bar::before,
#top-bar::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

#top-bar::before {
    z-index: -1;
    inset: 100% 0 auto;
    height: 150px;
    background: radial-gradient(ellipse 68% 100% at 50% 0, rgba(157, 79, 157, 0.055) 0%, rgba(157, 79, 157, 0.022) 42%, transparent 100%);
}

body:not(.dark-mode) #top-bar::before {
    background: radial-gradient(ellipse 68% 100% at 50% 0, rgba(157, 79, 157, 0.045) 0%, rgba(157, 79, 157, 0.018) 42%, transparent 100%);
}

#top-bar::after {
    z-index: 2;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(157, 79, 157, 0.3) 0%, rgba(157, 79, 157, 0.38) 50%, rgba(157, 79, 157, 0.3) 100%);
    box-shadow: 0 0 6px rgba(157, 79, 157, 0.18);
}

#top-bar .brand-icon {
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px;
    border-radius: 6px;
    filter: drop-shadow(0 0 4px rgba(255, 138, 36, 0.6)) drop-shadow(0 0 11px rgba(255, 112, 22, 0.3));
}

#top-bar .desktop-domain {
    display: inline-block !important;
    color: inherit;
    font-size: 16px !important;
    font-weight: 600;
    letter-spacing: 0.1px;
    text-decoration: none;
    white-space: nowrap;
}

#top-bar .desktop-domain:focus-visible {
    outline: 2px solid #9b78e8;
    outline-offset: 4px;
    border-radius: 2px;
}

body.dark-mode #top-bar .desktop-domain {
    text-shadow: 0 0 5px rgba(158, 91, 203, 0.36), 0 0 11px rgba(158, 91, 203, 0.2);
}

body:not(.dark-mode) #top-bar .desktop-domain {
    text-shadow: 0 0 5px rgba(143, 81, 178, 0.34), 0 0 11px rgba(143, 81, 178, 0.18);
}

@media (max-width: 600px) {
    #top-bar .desktop-domain {
        display: inline-block !important;
        max-width: calc(100vw - 118px);
        overflow: hidden;
        font-size: clamp(14px, 4.1vw, 16px) !important;
        text-overflow: ellipsis;
    }

    #top-bar .brand-icon {
        width: 28px !important;
        height: 28px !important;
        flex-basis: 28px;
    }

    #top-bar .brand-title {
        display: none !important;
    }
}

/* Final overrides: keep the reference palette and mobile header after legacy rules. */
html.dark-preload,
html.dark-preload body,
body.dark-mode {
    background: #171719 !important;
    color: #ededed !important;
}

body:not(.dark-mode) {
    background: #f5f3f0 !important;
    color: #292826 !important;
}

body.dark-mode #top-bar,
html.dark-preload #top-bar {
    background: rgba(27, 27, 29, 0.94) !important;
    border-color: #37383b !important;
}

body:not(.dark-mode) #top-bar {
    background: rgba(249, 247, 244, 0.95) !important;
    border-color: #d8d3cd !important;
}

#top-bar::before {
    display: none !important;
}

#top-bar::after {
    background: linear-gradient(90deg, rgba(190, 72, 22, 0.34) 0%, rgba(234, 98, 30, 0.72) 50%, rgba(190, 72, 22, 0.34) 100%) !important;
    box-shadow: 0 0 7px rgba(234, 98, 30, 0.22) !important;
}

@media (min-width: 601px) {
    body.dark-mode #top-bar #topSearchBar.top-search-bar {
        background: #202023 !important;
        border-color: #38383c !important;
    }

    body:not(.dark-mode) #top-bar #topSearchBar.top-search-bar {
        background: #fffaf5 !important;
        border-color: #e1ddd7 !important;
    }
}

body.dark-mode .hero-stat-players,
body.dark-mode .hero-stat-servers,
body.dark-mode th.sorted,
body.dark-mode .sort-pill.active,
body:not(.dark-mode) .hero-stat-players,
body:not(.dark-mode) .hero-stat-servers,
body:not(.dark-mode) th.sorted,
body:not(.dark-mode) .sort-pill.active {
    color: #f97316 !important;
}

body.dark-mode .client-tab,
body:not(.dark-mode) .client-tab {
    color: var(--client-color, #f97316);
}

body.dark-mode .client-tab.active,
body:not(.dark-mode) .client-tab.active {
    color: var(--client-color, #f97316) !important;
    border-bottom-color: var(--client-color, #f97316) !important;
    background: color-mix(in srgb, var(--client-color, #f97316) 12%, transparent);
}

body.dark-mode .client-pill,
body:not(.dark-mode) .client-pill {
    border-color: color-mix(in srgb, var(--client-color, #f97316) 35%, transparent);
    background: color-mix(in srgb, var(--client-color, #f97316) 16%, transparent) !important;
    color: var(--client-color, #f97316) !important;
}

@media (min-width: 601px) {
    th.col-server, td.col-server-cell { width: 35%; }
    th.col-map, td.col-map-cell { width: 22%; }
    th.col-players, td.col-players-cell { width: 18%; }
    th.col-client, td.col-client-cell { width: 10%; }
    th.col-connect, td.col-connect-cell { width: 15%; }
}

@media (max-width: 600px) {
    #top-bar .desktop-domain {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        margin: 0 !important;
    }

    #top-bar .top-bar-row {
        flex-wrap: nowrap;
        min-height: 48px;
    }

    #top-buttons {
        flex: 0 0 auto;
        gap: 10px;
    }

    #top-buttons button {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
    }

    #top-bar #topSearchBar.top-search-bar {
        position: absolute !important;
        top: calc(100% + 8px);
        left: 12px;
        right: 12px;
        z-index: 3;
        flex: none !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
    }

    body.dark-mode #top-bar #topSearchBar.top-search-bar {
        background: #202023 !important;
        border-color: #38383c !important;
    }

    body:not(.dark-mode) #top-bar #topSearchBar.top-search-bar {
        background: #fffaf5 !important;
        border-color: #e1ddd7 !important;
    }

    /* iOS zooms the page when a focused text input is smaller than 16px. */
    #top-bar #topSearchBar .top-search-input-wrap input {
        font-size: 16px !important;
    }

    #top-buttons #topSearchBtn {
        order: 1;
    }

    #top-buttons #darkButton {
        order: 2 !important;
    }

    #top-buttons #topFavBtn {
        order: 3 !important;
    }

    #top-buttons #topSearchBtn,
    #top-buttons #topSearchBtn.active {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        border-radius: 9px !important;
    }

    body:not(.dark-mode) #top-buttons #topSearchBtn,
    body:not(.dark-mode) #top-buttons #topSearchBtn.active {
        background: #ffffff !important;
        border-color: #d8d3cd !important;
        color: #1f2328 !important;
    }

    body.dark-mode #top-buttons #topSearchBtn,
    body.dark-mode #top-buttons #topSearchBtn.active {
        background: #252629 !important;
        border-color: #3a3b3f !important;
        color: #e5e5e5 !important;
    }

    .server-row .col-connect-cell,
    .details-connect-row {
        display: none !important;
    }

    .server-row {
        grid-template-rows: 20px 18px 22px !important;
    }

    body:not(.dark-mode) .mobile-player-bar {
        background: #d4d4d4 !important;
    }

    body.dark-mode .mobile-player-bar {
        background: #3a3a3c !important;
    }
}

/* Sort controls mirror the game pills; selection adds only a thin Plutonium-orange border. */
body:not(.dark-mode) .sort-buttons .sort-pill {
    background: #ffffff !important;
    border: 1px solid #e8e4ed !important;
    border-radius: 8px !important;
    color: #1f2328 !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

body:not(.dark-mode) .sort-buttons .sort-pill:hover {
    background: #f1eef5 !important;
    border-color: #d0d7de !important;
}

body.dark-mode .sort-buttons .sort-pill {
    background: #15121b !important;
    border-color: #2a2532 !important;
    color: #d5d0dc !important;
}

body.dark-mode .sort-buttons .sort-pill:hover {
    background: #1c202d !important;
    border-color: #3b4254 !important;
}

body:not(.dark-mode) .sort-buttons .sort-pill.active {
    background: #ffffff !important;
    border: 1px solid #f97316 !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    color: #1f2328 !important;
}

body.dark-mode .sort-buttons .sort-pill.active {
    background: #15121b !important;
    border: 1px solid #f97316 !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    color: #d5d0dc !important;
}

@media (min-width: 601px) {
    .sort-buttons .sort-pill {
        min-height: 28px !important;
        padding: 4px 9px !important;
        border-radius: 6px !important;
        font-size: 12px !important;
    }

    body:not(.dark-mode) .sort-buttons .sort-pill:not(.active):not(:hover) {
        background: #eef3f7 !important;
        border-color: #d0d7de !important;
    }

    body:not(.dark-mode) .sort-buttons .sort-pill.active {
        background: #eef3f7 !important;
    }
}

@media (max-width: 600px) {
    body.dark-mode .search-results-banner {
        background: #101010 !important;
        border-color: #2a2532 !important;
    }

    body.dark-mode .search-results-info {
        color: #e8e5ee !important;
    }

    body.dark-mode .search-banner-icon {
        color: #f97316 !important;
    }

    body:not(.dark-mode) .search-results-banner {
        background: #ffffff !important;
        border-color: #d0d7de !important;
    }

    body:not(.dark-mode) .search-results-info {
        color: #1f2328 !important;
    }

    body:not(.dark-mode) .search-banner-icon {
        color: #f97316 !important;
    }

/* Mobile client tabs stay text-only; the active underline remains visible. */
.client-tabs .client-tab,
.client-tabs .client-tab:hover,
.client-tabs .client-tab.active,
.client-tabs .client-tab.active:hover {
    background: transparent !important;
}
}

/* Soft charcoal fills for game and sort pills in dark mode, on all screens. */
body.dark-mode .game-pill,
body.dark-mode .game-pill:hover,
body.dark-mode .game-pill.active,
body.dark-mode .sort-buttons .sort-pill,
body.dark-mode .sort-buttons .sort-pill:hover,
body.dark-mode .sort-buttons .sort-pill.active {
    background-color: #242426 !important;
}

/* Keep each client link beside its game name and server/player totals. */
.game-title-left {
    justify-content: flex-start !important;
}

.game-title-stats {
    margin-right: 0 !important;
}

.game-title-client {
    margin-left: 0 !important;
}

.game-title-updated {
    margin-left: auto !important;
}

@media (min-width: 601px) {
    #top-buttons #topSearchBtn {
        order: 1;
    }

    #top-buttons #darkButton {
        order: 2;
    }

    #top-buttons #topFavBtn {
        order: 3;
    }
}

/* Keep selected client tabs transparent while preserving their accent underline. */
body.dark-mode .client-tab.active,
body.dark-mode .client-tab.active:hover,
body:not(.dark-mode) .client-tab.active,
body:not(.dark-mode) .client-tab.active:hover {
    background: transparent !important;
}

/* The search-results magnifier stays orange in both themes and at every viewport width. */
#searchResultsBanner .search-banner-icon {
    color: #f97316 !important;
}

/* Mobile metadata order: flag on the left, player count/bar and client pill on the right. */
@media (max-width: 600px) {
    .col-mobile-meta > .flag-wrap {
        order: 0;
        margin-left: 5mm !important;
        margin-right: 0 !important;
    }

    .col-mobile-meta > .flag-placeholder {
        order: 0;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .col-mobile-meta > .mobile-player-group {
        order: 1;
        flex: 0 0 auto;
        margin-left: auto;
    }

    .col-mobile-meta > .client-pill {
        order: 2;
        flex: 0 0 auto;
    }
}

/* Keep the desktop domain and favicon clear; mobile uses only the favicon. */
#top-bar .brand-icon {
    filter: none !important;
}

#top-bar .desktop-domain {
    text-shadow: none !important;
}

@media (max-width: 600px) {
    #top-bar .desktop-domain {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        margin: 0 !important;
    }
}

@media (min-width: 601px) {
    #top-bar #topSearchBar.top-search-bar {
        margin-left: calc(14px + 1cm) !important;
    }
}

/* Keep the search-results notice neutral on desktop, matching its mobile style. */
body.dark-mode .search-results-banner {
    background: rgba(249, 115, 22, 0.06) !important;
    border-color: #f97316 !important;
}

body.dark-mode .search-results-info {
    color: #e8e5ee !important;
}

body.dark-mode .search-results-banner .search-banner-icon {
    color: #f97316 !important;
}

body:not(.dark-mode) .search-results-banner {
    background: rgba(249, 115, 22, 0.04) !important;
    border-color: #f97316 !important;
}

body:not(.dark-mode) .search-results-info {
    color: #1f2328 !important;
}

body:not(.dark-mode) .search-results-banner .search-banner-icon {
    color: #f97316 !important;
}

/* Subtle resting outlines for game and sort controls; hover keeps its stronger border. */
body.dark-mode .game-pill:not(:hover):not(.active),
body.dark-mode .sort-buttons .sort-pill:not(:hover):not(.active) {
    border: 1px solid #343438 !important;
}

body:not(.dark-mode) .game-pill:not(:hover):not(.active),
body:not(.dark-mode) .sort-buttons .sort-pill:not(:hover):not(.active) {
    border: 1px solid #d9dadd !important;
}

/* Reference dark palette: deep violet-black, muted lavender, and fuchsia accents. */
html.dark-preload {
    background-color: #171719 !important;
}

html.dark-preload body,
body.dark-mode {
    --bg: #0f0e14;
    --surface: #15131c;
    --surface2: #1c1924;
    --border: #2d2936;
    --text: #e9e6ef;
    --muted: #a19baa;
    background: #171719 !important;
    color: #e9e6ef !important;
}

body.dark-mode #top-bar,
html.dark-preload #top-bar {
    background: rgba(21, 18, 27, 0.96) !important;
    border-color: #2d2936 !important;
}

body.dark-mode #top-bar .top-search-bar {
    background: #1c1924 !important;
    border-color: #302c39 !important;
}

body.dark-mode .sort-filter-bar,
body.dark-mode .table-container,
body.dark-mode #servers,
body.dark-mode .game,
body.dark-mode .details-row,
body.dark-mode .details-row > td,
body.dark-mode .details-row .details,
body.dark-mode .pagination-container {
    background-color: #17151e !important;
    border-color: #2d2936 !important;
}

body.dark-mode th {
    background: #1d1a25 !important;
    border-color: #2d2936 !important;
    color: #aaa5b4 !important;
}

body.dark-mode td,
body.dark-mode .server-row {
    border-color: #292631 !important;
}

body.dark-mode .client-tabs {
    border-bottom-color: #2b2734 !important;
}

html.dark-preload .client-tabs .client-tab,
body.dark-mode .client-tabs .client-tab {
    color: #aaa5b4 !important;
    background: transparent !important;
}

body.dark-mode .client-tabs .client-tab:hover:not(.active) {
    color: #e9e6ef !important;
    background: transparent !important;
}

body.dark-mode .client-tabs .client-tab.active,
body.dark-mode .client-tabs .client-tab.active:hover {
    color: var(--client-color, #f97316) !important;
    border-bottom-color: var(--client-color, #f97316) !important;
    background: transparent !important;
}

body.dark-mode .hero-stat-players {
    color: #e879f9 !important;
}

body.dark-mode .hero-stat-servers {
    color: #f0edf5 !important;
}

body.dark-mode .hero-subtitle .client-link-inline {
    color: #cbc6d2 !important;
}

body.dark-mode .hero-subtitle .client-link-inline:hover {
    color: #e879f9 !important;
}

body.dark-mode #heroBanner::before,
html.dark-preload #heroBanner::before {
    background: radial-gradient(ellipse 60% 130% at 50% 48%, rgba(147, 51, 234, 0.12) 0%, rgba(147, 51, 234, 0.04) 52%, transparent 100%) !important;
}

body.dark-mode .game-pill,
body.dark-mode .game-pill:hover,
body.dark-mode .game-pill.active {
    color: #d5d0dc !important;
}

body.dark-mode .game-pill:not(:hover):not(.active) {
    background: #1d1a25 !important;
}

body.dark-mode .game-pill:hover:not(.active) {
    background: color-mix(in srgb, var(--dot-color, #d946ef) 9%, transparent) !important;
}

body.dark-mode .game-pill.active {
    background: color-mix(in srgb, var(--dot-color, #d946ef) 16%, transparent) !important;
}

body.dark-mode .game-pill .game-pill-code {
    color: #d5d0dc !important;
}

body.dark-mode .game-pill .game-pill-count {
    color: #aaa5b4 !important;
}

body.dark-mode .sort-buttons .sort-pill:not(.active) {
    background: #1d1a25 !important;
    border-color: #34303d !important;
    color: #aaa5b4 !important;
}

body.dark-mode .sort-buttons .sort-pill:not(.active):hover,
body.dark-mode .sort-buttons .sort-pill.active:hover {
    background: #242426 !important;
    border-color: color-mix(in srgb, #f97316 55%, #34303d) !important;
    color: #e9e6ef !important;
}

body.dark-mode .sort-buttons .sort-pill.active {
    background: color-mix(in srgb, #f97316 16%, transparent) !important;
    border-color: #f97316 !important;
    color: #d5d0dc !important;
}

body.dark-mode th.sorted {
    color: #e879f9 !important;
}

/* Sort labels use the same neutral text color as the game buttons. */
body.dark-mode .sort-buttons .sort-pill,
body.dark-mode .sort-buttons .sort-pill:hover,
body.dark-mode .sort-buttons .sort-pill.active {
    color: #d5d0dc !important;
}

/* Restore the earlier charcoal-gray dark surfaces while keeping the current layout. */
html.dark-preload {
    background-color: #171719 !important;
}

html.dark-preload body,
body.dark-mode {
    --bg: #171719;
    --surface: #202124;
    --surface2: #292a2d;
    --border: #3a3b3f;
    --text: #ededed;
    --muted: #a5a5a5;
    background: #171719 !important;
    color: #ededed !important;
}

body.dark-mode #top-bar,
html.dark-preload #top-bar {
    background: rgba(27, 27, 29, 0.94) !important;
    border-color: #37383b !important;
}

body.dark-mode #top-bar .top-search-bar {
    background: #202023 !important;
    border-color: #38383c !important;
}

body.dark-mode .sort-filter-bar,
body.dark-mode .table-container,
body.dark-mode #servers,
body.dark-mode .game,
body.dark-mode .details-row,
body.dark-mode .details-row > td,
body.dark-mode .details-row .details,
body.dark-mode .pagination-container {
    background-color: #202124 !important;
    border-color: #38393c !important;
}

body.dark-mode th {
    background: #252629 !important;
    border-color: #38393c !important;
}

body.dark-mode td,
body.dark-mode .server-row {
    border-color: #38393c !important;
}

body.dark-mode .client-tabs {
    border-bottom-color: #38393c !important;
}

body.dark-mode .game-pill:not(:hover):not(.active),
body.dark-mode .sort-buttons .sort-pill:not(:hover):not(.active) {
    background: #242426 !important;
}

body.dark-mode #heroBanner::before,
html.dark-preload #heroBanner::before {
    background: radial-gradient(ellipse 60% 130% at 50% 48%, rgba(132, 53, 18, 0.16) 0%, rgba(132, 53, 18, 0.06) 52%, transparent 100%) !important;
}

body.dark-mode .hero-stat-players {
    color: #f97316 !important;
}

/* In light mode, client tabs stay neutral until that client is selected. */
body:not(.dark-mode) .client-tabs .client-tab:not(.active) {
    color: #656d76 !important;
    background: transparent !important;
}

body:not(.dark-mode) .client-tabs .client-tab:not(.active):hover {
    color: #1f2328 !important;
    background: transparent !important;
}

body:not(.dark-mode) .client-tabs .client-tab.active,
body:not(.dark-mode) .client-tabs .client-tab.active:hover {
    color: var(--client-color, #f97316) !important;
    border-bottom-color: var(--client-color, #f97316) !important;
    background: transparent !important;
}

body:not(.dark-mode) .sort-buttons .sort-pill:not(.active):hover {
    background: #f1eef5 !important;
    border-color: color-mix(in srgb, #f97316 55%, #d9dadd) !important;
    color: #1f2328 !important;
}

body:not(.dark-mode) .sort-buttons .sort-pill.active:hover {
    background: #f1eef5 !important;
    border-color: #f97316 !important;
    color: #1f2328 !important;
}

/* Keep the server count the same color as the surrounding text in light mode. */
body:not(.dark-mode) .hero-stat-servers {
    color: inherit !important;
}

/* Match light mode: the page owns the background; loading/list wrapper stays transparent. */
html.dark-preload #servers.is-loading,
body.dark-mode #servers.is-loading,
body.dark-mode #servers {
    background: transparent !important;
    border-color: transparent !important;
}


/* Hover fixes: game buttons get fine border of game color without transparent background, client tabs get client color */
.game-pill:hover,
body.dark-mode .game-pill:hover,
body:not(.dark-mode) .game-pill:hover,
body.dark-mode .game-pill:hover:not(.active),
body:not(.dark-mode) .game-pill:hover:not(.active) {
    border-color: var(--dot-color, #f97316) !important;
}

body.dark-mode .game-pill:hover:not(.active) {
    background: #242426 !important;
}

body:not(.dark-mode) .game-pill:hover:not(.active) {
    background: #ffffff !important;
}

.client-tab:hover,
.client-tabs .client-tab:hover,
body.dark-mode .client-tab:hover,
body.dark-mode .client-tabs .client-tab:hover,
body.dark-mode .client-tabs .client-tab:hover:not(.active),
body.dark-mode .client-tabs .client-tab:not(.active):hover,
body:not(.dark-mode) .client-tab:hover,
body:not(.dark-mode) .client-tabs .client-tab:hover,
body:not(.dark-mode) .client-tabs .client-tab:hover:not(.active),
body:not(.dark-mode) .client-tabs .client-tab:not(.active):hover {
    color: var(--client-color, #f97316) !important;
    background: transparent !important;
}

/* En modo claro, mantener neutrales los nombres de juego; el punto conserva su color. */
body:not(.dark-mode) .game-pill .game-pill-code {
    color: #1f2328 !important;
}

/* En modo claro, el juego activo usa un fondo tenue de su propio color. */
body:not(.dark-mode) .game-pill.active,
body:not(.dark-mode) .game-pill.active:hover {
    background: color-mix(in srgb, var(--dot-color, #f97316) 16%, transparent) !important;
}

/* Los enlaces del resumen conservan un color neutro en modo claro. */
body:not(.dark-mode) .hero-subtitle .client-link-inline {
    color: #656d76 !important;
}

/* Subrayado fino permanente para los nombres de clientes en ambos temas. */
.hero-subtitle .client-link-inline {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Match dark mode: selected sort controls use a 16% accent fill in light mode. */
body:not(.dark-mode) .sort-buttons .sort-pill.active,
body:not(.dark-mode) .sort-buttons .sort-pill.active:focus,
body:not(.dark-mode) .sort-buttons .sort-pill.active:focus-visible {
    background: color-mix(in srgb, #f97316 16%, transparent) !important;
    background-color: color-mix(in srgb, #f97316 16%, transparent) !important;
}

body:not(.dark-mode) .sort-buttons .sort-pill.active:hover {
    background: #f1eef5 !important;
    background-color: #f1eef5 !important;
}

/* On touch screens, :hover can persist after a tap; keep the selected sort orange. */
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
    body.dark-mode .sort-buttons .sort-pill.active,
    body.dark-mode .sort-buttons .sort-pill.active:hover,
    body.dark-mode .sort-buttons .sort-pill.active:focus,
    body.dark-mode .sort-buttons .sort-pill.active:focus-visible,
    body.dark-mode .sort-buttons .sort-pill.active:active,
    body:not(.dark-mode) .sort-buttons .sort-pill.active,
    body:not(.dark-mode) .sort-buttons .sort-pill.active:hover,
    body:not(.dark-mode) .sort-buttons .sort-pill.active:focus,
    body:not(.dark-mode) .sort-buttons .sort-pill.active:focus-visible,
    body:not(.dark-mode) .sort-buttons .sort-pill.active:active {
        background: color-mix(in srgb, #f97316 16%, transparent) !important;
        background-color: color-mix(in srgb, #f97316 16%, transparent) !important;
        border-color: #f97316 !important;
    }
}

/* Match game-pill hover: accent borders for SORT and an orange ring on the active button. */
@media (min-width: 601px) {
    body.dark-mode .sort-buttons .sort-pill:not(.active):hover,
    body:not(.dark-mode) .sort-buttons .sort-pill:not(.active):hover,
    body.dark-mode .sort-buttons .sort-pill.active:hover,
    body:not(.dark-mode) .sort-buttons .sort-pill.active:hover {
        border-color: #f97316 !important;
    }

    body.dark-mode .sort-buttons .sort-pill.active:hover,
    body:not(.dark-mode) .sort-buttons .sort-pill.active:hover {
        background: color-mix(in srgb, #f97316 16%, transparent) !important;
        background-color: color-mix(in srgb, #f97316 16%, transparent) !important;
        box-shadow: 0 0 0 1px #f97316 !important;
    }
}

/* Subtle background-matched server-row highlight in both themes and on touch. */
.server-row:hover,
.server-row:active,
body:not(.dark-mode) .server-row:hover,
body:not(.dark-mode) .server-row:active {
    background: rgba(31, 35, 40, 0.045) !important;
}

body.dark-mode .server-row:hover,
body.dark-mode .server-row:active,
html.dark-preload .server-row:hover,
html.dark-preload .server-row:active {
    background: rgba(255, 255, 255, 0.055) !important;
}

/* Shift only the mobile player count/bar and client badge left, without changing their line. */
@media (max-width: 600px) {
    .col-mobile-meta > .mobile-player-group,
    .col-mobile-meta > .client-pill {
        transform: translateX(calc(-24px - 1cm));
    }
}

