/* ===================================================================
   Bestrust — Rust main-menu style
   =================================================================== */

:root {
    --red: #cd412b;
    --red-dark: #a83421;
    --yellow: #d5a118;
    --green-chip: #9cb54e;
    --bg: #0d0d0d;
    --panel: rgba(0, 0, 0, 0.55);
    --panel-solid: #141414;
    --row: rgba(0, 0, 0, 0.35);
    --row-hover: rgba(255, 255, 255, 0.07);
    --text: #e6e0da;
    --text-dim: #9a948e;
    --chip-bg: rgba(255, 255, 255, 0.08);
    --font: "Roboto Condensed", "Arial Narrow", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Scale the whole UI up on large screens — the base design targets ~1080p,
   so 1440p gets +25%, ultrawide/4K more. */
@media (min-width: 1800px) { body { zoom: 1.1; } }
@media (min-width: 2300px) { body { zoom: 1.25; } }
@media (min-width: 3400px) { body { zoom: 1.6; } }

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow: hidden;
}

svg { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.12em; }

a { color: inherit; text-decoration: none; }

button {
    font-family: var(--font);
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* ------------------------------------------------------------------
   Background video
------------------------------------------------------------------- */
.bg-video {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.92) brightness(0.9);
}

.bg-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.05) 18%, rgba(0,0,0,0.05) 70%, rgba(0,0,0,0.6) 100%),
        radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.45) 100%);
    pointer-events: none;
}

/* Play view darkens the video a lot, like the in-game browser.
   Driven by html.route-play so the state can be set before first paint
   (see the inline script in index.html) — avoids a home-view flash. */
html.route-play .bg-video video { filter: brightness(0.35) saturate(0.7); }
html.route-play .bg-vignette { background: rgba(10, 8, 7, 0.55); }

/* The site footer (legal links + disclaimer + socials) lives on the HOME page
   only — on the server browser it would crowd the list. */
html.route-play .sitefooter { display: none; }
html.route-play .view { bottom: 0; }

/* Correct view visibility before the JS router runs */
html.route-play #view-home { display: none; }
html.route-play #view-play { display: flex; }

/* ------------------------------------------------------------------
   Top bar
------------------------------------------------------------------- */
.topbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: stretch;
    height: 72px;
    /* body.legal is a fixed-height flex column (the body itself scrolls) —
       without this, long pages compress the bar below its 72px height. */
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.82);
}

.logo {
    width: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.logo img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.brand-name {
    display: flex;
    align-items: baseline;
    align-self: center;
    gap: 7px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    font-size: 20px;
    letter-spacing: 0.03em;
    margin-right: 16px;
}

.brand-name span {
    font-weight: 700;
    color: inherit;
    letter-spacing: inherit;
}

/* Free up room for the nav on smaller widths — localized labels run long. */
@media (max-width: 1570px) { .brand-name span { display: none; } }
@media (max-width: 1400px) { .brand-name { display: none; } }
@media (max-width: 1100px) { .nav-item span { display: none; } .nav-item { font-size: 17px; } }

.mainnav {
    display: flex;
    align-items: stretch;
    margin: 0 auto;
    height: 100%;
    min-width: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 clamp(10px, 1.8vw, 30px);
    font-size: clamp(13px, 1.15vw, 17px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #cfc9c2;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}

.nav-item svg { font-size: 19px; opacity: 0.9; }

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.nav-item.active {
    background: linear-gradient(to bottom, #b8412c, #9e3521);
    color: #fff;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding-right: 14px;
}

.lang-pick {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.07);
    padding: 8px 10px;
    color: #9a948e;
    font-size: 15px;
}

.lang-pick select {
    background: none;
    border: none;
    color: #cfc9c2;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    outline: none;
    cursor: pointer;
}

.lang-pick select option {
    background: #171412;
    color: #cfc9c2;
    text-transform: none;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 14px;
}

.iconbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    color: #cfc9c2;
    font-size: 18px;
}

.iconbtn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ------------------------------------------------------------------
   Views
------------------------------------------------------------------- */
.view {
    position: absolute;
    top: 72px;
    bottom: 34px;
    left: 0;
    right: 0;
    z-index: 5;
    display: none;
}

.view.active { display: block; }

/* ------------------------------------------------------------------
   HOME — quick join
------------------------------------------------------------------- */
.quickjoin {
    position: absolute;
    top: 36px;
    right: 40px;
    width: 460px;
    /* On forced-wipe day every server wipes in the same hour, so the list
       can hold 100+ rows — cap it and scroll inside instead of overlapping
       the hero (desktop) or pushing it away (mobile). */
    max-height: 55%;
    display: flex;
    flex-direction: column;
}

#quickjoin-list {
    min-height: 0;
    overflow-y: auto;
}

.quickjoin-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #d8d2cb;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    margin-bottom: 10px;
    padding-left: 6px;
}

.qj-row {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.72);
    margin-bottom: 6px;
    padding: 10px 12px;
    transition: background 0.12s;
    cursor: pointer;
}

.qj-row:hover { background: rgba(20, 20, 20, 0.9); }

.qj-info { flex: 1; min-width: 0; }

.qj-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qj-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.qj-wipe {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.qj-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    color: #fff;
    font-size: 16px;
    margin-left: 12px;
    flex-shrink: 0;
    transition: border-color 0.12s, background 0.12s;
}

.qj-row:hover .qj-play { border-color: #fff; background: rgba(255,255,255,0.1); }

/* ------------------------------------------------------------------
   HOME — promo card (bottom left)
------------------------------------------------------------------- */
.promo-card {
    position: absolute;
    left: 40px;
    bottom: 36px;
    width: 400px;
    display: block;
    background: rgba(0, 0, 0, 0.72);
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}

.promo-media {
    height: 200px;
    background: linear-gradient(135deg, #1c1a18, #2c221c 60%, #3a2418);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.promo-media img { width: 100%; height: 100%; object-fit: cover; }

.promo-fallback {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.14);
}

.promo-caption { padding: 12px 14px 14px; }

.promo-caption h3 {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
}

.promo-text {
    margin-top: 6px;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--text-dim);
}

/* ------------------------------------------------------------------
   HOME — hero (bottom right)
------------------------------------------------------------------- */
.hero {
    position: absolute;
    right: 40px;
    bottom: 48px;
    width: min(640px, 55vw);
    text-align: right;
    text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}

.hero-fw {
    display: block;
    color: inherit;
}

.hero-date {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d8d2cb;
    margin-bottom: 8px;
}

.hero-badge {
    display: inline-block;
    background: #97b83b;
    color: #14180a;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    margin-left: 8px;
    text-shadow: none;
    vertical-align: 2px;
    transition: filter 0.12s;
}

.hero-count {
    color: #f0b13b;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.hero-fw:hover .hero-badge { filter: brightness(1.15); }
.hero-fw:hover .hero-title { color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,0.95); }

.hero-title {
    font-size: clamp(44px, 6vw, 84px);
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}

.hero-sub {
    margin-top: 12px;
    font-size: 17px;
    line-height: 1.45;
    color: #d8d2cb;
}

.hero-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ------------------------------------------------------------------
   Buttons
------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    border: none;
    transition: filter 0.12s, background 0.12s, transform 0.07s, box-shadow 0.12s;
}

.btn svg { font-size: 15px; }

/* Press feedback: every button visibly depresses when clicked. */
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-dark { background: rgba(0, 0, 0, 0.75); color: #ddd7d0; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-dark:active { background: #000; color: #fff; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6); }

/* Refresh: spin the icon and lock the button while a fetch is in flight. */
@keyframes br-spin { to { transform: rotate(360deg); } }
#refresh.is-loading { pointer-events: none; opacity: 0.7; }
#refresh.is-loading svg { animation: br-spin 0.7s linear infinite; transform-origin: 50% 50%; }

.btn-yellow { background: var(--yellow); color: #241c05; }
.btn-yellow:hover { filter: brightness(1.1); }

.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { filter: brightness(1.1); }

/* ------------------------------------------------------------------
   PLAY — top bar
------------------------------------------------------------------- */
#view-play {
    display: none;
    flex-direction: column;
}

#view-play.active { display: flex; }

.browser-topbar {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 24px;
    gap: 10px;
}

.browser-tabs { display: flex; gap: 8px; }

.btab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.06);
    color: #cfc9c2;
    transition: background 0.12s;
}

.btab:hover { background: rgba(255,255,255,0.12); }

.btab.active { background: #7f9e3d; color: #10130a; }

.btab-count {
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 7px;
    font-size: 12px;
    border-radius: 2px;
}

.btab.active .btab-count { background: rgba(0,0,0,0.2); }

.browser-search {
    margin-left: auto;
    position: relative;
    width: 280px;
}

.browser-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: none;
    color: #fff;
    font-family: var(--font);
    font-size: 14px;
    padding: 10px 38px 10px 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    outline: none;
}

.browser-search input::placeholder { color: #7c766f; }

.browser-search svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9a948e;
    font-size: 16px;
}

/* ------------------------------------------------------------------
   PLAY — body layout
------------------------------------------------------------------- */
.browser-body {
    flex: 1;
    display: flex;
    min-height: 0;
    padding: 0 24px;
}

/* Sidebar */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    overflow: hidden;
    padding: 16px 14px 20px;
    background:
        linear-gradient(to top, rgba(120, 30, 15, 0.35), rgba(0,0,0,0) 45%),
        rgba(15, 10, 8, 0.72);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Only the filters scroll; the action buttons stay pinned at the bottom. */
.sidebar-filters {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-right: 4px;
    margin-right: -4px;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }

.filter-head {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #b3ada6;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 4px;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cfc9c2;
    cursor: pointer;
    background: rgba(0,0,0,0.45);
    margin-bottom: 4px;
}

.check:hover { background: rgba(255, 255, 255, 0.08); }

.check input { display: none; }

.check .box {
    width: 18px;
    height: 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    position: relative;
    flex-shrink: 0;
}

.check input:checked + .box { background: #7f9e3d; border-color: #7f9e3d; }

.check input:checked + .box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #10130a;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.sidebar-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-actions .btn { width: 100%; }

.list-updated {
    text-align: center;
    font-size: 11px;
    color: rgba(221, 215, 208, 0.55);
    letter-spacing: 0.02em;
    min-height: 14px;
    margin-top: 2px;
}

/* Server list */
.serverlist {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0 8px 0 20px;
}

.sl-header, .srow {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 150px 150px 140px 160px;
    align-items: center;
    gap: 8px;
}

.sl-header .sortable {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sl-header .sortable:hover { color: #e6e0da; }

.sort-ind { font-size: 10px; opacity: 0; }
.sl-header .sortable.active { color: #fff; }
.sl-header .sortable.active .sort-ind { opacity: 0.9; }

.sl-header {
    background: rgba(0, 0, 0, 0.8);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b3ada6;
    padding: 12px 6px;
    margin: 10px 0 2px;
}

.sl-header .sl-fav { text-align: center; }

.sl-rows {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.srow {
    padding: 11px 6px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.1s;
}

.srow:hover { background: var(--row-hover); }

.srow.offline { opacity: 0.45; }

/* fav heart */
.fav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: rgba(255,255,255,0.25);
    width: 100%;
    padding: 4px 0;
    transition: color 0.12s, transform 0.12s;
}

.fav-btn:hover { color: rgba(255,255,255,0.6); transform: scale(1.15); }
.fav-btn.on { color: var(--red); }

.srow-name { min-width: 0; }

.srow-title {
    font-size: 16px;
    font-weight: 700;
    color: #f2ede8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Short config-name variant of the title: only shown on mobile. */
.srow-title-short {
    display: none;
    font-size: 16px;
    font-weight: 700;
    color: #f2ede8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.srow-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.chip {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a49e97;
    background: var(--chip-bg);
    padding: 2px 7px;
}

.chip.green { background: var(--green-chip); color: #17190b; }
.chip.dim { background: none; padding-left: 0; }

.srow-lastwipe, .srow-nextwipe { font-size: 14px; font-weight: 700; color: #e6e0da; }
.srow-lastwipe { color: var(--text-dim); font-weight: 400; }

.srow-nextwipe.full-wipe::after,
.srow-nextwipe.map-wipe::after {
    font-size: 10px;
    padding: 1px 5px;
    margin-left: 7px;
    vertical-align: 1px;
    background: var(--chip-bg);
    color: #a49e97;
}

.srow-nextwipe.full-wipe::after { content: "FULL"; }
.srow-nextwipe.map-wipe::after { content: "MAP"; }

.srow-players { font-size: 15px; font-weight: 700; color: #fff; }
.srow-players .max { color: var(--text-dim); font-weight: 400; }

.queue-chip {
    display: inline-block;
    background: #7f9e3d;
    color: #10130a;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    margin-left: 8px;
}

.srow-country {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #b3ada6;
}

.sl-empty {
    text-align: center;
    color: var(--text-dim);
    font-size: 16px;
    padding: 60px 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ------------------------------------------------------------------
   Server detail overlay
------------------------------------------------------------------- */
.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.detail-overlay[hidden] { display: none; }

.detail-panel {
    width: min(960px, 100%);
    max-height: 100%;
    background: #0f0d0c;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
}

.detail-head {
    padding: 18px 22px 12px;
    flex-shrink: 0;
}

.detail-head h2 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.detail-tags .chip {
    font-size: 12px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.09);
    color: #cfc9c2;
}

/* Hero image — the server's header image (RustMagic banner) */
.detail-hero {
    height: 300px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1c1a18, #2c221c 60%, #3a2418) center/cover no-repeat;
    position: relative;
}

.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 -40px 60px -20px rgba(0,0,0,0.6);
    pointer-events: none;
}

.detail-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 18px;
    padding: 16px 22px;
    flex-shrink: 0;
}

.dstat { min-width: 0; }

.dstat .k {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.dstat .v {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.06);
    padding: 9px 13px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dstat .v.red { color: #ef7a64; }
.dstat .v.green { color: #a9c45c; }

.dstat .v .viewbtn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #55771f;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dstat .v .viewbtn:hover { background: #67902a; }

.dstat.copyable .v { cursor: pointer; }
.dstat.copyable .v:hover { background: rgba(255,255,255,0.11); }

.detail-desc-wrap {
    flex: 1;
    min-height: 90px;
    overflow-y: auto;
    padding: 0 22px;
}

.detail-desc {
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: #cfc9c2;
    white-space: pre-wrap;
    margin: 0;
}

.detail-desc a { color: #7fb3d8; }

.detail-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px 20px;
    flex-shrink: 0;
}

.detail-actions-right {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.detail-actions .btn { padding: 13px 22px; }

.btn-green { background: #55771f; color: #fff; }
.btn-green:hover { background: #67902a; }

/* ------------------------------------------------------------------
   Site footer
------------------------------------------------------------------- */
.sitefooter {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 34px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 14px;
    background: rgba(0, 0, 0, 0.78);
    font-size: 11px;
    color: #7c766f;
}

.sf-social {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sf-social a {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: #9a948e;
    font-size: 15px;
    transition: color 0.12s, background 0.12s;
}

.sf-social a:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Even out the perceived icon sizes: each glyph fills a different share of
   its 24-unit viewBox (YouTube 20, Discord 17.8, TikTok 16.8, Steam 24…),
   so the svg box is scaled per network to render every glyph ~12.5px. */
.sf-social a[data-net="discord"] svg { width: 17px; height: 17px; }
.sf-social a[data-net="tiktok"] svg { width: 18px; height: 18px; }
.sf-social a[data-net="steam"] svg { width: 12.5px; height: 12.5px; }

/* Invisible text over each icon: Ctrl+F still matches it, and the browser's
   own find highlight paints over the icon, but no glyphs are visible. */
.sf-find {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 8px;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
}

.sf-disclaimer {
    flex: 1;
    min-width: 0;
    text-align: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-links {
    display: flex;
    gap: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.sf-links a:hover { color: #fff; }

/* ------------------------------------------------------------------
   Legal pages (privacy / terms)
------------------------------------------------------------------- */
body.legal {
    overflow: auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* On scrollable content pages the footer flows after the content (only
   visible when scrolled to the bottom); on short pages margin-top:auto
   pushes it to the bottom edge. position:relative keeps it above the
   fixed background video — with static positioning the z-index would be
   ignored and the video overlay would cover it. */
body.legal .sitefooter {
    position: relative;
    z-index: 5;
    margin-top: auto;
}

/* Same video background as the home page, with a touch more darkening so the
   long-form text stays comfortable to read. */
body.legal .bg-vignette {
    background:
        linear-gradient(rgba(10, 8, 7, 0.45), rgba(10, 8, 7, 0.45)),
        linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.05) 18%, rgba(0,0,0,0.05) 70%, rgba(0,0,0,0.6) 100%),
        radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.45) 100%);
}

.legal-wrap {
    position: relative;
    z-index: 5;
    max-width: 860px;
    margin: 40px auto 80px;
    padding: 36px 42px;
    background: rgba(10, 9, 8, 0.92);
}

.legal-wrap h1 {
    font-size: 32px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    margin-bottom: 4px;
}

.legal-wrap .legal-updated {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 26px;
}

.legal-wrap h2 {
    font-size: 19px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f2ede8;
    margin: 26px 0 8px;
}

.legal-wrap h3 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 14px 0 6px;
}

.legal-wrap h3.rule-no { color: #ef7a64; }
.legal-wrap h3.rule-no::before { content: "✕ "; }
.legal-wrap h3.rule-yes { color: #a9c45c; }
.legal-wrap h3.rule-yes::before { content: "✓ "; }

.legal-wrap .rule-warning {
    color: #ef7a64;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.legal-wrap ul ul { margin-top: 6px; }

.legal-wrap p, .legal-wrap li {
    font-size: 15px;
    line-height: 1.65;
    color: #cfc9c2;
    margin-bottom: 10px;
}

.legal-wrap ul { padding-left: 22px; margin-bottom: 10px; }

.legal-wrap a:not(.btn) { color: #7fb3d8; }
.legal-wrap a:not(.btn):hover { text-decoration: underline; }

/* Forced wipe page */
.fw-next {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.fw-cell {
    flex: 1;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.06);
    padding: 14px 18px;
}

.fw-cell .k {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.fw-cell .v {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Upcoming forced wipe dates table */
.fw-sched-wrap { overflow-x: auto; margin: 6px 0 16px; }

.fw-sched {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.fw-sched th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
}

.fw-sched td {
    padding: 8px 14px;
    color: #cfc9c2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    white-space: nowrap;
}

.fw-sched tr.is-next td { color: #fff; font-weight: 700; background: rgba(184, 65, 44, 0.16); }

/* Why-play page */
.why-wrap {
    position: relative;
    z-index: 5;
    max-width: 1100px;
    margin: 40px auto 80px;
    padding: 0 24px;
}

.why-wrap h1 {
    font-size: 38px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff;
    margin-bottom: 12px;
}

.why-intro {
    font-size: 17px;
    line-height: 1.6;
    color: #cfc9c2;
    max-width: 820px;
    margin-bottom: 34px;
}

.why-intro strong { color: #fff; }

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.why-card {
    background: rgba(10, 9, 8, 0.9);
    padding: 18px 20px;
}

.why-card h2 {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    margin-bottom: 8px;
}

.why-card p {
    font-size: 14.5px;
    line-height: 1.55;
    color: #cfc9c2;
}

.why-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.why-wrap .legal-disclaimer {
    margin-top: 30px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: var(--text-dim);
}

.legal-wrap .legal-disclaimer {
    margin-top: 30px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: var(--text-dim);
}

/* ------------------------------------------------------------------
   Scrollbars
------------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.4); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------- */
.filters-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* Small desktop: the region column starves the server name (the region
   already shows as a chip in the tags row anyway). */
@media (max-width: 1300px) {
    .sl-header, .srow { grid-template-columns: 44px minmax(0,1fr) 140px 140px 120px; }
    .sl-header .sl-country, .srow-country { display: none; }
}

@media (max-width: 1100px) {
    .sl-header, .srow { grid-template-columns: 40px minmax(0,1fr) 130px 130px 90px; }
    .sl-header .sl-country, .srow-country { display: none; }
    .sidebar { width: 240px; }
    .quickjoin { width: min(420px, calc(100vw - 60px)); }
    .promo-card { display: none; }
    .hero { width: calc(100vw - 80px); }
}

/* Tablet: the sidebar plus four fixed columns starve the name column,
   so drop "last wipe" and slim the rest. */
@media (max-width: 940px) {
    .sl-header, .srow { grid-template-columns: 40px minmax(0,1fr) 120px 90px; }
    .sl-header .sl-lastwipe, .srow-lastwipe { display: none; }
    .sidebar { width: 220px; }
    .chip { white-space: nowrap; }
}

@media (max-width: 760px) {
    html, body { overflow: auto; }

    /* Top bar: compact icon-only nav that fits a 375px viewport; on even
       narrower screens the nav scrolls horizontally instead of clipping. */
    .topbar { height: 60px; }
    .view { top: 60px; }
    .logo { width: 46px; margin-right: 0; }
    .logo img { width: 38px; height: 38px; }
    .mainnav { overflow-x: auto; scrollbar-width: none; }
    .mainnav::-webkit-scrollbar { display: none; }
    .nav-item { padding: 0 clamp(5px, 1.7vw, 10px); font-size: 14px; }
    .nav-item span { display: none; }
    .nav-item svg { font-size: 18px; }
    .topbar-right { padding-right: 6px; gap: 4px; }
    .lang-pick { padding: 6px 5px; gap: 4px; }
    .lang-pick svg { display: none; }
    .lang-pick select { font-size: 11.5px; max-width: 76px; }

    /* Home: quick join on top, the forced wipe hero pushed to the bottom
       edge (margin-top:auto), mirroring the desktop anchoring. */
    #view-home { overflow-y: auto; display: flex; flex-direction: column; }
    .quickjoin { position: static; width: auto; margin: 16px 12px; }
    .promo-card { position: static; }
    .hero { position: static; width: auto; margin: 24px 12px 20px; margin-top: auto; text-align: left; }
    .hero-title { font-size: clamp(34px, 11vw, 56px); }
    .hero-actions { justify-content: flex-start; flex-wrap: wrap; }

    /* Server browser: icon tabs + filter drawer toggle; the search box
       drops to its own full-width row. */
    .browser-topbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
    .browser-tabs { flex-wrap: wrap; }
    .btab { padding: 8px 9px; font-size: 11.5px; gap: 5px; }
    .btab-count { padding: 1px 5px; font-size: 10.5px; }
    .filters-toggle { display: inline-flex; margin-left: auto; padding: 8px 12px; font-size: 12px; }
    .browser-search { margin-left: 0; width: 100%; }
    .browser-search input { font-size: 16px; } /* <16px zooms iOS on focus */
    .browser-body { padding: 0 10px; }
    .serverlist { padding: 0; }

    /* Filters become a slide-in drawer over the list. The play view is its
       own stacking context below the topbar, so start the drawer under it. */
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        z-index: 70;
        width: min(320px, 86vw);
        background: #161009;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    }
    body.filters-open .sidebar { transform: translateX(0); }
    body.filters-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(0, 0, 0, 0.55);
    }

    /* Same columns as desktop (name | last wipe | next wipe | players),
       just compressed with smaller type so they fit a 375px screen. */
    .sl-header, .srow {
        grid-template-columns: 20px minmax(0, 1fr) 62px 76px 50px;
        gap: 5px;
    }
    .sl-header { padding: 10px 6px; font-size: 10px; letter-spacing: 0.04em; }
    .sl-header .sl-lastwipe, .srow-lastwipe { display: flex; }
    .sl-header .sortable { gap: 3px; }
    .srow { padding: 10px 6px; }
    .srow-lastwipe { display: block; font-size: 10.5px; }
    .srow-nextwipe { font-size: 11px; }
    .srow-nextwipe.full-wipe::after,
    .srow-nextwipe.map-wipe::after { content: none; }
    .srow-players { font-size: 12px; }
    .srow-country { display: none; }
    .srow-title { display: none; }
    .srow-title-short {
        display: block;
        font-size: 13px;
        white-space: normal;
        overflow: visible;
        overflow-wrap: anywhere;
    }
    .srow-tags { gap: 4px; margin-top: 4px; }
    .srow-tags .chip { font-size: 9px; padding: 1px 5px; }
    .fav-btn { font-size: 14px; }

    /* Server detail overlay */
    .detail-overlay { padding: 10px; }
    .detail-head { padding: 14px 14px 10px; }
    .detail-head h2 { font-size: 19px; white-space: normal; }
    .detail-hero { height: 150px; }
    .detail-stats { grid-auto-flow: row; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px; }
    .detail-desc-wrap { padding: 0 14px; }
    .detail-actions { flex-wrap: wrap; gap: 8px; padding: 12px 14px 16px; }
    .detail-actions .btn { flex: 1; padding: 12px 14px; }
    .detail-actions-right { margin-left: 0; flex: 1 1 100%; gap: 8px; }
    .detail-actions-right .btn { flex: 1; }

    /* Footer: drop the disclaimer, stack the legal links so long
       translations still fit next to the social icons. */
    .sitefooter { gap: 8px; padding: 0 10px; }
    .sf-disclaimer { display: none; }
    .sf-social { gap: 0; }
    .sf-social a { width: 24px; }
    .sf-links { flex-direction: column; gap: 1px; margin-left: auto; font-size: 10px; }
    .sf-links a { white-space: nowrap; }

    /* Content pages (forced wipe, rules, privacy, terms, why) */
    .legal-wrap { margin: 14px 10px 40px; padding: 22px 16px; }
    .legal-wrap h1 { font-size: 25px; }
    .fw-cell .v { font-size: 19px; }
    .why-wrap { margin: 24px auto 60px; padding: 0 14px; }
    .why-wrap h1 { font-size: 27px; }
    .why-grid { grid-template-columns: 1fr; }
}
