/* Base Arena — premium gold/amber style for all windows (onboarding, main game, battle modal). */

/* ----- Onboarding: same premium window style ----- */
.screen-onboarding {
    max-width: 520px;
    margin: 0 auto;
}

.screen-onboarding .onboard-header {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.screen-onboarding .onboard-header::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #d97706 50%, #b45309 75%, #fbbf24 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mg-borderRotate 3s linear infinite;
    pointer-events: none;
}

.screen-onboarding .onboard-step {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.screen-onboarding .onboard-step::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #d97706 50%, #b45309 75%, #fbbf24 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mg-borderRotate 3s linear infinite;
    pointer-events: none;
}

.screen-onboarding .onboard-step h2 {
    color: #fbbf24;
    font-weight: 600;
}

.screen-onboarding .input-name {
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(15, 23, 42, 0.6);
}

.screen-onboarding .input-name:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.screen-onboarding .avatar-card.selected {
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3);
}

.screen-onboarding .wallet-btn:hover {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}

.screen-onboarding .onboard-wallet {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
}

.screen-onboarding .training-result,
.screen-onboarding .step3-heal {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.08);
}

@keyframes mg-borderRotate {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes mg-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----- Main game: tabs ----- */
#mainGame .main-tabs.tab-navigation {
    display: flex;
    justify-content: center;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    border-radius: 20px;
    padding: 10px;
    margin: 20px 0;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    position: relative;
}

#mainGame .main-tabs.tab-navigation::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #d97706 50%, #b45309 75%, #fbbf24 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mg-borderRotate 3s linear infinite;
    pointer-events: none;
}

/* Градиент текста: светлый → золотой (вкладки и имя бойца) */
#mainGame .main-tabs .tab {
    position: relative;
    z-index: 1;
    border: none;
    padding: 15px 30px;
    margin: 0 5px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.35)) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#mainGame .main-tabs .tab.active {
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.4);
    filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

#mainGame .main-tabs .tab:hover:not(.active) {
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
    filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.45)) drop-shadow(0 2px 5px rgba(0,0,0,0.35));
}

#mainGame .tab-panel {
    animation: mg-fadeIn 0.35s ease-out;
}

/* ----- Main game: header (same frame style as Info/Character/Inventory) ----- */
#mainGame .main-header {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

#mainGame .main-header::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 3px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #d97706 50%, #b45309 75%, #fbbf24 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mg-borderRotate 3s linear infinite;
    pointer-events: none;
}

#mainGame .main-header .main-brand,
#mainGame .main-header .main-wallet,
#mainGame .main-header .main-wallet-connect {
    position: relative;
    z-index: 1;
}

#mainGame .main-header .main-brand {
    gap: 14px;
}

/* Название игры в шапке: +20% размер, общий градиент светлый → золотой */
#mainGame .main-header .main-brand span {
    font-size: 1.92rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* Лого в шапке: +20% */
#mainGame .main-header .main-logo {
    width: clamp(58px, 9.6vw, 77px);
    height: auto;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.45)) drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}

#mainGame .main-wallet,
#mainGame .main-wallet-connect {
    padding: 0.5rem 1rem;
    background: rgba(251, 191, 36, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* ----- Character: 3-column layout ----- */
#mainGame .panel-character.character-layout {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
}

#mainGame .character-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    min-height: 60vh;
    align-items: start;
}

#mainGame .character-stats,
#mainGame .character-avatar,
#mainGame .character-inventory {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    border-radius: 20px;
    padding: 16px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

/* Все заголовки блоков/меню: единый градиент светлый → золотой */
#mainGame .panel-block-title,
#mainGame .battle-leagues h2,
#mainGame .battle-active h2,
#mainGame .leaderboard-hero,
#mainGame .league-block-title,
#mainGame .stats-block h4,
#mainGame .chests-section h4,
#mainGame .train-block h4,
#mainGame .bar-block h4,
#mainGame .equip-bonuses h5,
#battleModal h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
#mainGame .stats-block h4,
#mainGame .chests-section h4,
#mainGame .train-block h4,
#mainGame .bar-block h4 {
    font-size: 1.15rem;
}
#mainGame .equip-bonuses h5 {
    font-size: 1.05rem;
}

#mainGame .panel-block-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 12px 0;
    padding: 0;
    text-align: center;
    flex-shrink: 0;
}

#mainGame .panel-block-title i {
    font-size: 1.15rem;
    opacity: 1;
}

#mainGame .character-stats::before,
#mainGame .character-avatar::before,
#mainGame .character-inventory::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 3px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #d97706 50%, #b45309 75%, #fbbf24 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mg-borderRotate 3s linear infinite;
    pointer-events: none;
}

/* --- Left column: 3 sub-blocks (equal height) --- */
#mainGame .character-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

#mainGame .character-stats .stats-block {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#mainGame .character-stats .info-block {
    flex: 0 0 auto;
}

#mainGame .character-stats .base-stats-block,
#mainGame .character-stats .calc-stats-block {
    flex: 1;
    min-height: 100px;
}

#mainGame .stats-block {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

#mainGame .stats-block h4 {
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

#mainGame .stats-block h4 .stat-points {
    color: #48bb78;
    font-size: 0.8rem;
    margin-left: auto;
}

#mainGame .stat-points-desc {
    color: #a0aec0;
    font-size: 0.8rem;
    margin: 0 0 8px 0;
}

/* Info block — компактный */
#mainGame .info-block {
    padding: 10px 12px;
}

#mainGame .info-block h4 {
    margin-bottom: 6px;
}

#mainGame .info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

#mainGame .avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(251, 191, 36, 0.6);
    flex-shrink: 0;
}

#mainGame .info-text {
    flex: 1;
}

#mainGame .char-name-small {
    font-weight: 600;
    font-size: 0.95rem;
    color: #e2e8f0;
}

/* Имя бойца (Your Fighter): градиент светлый → золотой, крупный текст с тенью */
#mainGame #charName {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    margin: 0.5rem 0 0;
}

#mainGame .info-stats {
    font-size: 0.8rem;
    color: #a0aec0;
    display: flex;
    gap: 12px;
}

#mainGame .info-wld {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(251, 191, 36, 0.15);
}

#mainGame .wld .label {
    display: block;
    font-size: 0.7rem;
    color: #718096;
}

#mainGame .wld .val {
    font-weight: 700;
    font-size: 1rem;
}

#mainGame .wld .val.green { color: #48bb78; }
#mainGame .wld .val.gray { color: #a0aec0; }
#mainGame .wld .val.red { color: #f56565; }

/* Base stats block */
#mainGame .base-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#mainGame .base-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(251, 191, 36, 0.06);
    border-radius: 8px;
    font-size: 0.85rem;
}

#mainGame .base-stat .stat-name {
    flex: 1;
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}
#mainGame .base-stat .stat-name:hover {
    background: rgba(251, 191, 36, 0.15);
}
#mainGame .stat-tooltip {
    position: fixed;
    z-index: 10000;
    display: none;
    max-width: 260px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    pointer-events: none;
    font-size: 0.85rem;
    line-height: 1.4;
}
#mainGame .stat-tooltip.visible {
    display: block;
}
#mainGame .stat-tooltip .stat-tooltip-title {
    display: block;
    font-weight: 700;
    color: #fef3c7;
    margin-bottom: 4px;
}
#mainGame .stat-tooltip .stat-tooltip-text {
    color: #a0aec0;
}

#mainGame .stat-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

#mainGame .stat-minus,
#mainGame .stat-plus {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    line-height: 1;
    padding: 0;
}

#mainGame .stat-plus {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: #fff;
}

#mainGame .stat-plus:hover {
    transform: scale(1.08);
    box-shadow: 0 0 10px rgba(72, 187, 120, 0.4);
}

#mainGame .stat-minus {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    color: #e2e8f0;
}

#mainGame .stat-minus:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 0 8px rgba(160, 174, 192, 0.4);
}

#mainGame .stat-minus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#mainGame .stats-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

#mainGame .stats-actions .btn {
    flex: 1;
    min-width: 90px;
    font-size: 0.8rem;
    padding: 8px 12px;
}

/* Combat Stats — одна колонка, ровные строки */
#mainGame .calc-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#mainGame .calc-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(159, 122, 234, 0.1);
    border-radius: 8px;
    font-size: 0.85rem;
    min-height: 32px;
}

#mainGame .calc-stat span:first-child {
    color: #a0aec0;
}

#mainGame .calc-stat span:last-child {
    font-weight: 600;
    color: #f6ad55;
    min-width: 4em;
    text-align: right;
}

/* --- Center column: Avatar + Equipment --- */
#mainGame .character-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    text-align: center;
}

#mainGame .equip-grid {
    display: grid;
    grid-template-areas:
        "top-left top-right"
        "avatar avatar"
        "bot-left bot-right";
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 16px;
    align-items: center;
    justify-items: center;
    width: 100%;
    max-width: 340px;
}

#mainGame .equip-slot {
    width: 77px;
    height: 77px;
    border-radius: 12px;
    background: rgba(26, 32, 44, 0.8);
    border: 2px solid rgba(251, 191, 36, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.08rem; /* +30% от 1.6rem — иконки одетых вещей крупнее */
    color: #718096;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

#mainGame .equip-slot:hover {
    border-color: #fbbf24;
    transform: scale(1.05);
}

#mainGame .equip-slot .equip-slot-icon {
    font-size: 2.08rem; /* +30% — иконка оружия (⚔) как у остальных слотов */
    line-height: 1;
    color: inherit;
}

#mainGame .equip-slot.top-left { grid-area: top-left; }
#mainGame .equip-slot.top-right { grid-area: top-right; }
#mainGame .equip-slot.bot-left { grid-area: bot-left; }
#mainGame .equip-slot.bot-right { grid-area: bot-right; }

#mainGame .avatar-center {
    grid-area: avatar;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#mainGame .avatar-ring {
    width: 156px;
    height: 156px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706, #b45309, #fbbf24);
    background-size: 200% 200%;
    animation: mg-borderRotate 3s linear infinite;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.4);
}

#mainGame .avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

#mainGame .avatar-center h2 {
    margin: 8px 0 0 0;
    font-size: 1rem;
    color: #e2e8f0;
}

.character-hp-bar-container {
    width: 100%;
    max-width: 200px;
    margin-top: 12px;
    position: relative;
}

.character-hp-bar-wrapper {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.character-hp-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f97316 50%, #fbbf24 100%);
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.character-hp-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: hp-shine 2s infinite;
}

@keyframes hp-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.character-hp-text {
    margin-top: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fbbf24;
    text-align: center;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.character-hp-plus {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 800;
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    opacity: 0;
    pointer-events: none;
    animation: hp-plus-fade 1.5s ease-out;
}

@keyframes hp-plus-fade {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(-8px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-24px);
    }
}

.character-hp-plus.show {
    animation: hp-plus-fade 1.5s ease-out;
}

#mainGame .equip-bonuses {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 10px;
    padding: 10px 14px;
    width: 100%;
    max-width: 320px;
    border: 1px solid rgba(72, 187, 120, 0.2);
}

#mainGame .equip-bonuses h5 {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
}

#mainGame .bonus-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 2px 0;
    color: #a0aec0;
}

#mainGame .bonus-row span:last-child {
    color: #68d391;
    font-weight: 600;
}

/* --- Right column: Inventory --- */
#mainGame .character-inventory {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#mainGame .character-inventory .panel-block-title {
    margin-bottom: 12px;
}

#mainGame .inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

#mainGame .inv-slot {
    aspect-ratio: 1;
    border-radius: 10px;
    background: rgba(26, 32, 44, 0.8);
    border: 2px solid rgba(251, 191, 36, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

#mainGame .inv-slot:hover {
    border-color: #fbbf24;
    transform: scale(1.03);
}

#mainGame .inv-slot.empty {
    color: #4a5568;
}

#mainGame .inv-slot.inv-slot-level-locked {
    opacity: 0.75;
    border-color: rgba(239, 68, 68, 0.4);
}

#mainGame .inv-slot.inv-slot-level-locked:hover {
    border-color: rgba(239, 68, 68, 0.7);
}

#mainGame .chests-section {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(246, 173, 85, 0.2);
}

#mainGame .chests-section h4 {
    margin: 0 0 8px 0;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

#mainGame .chest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
}

#mainGame .chest-row:last-child {
    border-bottom: none;
}

#mainGame .chest-row .chest-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
#mainGame .chest-row .chest-open-btn.btn-sm,
#mainGame .chest-row .chest-open-btn {
    font-size: 0.49rem !important;
    padding: 3px 7px !important;
    white-space: nowrap;
    line-height: 1.2;
}
#mainGame .chest-row .btn {
    font-size: 0.7rem;
    padding: 4px 8px;
}

#mainGame .inventory-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

#mainGame .chests-section .chest-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.35));
}

#mainGame .chests-section .chest-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

#mainGame .chests-section .chest-icon-fallback {
    display: none;
    font-size: 1.1rem;
}

#mainGame .chests-section .chest-icon-fallback.show {
    display: inline;
}

#mainGame .chests-section .chest-count {
    font-weight: 700;
    min-width: 1.5em;
    text-align: right;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

#mainGame .arna-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(26, 32, 44, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

#mainGame .arna-section .arna-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

#mainGame .arna-section .arna-icon-fallback {
    display: none;
    font-size: 1.3rem;
}

#mainGame .arna-section .arna-icon-fallback.show {
    display: inline;
}

#mainGame .arna-section .arna-label {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

#mainGame .arna-section .arna-balance {
    margin-left: auto;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

#mainGame .char-actions-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

#mainGame .char-actions-mini .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 6px 8px;
    min-width: 70px;
}

#mainGame .btn-sm {
    font-size: 0.8rem;
    padding: 6px 12px;
}

#mainGame .char-stats .stat {
    background: rgba(251, 191, 36, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

#mainGame .char-stats .stat .label {
    display: block;
    color: #718096;
    font-size: 0.75rem;
}

#mainGame .char-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#mainGame .char-actions .btn {
    width: 100%;
    justify-content: center;
}

/* ----- Fight: battle layout ----- */
#mainGame .panel-fight.battle-layout {
    background: transparent;
    border: none;
    padding: 0;
}

#mainGame .battle-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

#mainGame .battle-leagues,
#mainGame .battle-active {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    border-radius: 20px;
    padding: 20px 20px 24px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

#mainGame .battle-leagues::before,
#mainGame .battle-active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 3px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #d97706 50%, #b45309 75%, #fbbf24 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mg-borderRotate 3s linear infinite;
    pointer-events: none;
}

#mainGame .battle-leagues h2,
#mainGame .battle-active h2 {
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    font-weight: 800;
    letter-spacing: 0.02em;
}

#mainGame .leagues-hint {
    color: #718096;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

#mainGame .leagues-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: stretch;
}

#mainGame .league-card {
    background: rgba(26, 32, 44, 0.85);
    border-radius: 15px;
    padding: 14px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 172px;
}

#mainGame .league-card.league-divine {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 80px;
    padding: 16px 20px;
    box-shadow: 0 0 30px rgba(221, 160, 221, 0.25);
}

#mainGame .league-card.league-divine h3 {
    font-size: 1.05rem;
    margin: 0;
    text-shadow: 0 0 12px rgba(221, 160, 221, 0.6);
}

#mainGame .league-card.league-divine .stake,
#mainGame .league-card.league-divine .req {
    margin: 0;
}

#mainGame .league-card.league-divine .btn-fight {
    margin-top: 0;
    margin-left: auto;
}

#mainGame .league-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 15px;
    padding: 2px;
    pointer-events: none;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

#mainGame .league-card.bronze::before {
    background: linear-gradient(135deg, #cd7f32, #f4a460, #cd7f32);
    background-size: 200% 200%;
    animation: mg-borderRotate 3s linear infinite;
}
#mainGame .league-card.silver::before {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8, #c0c0c0);
    background-size: 200% 200%;
    animation: mg-borderRotate 3s linear infinite;
}
#mainGame .league-card.gold::before {
    background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700);
    background-size: 200% 200%;
    animation: mg-borderRotate 3s linear infinite;
}
#mainGame .league-card.diamond::before {
    background: linear-gradient(135deg, #b9f2ff, #e0f7ff, #b9f2ff);
    background-size: 200% 200%;
    animation: mg-borderRotate 3s linear infinite;
}
#mainGame .league-card.divine::before {
    background: linear-gradient(135deg, #dda0dd, #f0e6f0, #dda0dd);
    background-size: 200% 200%;
    animation: mg-borderRotate 3s linear infinite;
}

#mainGame .league-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

#mainGame .league-card.league-divine:hover {
    transform: translateY(-3px);
}

#mainGame .league-card h3 {
    margin-bottom: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.4em;
}
#mainGame .league-card .stake { color: #e2e8f0; font-size: 0.8rem; margin-bottom: 2px; line-height: 1.3; }
#mainGame .league-card .per-player { color: #718096; font-size: 0.7rem; }
#mainGame .league-card .req { color: #48bb78; font-size: 0.75rem; margin-bottom: 10px; line-height: 1.3; }
#mainGame .league-card p { color: #a0aec0; font-size: 0.85rem; margin-bottom: 6px; }

/* Кнопка Enter внизу карточки на одном уровне во всех лигах; подсветка для доступной лиги */
#mainGame .league-card .btn-fight {
    margin-top: auto;
    opacity: 0.6;
    filter: grayscale(0.3);
    transition: opacity 0.25s, filter 0.25s, box-shadow 0.25s;
}
#mainGame .league-card.league-available .btn-fight {
    opacity: 1;
    filter: none;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

#mainGame .fight-extra-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 16px;
    margin-top: 16px;
    align-items: stretch;
}

#mainGame .train-block,
#mainGame .bar-block {
    background: rgba(26, 32, 44, 0.8);
    border-radius: 12px;
    padding: 14px 18px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#mainGame .train-block h4,
#mainGame .bar-block h4 {
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    font-weight: 800;
    letter-spacing: 0.02em;
}

#mainGame .bar-lobby,
#mainGame .bar-active {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    width: 100%;
    text-align: left;
}
#mainGame .bar-lobby-title { margin: 0 0 6px 0; font-size: 0.85rem; color: #e2e8f0; }
#mainGame .bar-lobby ul { margin: 0; padding-left: 18px; font-size: 0.8rem; color: #a0aec0; }
#mainGame .bar-active p { margin: 0 0 8px 0; font-size: 0.85rem; color: #e2e8f0; }

#mainGame .train-desc,
#mainGame .bar-desc {
    color: #a0aec0;
    font-size: 0.8rem;
    margin: 0 0 12px 0;
    line-height: 1.35;
    flex: 1;
    min-height: 2.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#mainGame .train-block .btn,
#mainGame .bar-block .btn {
    width: 100%;
    max-width: 160px;
    justify-content: center;
}

#mainGame .fighter-info-compact {
    background: rgba(26, 32, 44, 0.7);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Your fighter (Fight tab): градиент светлый → золотой, как у заголовков блоков */
#mainGame .fighter-info-compact h4 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.45)) drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

#mainGame .fighter-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 0.85rem;
    color: #e2e8f0;
    margin-bottom: 8px;
}

#mainGame .fighter-stats-row span {
    font-weight: 600;
}

#mainGame .battles-list {
    background: rgba(26, 32, 44, 0.5);
    border-radius: 12px;
    padding: 1rem;
    min-height: 120px;
}

#mainGame .battle-item {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

/* ----- Leaderboard: завораживающий вид, топ 5 по лигам, награды ----- */
#mainGame .leaderboard-layout {
    background: linear-gradient(165deg, #0f172a 0%, #1e293b 35%, #0f172a 100%);
    border-radius: 24px;
    padding: 28px 24px 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0,0,0,0.6), 0 0 60px rgba(251, 191, 36, 0.08);
}

#mainGame .leaderboard-layout::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 3px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 20%, #d97706 40%, #b45309 60%, #fbbf24 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mg-borderRotate 4s linear infinite;
    pointer-events: none;
    opacity: 0.95;
}

/* Все надписи Leaderboard: градиент светлый → золотой (переопределяем style.css .panel-leaderboard h2) */
#mainGame .leaderboard-hero,
#mainGame .panel-leaderboard h2 {
    font-size: 1.5rem;
    margin: 0 0 6px 0;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

#mainGame .leaderboard-tagline {
    font-size: 0.9rem;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.4));
}

#mainGame .season-countdown {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.15);
    background-clip: padding-box;
    color: #fcd34d;
}
#mainGame .season-countdown strong {
    color: #f59e0b;
    font-weight: 800;
}
#mainGame .season-countdown.season-ended { background: rgba(100, 116, 139, 0.2); border-color: rgba(148, 163, 184, 0.3); color: #cbd5e1; }

#mainGame .leaderboard-leagues {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#mainGame .league-block {
    border-radius: 16px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.3);
}

#mainGame .league-block.bronze { background: linear-gradient(135deg, rgba(205, 127, 50, 0.12) 0%, rgba(26, 32, 44, 0.9) 100%); border-color: rgba(205, 127, 50, 0.3); }
#mainGame .league-block.silver { background: linear-gradient(135deg, rgba(192, 192, 192, 0.12) 0%, rgba(26, 32, 44, 0.9) 100%); border-color: rgba(192, 192, 192, 0.35); }
#mainGame .league-block.gold { background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(26, 32, 44, 0.9) 100%); border-color: rgba(255, 215, 0, 0.35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 30px rgba(255, 215, 0, 0.1); }
#mainGame .league-block.diamond { background: linear-gradient(135deg, rgba(185, 242, 255, 0.1) 0%, rgba(26, 32, 44, 0.9) 100%); border-color: rgba(185, 242, 255, 0.4); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 25px rgba(185, 242, 255, 0.08); }
#mainGame .league-block.divine { background: linear-gradient(135deg, rgba(221, 160, 221, 0.15) 0%, rgba(30, 41, 59, 0.95) 100%); border-color: rgba(221, 160, 221, 0.5); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 40px rgba(221, 160, 221, 0.2); }

#mainGame .league-block-title {
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5)) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    font-weight: 800;
    letter-spacing: 0.02em;
}

#mainGame .league-pool {
    font-size: 0.95rem;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.4));
}

#mainGame .league-pool .pool-arna {
    font-weight: 800;
    font-size: 1.05rem;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

#mainGame .league-pool .pool-eth {
    font-weight: 700;
    margin-left: 6px;
    background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 50%, #10b981 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

#mainGame .league-pool.divine-pool .pool-eth {
    font-weight: 700;
    margin-left: 6px;
    background: linear-gradient(135deg, #e9d5ff 0%, #c4b5fd 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

#mainGame .league-payouts {
    font-size: 0.75rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.35));
}

#mainGame .league-table {
    border-radius: 10px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255,255,255,0.06);
}

#mainGame .league-table-header {
    display: grid;
    grid-template-columns: 36px 1fr 52px 1fr;
    gap: 8px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 0.8rem;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
}
#mainGame .league-table-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    z-index: -1;
}

#mainGame .league-row {
    display: grid;
    grid-template-columns: 36px 1fr 52px 1fr;
    gap: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    align-items: center;
    transition: background 0.2s;
}

#mainGame .league-row:last-child { border-bottom: none; }
#mainGame .league-row:hover { background: rgba(255,255,255,0.03); }
#mainGame .league-row.empty { color: #64748b; }
#mainGame .league-row .leaderboard-wallet {
    font-size: 0.8em; opacity: 0.85; font-weight: 500;
}
#mainGame .league-row.current-user {
    background: rgba(251, 191, 36, 0.12);
    color: #fef3c7;
    font-weight: 600;
}

#mainGame .league-row[data-rank="1"] .rank { color: #fbbf24; font-weight: 800; }
#mainGame .league-block.divine .league-row[data-rank="1"] .rank { color: #dda0dd; text-shadow: 0 0 8px rgba(221, 160, 221, 0.5); }
#mainGame .league-row .reward { font-weight: 600; color: #86efac; font-size: 0.8rem; }
#mainGame .league-block.divine .league-row[data-rank="1"] .reward { color: #a78bfa; }

#mainGame .leaderboard-footer {
    margin-top: 20px;
    font-size: 0.8rem;
    text-align: center;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.35));
}

/* ----- Buttons inside main game ----- */
#mainGame .btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    box-shadow: 0 5px 20px rgba(251, 191, 36, 0.35);
}
#mainGame .btn-primary:hover:not(:disabled) {
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.5);
}
#mainGame .btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    box-shadow: 0 5px 20px rgba(72, 187, 120, 0.35);
}
#mainGame .btn-success:hover:not(:disabled) {
    box-shadow: 0 10px 30px rgba(72, 187, 120, 0.5);
}
#mainGame .btn-secondary {
    background: linear-gradient(135deg, #718096, #4a5568);
}
#mainGame .btn-fight {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    box-shadow: 0 5px 20px rgba(245, 101, 101, 0.35);
}
#mainGame .btn-fight:hover:not(:disabled) {
    box-shadow: 0 10px 30px rgba(245, 101, 101, 0.5);
}

/* ----- Battle modal: premium arena (training + PvP) ----- */
#battleModal {
    background: radial-gradient(ellipse at center, rgba(20, 25, 35, 0.95) 0%, rgba(0, 0, 0, 0.92) 100%);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

#battleModal .modal-content.battle-arena {
    background: linear-gradient(165deg, #1e293b 0%, #0f172a 40%, #1e293b 100%);
    border-radius: 28px;
    padding: 32px;
    width: 100%;
    max-width: 560px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15), 0 25px 60px rgba(0,0,0,0.5), 0 0 80px rgba(251, 191, 36, 0.06);
}

#battleModal .modal-content.battle-arena.crit-shake {
    animation: battle-modal-shake 0.9s ease-out;
}

@keyframes battle-modal-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

#battleModal .modal-content.battle-arena::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    padding: 2px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #d97706 50%, #b45309 75%, #fbbf24 100%);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: mg-borderRotate 6s linear infinite;
    pointer-events: none;
    opacity: 0.9;
}

#battleModal .modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 2;
}
#battleModal .modal-close:hover { color: #fbbf24; transform: scale(1.1); }

#battleModal h2 {
    margin-bottom: 1.25rem;
    text-align: center;
}

#battleModal .training-pay-step {
    padding: 1rem 0 1.5rem;
    text-align: center;
}
#battleModal .training-pay-desc {
    color: #a0aec0;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}
#battleModal #btnTrainingPay {
    min-width: 200px;
}

/* Арена: бойцы слева/справа, зоны по центру */
#battleModal .battle-arena-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin: 1.25rem 0;
    min-height: 240px;
}

#battleModal .battle-fighter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

#battleModal .battle-fighter-right {
    flex-direction: column;
}

#battleModal .battle-fighter-record {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 2px;
    margin-bottom: 4px;
}

#battleModal .battle-hp-bar-wrap {
    width: 100%;
    max-width: 130px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#battleModal .battle-hp-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #fbbf24;
    min-width: 22px;
}

#battleModal .battle-hp-bar {
    flex: 1;
    height: 8px;
    background: rgba(0,0,0,0.4);
    border-radius: 4px;
    overflow: hidden;
}

#battleModal .battle-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
    border-radius: 4px;
    transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

#battleModal .battle-hp-bar.took-damage .battle-hp-fill {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    animation: hp-damage-pulse 1s ease-out;
}

@keyframes hp-damage-pulse {
    0% { filter: brightness(1.2) saturate(1.2); }
    40% { filter: brightness(1.4) hue-rotate(-5deg); }
    100% { filter: brightness(1); }
}

#battleModal .battle-hp-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
    min-width: 2.8em;
}

#battleModal .battle-stats-block {
    width: 100%;
    max-width: 120px;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.15);
    font-size: 0.7rem;
}

#battleModal .battle-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    gap: 8px;
}

#battleModal .battle-stat-row span:first-child {
    color: #94a3b8;
}

#battleModal .battle-stat-row span:last-child {
    color: #fef3c7;
    font-weight: 600;
}

#battleModal .battle-zone-bonus {
    margin: 0.5rem 0 0 0;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #fbbf24;
    text-align: center;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.08);
}

#battleModal .battle-avatar-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: visible;
    border: 3px solid rgba(251, 191, 36, 0.5);
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 12px 32px rgba(0,0,0,0.4), 0 0 24px rgba(251, 191, 36, 0.1);
}

#battleModal .battle-avatar-inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
}

#battleModal .battle-avatar-inner .battle-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#battleModal .battle-float-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

#battleModal .battle-float-text {
    position: absolute;
    font-weight: 800;
    font-size: 1.4rem;
    text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.8);
    white-space: nowrap;
    animation: battle-float-up 1.7s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

#battleModal .battle-float-text.float-damage {
    color: #fef3c7;
    font-size: 1.6rem;
}

#battleModal .battle-float-text.float-crit {
    color: #fbbf24;
    font-size: 1.8rem;
    animation: battle-float-up 1.9s ease-out forwards, battle-crit-glow 1.1s ease-out;
}

#battleModal .battle-float-text.float-dodge {
    color: #94a3b8;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    animation: battle-float-up 1.5s ease-out forwards, battle-dodge-shake 0.9s ease-out;
}

@keyframes battle-float-up {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    25% { transform: translateY(-12px) scale(1.15); }
    100% { opacity: 0; transform: translateY(-45px) scale(1.1); }
}

@keyframes battle-crit-glow {
    0%, 100% { text-shadow: 0 0 8px rgba(0,0,0,0.9), 0 0 20px rgba(251, 191, 36, 0.8); }
    50% { text-shadow: 0 0 16px rgba(251, 191, 36, 1), 0 0 32px rgba(251, 191, 36, 0.6); }
}

@keyframes battle-dodge-shake {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-4px) translateX(-6px); }
    75% { transform: translateY(-4px) translateX(6px); }
}

#battleModal .battle-avatar {
    display: block;
}

#battleModal .battle-fighter-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    text-align: center;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5), 0 0 12px rgba(251, 191, 36, 0.15);
    letter-spacing: 0.02em;
}

#battleModal .battle-zones-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.06) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-radius: 24px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    box-shadow: inset 0 2px 20px rgba(0,0,0,0.3), 0 0 40px rgba(251, 191, 36, 0.04);
}

#battleModal .battle-zones-center .move-section {
    width: 100%;
}

#battleModal .battle-zones-center .move-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.88rem;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 6px;
}

#battleModal .battle-selected {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #cbd5e1;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

/* Лог боя */
#battleModal .battle-log {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    max-height: 140px;
    display: flex;
    flex-direction: column;
}

#battleModal .battle-log-title {
    font-size: 0.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 35%, #fcd34d 70%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#battleModal .battle-log-lines {
    flex: 1;
    overflow-y: auto;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #cbd5e1;
}

#battleModal .battle-log-line {
    padding: 3px 0;
    border-bottom: 1px solid rgba(251, 191, 36, 0.08);
    animation: battle-log-in 0.25s ease-out;
}

#battleModal .battle-log-line:last-child {
    border-bottom: none;
}

#battleModal .battle-log-line.crit {
    color: #fbbf24;
    font-weight: 600;
}

#battleModal .battle-log-line.dodge {
    color: #94a3b8;
    font-style: italic;
}

@keyframes battle-log-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Эффекты удара/блока (для результата) */
#battleModal .battle-fighter.hit-flash {
    animation: battle-hit 0.9s ease-out;
}

#battleModal .battle-fighter.block-flash {
    animation: battle-block 0.4s ease-out;
}

#battleModal .battle-fighter.dodge-flash {
    animation: battle-dodge 1s ease-out;
}

@keyframes battle-dodge {
    0% { filter: brightness(1); transform: scale(1); }
    30% { filter: brightness(1.4); transform: scale(1.03); }
    100% { filter: brightness(1); transform: scale(1); }
}

@keyframes battle-hit {
    0% { filter: brightness(1); transform: scale(1); }
    35% { filter: brightness(2.2) hue-rotate(-8deg); transform: scale(1.06); }
    100% { filter: brightness(1); transform: scale(1); }
}

@keyframes battle-block {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3); box-shadow: 0 0 24px rgba(251, 191, 36, 0.5); }
    100% { filter: brightness(1); }
}


#battleModal .move-section {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(251, 191, 36, 0.15);
    box-shadow: inset 0 1px 0 rgba(251, 191, 36, 0.05);
}

#battleModal .move-section h3 {
    color: #fbbf24;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

#battleModal .zone-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

#battleModal .zone-btn {
    padding: 12px 18px;
    min-width: 90px;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

#battleModal .zone-btn:hover {
    border-color: rgba(251, 191, 36, 0.5);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.12) 0%, rgba(251, 191, 36, 0.04) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.15);
}

#battleModal .zone-btn.selected {
    border-color: #fbbf24;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.08) 100%);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
    color: #fef3c7;
}

#battleModal .modal-content > p {
    margin: 0.75rem 0;
    font-size: 0.9rem;
    color: #a0aec0;
    text-align: center;
}

#battleModal #commitMove {
    width: 100%;
    margin-top: 0.75rem;
    justify-content: center;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 50%, #b45309 100%);
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.35);
}
#battleModal #commitMove:hover:not(:disabled) {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
    box-shadow: 0 6px 28px rgba(251, 191, 36, 0.45);
}
#battleModal #commitMove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
    #mainGame .character-layout {
        grid-template-columns: 1fr;
    }
    #mainGame .battle-layout {
        grid-template-columns: 1fr;
    }
    #mainGame .leagues-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    #mainGame .league-card.league-divine {
        transform: none;
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    #mainGame .main-tabs.tab-navigation { flex-wrap: wrap; justify-content: center; }
    #mainGame .main-tabs .tab { padding: 10px 16px; font-size: 0.9rem; }
    #mainGame .leagues-grid { grid-template-columns: 1fr; }
    #mainGame .league-card.league-divine { grid-column: 1 / -1; }
    #mainGame .fight-extra-actions { flex-direction: column; }
    #battleModal .battle-arena-layout { grid-template-columns: 1fr; }
}

/* Loading overlay (create battle, training, etc.) */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-box {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 16px;
    padding: 28px 36px;
    text-align: center;
    min-width: 260px;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(251, 191, 36, 0.3);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.4;
}
