* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 300;
}

html {
    height: 100%;
}

body {
    background-color: #0a0e17;
    color: #e8ecf2;
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
    background-image:
        radial-gradient(ellipse at 20% 0%, #1a2540 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, #1a1040 0%, transparent 50%);
    background-attachment: fixed;
    scrollbar-width: thin;
    scrollbar-color: rgba(72, 132, 255, 0.35) transparent;
    overflow-x: hidden;
}

*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(72, 132, 255, 0.3);
    border-radius: 6px;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 77, 109, 0.45);
}

.left-sidebar,
.right-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(72, 132, 255, 0.3) transparent;
}
.left-sidebar::-webkit-scrollbar,
.right-sidebar::-webkit-scrollbar { width: 4px; }
.left-sidebar::-webkit-scrollbar-thumb,
.right-sidebar::-webkit-scrollbar-thumb {
    background: rgba(72, 132, 255, 0.3);
    border-radius: 4px;
}

.hidden { display: none !important; }

.text-muted { opacity: 0.6; }
.text-success { color: #3acf6b; }
.text-gold { color: #ffb347; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes bounceIn {
    from { transform: translateX(-50%) scale(0.8); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Основной layout */
.main-layout {
    display: flex;
    max-width: 1440px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* ЛЕВЫЙ САЙДБАР */
.left-sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(12, 17, 28, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
}

.sidebar-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 14px;
    border: 0.5px solid rgba(255, 255, 255, 0.05);
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #5a7fb5;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    font-size: 0.8rem;
    color: #4884ff;
}

.profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(72, 132, 255, 0.05);
    border: 0.5px solid rgba(72, 132, 255, 0.15);
    margin-bottom: 12px;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4d6d, #ff8c42);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.3);
}

.profile-info .name {
    font-weight: 500;
    font-size: 0.9rem;
}

.profile-info .status {
    font-size: 0.7rem;
    color: #3acf6b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-info .status.offline {
    color: #8a8a9a;
}

.profile-info .status .dot {
    width: 6px;
    height: 6px;
    background: #3acf6b;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.profile-info .status .dot.offline {
    background: #5a5a6e;
    animation: none;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    color: #b0c4de;
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.2s;
    font-weight: 400;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(72, 132, 255, 0.1);
    color: #fff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.nav-badge {
    margin-left: auto;
    background: #ff4d6d;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 500;
}

.exchange-mini .rate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.rate-up { color: #3acf6b; }
.rate-down { color: #ff4d6d; }

.exchange-btn,
a.exchange-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 0.5px solid rgba(72, 132, 255, 0.3);
    border-radius: 12px;
    background: rgba(72, 132, 255, 0.15);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: 0.2s;
}

.exchange-btn:hover {
    background: rgba(72, 132, 255, 0.25);
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.8rem;
}

.friend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3acf6b;
    flex-shrink: 0;
}

.friend-dot.offline {
    background: #5a5a6e;
}

/* ЦЕНТР */
.center-content {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    min-width: 0;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.greeting {
    font-size: 1.6rem;
    font-weight: 200;
    letter-spacing: -0.5px;
}

.greeting strong {
    font-weight: 600;
    color: #4884ff;
}

.currency-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.currency-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
}

.currency-pill i.fa-coins { color: #f7b955; }
.currency-pill i.fa-gem { color: #a855f7; }
.currency-pill i.fa-star { color: #4884ff; }

/* ПРАВЫЙ САЙДБАР — расширенный на ПК */
.right-sidebar {
    width: 320px;
    min-width: 320px;
    background: rgba(12, 17, 28, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.main-layout {
    max-width: 1560px;
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(16, 22, 38, 0.9), rgba(12, 17, 28, 0.95));
    border-radius: 20px;
    border: 0.5px solid rgba(72, 132, 255, 0.12);
    overflow: hidden;
    min-height: 280px;
    max-height: 420px;
}

.chat-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(72, 132, 255, 0.06);
}

.chat-header i { color: #4884ff; }

.chat-messages {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: none;
    font-size: 0.78rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(72, 132, 255, 0.35) transparent;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(72, 132, 255, 0.35);
    border-radius: 4px;
}

.chat-msg {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 11px;
    border-radius: 12px 12px 12px 4px;
    border: 0.5px solid rgba(255, 255, 255, 0.04);
    line-height: 1.35;
    word-break: break-word;
    animation: chatIn 0.25s ease;
}

@keyframes chatIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.chat-msg .user {
    font-weight: 600;
    color: #6aa0ff;
    font-size: 0.72rem;
    margin-right: 4px;
}

.chat-msg .mention {
    color: #ffb347;
    background: rgba(255, 179, 71, 0.12);
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 500;
}

.chat-msg.muted { opacity: 0.45; text-align: center; border: none; background: transparent; }

.chat-input-row {
    display: flex;
    padding: 10px;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
}

.chat-input-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 10px 14px;
    color: white;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-row input:focus {
    border-color: rgba(72, 132, 255, 0.5);
}

.chat-send {
    background: linear-gradient(135deg, #4884ff, #6a5acd);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(72, 132, 255, 0.3);
}

.chat-send:hover { transform: scale(1.05); }

.top-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.top-rank {
    width: 22px;
    font-weight: 600;
    color: #ffb347;
}

.event-item {
    background: rgba(255, 77, 109, 0.06);
    border: 0.5px solid rgba(255, 77, 109, 0.2);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 0.78rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-item i {
    color: #ff4d6d;
}

.mention { color: #ffb347; font-weight: 500; }

/* Toast */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.85rem;
    z-index: 600;
    display: none;
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    display: block;
    animation: bounceIn 0.35s ease;
}

.toast-success,
.toast.show:not(.toast-error):not(.toast-info) {
    background: #3acf6b;
    color: #000;
}

.toast-error,
.toast.error {
    background: #ff4d6d;
    color: #fff;
}

.toast-info {
    background: #4884ff;
    color: #fff;
}

/* Мобильная навигация */
.mobile-bottom-nav,
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: rgba(12, 17, 28, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
    gap: 2px;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 12px;
    color: #7a8faa;
    text-decoration: none;
    font-size: 0.6rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    min-width: 0;
}

.mobile-nav-item i {
    font-size: 1.1rem;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: #fff;
    background: rgba(72, 132, 255, 0.12);
}

.mobile-menu-toggle.active {
    color: #4884ff;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
}

.sidebar-overlay.show {
    display: block;
}

.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

@media (max-width: 1100px) {
    .left-sidebar { width: 220px; min-width: 220px; }
    .right-sidebar { width: 240px; min-width: 240px; }
    .center-content { padding: 16px; }
}

@media (max-width: 1024px) {
    .left-sidebar,
    .right-sidebar {
        display: none;
    }

    .left-sidebar.mobile-open {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(86vw, 300px);
        height: 100vh;
        height: 100dvh;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 400;
    }

    .mobile-bottom-nav,
    .mobile-nav {
        display: flex;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }

    .main-layout {
        max-width: 100%;
        min-height: 100dvh;
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
        gap: 0;
    }

    .center-content {
        max-width: 100%;
        width: 100%;
        padding: 10px 12px;
        padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
        gap: 12px;
    }

    /* Первый экран: без тяжёлых рамок/стекла */
    .center-content > .top-bar,
    .center-content > .page-title,
    .center-content > .greeting {
        margin: 0;
    }

    .center-content > .glass-panel,
    .center-content > .balance-banner,
    .center-content > .challenge-info,
    .center-content > .train-hero,
    .center-content > .featured-tournament,
    .center-content > .inv-page-header {
        border-radius: 14px;
        border-width: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(255, 255, 255, 0.03);
        padding: 12px 14px;
    }

    .sidebar-section {
        border-radius: 14px;
        padding: 12px;
    }

    .toast {
        bottom: calc(78px + env(safe-area-inset-bottom));
        left: 12px;
        right: 12px;
        width: auto;
        transform: none;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .greeting { font-size: 1.2rem; letter-spacing: -0.3px; }
    .page-title { font-size: 1.15rem; }
    .currency-row {
        width: 100%;
        gap: 6px;
    }
    .currency-pill {
        flex: 1;
        justify-content: center;
        font-size: 0.72rem;
        padding: 6px 8px;
        border-radius: 10px;
        min-width: 0;
    }
    .btn {
        min-height: 42px;
    }
    .modal-card {
        border-radius: 16px;
        padding: 16px;
        max-height: 88dvh;
    }
}

/* === Shared UI polish === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: 0.25s;
    padding: 16px;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-card {
    background: rgba(16,22,38,0.95);
    border: 0.5px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
}
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.inventory-item {
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    position: relative;
}
.inv-icon { font-size: 1.8rem; margin-bottom: 6px; }
.inv-name { font-size: 0.75rem; font-weight: 500; }
.inv-stats, .inv-slot { font-size: 0.65rem; opacity: 0.6; margin: 4px 0; }
.inv-qty {
    position: absolute;
    top: 6px;
    right: 8px;
    background: #4884ff;
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 8px;
}
.btn-sm { padding: 6px 12px; font-size: 0.72rem; border-radius: 10px; }
.btn-equip {
    margin-top: 8px;
    width: 100%;
    background: rgba(72,132,255,0.2);
    border: 0.5px solid rgba(72,132,255,0.4);
    color: #fff;
    cursor: pointer;
}

.quests-count {
    margin-left: auto;
    background: rgba(72,132,255,0.2);
    color: #8eb4ff;
    font-size: 0.65rem;
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 600;
}
.quests-all-done {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #3acf6b;
    padding: 4px 0;
}
.quests-panel .daily-quest-row { padding: 7px 0; }
.quests-panel .quest-row-top { font-size: 0.74rem; margin-bottom: 4px; }
.quests-panel .quest-reward {
    font-size: 0.65rem;
    padding: 1px 6px;
}
.quests-panel .quest-progress-wrap { height: 3px; margin-bottom: 4px; }
.quests-panel .quest-row-bottom { font-size: 0.65rem; }
.quests-panel .btn-quest-claim { padding: 3px 9px; font-size: 0.65rem; }

.product-img-file {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 10px;
}

/* Daily quests — улучшенный блок */
.sidebar-section:has(.daily-quest-row),
.quests-panel {
    background: linear-gradient(160deg, rgba(72, 132, 255, 0.06), rgba(255, 77, 109, 0.04));
    border: 0.5px solid rgba(72, 132, 255, 0.18) !important;
}
.daily-quest-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.daily-quest-row:last-child { border-bottom: none; }
.quest-row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    margin-bottom: 6px;
}
.quest-title {
    font-weight: 400;
    color: #e8ecf2;
    line-height: 1.3;
}
.quest-title.quest-done { text-decoration: line-through; opacity: 0.45; }
.quest-reward {
    color: #c4b5fd;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(168, 85, 247, 0.12);
    border: 0.5px solid rgba(168, 85, 247, 0.25);
    padding: 2px 8px;
    border-radius: 10px;
}
.quest-progress-wrap {
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    height: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}
.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4884ff, #a855f7);
    border-radius: 6px;
    transition: width 0.4s ease;
}
.quest-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    gap: 8px;
}
.quest-progress-text {
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
}
.btn-quest-claim {
    background: linear-gradient(135deg, rgba(58,207,107,0.25), rgba(58,207,107,0.1));
    border: 0.5px solid rgba(58,207,107,0.5);
    color: #3acf6b;
    border-radius: 10px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.btn-quest-claim:hover {
    background: rgba(58,207,107,0.3);
    transform: translateY(-1px);
}
.quest-claimed {
    color: #3acf6b;
    font-size: 0.68rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

/* Right sidebar extras */
.rs-quick .rs-energy {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 6px;
}
.rs-energy-bar {
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}
.rs-energy-bar > div {
    height: 100%;
    background: linear-gradient(90deg, #ffb347, #ff4d6d);
    border-radius: 6px;
}
.rs-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rs-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 0.5px solid rgba(255,255,255,0.08);
    color: #c8d4e8;
    text-decoration: none;
    font-size: 0.72rem;
    transition: 0.2s;
    position: relative;
}
.rs-chip:hover {
    background: rgba(72,132,255,0.12);
    border-color: rgba(72,132,255,0.35);
    color: #fff;
}
.rs-badge {
    background: #ff4d6d;
    color: #fff;
    border-radius: 8px;
    font-size: 0.6rem;
    padding: 1px 5px;
    font-weight: 600;
}

.battle-live-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 77, 109, 0.25), rgba(72, 132, 255, 0.2));
    border: 1px solid rgba(255, 77, 109, 0.45);
    box-shadow: 0 0 24px rgba(255, 77, 109, 0.15);
    transition: 0.2s;
}
.battle-live-banner:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 77, 109, 0.7);
}
.battle-live-banner strong { display: block; font-size: 0.85rem; font-weight: 600; }
.battle-live-banner span { font-size: 0.7rem; opacity: 0.75; }
.battle-live-banner > i { margin-left: auto; opacity: 0.7; }
.battle-live-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4d6d;
    box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6);
    animation: livePulse 1.4s infinite;
    flex-shrink: 0;
}
@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(255, 77, 109, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); }
}

.rs-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.75rem;
}
.rs-stats > div {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
}
.rs-stats span { opacity: 0.55; }
.top-player { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.8rem; }
.top-avatar { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.top-avatar img, .user-avatar-img.avatar-xs {
    width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
}
.user-avatar-img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}
.item-icon-img {
    width: 36px; height: 36px; object-fit: contain; border-radius: 8px;
}
.item-icon-wrap { display: inline-flex; align-items: center; justify-content: center; }
.equip-slot .item-icon-img,
.equip-slot-icon .item-icon-img {
    width: 32px;
    height: 32px;
}
.doll-slot .item-icon-img {
    width: 40px;
    height: 40px;
}

/* Arena extras */
.rating-up { color: #3acf6b !important; font-weight: 600; }
.rating-down { color: #ff4d6d !important; font-weight: 600; }
.energy-warning { border: 1px solid rgba(255,77,109,0.4); border-radius: 16px; padding: 4px 10px; }
.energy-alert {
    background: rgba(255,77,109,0.1);
    border: 0.5px solid rgba(255,77,109,0.3);
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #ff8c9a;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.energy-bar .btn-buy-energy {
    min-height: 28px;
    padding: 0 10px;
    margin-left: 4px;
}
.found-opponent-card {
    background: rgba(58,207,107,0.08);
    border: 0.5px solid rgba(58,207,107,0.25);
    border-radius: 20px;
    padding: 14px;
    margin: 12px 0;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}
.found-opp-inner { display: flex; align-items: center; gap: 12px; text-align: left; }
.found-opp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(58,207,107,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #3acf6b;
}
.found-opp-info { display: flex; flex-direction: column; gap: 2px; font-size: 0.78rem; }
.live-battle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.live-row-anim { animation: livePulse 3s ease-in-out infinite; }
@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}
.live-dot {
    width: 8px;
    height: 8px;
    background: #ff4d6d;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.2s infinite;
    margin-right: 4px;
}

/* Shop */
.gold-display {
    background: linear-gradient(135deg, rgba(255,179,71,0.15), rgba(255,140,66,0.08));
    border: 0.5px solid rgba(255,179,71,0.35);
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    color: #ffb347;
    font-size: 0.95rem;
}
.shop-top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shop-toolbar { margin-bottom: 4px; }
.deal-countdown { font-size: 0.75rem; color: #ff4d6d; margin: 6px 0; font-weight: 500; }

/* Training */
.active-mode-badge {
    background: rgba(255,77,109,0.1);
    border: 0.5px solid rgba(255,77,109,0.3);
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.coach-tip-block {
    background: rgba(72,132,255,0.06);
    border: 0.5px solid rgba(72,132,255,0.15);
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.coach-tip-block i { color: #ffb347; }
.btn-tip-refresh {
    margin-left: auto;
    background: none;
    border: none;
    color: #4884ff;
    cursor: pointer;
    opacity: 0.7;
}
.mode-card.active { border-color: rgba(72,132,255,0.6); box-shadow: 0 0 20px rgba(72,132,255,0.15); }

/* Tournament */
.my-tournament-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.my-stat-card {
    background: rgba(255,255,255,0.03);
    border: 0.5px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
}
.my-stat-val { display: block; font-weight: 600; font-size: 1rem; color: #ffb347; }
.my-stat-label { font-size: 0.65rem; opacity: 0.6; }
.prize-pool-visual {
    display: flex;
    height: 28px;
    border-radius: 12px;
    overflow: hidden;
    margin: 12px auto;
    max-width: 400px;
    font-size: 0.6rem;
}
.prize-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}
.prize-bar-1 { background: linear-gradient(135deg, #ffb347, #ff8c42); }
.prize-bar-2 { background: linear-gradient(135deg, #c0c0c0, #a8a8a8); }
.prize-bar-3 { background: linear-gradient(135deg, #cd7f32, #b87333); }
.prize-bar-rest { background: rgba(255,255,255,0.15); color: #fff; font-size: 0.55rem; }
.btn-register.registered, .btn-tour-register.registered {
    opacity: 0.7;
    background: rgba(58,207,107,0.15) !important;
    border-color: rgba(58,207,107,0.3) !important;
    color: #3acf6b !important;
}
.bracket-empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.7;
}
.bracket-empty i { font-size: 2.5rem; margin-bottom: 12px; display: block; color: #4884ff; }

.challenges-page { /* page hook */ }

.user-avatar-img,
.profile-avatar-img,
.fighter-avatar-img,
.battle-avatar-img,
.top-player-img,
.doll-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(72, 132, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.2rem;
    color: #4884ff;
    flex-shrink: 0;
}

.fighter-avatar-large {
    overflow: hidden;
}

.fighter-avatar-large .user-avatar-img,
.fighter-avatar-img {
    border-radius: 50%;
}

.top-player {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-player-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    background: rgba(72, 132, 255, 0.12);
    flex-shrink: 0;
}

.item-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.item-icon-img,
.product-img-file {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-img .product-img-file {
    width: 64px;
    height: 64px;
}

.equip-slot-icon .item-icon-img {
    width: 24px;
    height: 24px;
}

/* Energy shop */
.energy-shop-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.energy-shop-modal.hidden { display: none !important; }
.energy-shop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}
.energy-shop-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: rgba(14, 18, 32, 0.97);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    padding: 22px 20px 18px;
}
.energy-shop-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
}
.energy-shop-card h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.energy-shop-card h2 i { color: #ffb347; }
.energy-shop-sub { font-size: 0.82rem; opacity: 0.6; margin: 0 0 14px; }
.energy-shop-status {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 14px;
    font-size: 0.88rem;
    font-weight: 500;
}
.energy-shop-status .fa-bolt { color: #ffb347; }
.energy-shop-status .fa-gem { color: #7eb6ff; }
.energy-shop-packs { display: grid; gap: 10px; }
.eshop-pack {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    grid-template-areas: "icon label price" "icon amount price" "icon hint price";
    gap: 2px 12px;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
    border-radius: 14px;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #e8ecf2;
    cursor: pointer;
    font: inherit;
}
.eshop-pack:hover:not(:disabled) {
    border-color: rgba(72, 132, 255, 0.45);
    background: rgba(72, 132, 255, 0.1);
}
.eshop-pack:disabled { opacity: 0.45; cursor: not-allowed; }
.eshop-icon {
    grid-area: icon;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 179, 71, 0.12);
    color: #ffb347;
}
.eshop-label { grid-area: label; font-weight: 600; font-size: 0.92rem; }
.eshop-amount { grid-area: amount; font-size: 0.8rem; color: #ffb347; }
.eshop-hint { grid-area: hint; font-size: 0.68rem; opacity: 0.5; }
.eshop-price {
    grid-area: price;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(72, 132, 255, 0.15);
    border: 0.5px solid rgba(72, 132, 255, 0.35);
    font-weight: 600;
}
.eshop-price i { color: #7eb6ff; }
.eshop-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 77, 109, 0.2);
    color: #ff8fa3;
}
.energy-shop-full { text-align: center; padding: 18px; color: #3acf6b; }
.btn-buy-energy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 0.5px solid rgba(72, 132, 255, 0.4);
    background: rgba(72, 132, 255, 0.12);
    color: #d6e4ff;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}
.btn-buy-energy--sm { margin-top: 8px; width: 100%; }
.btn-buy-energy:hover { background: rgba(72, 132, 255, 0.22); color: #fff; }

@media (max-width: 600px) {
    .my-tournament-stats { grid-template-columns: repeat(2, 1fr); }
    .recent-battle-row { grid-template-columns: 1fr 1fr; }
}
