/* ============================================================
   style.css — DEVALIADA DayZ Server
   Все стили вынесены из HTML
   ============================================================ */

/* ----- СБРОС И БАЗА (DayZ-палитра) ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
   ДИЗАЙН-ТОКЕНЫ (единая палитра и метрики)
   Значения совпадают с прежними хардкодами — внешний вид не меняется
   ============================================================ */
:root {
    /* Фоны */
    --bg-body: #1a1e1c;
    --bg-main: #1f2622;
    --bg-footer: #1a221e;
    --bg-panel: #2a332e;
    --bg-item: #1f2822;
    --bg-item-alt: #1d2620;
    --bg-inset: #1f2a24;
    --bg-code: #141b17;
    --bg-date: #2f3d32;
    --bg-tag: #2a3a2e;
    --bg-hover: #2e3d34;
    --bg-hover-alt: #2d3a30;
    --bg-hover-2: #2a352e;
    --bg-hover-code: #1d2820;
    --bg-owner: #242e28;
    --bg-open: #1f2a22;
    --bg-closed-hover: #222824;
    --bg-close-type: #2a2a2a;
    --bg-retry-hover: #4d604d;

    /* Акценты (бронза) */
    --accent: #b87c4b;
    --accent-hover: #d4a86a;
    --accent-glow: #e8c88a;
    --cream-bright: #f5e7c8;
    --cream: #dac9b0;
    --accent-line: #7a5c3a;
    --accent-line-kill: #8f5e3a;
    --accent-line-hover: #c99f6b;
    --accent-line-hover-2: #c9a063;
    --header-border: #7a4c2c;
    --logo-shadow: #3a2a1a;
    --date: #cfb587;
    --amber: #d9a066;

    /* Текст */
    --text: #d2d9ce;
    --text-body: #e0e0d8;
    --text-bright: #e8e0d0;
    --text-title: #ede3d0;
    --text-strong: #e6ddd0;
    --text-nav: #d0d8ca;
    --text-sub: #d0c8b0;
    --text-warm: #e6d7b8;
    --text-soft: #b0bcae;
    --text-muted: #b0b8a8;
    --text-muted-2: #b0b8a0;
    --text-dim: #9aae9a;
    --text-faint: #8a9a8a;
    --text-ghost: #6a7a6a;
    --text-ghost-2: #7a8a7a;
    --text-faint-2: #5a6a5a;
    --placeholder: #6e7e72;
    --text-hover: #f0ead8;
    --flag-label: #c0c8b8;
    --footer-text: #9dad9a;
    --md-h1: #e8dcc8;
    --highlight: #feedba;

    /* Статусы */
    --green: #6a9a6a;
    --green-border: #5f7a5a;
    --green-hover: #8aba8a;
    --green-soft: #8aaa7a;
    --red: #b84a4a;
    --red-soft: #d4a0a0;
    --red-2: #e8b0b0;
    --red-muted: #9a6a6a;
    --red-border: #7a4a4a;
    --gray-border: #4a4a4a;
    --gray-text: #6a6a6a;

    /* Границы */
    --border: #3f4d3f;
    --border-soft: #4d5e4f;
    --border-inset: #4f604f;
    --border-main: #3f4d42;
    --tab-border: #3d4a42;
    --border-pill: #5f6f5a;
    --checkbox-border: #4f5f4f;

    /* Скроллбар */
    --scrollbar: #5d704f;
    --scrollbar-hover: #7c9466;
    --scrollbar-track: #1e2922;

    /* Спиннеры */
    --spinner-track: #3d4d3d;

    /* Шрифты */
    --font-main: 'Roboto', sans-serif;
    --font-mono: 'Roboto Mono', Consolas, monospace;

    /* Радиусы */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --radius-pill: 40px;
    --radius-btn: 20px;
    --radius-btn-sm: 6px;

    /* Тени */
    --shadow-card: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-item: 0 1px 4px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 14px rgba(0,0,0,0.7);
    --shadow-soft: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-deep: 0 8px 24px rgba(0,0,0,0.8);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ----- ШАПКА (фиксированная, с фоновым рисунком) ----- */
.header {
    flex-shrink: 0;
    background-image: url('/pic/devaliada-header.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-bottom: 2px solid var(--header-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.8);
    padding: 8px 24px 4px 24px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Затемнение поверх фона */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 12, 0.65);
    z-index: 0;
    pointer-events: none;
}

.header > * {
    position: relative;
    z-index: 1;
}

/* Верхняя часть: логотип слева, флаги справа */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 12px;
}

/* Логотип DEVALIADA */
.logo {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    letter-spacing: 4px;
    color: var(--cream-bright);
    text-shadow: 0 2px 16px rgba(0,0,0,0.9), 0 0 8px var(--logo-shadow);
    background: rgba(20, 26, 22, 0.5);
    padding: 4px 20px 4px 12px;
    border-radius: 40px;
    backdrop-filter: blur(2px);
    border-left: 4px solid var(--accent);
    display: inline-block;
}
.logo small {
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--text-muted-2);
    margin-left: 12px;
}

/* Блок флагов */
.lang-flags {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(0,0,0,0.5);
    padding: 6px 16px 6px 12px;
    border-radius: 40px;
    backdrop-filter: blur(3px);
    border: 1px solid var(--border-pill);
}
.lang-flags span[data-lang] {
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.1s;
    filter: grayscale(0.4);
    display: inline-block;
    user-select: none;
}
.lang-flags span[data-lang].active {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
    text-shadow: 0 0 12px var(--accent);
}
.lang-flags span[data-lang]:hover {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.05);
}
.flag-icon {
    font-size: 1.8rem;
    line-height: 1;
}
.flag-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--flag-label);
    letter-spacing: 0.5px;
    margin-left: 2px;
}

/* Меню-табы */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--tab-border);
    padding-bottom: 4px;
    margin-top: 2px;
    flex-wrap: wrap;
}

/* Стили для ссылок-табов */
.tab {
    display: inline-block;
    padding: 10px 24px;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-nav);
    border-radius: 20px 20px 0 0;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    background: rgba(20, 30, 24, 0.5);
    border: none;
    border-bottom: 3px solid transparent;
    backdrop-filter: blur(2px);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    user-select: none;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    line-height: 1.5;
}

.tab-active {
    color: var(--cream-bright);
    background: rgba(40, 54, 46, 0.8);
    border-bottom: 3px solid var(--accent);
    box-shadow: inset 0 -2px 0 var(--accent);
}

.tab:hover {
    background: rgba(50, 70, 56, 0.7);
    color: var(--text-hover);
}

/* ----- ОСНОВНОЙ КОНТЕНТ (прокручиваемый) ----- */
.main {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 24px 20px 24px;
    background: var(--bg-main);
    scroll-behavior: smooth;
    border-top: 1px solid var(--border-main);
    border-bottom: 1px solid var(--border-main);
}

/* СТРАНИЦЫ (переключение) */
.page {
    display: none;
    opacity: 0;
    transition: opacity 0.1s ease;
    animation: fadeIn 0.1s ease;
}
.page.active {
    display: block;
    opacity: 1;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Карточки */
.card {
    background: var(--bg-panel);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border-left: 4px solid var(--accent-line);
    transition: transform 0.1s;
}

.card-title {
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--cream);
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-title .material-icons {
    font-size: 2rem;
    color: var(--accent);
}

/* Текстовая информация */
.info-text p {
    margin-bottom: 14px;
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text);
}
.info-text strong {
    color: var(--text-warm);
}
.info-text ul {
    list-style: none;
    padding-left: 8px;
}
.info-text ul li::before {
    content: "▸ ";
    color: var(--accent);
    font-weight: 700;
}
.info-text ul li {
    margin-bottom: 8px;
    padding-left: 8px;
}

/* ----- НОВОСТИ (адаптивная высота) ----- */
.news-item {
    background: var(--bg-item);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 6px solid var(--green-border);
    transition: background 0.2s, box-shadow 0.2s, border-left-color 0.2s;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.news-item:hover {
    background: var(--bg-hover);
    border-left-color: var(--accent-line-hover);
    box-shadow: 0 4px 14px rgba(0,0,0,0.7);
}
.news-item .news-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.news-item .news-date {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--date);
    letter-spacing: 0.5px;
    background: var(--bg-date);
    padding: 0 12px;
    border-radius: 30px;
    line-height: 1.8;
    white-space: nowrap;
}
.news-item .news-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-title);
}
.news-item .news-brief {
    font-size: 0.95rem;
    color: var(--text-soft);
    margin-top: 2px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.5;
}

/* ----- КИЛЛФИД ----- */
.kill-item {
    background: var(--bg-item-alt);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    border-left: 6px solid var(--accent-line-kill);
    transition: background 0.15s, border-left-color 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    min-height: 56px;
}
.kill-item:hover {
    background: var(--bg-hover-alt);
    border-left-color: var(--accent-line-hover-2);
}
.kill-item .kill-time {
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 24px;
    min-width: 70px;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.kill-item .kill-desc {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-strong);
    word-break: break-word;
}
.kill-item .kill-desc .highlight {
    color: var(--amber);
    font-weight: 700;
}
.kill-item .kill-desc .weapon {
    color: #b0b89a;
    font-style: italic;
}

/* Фильтр */
.filter-area {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-inset);
    padding: 8px 18px;
    border-radius: 40px;
    margin-bottom: 20px;
    border: 1px solid var(--border-inset);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}
.filter-area .material-icons {
    color: #b8b8a8;
}
.filter-area input {
    background: transparent;
    border: none;
    padding: 12px 0;
    font-size: 1rem;
    color: var(--text-bright);
    width: 100%;
    outline: none;
}
.filter-area input::placeholder {
    color: var(--placeholder);
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ============================================================
   ПОДВАЛ (с баннером)
   ============================================================ */
.footer {
    flex-shrink: 0;
    background: var(--bg-footer);
    border-top: 2px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--footer-text);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.6);
    min-height: 100px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-center {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-center img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    transition: opacity 0.2s, transform 0.2s;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.footer-center img:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.footer .year {
    font-weight: 300;
    color: var(--text-ghost-2);
}

/* ----- АДАПТИВНОСТЬ ----- */
@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 16px;
        min-height: auto;
    }
    .footer-left {
        align-items: center;
    }
    .footer-center {
        width: 100%;
        max-width: 468px;
    }
    .footer-center img {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 6px 12px 4px 12px;
    }
    .logo {
        font-size: 1.6rem;
        padding: 2px 12px 2px 8px;
    }
    .logo small {
        font-size: 0.7rem;
        margin-left: 6px;
    }
    .lang-flags {
        padding: 4px 10px 4px 8px;
        gap: 6px;
    }
    .flag-icon {
        font-size: 1.4rem;
    }
    .tab {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    .news-item .news-header {
        gap: 8px;
    }
    .kill-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .kill-item .kill-time {
        margin-right: 0;
    }
}

/* ----- ПОЛОСА ПРОКРУТКИ ----- */
.main::-webkit-scrollbar {
    width: 8px;
    background: var(--scrollbar-track);
}
.main::-webkit-scrollbar-thumb {
    background: var(--scrollbar);
    border-radius: 16px;
    border: 1px solid #2f3d2f;
}
.main::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

/* ============================================================
   Шапка с анимированной кнопкой "назад" (финальная)
   ============================================================ */

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 12px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Стрелка назад */
.back-arrow-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    text-decoration: none;
    font-size: 2.2rem;
    font-weight: 300;
    line-height: 1;
    padding: 0;
    border-radius: 4px;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    z-index: 2;
    position: relative;
}

.back-arrow-link:hover {
    color: var(--accent-hover);
}

/* Контейнер для логотипа */
.logo-container {
    border-radius: 40px;
    background: rgba(20, 26, 22, 0.5);
    backdrop-filter: blur(2px);
    border-left: 4px solid var(--accent);
    padding: 0 20px 0 12px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: padding 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Основной текст логотипа */
.logo-text {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 2.4rem;
    letter-spacing: 4px;
    color: var(--cream-bright);
    text-shadow: 0 2px 16px rgba(0,0,0,0.9), 0 0 8px var(--logo-shadow);
    white-space: nowrap;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
}

.logo-text small {
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--text-muted-2);
    margin-left: 12px;
}

.logo-text small span {
    font-weight: 300;
}

/* Подсказка "На главную" — абсолютно позиционирована, выравнивание по левому краю */
.logo-hint {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--cream);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    transform-origin: left center;
}

.logo-hint::before {
    content: '‹';
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--accent);
}

/* При наведении на стрелку — логотип исчезает, подсказка появляется */
.back-arrow-link:hover ~ .logo-container .logo-text {
    opacity: 0;
    transform: translateX(-20px);
}

.back-arrow-link:hover ~ .logo-container .logo-hint {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    transform-origin: left center;
}

/* Адаптивность для мобильных */
@media (max-width: 640px) {
    .logo-container {
        height: 40px;
        padding: 0 12px 0 8px;
        border-left-width: 3px;
    }
    .logo-text {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
    .logo-text small {
        font-size: 0.7rem;
        margin-left: 8px;
    }
    .logo-hint {
        font-size: 0.85rem;
        left: 8px;
    }
    .logo-hint::before {
        font-size: 1.2rem;
    }
    .back-arrow-link {
        font-size: 1.8rem;
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        height: 34px;
        padding: 0 8px 0 6px;
    }
    .logo-text {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    .logo-text small {
        font-size: 0.55rem;
        margin-left: 4px;
    }
    .logo-hint {
        font-size: 0.7rem;
        left: 6px;
    }
    .logo-hint::before {
        font-size: 1rem;
    }
    .back-arrow-link {
        font-size: 1.4rem;
        width: 26px;
        height: 26px;
    }
}

/* Ссылка на форум в подвале */
.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 4px;
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s, transform 0.2s;
    letter-spacing: 0.3px;
}

.footer-link:hover {
    color: var(--accent-hover);
    transform: translateX(2px);
}

.footer-link-hint {
    color: var(--text-ghost);
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 0.2px;
}

/* ============================================================
   БЕЙДЖ ПОЛЬЗОВАТЕЛЯ + МЕНЮ (общий для всех страниц)
   ============================================================ */

/* Поднимаем header-top над вкладками (.tabs), чтобы выпадающее меню
   не перекрывалось ими и кликалось полностью */
.header-top {
    z-index: 20;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 26, 22, 0.5);
    border: 1px solid var(--border-pill);
    border-radius: 40px;
    padding: 6px 14px 6px 10px;
    color: var(--text-nav);
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    backdrop-filter: blur(2px);
}

.user-menu-btn:hover {
    background: rgba(50, 70, 56, 0.7);
    color: var(--text-hover);
    border-color: var(--accent);
}

.user-menu-avatar {
    font-size: 1.1rem;
    line-height: 1;
}

.user-menu-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-caret {
    font-size: 1.3rem;
    line-height: 1;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-menu.open .user-menu-caret {
    transform: rotate(180deg);
}

/* Выпадающее меню */
.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    background: var(--bg-footer);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.8);
    overflow: hidden;
    z-index: 1000;
}

.user-menu.open .user-menu-dropdown {
    display: block;
}

/* Пункты меню: ссылки и кнопка выхода */
.user-menu-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-nav);
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.user-menu-item:hover {
    background: rgba(184, 124, 75, 0.15);
    color: var(--cream);
}

/* Разделитель между страницами и кнопкой выхода */
.user-menu-separator {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

@media (max-width: 640px) {
    .user-menu-name {
        max-width: 90px;
    }
    .user-menu-btn {
        padding: 5px 10px 5px 8px;
    }
}

