/* madwars.ru — Steam Library стиль карточек */

:root {
    --bg-0: #0a0e15;
    --bg-1: #11161f;
    --bg-2: #161d29;
    --bg-3: #1f2839;
    --line: #2a3346;
    --line-soft: #1c2230;
    --txt: #e2e6ed;
    --txt-soft: #8a93a3;
    --txt-mute: #5a6275;
    --accent: #d4a657;        /* gold */
    --accent-2: #c14040;      /* кровавый — для bad/hidden/danger */
    --accent-3: #4a90e2;      /* синий — резерв */
    --neon-blue: #3ad9ff;     /* электрический cyan */
    --neon-blue-2: #4a90e2;   /* мягкий синий ambient */
    --neon-red: #ff3a3a;      /* интенсивный красный для action */
    --good: #5db35d;
    --bad: #c14040;
    --hidden: #c79a3a;
    --shadow: 0 4px 24px rgba(0,0,0,.5);
    --display: "Cinzel", Georgia, "Times New Roman", serif;
    --mono: ui-monospace, "JetBrains Mono", "Fira Code", Consolas, monospace;
}

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

body {
    background: var(--bg-0);
    background-image:
        radial-gradient(ellipse 1200px 600px at 50% -100px, rgba(40,55,85,.5) 0%, transparent 70%),
        radial-gradient(ellipse 800px 400px at 100% 0%, rgba(212,166,87,.06) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--txt);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}

/* ============== HEADER ============== */
.topbar {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 14px 32px;
    background: linear-gradient(180deg, rgba(14,19,28,.95) 0%, rgba(9,12,18,.95) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: inherit;
    cursor: pointer;
    transition: opacity .15s, filter .15s;
}
.brand:hover { filter: brightness(1.15) drop-shadow(0 0 10px rgba(212,166,87,.35)); }
.brand .logo-mark, .brand .brand-title, .brand .brand-sub { pointer-events: none; }
.logo-mark {
    width: 72px; height: 72px;
    display: block;
    object-fit: contain;
    filter:
        drop-shadow(0 0 4px rgba(0,0,0,1))
        drop-shadow(0 0 10px rgba(0,0,0,.85))
        drop-shadow(0 0 18px rgba(74,144,226,.55))
        drop-shadow(0 0 32px rgba(74,144,226,.35));
}
.brand:hover .logo-mark {
    filter:
        drop-shadow(0 0 4px rgba(0,0,0,1))
        drop-shadow(0 0 12px rgba(0,0,0,.9))
        drop-shadow(0 0 22px rgba(74,144,226,.85))
        drop-shadow(0 0 40px rgba(74,144,226,.55));
}
@media (max-width: 720px) {
    .logo-mark { width: 52px; height: 52px; }
}
.brand-title {
    font-family: var(--display);
    font-weight: 800; font-size: 28px; letter-spacing: 2px;
    color: var(--txt);
    line-height: 1;
    text-shadow: 0 1px 0 rgba(0,0,0,.7);
}
.brand-title .dot {
    color: var(--accent-2);
    text-shadow: 0 0 6px rgba(255,58,58,.55), 0 0 14px rgba(193,64,64,.4);
    animation: brandDotPulse 2.4s ease-in-out infinite;
}
@keyframes brandDotPulse {
    0%, 100% { text-shadow: 0 0 4px rgba(255,58,58,.4), 0 0 10px rgba(193,64,64,.25); opacity: .9; }
    50%      { text-shadow: 0 0 8px rgba(255,58,58,.85), 0 0 18px rgba(255,58,58,.5); opacity: 1; }
}
.brand-sub { font-size: 10px; color: var(--txt-soft); text-transform: uppercase; letter-spacing: 2px; margin-top: 4px; }

.topnav { display: flex; gap: 4px; flex: 1; margin-left: 24px; }
.topnav a {
    position: relative;
    padding: 8px 14px; color: var(--txt-soft);
    text-decoration: none; border-radius: 4px; font-size: 14px;
    transition: all .15s;
}
.topnav a::after {
    content: ""; position: absolute;
    left: 12px; right: 12px; bottom: 4px;
    height: 1px;
    background: var(--neon-blue);
    box-shadow: 0 0 6px var(--neon-blue), 0 0 12px rgba(58,217,255,.55);
    opacity: 0;
    transform: scaleX(.4);
    transform-origin: center;
    transition: opacity .18s ease, transform .22s ease;
    pointer-events: none;
}
.topnav a:hover { color: var(--txt); background: var(--bg-2); }
.topnav a:hover::after { opacity: .85; transform: scaleX(1); }
.topnav a.active {
    color: var(--accent);
    background: var(--bg-2);
    text-shadow: 0 0 8px rgba(58,217,255,.35);
}
.topnav a.active::after { opacity: 1; transform: scaleX(1); }
.topnav-stats:hover::after {
    background: var(--neon-red);
    box-shadow: 0 0 6px var(--neon-red), 0 0 12px rgba(255,58,58,.55);
}

.lang-switch { display: flex; gap: 2px; background: var(--bg-2); border-radius: 4px; padding: 2px; }
.lang-switch button {
    background: none; border: 0; color: var(--txt-soft);
    padding: 6px 10px; font-size: 12px; font-weight: 600;
    cursor: pointer; border-radius: 3px; font-family: inherit;
}
.lang-switch button.on { background: var(--accent); color: #1a1209; }

/* ============== HERO ============== */
.hero {
    position: relative;
    padding: 36px 32px 28px;
    border-bottom: 1px solid var(--line-soft);
    overflow: hidden;
    isolation: isolate;
}
/* Cinematic-баннер только на #all — на табах конкретной игры просто полоска */
body[data-tab="all"] .hero {
    min-height: 320px;
    padding: 60px 32px 40px;
    background-image:
        linear-gradient(180deg, rgba(8,11,18,.45) 0%, rgba(8,11,18,.78) 60%, rgba(10,14,21,.98) 100%),
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(193,64,64,.15) 0%, transparent 70%),
        url('brand/hero.jpg');
    background-position: center 22%;
    background-size: cover;
    background-repeat: no-repeat;
    border-bottom: 1px solid rgba(193,64,64,.25);
}
body[data-tab="all"] .hero::after {
    content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, var(--accent-2) 50%, var(--accent) 70%, transparent 100%);
    opacity: .55;
    pointer-events: none;
}
.hero-stats {
    display: flex; gap: 56px;
    max-width: 1320px; margin: 0 auto;
    width: 100%; box-sizing: border-box; padding: 0 32px;
    position: relative; z-index: 1;
}
body[data-tab="all"] .hero-stats { margin-top: 80px; }
.stat { display: flex; flex-direction: column; }
.stat .num {
    font-size: 44px; font-weight: 800; color: var(--accent);
    font-family: var(--display); letter-spacing: 1px; line-height: 1;
    text-shadow:
        0 2px 0 rgba(0,0,0,.6),
        0 0 14px rgba(58,217,255,.35),
        0 0 28px rgba(74,144,226,.28);
}
.stat .lbl {
    font-size: 11px; text-transform: uppercase; color: var(--txt-mute);
    letter-spacing: 1.8px; margin-top: 8px;
}

/* ============== GROUPS ============== */
main { max-width: 1320px; margin: 0 auto; padding: 28px 32px 64px; width: 100%; box-sizing: border-box; }

/* ============== OVERVIEW (главная-сводка) ============== */
.overview {
    max-width: 1320px; margin: 0 auto;
    width: 100%; box-sizing: border-box;
    padding: 24px 32px 0;
}
.ovr-table {
    width: 100%;
    border-collapse: separate; border-spacing: 0;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.ovr-table thead th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--txt-mute);
    font-weight: 700;
}
.ovr-table thead th.num { text-align: right; }
.ovr-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 14px;
    color: var(--txt);
    vertical-align: middle;
}
.ovr-table tbody tr:last-child td { border-bottom: 0; }
.ovr-table tbody tr:hover td { background: rgba(255,255,255,.025); }
.ovr-row { cursor: pointer; transition: background .12s; }

.ovr-name {
    font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
.ovr-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--bad); flex-shrink: 0;
    box-shadow: 0 0 6px var(--bad);
}
.ovr-dot.on {
    background: var(--neon-blue);
    box-shadow: 0 0 4px #fff, 0 0 8px var(--neon-blue), 0 0 14px rgba(58,217,255,.45);
}
.ovr-dot.partial { background: var(--accent); box-shadow: 0 0 6px rgba(212,166,87,.7); }
.ovr-dot.off { background: var(--bad); box-shadow: 0 0 6px rgba(192,64,64,.4); }
.ovr-sub {
    font-size: 11px; color: var(--txt-mute); font-weight: 500;
    margin-left: 6px; letter-spacing: .5px;
}
td.num { text-align: right; }
.ovr-mono { font-family: var(--mono); font-weight: 700; }
.ovr-status {
    display: inline-block;
    padding: 3px 8px; border-radius: 3px;
    font-family: var(--mono); font-size: 10px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1px;
}
.ovr-status.on  {
    background: rgba(58,217,255,.10);
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(58,217,255,.45);
}
.ovr-status.off { background: rgba(192,64,64,.15); color: var(--bad); }
.ovr-go a {
    color: var(--accent); text-decoration: none; font-weight: 600;
    font-size: 13px;
}
.ovr-go a:hover { color: #fff; }

/* видимость групп: по умолчанию ВСЕ группы скрыты, JS показывает нужную */
body[data-tab="all"] .group { display: block; }
body[data-tab="all"] .group .srv-grid { display: none; }
body[data-tab="all"] .group-stats.gs-pending { display: none; }
body[data-tab="all"] .overview { display: block; }
body:not([data-tab="all"]) .overview { display: none; }
body:not([data-tab="all"]) .group { display: none; }
body[data-tab="qw"] .group#qw,
body[data-tab="q2"] .group#q2,
body[data-tab="q3"] .group#q3,
body[data-tab="ql"] .group#ql,
body[data-tab="tw"] .group#tw,
body[data-tab="ts"] .group#ts { display: block; }

@media (max-width: 720px) {
    .overview { padding: 16px 16px 0; }
    .ovr-table thead th, .ovr-table tbody td { padding: 10px 12px; font-size: 13px; }
    .ovr-sub { display: none; }
}
.group { margin: 32px 0; }
.group-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 4px 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line-soft);
}
.group-title { display: flex; align-items: baseline; gap: 14px; }
.group-title h2 {
    margin: 0; font-size: 26px; font-weight: 800;
    color: var(--txt); letter-spacing: 2px;
    font-family: var(--display);
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
.group-sub { font-size: 11px; color: var(--txt-mute); text-transform: uppercase; letter-spacing: 1.2px; }
.group-totals { display: flex; gap: 8px; }
.badge {
    padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 700;
    background: var(--bg-3); color: var(--txt-soft);
    text-transform: uppercase; letter-spacing: .8px; font-family: var(--mono);
}
.badge.online  { background: rgba(93,179,93,.12); color: var(--good); }
.badge.players { background: rgba(212,166,87,.12); color: var(--accent); }

/* ============== CARD GRID — Steam Library ============== */
/* Flexbox с justify-content: center и фиксированной шириной — гарантированно 3+2 на 5 серверов */
.srv-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-content: flex-start;
}
.srv-card {
    flex: 0 0 calc(33.333% - 14px);
    max-width: calc(33.333% - 14px);
    min-width: 0;
}
@media (max-width: 940px) {
    .srv-grid { gap: 16px; }
    .srv-card { flex: 0 0 calc(50% - 8px); max-width: calc(50% - 8px); }
}
@media (max-width: 640px) {
    .srv-grid { flex-direction: column; gap: 10px; }
    .srv-card { flex: none; max-width: none; width: 100%; }
}

.srv-card {
    position: relative;
    aspect-ratio: 16 / 9.45;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-2);
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
    cursor: pointer;
    isolation: isolate;
    transition: transform .15s cubic-bezier(.4, 0, .2, 1), box-shadow .15s, border-color .15s;
}
.srv-card:hover {
    transform: translateY(-3px) scale(1.015);
    border-color: rgba(255,58,58,.65);
    box-shadow:
        0 12px 32px rgba(0,0,0,.65),
        -4px 0 22px rgba(58,217,255,.32),
         4px 0 22px rgba(255,58,58,.32),
        0 0 0 1px rgba(255,58,58,.35);
    z-index: 5;
}
.srv-card.on:hover {
    border-color: rgba(58,217,255,.55);
    box-shadow:
        0 12px 32px rgba(0,0,0,.65),
        -5px 0 26px rgba(58,217,255,.45),
         5px 0 26px rgba(255,58,58,.28),
        0 0 0 1px rgba(58,217,255,.4);
}
.srv-card:active { transform: translateY(-1px) scale(1.005); }

.card-bg {
    position: absolute; inset: 0; z-index: 1;
    background-color: #161d29;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: transform .3s ease-out;
}
.srv-card:hover .card-bg { transform: scale(1.05); }
.srv-card.off .card-bg, .srv-card.hidden-status .card-bg {
    filter: saturate(.2) brightness(.4);
}

/* Fallback паттерны для серверов без скриншотов */
.srv-card:not([data-bg]) .card-bg,
.srv-card[data-bg=""] .card-bg {
    background-image:
        radial-gradient(ellipse at 30% 30%, rgba(80,100,140,.2) 0%, transparent 60%),
        repeating-linear-gradient(45deg, transparent 0 14px, rgba(255,255,255,.025) 14px 15px);
}
#q2 .srv-card:not([data-bg]) .card-bg,
#q2 .srv-card[data-bg=""] .card-bg {
    background-image:
        radial-gradient(ellipse at 30% 30%, rgba(180,90,40,.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(90,40,20,.3) 0%, transparent 60%),
        repeating-linear-gradient(45deg, transparent 0 12px, rgba(255,140,80,.05) 12px 13px);
    background-color: #1f1410;
}
#qw .srv-card:not([data-bg]) .card-bg,
#qw .srv-card[data-bg=""] .card-bg {
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(80,100,140,.3) 0%, transparent 55%),
        repeating-linear-gradient(0deg, transparent 0 16px, rgba(160,180,220,.025) 16px 17px);
    background-color: #14181f;
}
#ts .srv-card:not([data-bg]) .card-bg,
#ts .srv-card[data-bg=""] .card-bg {
    background-image: radial-gradient(ellipse at 50% 0%, rgba(100,80,200,.3) 0%, transparent 60%);
    background-color: #18142a;
}
#tw .srv-card:not([data-bg]) .card-bg,
#tw .srv-card[data-bg=""] .card-bg {
    background-image:
        radial-gradient(ellipse at 30% 30%, rgba(140,200,90,.25) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(60,120,40,.3) 0%, transparent 60%),
        repeating-linear-gradient(45deg, transparent 0 14px, rgba(180,220,140,.04) 14px 15px);
    background-color: #1a2410;
}
.srv-card:not([data-bg]) .card-bg::after,
.srv-card[data-bg=""] .card-bg::after {
    content: attr(data-mapname);
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-family: var(--mono);
    font-size: 30px; font-weight: 800;
    color: rgba(255,255,255,.06);
    letter-spacing: 4px;
    text-transform: uppercase;
    pointer-events: none;
}

/* Overlay-gradient для читаемости текста */
.card-overlay {
    position: absolute; inset: 0; z-index: 2;
    background:
        linear-gradient(180deg, rgba(8,10,16,.4) 0%, rgba(8,10,16,0) 30%, rgba(8,10,16,.55) 60%, rgba(8,10,16,.95) 100%);
    pointer-events: none;
}

/* Top-right corner: mode */
.card-corner {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    display: flex; align-items: center; gap: 6px;
}
.strip-actions {
    display: flex; align-items: center; gap: 5px;
    margin-top: 5px;
}
.card-mode {
    background: rgba(0,0,0,.65);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    font-family: var(--mono);
    font-size: 10px; font-weight: 700;
    padding: 3px 8px; border-radius: 3px;
    text-transform: uppercase; letter-spacing: .8px;
    backdrop-filter: blur(4px);
}
.btn-steam {
    display: grid; place-items: center;
    width: 26px; height: 24px;
    background: linear-gradient(180deg, #2a4060, #1a2840);
    border: 1px solid #3a5a8a;
    color: #c0d8ff;
    border-radius: 3px;
    text-decoration: none;
    transition: all .15s;
    flex-shrink: 0;
}
.btn-steam:hover { background: #3a5680; color: #fff; }

.btn-connect {
    flex: 1;
    display: inline-block;
    background: linear-gradient(180deg, #3a72b5 0%, #2c5a93 100%);
    border: 1px solid #4a8acf;
    color: white; font-weight: 700;
    padding: 4px 8px; font-size: 10px; border-radius: 3px;
    cursor: pointer; text-transform: uppercase; letter-spacing: .6px;
    font-family: inherit;
    text-decoration: none; text-align: center;
    box-shadow:
        0 1px 0 rgba(255,255,255,.12) inset,
        0 1px 4px rgba(0,0,0,.4),
        0 0 10px rgba(58,217,255,.28),
        0 4px 14px rgba(58,217,255,.18);
    transition: filter .15s, box-shadow .18s, border-color .18s, background .18s;
}
.btn-connect:hover {
    filter: brightness(1.1);
    background: linear-gradient(180deg, #c14a4a 0%, #8c2727 100%);
    border-color: #ff6a6a;
    box-shadow:
        0 1px 0 rgba(255,255,255,.15) inset,
        0 1px 4px rgba(0,0,0,.45),
        0 0 12px rgba(255,58,58,.45),
        0 4px 18px rgba(255,58,58,.3);
}
.btn-connect.copied { background: linear-gradient(180deg, #5db35d, #4a9c4a); border-color: #6cc56c; }

/* Bottom info strip */
.card-strip {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
    padding: 10px 12px 11px;
    display: flex; flex-direction: column; gap: 3px;
}

.strip-main {
    display: flex; align-items: center; gap: 8px;
}
.dot-status {
    flex-shrink: 0;
    display: block; width: 9px; height: 9px; border-radius: 50%;
    background: var(--bad);
    box-shadow: 0 0 6px rgba(193,64,64,.45);
}
.srv-card.on .dot-status {
    background: var(--neon-blue);
    box-shadow:
        0 0 4px #fff,
        0 0 8px var(--neon-blue),
        0 0 16px rgba(58,217,255,.55);
    animation: dotPulseBlue 2.6s ease-in-out infinite;
}
.srv-card.off .dot-status {
    background: var(--bad);
    box-shadow: 0 0 5px rgba(193,64,64,.35);
    opacity: .75;
}
.srv-card.hidden-status .dot-status { background: var(--hidden); box-shadow: 0 0 8px rgba(199,154,58,.5); }

@keyframes dotPulseBlue {
    0%, 100% { box-shadow: 0 0 4px #fff, 0 0 8px var(--neon-blue), 0 0 14px rgba(58,217,255,.45); }
    50%      { box-shadow: 0 0 5px #fff, 0 0 12px var(--neon-blue), 0 0 22px rgba(58,217,255,.7); }
}

.strip-name {
    margin: 0;
    font-size: 17px; font-weight: 700; color: #fff;
    letter-spacing: .2px;
    text-shadow: 0 1px 0 rgba(0,0,0,.9), 0 2px 8px rgba(0,0,0,.95);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.strip-counter {
    font-family: var(--mono); font-weight: 800;
    font-size: 15px; color: var(--accent);
    text-shadow: 0 1px 0 rgba(0,0,0,.95), 0 2px 6px rgba(0,0,0,.9);
    flex-shrink: 0;
}
.strip-hidden {
    font-size: 10px; font-style: italic; color: var(--hidden);
    text-shadow: 0 1px 0 rgba(0,0,0,.95);
    flex-shrink: 0;
}

.strip-meta {
    display: flex; align-items: center; gap: 7px;
    font-family: var(--mono); font-size: 13px;
    color: var(--txt-soft);
    text-shadow: 0 1px 2px rgba(0,0,0,.95);
    overflow: hidden;
}
.strip-map {
    color: var(--accent); font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,.95), 0 0 8px rgba(212,166,87,.3);
    letter-spacing: .3px;
}
.strip-sep { color: rgba(255,255,255,.25); }
.strip-ip {
    color: var(--neon-blue);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,.95), 0 0 6px rgba(58,217,255,.35);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.strip-nicks {
    display: flex; flex-wrap: wrap; gap: 3px 5px;
    margin-top: 4px;
    font-family: var(--mono); font-size: 10px;
    max-height: 18px; overflow: hidden;
}
.nick {
    color: #fff;
    background: rgba(0,0,0,.55);
    padding: 1px 5px; border-radius: 2px;
    border: 1px solid rgba(255,255,255,.06);
    white-space: nowrap;
    max-width: 110px; overflow: hidden; text-overflow: ellipsis;
}
.nick.more { color: var(--txt-mute); }

/* Toast уведомление — pill снизу карточки, видна полная команда */
.card-toast {
    position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 10;
    transform: translateY(8px) scale(.96);
    padding: 9px 14px;
    background: linear-gradient(180deg, rgba(93,179,93,.97), rgba(70,150,70,.97));
    color: #fff; font-weight: 700; font-size: 12px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 4px 16px rgba(0,0,0,.6), 0 0 18px rgba(93,179,93,.35);
    letter-spacing: .3px;
    font-family: var(--mono);
    text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.srv-card.copied .card-toast {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ============== Q3 color codes ============== */
.q3c-0 { color: #000; } .q3c-1 { color: #ff3838; } .q3c-2 { color: #6cda6c; }
.q3c-3 { color: #ffe042; } .q3c-4 { color: #4a9eff; } .q3c-5 { color: #4adfff; }
.q3c-6 { color: #ff6cff; } .q3c-7 { color: #ffffff; } .q3c-8 { color: #ff8c00; }
.q3c-9 { color: #888; }

/* ============== STATS PAGE ============== */
.stats-main { max-width: 1320px; margin: 0 auto; padding: 28px 32px 64px; width: 100%; box-sizing: border-box; }
.stats-section { margin-top: 32px; }
.stats-section:first-child { margin-top: 0; }
.stats-recent {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
}
.match-card {
    position: relative;
    background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
    transition: border-color .15s, box-shadow .15s;
}
.match-card:hover {
    border-color: var(--accent-2);
    box-shadow: 0 6px 22px rgba(0,0,0,.5), 0 0 0 1px rgba(193,64,64,.3);
    cursor: pointer;
}
.match-card:has(.match-cover:hover) {
    border-color: var(--accent);
    box-shadow: 0 8px 26px rgba(0,0,0,.55), 0 0 0 1px rgba(212,166,87,.45), 0 0 22px rgba(212,166,87,.18);
}
.match-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    text-decoration: none;
    /* invisible overlay link covering the card */
}
.match-card .match-meta,
.match-card .vs-block,
.match-card .match-scoreboard {
    position: relative;
    z-index: 2;
}
.match-card .q3-link {
    position: relative;
    z-index: 3;
}
.q3-link { text-decoration: none; }
.q3-link:hover { filter: brightness(1.25) drop-shadow(0 0 4px rgba(212, 166, 87, .55)); }
.match-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    font-family: var(--mono); font-size: 11px; color: var(--txt-mute);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
}
.match-gt {
    background: rgba(193,64,64,.18); color: var(--accent-2);
    padding: 2px 8px; border-radius: 3px;
    font-weight: 800; letter-spacing: 1.5px;
    border: 1px solid rgba(255,58,58,.3);
    text-shadow: 0 0 6px rgba(255,58,58,.5);
    box-shadow: 0 0 8px rgba(255,58,58,.18), inset 0 0 6px rgba(255,58,58,.08);
}
.match-server { color: var(--accent); }
.match-map { color: var(--txt-soft); }
.match-time { margin-left: auto; }

.more-link {
    color: var(--neon-blue); text-decoration: none;
    font-family: var(--display); font-weight: 600;
    font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
    padding: 6px 14px; border: 1px solid rgba(58,217,255,.3);
    border-radius: 4px;
    transition: all .15s;
}
.more-link:hover {
    background: rgba(58,217,255,.12);
    box-shadow: 0 0 14px rgba(58,217,255,.3);
}

.match-game-badge {
    font-family: var(--display);
    font-weight: 800; font-size: 10px;
    letter-spacing: 2px;
    color: #1a1209;
    background: linear-gradient(180deg, #d4a657 0%, #8a6a2e 100%);
    padding: 3px 10px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 0 10px rgba(212,166,87,.35);
    text-transform: uppercase;
}
.match-card[data-game="ql"] .match-game-badge {
    background: linear-gradient(180deg, var(--neon-blue) 0%, var(--neon-blue-2) 100%);
    color: #001825;
    box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 0 12px rgba(58,217,255,.45);
}
.match-card[data-game="q1"] .match-game-badge,
.match-card[data-game="qw"] .match-game-badge {
    background: linear-gradient(180deg, #b8b8c8 0%, #5a5a72 100%);
    color: #1a1a25;
}
.match-card[data-game="q2"] .match-game-badge {
    background: linear-gradient(180deg, #d6803c 0%, #8a4818 100%);
    color: #1a0e05;
}
.match-card[data-game="tw"] .match-game-badge {
    background: linear-gradient(180deg, #b3da7a 0%, #5e8a3e 100%);
    color: #0c1505;
}

/* VS-block для дуэлей */
.vs-block {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px 0 4px;
}
.vs-block.solo { grid-template-columns: 1fr auto; }
.vs-side {
    display: flex; align-items: center; gap: 14px;
    padding: 8px 12px;
    background: rgba(20,26,38,.6);
    border-radius: 6px;
    border: 1px solid var(--line-soft);
    min-width: 0;
}
.vs-side:first-child { justify-content: flex-end; }
.vs-side:last-child { justify-content: flex-start; }
.vs-block.solo .vs-side { justify-content: flex-start; }
.vs-side.win {
    border-color: var(--accent);
    box-shadow:
        0 0 0 1px rgba(212,166,87,.4),
        0 0 18px rgba(212,166,87,.18),
        0 0 26px rgba(58,217,255,.18),
        inset 0 0 14px rgba(74,144,226,.08);
    background: linear-gradient(90deg, rgba(212,166,87,.08), rgba(20,26,38,.6));
}
.vs-side.win:last-child {
    background: linear-gradient(270deg, rgba(212,166,87,.08), rgba(20,26,38,.6));
}
.vs-avatar {
    width: 36px; height: 36px;
    image-rendering: pixelated;
    border-radius: 4px;
    border: 1px solid rgba(212,166,87,.25);
    background: rgba(0,0,0,.4);
    flex-shrink: 0;
}
.vs-side.win .vs-avatar {
    border-color: rgba(212,166,87,.6);
    box-shadow: 0 0 8px rgba(58,217,255,.45);
}
.vs-name {
    font-family: var(--display); font-weight: 800;
    font-size: 18px; letter-spacing: 1px; color: var(--txt);
    text-shadow: 0 1px 0 rgba(0,0,0,.7);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vs-score {
    font-family: var(--display); font-weight: 800; font-size: 32px;
    color: var(--accent);
    line-height: 1;
    text-shadow: 0 1px 0 rgba(0,0,0,.8), 0 0 14px rgba(212,166,87,.35);
}
.vs-side.win .vs-score {
    color: #ffd277;
    text-shadow:
        0 1px 0 rgba(0,0,0,.8),
        0 0 12px rgba(255,210,119,.5),
        0 0 22px rgba(58,217,255,.35),
        0 0 36px rgba(74,144,226,.25);
}
.vs-mid {
    font-family: var(--display); font-size: 14px; font-weight: 800;
    color: var(--accent-2);
    letter-spacing: 2px; text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0,0,0,.8);
}

/* Скорборд для FFA/TDM/CA */
.match-scoreboard {
    margin: 0; padding: 0;
    list-style: none;
    display: flex; flex-direction: column;
    gap: 4px;
}
.match-scoreboard li {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    background: rgba(20,26,38,.4);
    border-radius: 4px;
    font-size: 14px;
}
.match-scoreboard li:first-child {
    background: rgba(212,166,87,.1);
    border: 1px solid rgba(212,166,87,.25);
}
.sb-pos { font-family: var(--mono); color: var(--txt-mute); font-size: 12px; }
.match-scoreboard li:first-child .sb-pos { color: var(--accent); font-weight: 800; }
.sb-name { color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-frags { font-family: var(--mono); font-weight: 800; color: var(--accent); }

/* Leaderboard table */
.leaderboard tbody tr:nth-child(1) td { background: rgba(212,166,87,.08); }
.leaderboard tbody tr:nth-child(1) td:first-child { color: var(--accent); font-weight: 800; }
.leaderboard tbody tr:nth-child(2) td:first-child,
.leaderboard tbody tr:nth-child(3) td:first-child { color: var(--txt); font-weight: 700; }

.topnav-sep { display: inline-block; width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.topnav-stats {
    color: var(--accent-2) !important; font-weight: 700;
    text-shadow: 0 0 6px rgba(255,58,58,.35);
}
.topnav-stats:hover {
    background: rgba(193,64,64,.12);
    text-shadow: 0 0 10px rgba(255,58,58,.7);
}

/* ============== FOOTER ============== */
body { min-height: 100vh; }
body > main, body > #content { flex: 1 0 auto; }
.footer {
    flex-shrink: 0;
    margin-top: auto;
    text-align: center; padding: 32px 24px;
    color: var(--txt-mute); font-size: 12px;
}
.footer .sep { margin: 0 8px; opacity: .5; }
.footer-link { color: var(--txt-mute); text-decoration: none; border-bottom: 1px dashed currentColor; }
.footer-link:hover { color: var(--accent); }
.empty { text-align: center; padding: 80px; color: var(--txt-mute); font-style: italic; }

/* ============== RESPONSIVE — header/topbar/typo ============== */
@media (max-width: 720px) {
    .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
    .topnav {
        order: 3; flex-basis: 100%; margin-left: 0; gap: 2px;
        overflow-x: auto;
        position: relative;
        mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
    }
    .topnav::-webkit-scrollbar { display: none; }
    .topnav a { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
    .brand-sub { display: none; }
    .hero { padding: 16px; }
    .hero-stats { gap: 18px; flex-wrap: wrap; }
    .stat .num { font-size: 24px; }
    .stat .lbl { font-size: 10px; }
    main { padding: 14px; }
    .group { margin: 20px 0; }
    .group-head { padding: 0 4px 10px; margin-bottom: 12px; }
    .group-title { gap: 8px; flex-wrap: wrap; }
    .group-title h2 { font-size: 17px; }
    .group-sub { font-size: 10px; }
}

/* ============== MOBILE — горизонтальная плашка (картинка слева, инфо справа) ============== */
@media (max-width: 640px) {
    .srv-card {
        aspect-ratio: auto;
        height: 124px;
        display: grid;
        grid-template-columns: 42% 1fr;
        grid-template-rows: 100%;
        overflow: hidden;
    }
    .srv-card:hover { transform: none; }
    .srv-card:hover .card-bg { transform: none; }

    .card-bg, .card-overlay, .card-strip {
        position: relative; inset: auto;
    }
    .card-bg {
        grid-column: 1 / 2; grid-row: 1 / 2;
        width: 100%; height: 100%;
    }
    .card-overlay {
        grid-column: 1 / 2; grid-row: 1 / 2;
        width: 100%; height: 100%;
        background: linear-gradient(90deg, rgba(8,10,16,0) 40%, rgba(8,10,16,.7) 90%, rgba(8,10,16,.95) 100%);
    }
    .card-strip {
        grid-column: 2 / 3; grid-row: 1 / 2;
        padding: 9px 11px 9px 12px;
        background: linear-gradient(180deg, rgba(20,26,38,.92) 0%, rgba(8,10,16,1) 100%);
        gap: 3px;
        overflow: hidden;
        min-width: 0;
    }
    .card-corner {
        top: 5px; right: 5px;
        z-index: 4;
    }
    .card-mode { font-size: 9px; padding: 2px 6px; letter-spacing: .4px; }

    .strip-main { gap: 6px; min-width: 0; }
    .strip-name { font-size: 13.5px; min-width: 0; }
    .strip-counter { font-size: 13px; }
    .strip-meta { font-size: 10.5px; gap: 4px; }
    .strip-meta .strip-ip { display: none; }
    .strip-nicks { display: none; }
    .strip-actions { gap: 4px; margin-top: auto; padding-top: 2px; }
    .btn-connect { font-size: 10px; padding: 4px 6px; }
    .btn-steam { width: 24px; height: 22px; }

    /* Hero на #all — компактнее, чтобы не съедать 60% мобильного экрана */
    body[data-tab="all"] .hero {
        min-height: 220px;
        padding: 30px 16px 20px;
    }
    body[data-tab="all"] .hero-stats { margin-top: 32px; }
    .hero-stats { gap: 18px; flex-wrap: wrap; }
    .stat .num { font-size: 28px; }

    /* Match-card scoreboard — горизонтальный скролл, чтобы 4 колонки не обрезались */
    .match-card .ovr-table,
    .match-card .leaderboard {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============== MOBILE — узкие экраны (≤540px) ============== */
@media (max-width: 540px) {
    /* Overview-таблица на главной: прячем колонку SERVERS, чтобы PLAYERS не резался.
       Селектор сужен до .overview, иначе бил по leaderboard на stats.php/map.php
       (где 3-я колонка = K, kills) и K-колонка обрезалась. */
    .overview .ovr-table th:nth-child(3),
    .overview .ovr-table td:nth-child(3) { display: none; }

    /* Match-leaderboard: прячем K/D, оставляем nick + frags + дельту */
    .match-card .ovr-table th:nth-child(4),
    .match-card .ovr-table td:nth-child(4),
    .match-card .leaderboard th:nth-child(4),
    .match-card .leaderboard td:nth-child(4) { display: none; }
}

/* ============== group-stats (mini block on index) ============== */
.group-stats {
    margin: 16px 0 0;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}
.gs-totals { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.gs-num { color: var(--accent); font-weight: 700; font-size: 18px; }
.gs-lbl { color: var(--txt-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.gs-sep { color: var(--txt-soft); opacity: .4; padding: 0 4px; }
.gs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 10px; }
.gs-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--txt-soft); margin-bottom: 6px; }
.gs-list { list-style: none; padding: 0; margin: 0; }
.gs-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.gs-pos { color: var(--txt-soft); width: 18px; }
.gs-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-map-link {
    display: flex; align-items: center; gap: 8px; flex: 1;
    padding: 2px 4px; margin: -2px -4px;
    border-radius: 4px;
    color: inherit; text-decoration: none;
    transition: background .15s;
}
.gs-map-link:hover { background: rgba(255,255,255,0.07); }
.gs-val { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.gs-thumb {
    display: inline-block; width: 28px; height: 18px;
    background-size: cover; background-position: center;
    border-radius: 3px; flex-shrink: 0;
}
.gs-thumb-empty { background: rgba(255,255,255,0.06); }
.gs-link {
    display: inline-block; margin-top: 6px;
    color: var(--accent); font-size: 12px; text-decoration: none;
    border-bottom: 1px dashed rgba(204,170,68,0.4);
}
.gs-link:hover { color: #fff; border-color: #fff; }
@media (max-width: 600px) {
    .gs-cols { grid-template-columns: 1fr; }
}

/* ============== stats.php tabs ============== */
.stats-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0;
}
.st-tab {
    display: flex; align-items: baseline; gap: 8px;
    padding: 10px 16px;
    color: var(--txt-soft);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 600;
    transition: all .15s;
}
.st-tab:hover { color: #fff; }
.st-tab.has { color: var(--txt); }
.st-tab.empty { opacity: .35; }
.st-tab.on {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.st-count {
    font-size: 11px;
    background: rgba(255,255,255,0.08);
    padding: 1px 7px;
    border-radius: 10px;
    color: var(--txt-soft);
    font-weight: 500;
}
.st-tab.on .st-count { background: rgba(204,170,68,0.2); color: var(--accent); }

/* ============== stats.php head ============== */
.stats-head { margin-bottom: 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.stats-head h1 { margin: 0; font-size: 28px; }
.stats-sub { color: var(--txt-soft); font-size: 14px; font-weight: 400; margin-left: 8px; }
.stats-totals { display: flex; gap: 28px; }
.stats-totals > div { display: flex; flex-direction: column; align-items: center; }
.stats-totals .num { font-size: 26px; color: var(--accent); font-weight: 700; line-height: 1; }
.stats-totals .lbl { font-size: 11px; text-transform: uppercase; color: var(--txt-soft); margin-top: 4px; letter-spacing: .04em; }

.stats-empty { padding: 60px 20px; text-align: center; color: var(--txt-soft); }
.stats-empty p { margin: 8px 0; }
.stats-empty .muted { font-size: 13px; opacity: .7; }

/* ============== stats.php grid ============== */
.stats-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
.stats-grid .span2 { grid-column: span 2; }
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid .span2 { grid-column: 1; }
}

/* ============== recent matches list ============== */
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    align-items: center;
    transition: background .15s;
}
.recent-row:hover { background: rgba(255,255,255,0.06); }
.rr-thumb { width: 80px; height: 50px; background-size: cover; background-position: center; border-radius: 4px; background-color: rgba(255,255,255,0.05); }
.rr-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rr-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rr-gt { background: rgba(204,170,68,0.15); color: var(--accent); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.rr-map { font-weight: 600; }
.rr-server { color: var(--txt-soft); font-size: 12px; }
.rr-time { color: var(--txt-soft); font-size: 12px; }
.rr-top { display: flex; flex-direction: column; gap: 2px; font-size: 12px; text-align: right; }
.rr-p b { color: var(--accent); margin-left: 4px; }
@media (max-width: 600px) {
    .recent-row { grid-template-columns: 60px 1fr; }
    .rr-thumb { width: 60px; height: 38px; }
    .rr-top { display: none; }
}

/* ============== map list ============== */
.map-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.map-list li { padding: 0; margin: 0; }
.ml-link {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}
.ml-link:hover { background: rgba(255,255,255,0.08); }
.ml-thumb { width: 50px; height: 32px; background-size: cover; background-position: center; border-radius: 3px; background-color: rgba(255,255,255,0.05); }
.ml-name { font-weight: 600; font-size: 13px; }
.ml-meta { color: var(--txt-soft); font-size: 11px; text-align: right; }

/* ============== weapons ============== */
.weap-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.weap-list li { display: grid; grid-template-columns: 50px 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.wp-tag {
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    padding: 3px 6px;
    border-radius: 4px;
    text-align: center;
    font-size: 10px;
    letter-spacing: .04em;
}
.wp-rg { background: rgba(64,200,255,0.18); color: #6cd1ff; }
.wp-rl { background: rgba(255,140,80,0.18); color: #ff9a5e; }
.wp-lg { background: rgba(255,240,140,0.2); color: #ffe66c; }
.wp-sg { background: rgba(255,80,80,0.18); color: #ff6b6b; }
.wp-pg { background: rgba(160,140,255,0.18); color: #b09cff; }
.wp-mg { background: rgba(180,180,180,0.18); color: #ccc; }
.wp-gl { background: rgba(140,200,90,0.18); color: #aedc6e; }
.wp-gt { background: rgba(255,160,200,0.18); color: #ffa0c8; }
.wp-bfg { background: rgba(80,255,160,0.18); color: #5cffaa; }
.wp-tfrag { background: rgba(255,80,255,0.18); color: #ff80ff; }
.wp-bar { height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.wp-fill { display: block; height: 100%; background: var(--accent); }
.wp-val { color: var(--txt-soft); font-variant-numeric: tabular-nums; font-size: 11px; min-width: 60px; text-align: right; }

.group-stats.gs-pending { opacity: .65; }
.group-stats.gs-pending .gs-num { color: var(--txt-soft); }
.gs-pending-msg {
    color: var(--txt-soft);
    font-size: 12px;
    font-style: italic;
    padding: 12px 0;
    text-align: center;
}

.h2h-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.h2h-row {
    display: grid;
    grid-template-columns: 1fr minmax(140px, 1.2fr) 1fr;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.h2h-a { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-b { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-bar {
    position: relative;
    height: 22px;
    background: rgba(255, 80, 80, 0.16);
    border-radius: 4px;
    overflow: hidden;
}
.h2h-fill-a {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: rgba(64, 200, 255, 0.28);
}
.h2h-mid {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    letter-spacing: .04em;
}

.mk-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: mk; }
.mk-list li {
    display: grid;
    grid-template-columns: minmax(120px, auto) 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 12px;
}
.mk-tag {
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .06em;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    background: rgba(255, 140, 80, 0.18);
    color: #ff9a5e;
}
.mk-tag.mk-streak { background: rgba(140, 200, 90, 0.18); color: #aedc6e; }
.mk-tag.mk-3 { background: rgba(255,200,80,0.18); color: #ffd066; }
.mk-tag.mk-4 { background: rgba(255,140,80,0.20); color: #ff9a5e; }
.mk-tag.mk-5,
.mk-tag.mk-6 { background: rgba(255,80,80,0.22); color: #ff6b6b; }
.mk-tag.mk-7,
.mk-tag.mk-8,
.mk-tag.mk-9 { background: rgba(255,80,255,0.22); color: #ff80ff; }
.mk-player { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-meta { color: var(--txt-soft); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.group-head .small { font-size: 10px; }

.gs-spark {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 32px;
    margin: 10px 0 6px;
    padding: 4px 6px;
    background: rgba(0,0,0,.18);
    border-radius: 4px;
}
.gs-spark-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}
.gs-spark-bar {
    background: rgba(76,160,255,.4);
    border-radius: 1px;
    min-height: 2px;
}
.gs-spark-col.today .gs-spark-bar { background: var(--accent, #4ca0ff); }

html.mw-splash-on, html.mw-splash-on body { overflow: hidden; }
#mw-splash {
    position: fixed; inset: 0;
    z-index: 9999;
    background: #06080d;
    animation: mws-in .4s ease-out;
}
.mws-bg-blur {
    position: absolute; inset: -40px;
    background: url('brand/splash.png') center/cover no-repeat;
    filter: blur(36px) brightness(.32) saturate(1.2);
    transform: scale(1.1);
    animation: mws-zoom 8s ease-out forwards;
}
.mws-bg-sharp { display: none; }
.mws-logo {
    width: clamp(260px, 48vmin, 540px);
    height: auto;
    max-height: 58vh;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, rgba(0,0,0,.55) 50%, transparent 78%);
            mask-image: radial-gradient(ellipse at center, #000 30%, rgba(0,0,0,.55) 50%, transparent 78%);
    filter: drop-shadow(0 0 38px rgba(193,64,64,.45));
    animation: mws-glow 2.4s ease-in-out infinite;
}
.mws-content {
    position: absolute; inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    z-index: 2;
    pointer-events: none;
}
.mws-greet {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: clamp(16px, 2.4vw, 22px);
    letter-spacing: .35em;
    text-transform: uppercase;
    color: rgba(255,255,255,.85);
    margin-top: 6px;
    text-shadow: 0 2px 10px rgba(0,0,0,.9);
}
.mws-title {
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: clamp(36px, 6vw, 64px);
    letter-spacing: .04em;
    color: #d4a657;
    text-shadow: 0 2px 14px rgba(193,64,64,.55), 0 0 32px rgba(212,166,87,.35);
}
.mws-dot { color: #c14040; }
.mws-sub {
    font-family: var(--mono, monospace);
    font-size: 11px;
    color: rgba(255,255,255,.45);
    letter-spacing: .4em;
    text-transform: uppercase;
}
.mws-bar {
    width: clamp(160px, 22vw, 280px);
    height: 2px;
    margin-top: 18px;
    background: rgba(255,255,255,.08);
    border-radius: 2px;
    overflow: hidden;
}
.mws-bar-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, #d4a657 50%, transparent 100%);
    animation: mws-bar 1.6s ease-out forwards;
}
#mw-splash.mws-fade { opacity: 0; transition: opacity .55s ease-out; }
@keyframes mws-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mws-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes mws-glow {
    0%, 100% { filter: drop-shadow(0 0 28px rgba(193,64,64,.30)); }
    50%      { filter: drop-shadow(0 0 48px rgba(193,64,64,.65)); }
}
@keyframes mws-zoom { from { transform: scale(1.0); } to { transform: scale(1.08); } }
@keyframes mws-bar { 0% { width: 0; } 100% { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
    .mws-logo, .mws-bar-fill, #mw-splash { animation: none !important; }
}

.player-search { position: relative; min-width: 140px; max-width: 180px; }
@media (max-width: 1280px) {
    .player-search { min-width: 110px; max-width: 140px; }
    #player-search { font-size: 11px; padding: 5px 8px; }
}
#player-search {
    width: 100%;
    padding: 6px 10px;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 4px;
    color: var(--txt);
    font-size: 12px;
    font-family: inherit;
    transition: border-color .15s, background .15s;
}
#player-search:focus { outline: none; border-color: rgba(58,217,255,.5); background: rgba(0,0,0,.5); }
#player-search::placeholder { color: var(--txt-mute); }
.psr-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: rgba(15, 18, 26, .98);
    border: 1px solid rgba(58,217,255,.25);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    z-index: 1000;
    max-height: 360px;
    overflow-y: auto;
}
.psr-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: 13px;
}
.psr-item:last-child { border-bottom: 0; }
.psr-item:hover { background: rgba(58,217,255,.08); }
.psr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psr-kd { color: var(--txt-mute); font-variant-numeric: tabular-nums; font-size: 11px; font-family: var(--mono); }
.psr-empty { padding: 10px; color: var(--txt-mute); text-align: center; font-size: 12px; }
@media (max-width: 900px) {
    .player-search { display: none; }
}

/* server / gametype bar lists */
.srv-bar-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.srv-bar-list li { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.sb-label { font-weight: 600; color: var(--txt); text-transform: uppercase; letter-spacing: .04em; }
.sb-bar { height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.sb-fill { display: block; height: 100%; background: linear-gradient(90deg, #4a8fff, #6cd1ff); }
.sb-val { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; min-width: 32px; text-align: right; }

/* activity calendar bars */
.activity-bars {
    display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px;
    height: 120px; align-items: end;
    padding: 12px 8px 6px;
    background: rgba(255,255,255,0.02); border-radius: 6px;
}
.ab-col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; cursor: help; }
.ab-bar { width: 100%; max-width: 36px; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; transition: filter .15s; }
.ab-col:hover .ab-bar { filter: brightness(1.3); }
.ab-col.today .ab-bar { background: #6cd1ff; }
.ab-day { font-size: 10px; color: var(--txt-soft); font-variant-numeric: tabular-nums; }
.ab-col.today .ab-day { color: #6cd1ff; font-weight: 700; }

/* ============================================================
   MOBILE OVERRIDES (v40)
   Только дополнения для узких экранов; не переписывают существующие
   правила. Цель — стабильное отображение всех страниц на 375 и 768.
   ============================================================ */

/* --- .stats-main: на узких экранах паддинг должен быть таким же, как у main, иначе контент уезжает за viewport --- */
@media (max-width: 720px) {
    .stats-main { padding: 14px; }
}
@media (max-width: 460px) {
    .stats-main { padding: 12px 10px 40px; }
    main { padding: 12px 10px; }
}

/* --- TABLET: оставить пункты nav в одну строку, без переноса --- */
@media (max-width: 820px) and (min-width: 721px) {
    .topnav a { white-space: nowrap; padding: 8px 10px; font-size: 13px; }
    .topnav { gap: 2px; }
}

/* --- LEADERBOARD на узких экранах: горизонтальный скролл, не скрытие колонок --- */
@media (max-width: 700px) {
    /* .ovr-table.leaderboard используется на stats.php/map.php — нужны все колонки */
    .stats-section > .ovr-table.leaderboard,
    .stats-section > .leaderboard {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    /* Чуть сжать паддинги ячеек, чтобы 5 колонок (#/Player/K/D/K/D) уместились без скролла */
    .ovr-table.leaderboard thead th,
    .ovr-table.leaderboard tbody td {
        padding: 8px 8px;
        font-size: 13px;
    }
}

/* --- /map.php map-hero: на узких экранах — стек в одну колонку --- */
@media (max-width: 700px) {
    .map-hero .map-hero-inner {
        grid-template-columns: 1fr;
        padding: 22px 16px 18px;
        gap: 14px;
    }
    .map-hero .map-hero-stats { gap: 16px; }
    .map-hero .map-hero-stats .stat .num { font-size: 22px; }
    .map-hero .map-hero-stats .stat .lbl { font-size: 10px; }
    .map-hero .map-hero-left h1 { font-size: clamp(26px, 7vw, 40px); margin: 6px 0 4px; }
}

/* --- recent-row без .rr-thumb (на map.php): не оставляем 80px/60px колонку пустой --- */
.recent-row:not(:has(.rr-thumb)) {
    grid-template-columns: 1fr !important;
}

/* --- vs-block (match-card) на самых узких — уменьшить шрифт, чтобы ник не клипался --- */
@media (max-width: 460px) {
    .vs-block { gap: 8px; padding: 10px 0 4px; }
    .vs-name { font-size: 14px; letter-spacing: .5px; }
    .vs-score { font-size: 26px; }
    .vs-mid { font-size: 11px; letter-spacing: 1px; }
    .vs-side { padding: 6px 8px; gap: 8px; }
    .vs-avatar { width: 28px; height: 28px; }
    .match-card { padding: 12px 12px; }
    .match-meta { gap: 6px; font-size: 10px; letter-spacing: .5px; }
}

/* --- /maps.php: 2 колонки на самых узких вместо 1, чтобы не пустовало место --- */
@media (max-width: 420px) {
    .map-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .map-tile {
        flex-basis: auto !important;
        max-width: none !important;
        min-width: 0 !important;
    }
    .map-name { font-size: 11px; padding: 6px 8px; }
}

/* --- topnav: показать всю ширину на mobile, чтобы Stats/Search не прятались за маской --- */
@media (max-width: 720px) {
    .topnav {
        mask-image: none;
        -webkit-mask-image: none;
        padding-bottom: 2px;
    }
}

/* --- match-card scoreboard на узких — нумерация и фраги меньше --- */
@media (max-width: 460px) {
    .match-scoreboard li {
        grid-template-columns: 22px 1fr auto;
        gap: 8px;
        padding: 4px 6px;
        font-size: 13px;
    }
    .sb-pos { font-size: 11px; }
}
