@font-face {
    font-family: 'SR';
    src: url('sr.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Logo';
    src: url('logo.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

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

:root {
    --pink: #e03aa0;
    --bg: #08080c;
    --border: rgba(255, 255, 255, 0.12);
    --text: #f2eef5;
    --muted: rgba(255, 255, 255, 0.58);
}

html, body { height: 100%; }

body {
    font-family: 'SR', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ===== Фон ===== */
.bg {
    position: fixed; inset: 0;
    background-color: #0a0810;
    background-image: url('bg.img');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
    filter: brightness(0.72) saturate(0.9) blur(12px);
    transform: scale(1.04);
    opacity: 0.85;
    transition: filter 0.7s ease, opacity 0.7s ease, transform 0.7s ease;
}
.bg.bg-ready {
    filter: brightness(0.72) saturate(0.9) blur(0);
    transform: scale(1);
    opacity: 1;
}

.dim {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.22) 100%),
        radial-gradient(ellipse at 65% 45%, transparent 30%, rgba(0,0,0,0.25) 100%);
}

.rain { position: fixed; inset: 0; z-index: 1; pointer-events: none; display: block; }

/* ===== Футер ===== */
.bottom {
    position: relative; z-index: 10; flex-shrink: 0;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 13px; line-height: 1.55; color: var(--muted);
}
.bottom p + p { margin-top: 4px; }
.bottom strong { color: #ff9ed8; font-weight: 600; }
.bottom a { color: var(--pink); text-decoration: none; border-bottom: 1px solid rgba(224, 58, 160, 0.4); }
.bottom a:hover { color: #ff9ed8; border-bottom-color: #ff9ed8; }

/* ===== Шапка (десктоп) ===== */
.top {
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    min-height: 72px;
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.brand-name { font-family: 'Logo', 'SR', sans-serif; font-size: 26px; letter-spacing: 0.04em; }
.brand-gerb {
    height: 28px !important;
    width: auto !important;
    max-height: 28px !important;
    max-width: 32px !important;
    margin-left: 4px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}
.brand-tag {
    font-size: 10px; font-weight: 700; letter-spacing: 0.12em; padding: 3px 8px;
    border: 1px solid rgba(224, 58, 160, 0.5); background: rgba(224, 58, 160, 0.12); color: #ff9ed8;
}
.brand-ver { font-size: 11px; color: var(--muted); }

.nav {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav-link {
    padding: 7px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-link:hover {
    color: #fff;
    background: rgba(224, 58, 160, 0.15);
    border-color: rgba(224, 58, 160, 0.4);
}
.nav-link.active {
    color: #fff;
    background: rgba(224, 58, 160, 0.15);
    border-color: rgba(224, 58, 160, 0.4);
}

.top-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; background: #666; }
.dot.on { background: #6dff9a; box-shadow: 0 0 8px #6dff9a; }
.dot.off { background: #ff6b7a; }
.dot.err { background: #ffb347; }

/* Гамбургер — скрыт на ПК */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

/* ===== Лейаут ===== */
.layout {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(320px, 480px) 1fr;
    gap: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 2;
}
.panel { padding: 32px 36px; display: flex; flex-direction: column; justify-content: center; }
.panel.left {
    border-right: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.18);
    gap: 14px;
    z-index: 3;
    overflow-y: auto;
}
.panel.right {
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* ===== Тексты ===== */
h1 {
    font-family: 'Logo', 'SR', sans-serif;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.05;
    letter-spacing: 0.03em;
    color: #fff;
}
.tagline { font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 360px; }
.versions { font-size: 13px; color: var(--muted); }
.versions strong { color: #ff9ed8; font-weight: 600; }

/* ===== Бегущие цитаты ===== */
.quotes {
    height: 28px; overflow: hidden; border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.4); max-width: 380px;
}
.quotes-viewport { height: 28px; overflow: hidden; }
.quotes-track { will-change: transform; }
.quote {
    height: 28px; line-height: 28px; padding: 0 12px; font-size: 12px;
    color: #ff9ed8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== IP-блок ===== */
.ip-block {
    display: flex; align-items: center; gap: 12px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border);
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
    max-width: 380px;
}
.ip-block:hover { background: rgba(224, 58, 160, 0.12); border-color: rgba(224, 58, 160, 0.55); }
.ip-block:active { background: rgba(224, 58, 160, 0.25); }
.ip-label {
    font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--pink);
    border: 1px solid rgba(224, 58, 160, 0.4); background: rgba(224, 58, 160, 0.12); padding: 3px 7px;
}
.ip-value { font-family: ui-monospace, monospace; font-size: 15px; font-weight: 600; flex: 1; }
.copy-hint { font-size: 11px; color: var(--muted); }
.copy-hint.ok { color: #6dff9a; }

/* ===== Статистика ===== */
.stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    background: var(--border); border: 1px solid var(--border); max-width: 380px;
}
.stat {
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 18px; font-weight: 700; }
.stat-value.on { color: #6dff9a; }
.stat-value.off { color: #ff6b7a; }
.stat-value.err { color: #ffb347; }

/* ===== Кнопки действий ===== */
.actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 4px;
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
}
.actions .btn {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    padding: 12px 10px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Базовая кнопка ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 18px;
    font-weight: 600; font-size: 13px;
    text-decoration: none; color: #fff;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform .16s ease;
    cursor: pointer;
    font-family: 'SR', 'Segoe UI', sans-serif;
    box-sizing: border-box;
    border-radius: 2px;
}
.btn:hover {
    background: rgba(224, 58, 160, 0.22);
    border-color: rgba(224, 58, 160, 0.75);
    box-shadow: 0 0 18px rgba(224, 58, 160, 0.18);
    transform: translateY(-1px);
}
.btn:active {
    background: rgba(224, 58, 160, 0.35);
    border-color: var(--pink);
    transform: translateY(0);
}

.ico { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.9; }

/* ===== Персонаж ===== */
.char {
    position: absolute; left: 50%; top: 48%; transform: translate(-55%, -50%);
    width: min(400px, 46vw); max-height: calc(100% - 16px);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 2;
}
.char img {
    width: 100%; height: auto; max-height: min(68vh, 100%);
    object-fit: contain;
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.5)) blur(10px);
    opacity: 0.55;
    transform: scale(1.03);
    transition: filter 0.65s ease, opacity 0.65s ease, transform 0.65s ease;
}
.char img.img-ready {
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.5)) blur(0);
    opacity: 1;
    transform: scale(1);
}

/* ===== Анимации появления ===== */
.fade-up {
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp .55s cubic-bezier(.2,.7,.2,1) forwards;
}
.fade-up.d1 { animation-delay: .05s; }
.fade-up.d2 { animation-delay: .12s; }
.fade-up.d3 { animation-delay: .2s; }
.fade-up.d4 { animation-delay: .28s; }
.fade-up.d5 { animation-delay: .36s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* Hover карточек (игроки/топы) */
.player-card, .top-row, .mods-row {
    transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.player-card:hover, .top-row:hover, .mods-row:hover {
    background: rgba(224,58,160,0.06);
    transform: translateX(2px);
    border-color: rgba(224,58,160,0.35);
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   Меню — часть хедера, растёт из него, координаты не при чём
   ============================================================ */
@media (max-width: 800px) {

    /* --- Шапка: без фикс-высоты, растёт по контенту --- */
    .top {
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 100;
        background: #0b0b12;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        padding: 0 16px;
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 0;
        min-height: 60px;
        justify-content: space-between;
    }

    /* Первая строка: brand, статус, гамбургер */
    .brand {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 60px;
        flex: 0 0 auto;
        order: 1;
    }
    .brand-gerb { display: none; } /* на телефоне герб в шапке скрыт */

    .top-status {
        order: 2;
        margin-left: auto;
        margin-right: 8px;
        height: 60px;
        display: inline-flex;
        align-items: center;
    }
    .top-status span:last-child { display: none; }

    .nav-toggle {
        display: inline-flex;
        order: 3;
        margin: 0;
        height: 60px;
        width: 38px;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 0;
        color: #fff;
    }

    /* --- Меню: часть хедера, растёт вниз --- */
    .nav {
        position: static;
        order: 10;
        flex: 0 0 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
        overflow: hidden;
        max-height: 0;
        transition: max-height .3s cubic-bezier(.2,.7,.2,1);
    }
    .nav.open { max-height: 520px; }

    /* --- Пункты --- */
    .nav-link {
        display: flex;
        align-items: center;
        width: 100%;
        height: 52px;
        padding: 0 20px;
        box-sizing: border-box;
        font-size: 15px;
        font-weight: 600;
        line-height: 1;
        text-align: left;
        color: rgba(255,255,255,0.85);
        background: transparent;
        border: 0;
        border-top: 1px solid rgba(255,255,255,0.05);
        border-radius: 0;
        margin: 0;
    }
    .nav-link:first-child {
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    .nav-link:last-child { border-bottom: 0; }

    .nav-link:hover {
        background: rgba(255,255,255,0.04);
        color: #fff;
    }
    .nav-link.active {
        background: rgba(224,58,160,0.16);
        color: #fff;
        border: 0;
        border-top: 1px solid rgba(255,255,255,0.05);
        border-left: 3px solid #e03aa0;
        padding: 0 20px 0 17px;
        height: 52px;
        display: flex;
        align-items: center;
    }
    .nav-link.active:first-child {
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    /* --- Скрыть персонажа и правую панель --- */
    .panel.right, .char { display: none; }

    /* --- Контент: отступ под первую строку хедера --- */
    .layout {
        grid-template-columns: 1fr;
        overflow: auto;
        padding-top: 60px;
    }
    .panel.left {
        border-right: none;
        max-width: none;
        padding: 24px 18px 28px;
        justify-content: flex-start;
        flex: 1;
    }
    h1 { font-size: 32px; }
    .tagline { font-size: 14px; }
    .quotes, .stats, .ip-block { max-width: none; }
    .stat-value { font-size: 16px; }

    .actions { flex-direction: column; max-width: none; }
    .actions .btn { width: 100%; flex: 0 0 auto; padding: 13px 16px; }

    .bottom { padding: 14px 16px 18px; font-size: 12px; }
}

@media (max-width: 400px) {
    h1 { font-size: 26px; }
    .brand-name { font-size: 18px; }
    .nav-link { height: 48px; font-size: 14px; }
    .nav-link.active { height: 48px; padding: 0 20px 0 17px; }
}
.gerb-mobile { display: none; }
@media (max-width: 800px) {
    .gerb-mobile { display: block; }
}
