/* ============================================ */
/* HOT ELEMENTAL — ОФОРМЛЕНИЕ v2                */
/* Рисованная сказка: ночное небо, бирюза,      */
/* бронза, четыре стихии. Графика —             */
/* assets/img/v2 (исходники promo/site-art-v2). */
/* Подключается ПОСЛЕДНИМ в <head> всех страниц */
/* (поверх style.css и встроенных стилей).      */
/* ============================================ */

@font-face {
    font-family: 'Philosopher';
    src: url('/assets/fonts/philosopher-bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

:root {
    --v2-teal: #4ecdc4;
    --v2-teal-dark: #0f5a5e;
    --v2-gold: #f2c230;
    --v2-bronze: #c98a3a;
    --v2-fire: #ff6b6b;
    --v2-ink: #08122b;
    --v2-panel: rgba(12, 22, 52, 0.88);
    --v2-head: 'Philosopher', 'Segoe UI', Tahoma, sans-serif;
    --v2-top: 64px;
}

/* ---------- Фон: ночное небо ---------- */
html body {
    background-color: #070d22;
    background-image: url('/assets/img/v2/backgrounds/bg_main.webp');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
}
html body::before {
    background: linear-gradient(180deg, rgba(6, 10, 30, 0.55), rgba(6, 10, 30, 0.78) 60%, rgba(6, 10, 30, 0.88));
}
@media (max-width: 768px) {
    html body {
        background-image: url('/assets/img/v2/backgrounds/bg_mobile.webp');
        background-attachment: scroll;
    }
}

/* ---------- Заголовки и текст ---------- */
html body h1, html body h2, html body h3,
html body .journey-title, html body .changelog-title {
    font-family: var(--v2-head);
    font-weight: 700;
    letter-spacing: 0.3px;
}
html body h1, html body h2 {
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 18px rgba(78, 205, 196, 0.18);
}

/* ---------- Шапка ---------- */
html body .top-bar {
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: var(--v2-top);
    padding: 6px 18px;
    gap: 10px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    background: linear-gradient(180deg, rgba(10, 20, 48, 0.96), rgba(8, 14, 36, 0.94));
    border-bottom: 2px solid rgba(78, 205, 196, 0.55);
    box-shadow: 0 1px 0 rgba(242, 194, 48, 0.35), 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* Название: рисованная плашка «HotElemental» (ИИ, promo/site-art-v2/brand) и подпись HotE RPG.
   Текст ссылки скрыт, но остаётся для читалок и поиска. */
html body .top-bar .logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 56px;
    padding-left: 205px;
    background: url('/assets/img/v2/brand/logo_plate.webp') left center / 205px auto no-repeat;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 0;
    white-space: nowrap;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55));
    transition: transform 0.2s;
}
html body .top-bar .logo::after {
    content: 'HotE RPG';
    margin-left: 8px;
    font: 700 1rem var(--v2-head);
    letter-spacing: 1px;
    background: linear-gradient(180deg, #8ff3ea, #4ecdc4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
html body .top-bar .logo:hover { transform: scale(1.03); }

html body .nav-buttons {
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 6px 8px;
    flex-wrap: wrap;
}

/* Кнопка меню — видна только на телефоне */
.nav-toggle { display: none; }

/* ---------- Кнопки: картинки v2, края не растягиваются ---------- */
html body .btn,
html body .user-name-btn {
    --tab: url('/assets/img/v2/buttons/tab_primary.webp');
    --tab-h: url('/assets/img/v2/buttons/tab_primary_hover.webp');
    position: relative;
    background: transparent;
    border-style: solid;
    border-color: transparent;
    border-width: 0 16px;
    border-image: var(--tab) 0 55 fill / 0 16px stretch;
    border-radius: 0;
    padding: 9px 6px 10px;
    min-height: 38px;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 6px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.15s, filter 0.15s;
}
html body .btn:hover,
html body .user-name-btn:hover {
    border-image-source: var(--tab-h);
    background: transparent;
    transform: translateY(-1px);
    filter: drop-shadow(0 0 6px rgba(242, 194, 48, 0.45));
}
html body .btn:active { transform: translateY(1px); }

/* Крупные кнопки действий: огонь / вода / земля / воздух */
html body .btn-primary {
    --tab: url('/assets/img/v2/buttons/btn_fire.webp');
    --tab-h: url('/assets/img/v2/buttons/btn_fire_hover.webp');
    border-width: 0 30px;
    border-image: var(--tab) 0 110 fill / 0 30px stretch;
    min-height: 42px;
    padding: 10px 4px 11px;
    color: #fff;
}
html body .btn-secondary {
    --tab: url('/assets/img/v2/buttons/btn_water.webp');
    --tab-h: url('/assets/img/v2/buttons/btn_water_hover.webp');
    border-width: 0 30px;
    border-image: var(--tab) 0 110 fill / 0 30px stretch;
    min-height: 42px;
    padding: 10px 4px 11px;
    color: #fff;
}
html body .btn-oilgame {
    --tab: url('/assets/img/v2/buttons/tab_earth.webp');
    --tab-h: url('/assets/img/v2/buttons/tab_earth_hover.webp');
}
html body .user-name-btn {
    --tab: url('/assets/img/v2/buttons/tab_water.webp');
    --tab-h: url('/assets/img/v2/buttons/tab_water_hover.webp');
}
html body .btn:disabled, html body .btn[disabled] {
    border-image-source: url('/assets/img/v2/buttons/btn_disabled.webp');
    filter: grayscale(0.4);
    opacity: 0.75;
    transform: none;
    cursor: not-allowed;
}

/* Значки разделов: медальоны v2 вместо значков шрифта */
.v2-ico {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    margin: -8px 0 -8px -6px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

/* Колокольчик */
html body .notification-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: url('/assets/img/v2/buttons/btn_round_primary.webp') center / contain no-repeat;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
html body .notification-icon:hover { background-image: url('/assets/img/v2/buttons/btn_round_primary_hover.webp'); }
html body .notification-icon i { color: #fff; text-shadow: 0 1px 2px #000; }

/* ---------- Поля ввода ---------- */
html body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
html body select, html body textarea {
    background: rgba(5, 14, 34, 0.85);
    border: 2px solid rgba(78, 205, 196, 0.45);
    border-radius: 14px;
    color: #f2f6ff;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}
html body input:focus, html body select:focus, html body textarea:focus {
    border-color: var(--v2-gold);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(242, 194, 48, 0.18);
}
html body input::placeholder, html body textarea::placeholder { color: #7f8db0; }

/* ---------- Окна (вход, регистрация и др.) ---------- */
html body .modal {
    z-index: 3000;
    background: rgba(3, 6, 18, 0.82);
    backdrop-filter: blur(3px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 12px;
}
html body .modal-content {
    position: relative;
    background: transparent;
    border: solid transparent;
    border-width: 0;
    border-image: url('/assets/img/v2/panels/panel_modal.webp') 90 160 fill / 36px 64px stretch;
    border-radius: 0;
    padding: 34px 30px 30px;
    margin: auto;
    max-height: none;
    box-shadow: none;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.6));
}
html body .modal-content h2 {
    text-align: center;
    color: #fff;
    margin-bottom: 14px;
}
html body .notifications-modal { z-index: 3000; }

/* ---------- Карточки ---------- */
html body .card, html body .profile-card, html body .feature-card,
html body .journey-card, html body .changelog-card, html body .about-card, html body .news-panel {
    background: var(--v2-panel);
    border: 1px solid rgba(78, 205, 196, 0.35);
    box-shadow: inset 0 0 0 1px rgba(242, 194, 48, 0.12), 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Разделитель под заголовком карточки */
.v2-divider {
    display: block;
    width: min(320px, 70%);
    height: 26px;
    margin: 4px auto 14px;
    background: url('/assets/img/v2/panels/divider.webp') center / contain no-repeat;
}

/* Рамка для картинки новости */
html body .news-image {
    border-style: solid;
    border-width: 18px;
    border-image: url('/assets/img/v2/frames/frame_news.webp') 85 fill / 18px stretch;
    border-image-outset: 6px;
    border-radius: 0;
    background-clip: padding-box;
}

/* Рамка аватара */
html body .profile-avatar {
    position: relative;
}
html body .profile-avatar::after {
    content: '';
    position: absolute;
    inset: -14%;
    background: url('/assets/img/v2/frames/frame_avatar.webp') center / contain no-repeat;
    pointer-events: none;
}

/* Уведомление-тост */
html body .toast-notification {
    background: rgba(10, 22, 52, 0.96);
    border-left: 4px solid var(--v2-teal);
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(242, 194, 48, 0.25), 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Подвал */
html body .footer {
    background: linear-gradient(180deg, rgba(8, 14, 36, 0.4), rgba(8, 14, 36, 0.85));
    border-top: 2px solid rgba(78, 205, 196, 0.35);
}

/* Полоса прокрутки */
html { scrollbar-color: #2a6f7a #0a1230; }

/* Ноутбук: всё меню в одну строку */
@media (min-width: 1301px) and (max-width: 1560px) {
    html body .top-bar .logo::after { display: none; }
    html body .top-bar .logo { padding-left: 180px; background-size: 180px auto; }
    html body .nav-buttons { gap: 4px; flex-wrap: nowrap; }
    html body .nav-buttons .btn, html body .nav-buttons .user-name-btn {
        font-size: 0.76rem;
        padding: 8px 0 9px;
        border-width: 0 13px;
        border-image-width: 0 13px;
        white-space: nowrap;
    }
    html body .nav-buttons .btn-primary { border-width: 0 22px; border-image-width: 0 22px; }
    html body .nav-buttons .v2-ico { width: 24px; height: 24px; flex-basis: 24px; margin: -6px 0 -6px -4px; }
}

/* ============ ТЕЛЕФОН И ПЛАНШЕТ: меню свёрнуто ============ */
@media (max-width: 1300px) {
    :root { --v2-top: 56px; }
    html body .top-bar {
        flex-wrap: wrap;
        padding: 6px 10px;
        gap: 0;
    }
    html body .top-bar .logo {
        height: 46px;
        padding-left: 168px;
        background-size: 168px auto;
        margin-right: auto;
    }
    /* Меню свёрнуто в плашку: открывается кнопкой справа */
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex: 0 0 auto;
        height: 40px;
        padding: 0 4px;
        border-style: solid;
        border-color: transparent;
        border-width: 0 16px;
        border-image: url('/assets/img/v2/buttons/tab_primary.webp') 0 55 fill / 0 16px stretch;
        background: transparent;
        color: #fff;
        font: 700 0.85rem 'Segoe UI', sans-serif;
        text-shadow: 0 1px 2px #000;
        cursor: pointer;
    }
    .nav-toggle .bars { font-size: 1.1rem; line-height: 1; }
    .top-bar.nav-open .nav-toggle { border-image-source: url('/assets/img/v2/buttons/tab_primary_hover.webp'); }
    .nav-toggle .badge {
        min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px;
        background: var(--v2-fire); color: #fff; font-size: 0.7rem; line-height: 18px; text-align: center;
    }

    html body .top-bar .nav-buttons {
        display: none;
        flex: 1 1 100%;
        order: 3;
        justify-content: center;
        gap: 8px;
        padding: 10px 0 6px;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    html body .top-bar.nav-open .nav-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    html body .top-bar.nav-open .nav-buttons > * { width: 100%; }
    html body .top-bar.nav-open .notification-wrapper { display: flex; justify-content: center; }

    /* Окна входа/регистрации — во всю ширину, сверху, с прокруткой:
       поле не прячется под клавиатурой и шапкой */
    html body .modal {
        align-items: flex-start;
        padding: 12px 8px calc(env(safe-area-inset-bottom, 0px) + 40vh);
    }
    html body .modal-content {
        width: 100%;
        max-width: 480px;
        padding: 26px 20px 22px;
        border-image-width: 30px 44px;
    }
    html body .modal-content input,
    html body .modal-content select,
    html body .modal-content textarea {
        font-size: 16px;          /* iOS не увеличивает страницу при вводе */
        min-height: 46px;
        margin: 7px 0;
    }
    html body .modal-content .btn { min-height: 46px; font-size: 0.95rem; }
}

@media (max-width: 400px) {
    html body .top-bar .logo { padding-left: 150px; background-size: 150px auto; }
    html body .top-bar .logo::after { display: none; }
}

/* ---------- Выбор языка: пергамент (окно рисует i18n.js) ---------- */
html body #hmLangGate .box {
    background: transparent;
    border: solid transparent;
    border-width: 0;
    border-image: url('/assets/img/v2/panels/lang_gate.webp') 110 130 fill / 54px 64px stretch;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6));
    padding: 46px 40px 40px;
    color: #3b2410;
}
html body #hmLangGate .rune { color: #7a3e10; text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6); }
html body #hmLangGate p { color: #3b2410; font-weight: 600; }
html body #hmLangGate .en { color: #6b5030; font-weight: 400; }
html body #hmLangGate button {
    min-width: 150px;
    min-height: 48px;
    border-radius: 0;
    border: solid transparent;
    border-width: 0 30px;
    border-image: url('/assets/img/v2/buttons/btn_water.webp') 0 110 fill / 0 30px stretch;
    background: transparent;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 2px #000;
}
html body #hmLangGate button[data-l="ru"] { border-image-source: url('/assets/img/v2/buttons/btn_fire.webp'); }
html body #hmLangGate button:hover { background: transparent; border-image-source: url('/assets/img/v2/buttons/btn_primary_hover.webp'); }

/* Переключатель языка в углу */
html body #hmLangSwitch {
    border: solid transparent !important;
    border-width: 0 14px !important;
    border-image: url('/assets/img/v2/buttons/tab_water.webp') 0 55 fill / 0 14px stretch !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #fff !important;
    padding: 8px 4px !important;
    text-shadow: 0 1px 2px #000;
}
html body #hmLangSwitch:hover { border-image-source: url('/assets/img/v2/buttons/tab_water_hover.webp') !important; }

/* ---------- Окно уведомлений: без серой полосы прокрутки, увиденное = прочитанное ---------- */
html body #notificationsModal > div,
html body .notifications-modal-content {
    background: linear-gradient(180deg, rgba(14, 26, 60, 0.98), rgba(8, 14, 36, 0.98)) !important;
    border: 1px solid rgba(78, 205, 196, 0.45) !important;
    border-top: 3px solid var(--v2-gold) !important;
    border-radius: 22px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(242, 194, 48, 0.12);
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
}
html body #notificationsModal > div::-webkit-scrollbar,
html body .notifications-modal-content::-webkit-scrollbar { display: none; }
html body #notificationsModal > div > div:first-child {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(12, 22, 52, 0.97);
    border-bottom: 1px solid rgba(78, 205, 196, 0.35) !important;
}
#notificationsList { padding: 8px 10px 30px !important; }
.notif-item {
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
    transition: background 0.6s, border-color 0.6s;
}
.notif-item:hover { background: rgba(78, 205, 196, 0.08); }
.notif-item.unread {
    background: rgba(78, 205, 196, 0.12);
    border-left-color: var(--v2-teal);
}
.notif-item b { font-family: var(--v2-head); font-size: 1.02rem; }
.notif-item .notif-msg { color: #d5dcef; font-size: 0.88rem; margin: 3px 0; line-height: 1.4; }
.notif-item .notif-date { font-size: 0.72rem; color: #7f8db0; }
html body #notificationsModal > div > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px !important;
}
html body #notificationsModal > div > div:first-child h3 { flex: 1; margin: 0; font-family: var(--v2-head); }
html body #notificationsModal > div > div:first-child > span {
    order: 3;
    float: none !important;
    width: 32px; height: 32px; line-height: 30px; text-align: center; font-size: 22px;
    border-radius: 50%; background: rgba(255, 255, 255, 0.06);
}
html body #notificationsModal > div > div:first-child .btn {
    float: none !important;
    margin: 0 !important;
    font-size: 0.75rem !important;
    min-height: 34px;
    border-width: 0 20px;
    border-image-width: 0 20px;
}
