/* ===========================
   UNIVERSAL HEADER V9 FINAL — DEGEN X
   Desktop (>900px): V8 layout — chain selector, wallets pill, search, star, bell, avatar
   Mobile (≤900px):  V5 layout — burger + gradient profile icon
   КЛАСИ: nav-links / mobile-open / mobile-menu-btn / mobile-header-right / mobile-profile-icon
   ========================== */

/* ======= VARIABLES ======= */
:root {
    --hdr-h: 80px;
    --c-green: #00ff41;
    --c-bg: rgba(6,6,8,0.95);
    --c-border: rgba(255,255,255,0.08);
    --c-txt: #e8e8ea;
    --c-txt2: rgba(255,255,255,0.45);
}

/* ======= SHELL ======= */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    height: var(--hdr-h);
    background: var(--c-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--c-border);
}

.top-header nav {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
}

/* ======= LOGO ======= */
.hdr-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--c-green);
    text-decoration: none;
    margin-right: 2.5rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.hdr-logo:hover { opacity: .8; }

.hdr-logo img {
    display: block;
    flex-shrink: 0;
    width: 32px;
    height: 36px;
    border-radius: 7px;
}

/* ======= NAV (desktop horizontal) ======= */
.nav-links {
    display: flex;
    gap: 2px;
    list-style: none;
    margin: 0 auto 0 0;
    padding: 0;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.nav-links li { margin: 0; padding: 0; }

.nav-links a {
    color: var(--c-txt2);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    display: block;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--c-txt);
    background: rgba(255,255,255,.06);
    transform: translateY(-1px);
}

.nav-links a.active {
    color: var(--c-green);
    background: rgba(0,255,65,.06);
}

/* ======= DESKTOP RIGHT SECTION ======= */
.hdr-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 1rem;
    flex-shrink: 0;
}

/* ======= CIRCLE BUTTON (search, star, bell) ======= */
.hdr-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.03);
    border: 1.5px solid rgba(255,255,255,.10);
    color: var(--c-txt2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    flex-shrink: 0;
    position: relative;
}

.hdr-circle:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.18);
    color: var(--c-txt);
    transform: translateY(-1px);
}

.hdr-circle svg { width: 18px; height: 18px; }

/* ======= CHAIN SELECTOR ======= */
.hdr-chain { position: relative; }

.hdr-chain-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 16px;
    background: rgba(0,255,65,.04);
    border: 1.5px solid rgba(0,255,65,.15);
    border-radius: 21px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    white-space: nowrap;
}

.hdr-chain-btn:hover {
    background: rgba(0,255,65,.08);
    border-color: rgba(0,255,65,.25);
    transform: translateY(-1px);
}

.hdr-chain-btn img { display: block; flex-shrink: 0; width: 22px; height: 22px; }
.hdr-chain-btn svg { width: 12px; height: 12px; }

/* Chain Dropdown */
.hdr-chain-dd {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #111119;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(.97);
    transition: all .15s;
    z-index: 10002;
}

.hdr-chain-dd.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.hdr-chain-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--c-txt2);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .12s;
}

.hdr-chain-opt img { display: block; flex-shrink: 0; }
.hdr-chain-opt:hover { background: rgba(255,255,255,.05); color: var(--c-txt); }
.hdr-chain-opt.active { background: rgba(0,255,65,.06); color: var(--c-green); }
.hdr-chain-soon {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #f59e0b;
    background: rgba(245,158,11,.1);
    border: 1px solid rgba(245,158,11,.2);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ======= DEPOSIT / SIGN IN ======= */
.hdr-deposit {
    height: 42px;
    padding: 0 24px;
    border: none;
    border-radius: 21px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    white-space: nowrap;
    background: linear-gradient(135deg, #4f46e5, #6d5bf7);
    color: #fff;
}

.hdr-deposit:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.hdr-deposit.signin { background: var(--c-green); color: #000; }
.hdr-deposit.signin:hover {
    filter: brightness(1.05);
    box-shadow: 0 4px 12px rgba(0,255,65,0.3);
}

/* ======= WALLETS PILL ======= */
.hdr-wallets-pill {
    display: flex !important;
    align-items: center;
    height: 42px;
    background: rgba(255,255,255,.04);
    border: 1.5px solid rgba(255,255,255,.08);
    border-radius: 21px;
    padding: 0 12px;
    gap: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: visible;
}

.hdr-wallets-pill:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.14);
    transform: translateY(-1px);
}

.wp-section {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--c-txt2);
    padding: 0 7px;
    flex-shrink: 0;
    white-space: nowrap;
}

.wp-bal {
    font-size: 0.88rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--c-txt);
}

.wp-section svg { flex-shrink: 0; width: 16px; height: 16px; }
.wp-section img { display: block; flex-shrink: 0; width: 18px; height: 18px; }
.wp-count { font-size: 0.9rem; font-weight: 600; color: var(--c-txt); }

.wp-sep {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,.10);
    margin: 0 7px;
    flex-shrink: 0;
}

/* ======= DESKTOP AVATAR ======= */
.hdr-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all .2s;
}
.hdr-profile-link:hover .hdr-avatar {
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(0,255,65,.35);
}
.hdr-profile-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    transition: color 0.2s;
}
.hdr-profile-link:hover .hdr-profile-text { color: #fff; }

.hdr-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #00ff41, #00aaff, #8b5cf6);
    text-decoration: none;
    transition: all .2s;
    box-shadow: 0 0 14px rgba(0,255,65,.15);
    flex-shrink: 0;
}

.hdr-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(0,255,65,.35);
}

.hdr-avatar svg { color: #000; width: 20px; height: 20px; }

/* ======= AUTH STATES ======= */
.header-auth-logged-out { display: flex; align-items: center; }
.header-auth-logged-in  { display: none;  align-items: center; }

/* ======= SEARCH OVERLAY ======= */
.hdr-search-ov {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.hdr-search-ov.open { display: flex; }

.hdr-search-modal {
    width: 100%;
    max-width: 580px;
    margin: 0 1rem;
    background: #0c0c14;
    border: 1px solid rgba(0,255,65,.1);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,.7), 0 0 40px rgba(0,255,65,.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    animation: searchSlideIn .2s ease-out;
}
@keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hdr-search-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}
.hdr-search-icon { flex-shrink: 0; }

.hdr-search-top input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    caret-color: #00ff41;
}
.hdr-search-top input::placeholder { color: rgba(255,255,255,.2); }

.hdr-search-top kbd {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 6px;
    padding: 3px 10px;
    color: rgba(255,255,255,.2);
    font-size: 0.7rem;
    font-family: 'IBM Plex Mono', monospace;
}

.hdr-search-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,255,65,.12), transparent);
}

.hdr-search-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,255,65,.15) transparent;
}
.hdr-search-body::-webkit-scrollbar { width: 4px; }
.hdr-search-body::-webkit-scrollbar-thumb { background: rgba(0,255,65,.15); border-radius: 4px; }

.hdr-search-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.2);
}

.hdr-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: background .12s;
    border-left: 2px solid transparent;
}
.hdr-search-item:hover,
.hdr-search-item.hdr-search-active {
    background: rgba(0,255,65,.04);
    border-left-color: #00ff41;
}
.hdr-search-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.hdr-search-item-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.06);
}
.hdr-search-item-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,255,65,.15), rgba(139,92,246,.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #00ff41;
    flex-shrink: 0;
}
.hdr-search-item-info { min-width: 0; }
.hdr-search-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hdr-search-item-full {
    font-weight: 400;
    color: rgba(255,255,255,.3);
    font-size: 0.8rem;
    margin-left: 6px;
}
.hdr-search-item-chain {
    font-size: 0.7rem;
    color: rgba(255,255,255,.2);
    margin-top: 1px;
}

.hdr-search-item-right {
    text-align: right;
    flex-shrink: 0;
}
.hdr-search-item-price {
    font-weight: 600;
    font-size: 0.85rem;
    font-family: 'IBM Plex Mono', monospace;
}
.hdr-search-item-change {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}
.hdr-search-green { color: #00ff41; }
.hdr-search-red { color: #ff4466; }
.hdr-search-item-vol {
    font-size: 0.65rem;
    color: rgba(255,255,255,.2);
    margin-top: 1px;
}

.hdr-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 2rem;
    color: rgba(255,255,255,.2);
    font-size: 0.85rem;
}
.hdr-search-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(0,255,65,.15);
    border-top-color: #00ff41;
    border-radius: 50%;
    animation: searchSpin .6s linear infinite;
}
@keyframes searchSpin { to { transform: rotate(360deg); } }

.hdr-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 2.5rem;
    color: rgba(255,255,255,.15);
    font-size: 0.85rem;
}

.hdr-search-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 20px;
    border-top: 1px solid rgba(255,255,255,.04);
    font-size: 0.7rem;
    color: rgba(255,255,255,.15);
}
.hdr-search-footer kbd {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
}

@media (max-width: 600px) {
    .hdr-search-ov { padding-top: 0; align-items: flex-start; }
    .hdr-search-modal {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
        border: none;
        height: 100vh;
        height: 100dvh;
    }
    .hdr-search-footer { display: none; }
    .hdr-search-top { padding: 14px 16px; }
    .hdr-search-item { padding: 10px 16px; }
    .hdr-search-label { padding: 10px 16px 6px; }
}

/* ======= SHARED OVERLAY MODALS (Favorites, Notifications) ======= */
.hdr-modal-ov {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.hdr-modal-ov.open { display: flex; }

.hdr-modal-panel {
    width: 100%;
    max-width: 480px;
    margin: 0 1rem;
    background: #0c0c14;
    border: 1px solid rgba(0,255,65,.1);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,.7), 0 0 40px rgba(0,255,65,.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 60vh;
    animation: searchSlideIn .2s ease-out;
}

.hdr-modal-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
}
.hdr-modal-title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}
.hdr-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.25);
    font-size: 1.4rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.hdr-modal-close:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}
.hdr-modal-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,255,65,.12), transparent);
}
.hdr-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,255,65,.15) transparent;
}
.hdr-modal-body::-webkit-scrollbar { width: 4px; }
.hdr-modal-body::-webkit-scrollbar-thumb { background: rgba(0,255,65,.15); border-radius: 4px; }

.hdr-modal-hint {
    font-size: 0.7rem;
    color: rgba(255,255,255,.1);
    margin-top: 2px;
}
.hdr-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-top: 1px solid rgba(255,255,255,.04);
    font-size: 0.7rem;
    color: rgba(255,255,255,.12);
}

/* Favorites items inside modal */
.hdr-fav-list {
    max-height: none;
}
.hdr-fav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.03);
    border-left: 2px solid transparent;
    transition: all .12s;
}
.hdr-fav-item:hover {
    background: rgba(0,255,65,.04);
    border-left-color: #ffd700;
}
.hdr-fav-item-img {
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.06);
}
.hdr-fav-item-placeholder {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,255,65,.15), rgba(139,92,246,.15));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; color: #00ff41; flex-shrink: 0;
}
.hdr-fav-item-info { flex: 1; min-width: 0; }
.hdr-fav-item-name { font-weight: 600; font-size: 0.9rem; }
.hdr-fav-item-full { font-size: 0.72rem; color: rgba(255,255,255,.3); margin-top: 1px; }
.hdr-fav-remove {
    background: none; border: none;
    color: rgba(255,255,255,.12); font-size: 1.2rem;
    cursor: pointer; padding: 4px 8px; border-radius: 8px;
    transition: all .15s; flex-shrink: 0;
}
.hdr-fav-remove:hover { color: #ff4466; background: rgba(255,68,102,.08); }
.hdr-fav-empty, .hdr-notif-empty {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    padding: 3rem 1.5rem;
    color: rgba(255,255,255,.15); font-size: 0.85rem;
    text-align: center;
}

/* Notification items inside modal */
.hdr-notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    border-left: 2px solid transparent;
    transition: background .12s;
}
.hdr-notif-item:hover { background: rgba(255,255,255,.02); border-left-color: #00ff41; }
.hdr-notif-unread { background: rgba(0,255,65,.02); }
.hdr-notif-item-icon { flex-shrink: 0; margin-top: 2px; }
.hdr-notif-item-body { min-width: 0; flex: 1; }
.hdr-notif-item-title { font-size: 0.85rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.hdr-notif-item-text { font-size: 0.75rem; color: rgba(255,255,255,.4); line-height: 1.4; }
.hdr-notif-item-time { font-size: 0.65rem; color: rgba(255,255,255,.15); margin-top: 4px; }

@media (max-width: 600px) {
    .hdr-modal-ov { padding-top: 0; }
    .hdr-modal-panel {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
        border: none;
        height: 100vh;
        height: 100dvh;
    }
    .hdr-modal-footer { display: none; }
}

/* ======= TOAST NOTIFICATIONS ======= */
.hdr-toast {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 200000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #0c0c14;
    border: 1px solid rgba(0,255,65,.15);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 20px rgba(0,255,65,.06);
    color: #fff;
    font-size: 0.88rem;
    max-width: 420px;
    transform: translateX(460px);
    opacity: 0;
    transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
}
.hdr-toast-in {
    transform: translateX(0);
    opacity: 1;
}
.hdr-toast-out {
    transform: translateX(460px) !important;
    opacity: 0 !important;
    transition: transform .3s ease-in, opacity .25s ease !important;
}
.hdr-toast-icon { flex-shrink: 0; color: #00ff41; }
.hdr-toast-info .hdr-toast-icon { color: #00ff41; }
.hdr-toast-msg { flex: 1; line-height: 1.4; }
.hdr-toast-close {
    background: none; border: none; color: rgba(255,255,255,.3);
    font-size: 1.2rem; cursor: pointer; padding: 0 0 0 8px;
    transition: color .15s;
}
.hdr-toast-close:hover { color: #fff; }
@media (max-width: 600px) {
    .hdr-toast { right: 10px; left: 10px; max-width: calc(100% - 20px); top: 85px; }
}

/* ======= NOTIFICATION DOT ======= */
.hdr-notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: #ff4466;
    border-radius: 50%;
    border: 2px solid #000;
}

/* ======= MOBILE RIGHT BLOCK (прихований на десктопі) ======= */
.mobile-header-right {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* ── Burger Button ── */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 1.5px solid rgba(0,255,65,0.2);
    border-radius: 10px;
    cursor: pointer;
    padding: 10px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn span {
    width: 22px;
    height: 2px;
    background: var(--c-green);
    transition: all 0.3s;
    display: block;
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* ── Mobile Profile Icon ── */
/* ======= MOBILE OVERLAY ======= */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ======= FOCUS STATES ======= */
.nav-links a:focus-visible,
.hdr-circle:focus-visible,
.hdr-chain-btn:focus-visible,
.hdr-deposit:focus-visible {
    outline: 2px solid var(--c-green);
    outline-offset: 2px;
}

/* ======= SIDEBAR / BODY PADDING ======= */
body:has(.sidebar) .top-header { z-index: 10000; }
body { padding-top: var(--hdr-h); }
body:has(.sidebar) { padding-top: 0; }
body:has(.sidebar) .platform-container,
body:has(.sidebar) main { padding-top: var(--hdr-h); }


/* ==============================================
   DESKTOP RESPONSIVE TWEAKS (>900px)
   padding nav керується clamp() — тут масштабуються елементи
   ============================================== */

/* Дуже великі екрани 1920px+ — padding однаковий */

/* 1600–1920px */
@media (max-width: 1600px) {
    .nav-links a { padding: 10px 12px; font-size: 0.93rem; }
}

/* 1400–1600px */
@media (max-width: 1400px) {
    .nav-links a { padding: 10px 10px; font-size: 0.9rem; }
    .hdr-right { gap: 6px; }
}

/* 1280–1400px */
@media (max-width: 1280px) {
    .nav-links a { padding: 9px 8px; font-size: 0.88rem; }
    .hdr-right { gap: 5px; }
    .hdr-circle { width: 36px; height: 36px; }
    .hdr-chain-btn { height: 38px; padding: 0 12px; font-size: 0.88rem; }
    .hdr-deposit { height: 38px; padding: 0 14px; }
    .hdr-wallets-pill { height: 38px; padding: 0 10px; }
    .hdr-avatar { width: 36px; height: 36px; }
}

/* 1100–1280px */
@media (max-width: 1100px) {
    :root { --hdr-h: 70px; }
    .nav-links a { padding: 8px 7px; font-size: 0.85rem; }
    .hdr-logo span { display: none; }
    .hdr-right { gap: 4px; padding-left: 0.5rem; }
    .hdr-chain-btn { padding: 0 10px; font-size: 0.85rem; }
    .hdr-deposit { padding: 0 12px; font-size: 0.85rem; }
    .wp-section { padding: 0 5px; gap: 5px; }
}


/* ==============================================
   MOBILE / TABLET (≤900px)
   Бургер з'являється, десктоп права панель ховається
   ============================================== */
/* Desktop: hide mobile-only elements */
.mob-user-card, .mob-section-label, .mob-nav-only, .mob-nav-icon { display: none !important; }
.mob-wallet-pill { display: none; }

/* ============================================================================
   MOBILE (≤900px)
   ============================================================================ */
@media (max-width: 900px) {
    :root { --hdr-h: 64px; }
    .mobile-header-right { display: flex !important; }
    .hdr-right { display: none !important; }
    .mobile-menu-btn { display: flex !important; }
    .mob-wallet-pill { display: flex !important; }

    /* Hide nav when closed */
    .nav-links:not(.mobile-open) { display: none !important; }

    /* ── Slide-in panel from right ── */
    .nav-links.mobile-open {
        display: flex !important;
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: 300px; max-width: 82vw;
        height: 100vh; height: 100dvh;
        background: #0d0d14;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0; gap: 0;
        z-index: 10002;
        overflow-y: auto; overflow-x: hidden;
        margin: 0; list-style: none;
        box-shadow: -8px 0 40px rgba(0,0,0,0.6);
        animation: mobSlideIn 0.25s cubic-bezier(.4,0,.2,1);
        -webkit-overflow-scrolling: touch;
    }
    @keyframes mobSlideIn {
        from { transform: translateX(100%); }
        to   { transform: translateX(0); }
    }

    /* ── User Card ── */
    .mob-user-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 14px !important;
        padding: 52px 20px 18px !important;
        background: linear-gradient(135deg, rgba(0,255,65,0.05), rgba(139,92,246,0.05));
        border-bottom: 1px solid rgba(255,255,255,0.05);
        margin-bottom: 6px;
        list-style: none;
    }
    .mob-user-avatar {
        width: 50px !important; height: 50px !important; border-radius: 50% !important;
        background: linear-gradient(135deg, #00ff41, #8b5cf6) !important;
        display: flex !important; align-items: center !important; justify-content: center !important;
        font-weight: 700; font-size: 1.05rem; color: #000;
        flex-shrink: 0 !important; position: relative;
    }
    .mob-online-dot {
        position: absolute; bottom: 1px; right: 1px;
        width: 10px; height: 10px; border-radius: 50%;
        background: #00ff41; border: 2px solid #0d0d14;
    }
    .mob-user-meta {
        flex: 1 !important; min-width: 0 !important;
        display: flex !important; flex-direction: column !important;
    }
    .mob-user-name {
        font-size: 1.1rem !important; font-weight: 600 !important; color: #fff !important;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        line-height: 1.3;
    }
    .mob-user-stats {
        font-size: 0.85rem !important; color: rgba(255,255,255,0.4) !important;
        margin-top: 5px; line-height: 1.3;
    }
    .mob-user-bal-badge { display: none !important; }

    /* ── Section Labels — pushed down after card ── */
    .mob-section-label {
        display: block !important;
        padding: 8px 18px 8px;
        margin-top: 16px;
        font-size: 0.6rem; font-weight: 700;
        letter-spacing: 1.5px; text-transform: uppercase;
        color: rgba(255,255,255,0.2);
        list-style: none;
        border-top: 1px solid rgba(255,255,255,.04);
    }
    .nav-links.mobile-open li.mob-section-label {
        padding: 8px 18px 8px !important;
        margin-top: 16px !important;
    }

    /* ── Nav rows ── */
    .nav-links.mobile-open li {
        display: list-item !important;
        list-style: none; width: 100%; margin: 0; padding: 2px 10px;
    }
    /* User card must stay flex - override the li rule above */
    .nav-links.mobile-open li.mob-user-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 52px 20px 20px !important;
    }
    .nav-links.mobile-open a,
    .nav-links.mobile-open .mob-deposit-btn,
    .nav-links.mobile-open .mob-auth-btn {
        display: flex !important;
        align-items: center; gap: 12px;
        width: 100%; padding: 13px 14px;
        font-size: 0.9rem; font-weight: 500;
        color: rgba(255,255,255,0.65); text-decoration: none;
        border-radius: 10px; transition: all 0.12s;
        background: transparent; border: none; cursor: pointer;
    }
    .nav-links.mobile-open a:hover,
    .nav-links.mobile-open a:active,
    .nav-links.mobile-open .mob-deposit-btn:hover,
    .nav-links.mobile-open .mob-auth-btn:hover {
        background: rgba(255,255,255,0.04); color: #fff;
    }
    .nav-links.mobile-open a.active {
        background: rgba(0,255,65,0.06); color: #00ff41;
    }
    .mob-nav-icon { display: inline-flex !important; width: 20px; height: 20px; opacity: 0.45; flex-shrink: 0; }
    .nav-links.mobile-open a.active .mob-nav-icon { opacity: 1; }

    /* ── Mobile-only items ── */
    .nav-links.mobile-open .mob-nav-only { display: list-item !important; }
    .nav-links.mobile-open .mob-nav-actions {
        display: flex !important; flex-direction: column;
        align-items: stretch; gap: 2px; padding: 2px 10px 30px;
    }
    .mob-deposit-btn { font-family: inherit; }
    .mob-auth-btn { font-family: inherit; }
    .mob-auth-btn .mob-auth-icon-in { display: inline-flex !important; }
    .mob-auth-btn .mob-auth-icon-out { display: none !important; }
    .mob-auth-btn.logged-in { color: #ff6680 !important; }
    .mob-auth-btn.logged-in .mob-auth-icon-in { display: none !important; }
    .mob-auth-btn.logged-in .mob-auth-icon-out { display: inline-flex !important; }
    .mob-auth-btn.logged-in:hover { background: rgba(255,80,100,0.04) !important; }

    /* ── Mobile Wallet Pill ── */
    .mob-wallet-pill {
        display: flex !important; align-items: center; gap: 5px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 20px; padding: 5px 10px; height: 34px;
        font-size: 0.75rem; font-weight: 600;
        color: rgba(255,255,255,0.7); white-space: nowrap;
    }
    .mob-wallet-pill img { flex-shrink: 0; }
    .mob-wp-sep { width: 1px; height: 14px; background: rgba(255,255,255,0.1); margin: 0 3px; }

    /* Logo */
    .hdr-logo { margin-right: 0; font-size: 1.15rem; }
    .hdr-logo span { display: inline !important; }
    .hdr-logo img { width: 28px; height: 28px; }
}

/* ── Tablet (600–900px) ── */
@media (max-width: 900px) and (min-width: 600px) {
    .nav-links.mobile-open { width: 340px; }
}

/* ── Phone (≤480px) ── */
@media (max-width: 480px) {
    :root { --hdr-h: 60px; }
    .hdr-logo img { width: 26px; height: 26px; }
    .mobile-menu-btn { width: 40px; height: 40px; padding: 9px; }
    .mobile-menu-btn span { width: 20px; }
    .mobile-profile-icon { width: 40px; height: 40px; }
    .mobile-profile-icon svg { width: 20px; height: 20px; }
    .mob-wallet-pill { padding: 4px 8px; font-size: 0.7rem; height: 30px; }
}

/* ── Small phones (≤360px) ── */
@media (max-width: 360px) {
    :root { --hdr-h: 56px; }
    .hdr-logo img { width: 24px; height: 24px; }
    .mobile-header-right { gap: 6px; }
}

/* ======= COOKIE CONSENT BANNER ======= */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100002;
    padding: 0 1.5rem 1.5rem;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
    pointer-events: none;
}
.cookie-consent.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.cookie-consent.dismissing {
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
}

.cookie-glow {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 120px;
    background: radial-gradient(ellipse, rgba(0,255,65,.06), transparent 70%);
    pointer-events: none;
}

.cookie-inner {
    max-width: 960px;
    margin: 0 auto;
    background: rgba(8,8,14,.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0,255,65,.1);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 -8px 40px rgba(0,0,0,.5), 0 0 30px rgba(0,255,65,.03);
}

.cookie-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.cookie-icon-wrap {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(0,255,65,.06);
    border: 1px solid rgba(0,255,65,.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-text { min-width: 0; }

.cookie-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.cookie-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,.35);
    line-height: 1.5;
}
.cookie-desc a {
    color: rgba(0,255,65,.5);
    text-decoration: none;
    transition: color .15s;
}
.cookie-desc a:hover { color: #00ff41; }

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn-accept {
    padding: 10px 22px;
    background: #00ff41;
    color: #000;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    font-family: inherit;
}
.cookie-btn-accept:hover {
    box-shadow: 0 0 20px rgba(0,255,65,.3);
    transform: translateY(-1px);
}

.cookie-btn-reject {
    padding: 10px 18px;
    background: transparent;
    color: rgba(255,255,255,.35);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    font-family: inherit;
}
.cookie-btn-reject:hover {
    color: rgba(255,255,255,.6);
    border-color: rgba(255,255,255,.15);
}

.cookie-btn-settings {
    padding: 10px 18px;
    background: transparent;
    color: rgba(255,255,255,.35);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    font-family: inherit;
}
.cookie-btn-settings:hover {
    color: rgba(0,255,65,.6);
    border-color: rgba(0,255,65,.15);
}

/* Settings Panel */
.cookie-settings-panel {
    max-width: 960px;
    margin: 0 auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}
.cookie-settings-panel.open {
    max-height: 400px;
    padding-top: 0;
}

.cookie-settings-inner {
    background: rgba(8,8,14,.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,.06);
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding: 1rem 1.5rem;
    margin-top: -1px;
}

.cookie-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.cookie-setting-row:last-of-type { border-bottom: none; }

.cookie-setting-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    display: block;
}
.cookie-setting-desc {
    font-size: 0.72rem;
    color: rgba(255,255,255,.25);
    display: block;
    margin-top: 2px;
}

.cookie-toggle {
    font-size: 0.7rem;
    color: rgba(0,255,65,.4);
    font-weight: 500;
    white-space: nowrap;
}

/* Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.cookie-switch input { opacity: 0; width: 0; height: 0; }
.cookie-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,.08);
    border-radius: 22px;
    transition: all .25s;
}
.cookie-slider::before {
    content: '';
    position: absolute;
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: rgba(255,255,255,.3);
    border-radius: 50%;
    transition: all .25s;
}
.cookie-switch input:checked + .cookie-slider {
    background: rgba(0,255,65,.2);
    border: 1px solid rgba(0,255,65,.3);
}
.cookie-switch input:checked + .cookie-slider::before {
    transform: translateX(18px);
    background: #00ff41;
}

.cookie-settings-actions {
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* Mobile */
@media (max-width: 768px) {
    .cookie-consent { padding: 0 0.75rem 0.75rem; }
    .cookie-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.25rem;
    }
    .cookie-left { flex-direction: column; gap: 0.75rem; }
    .cookie-icon-wrap { width: 36px; height: 36px; }
    .cookie-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .cookie-btn-accept { grid-column: 1 / -1; }
}
