/* ============================================
   Fighter Clicker — ALL BIG, NO TINY ELEMENTS
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
button, .nav-btn, .shop-item, .brawler-card, .gem-upgrade-card, .legendary-pack-card,
.strip-brawler, .quick-upgrade-item, .donate-item, .shop-donate-item, .donate-hero-card,
.companion-mini, #click-area, .brawler-arrow, .bg-btn, .lb-tab-btn, .trophy-shop-card { touch-action: manipulation; }

:root {
    --bg-dark: #0d0e2b; --bg-panel: #1e2048; --bg-card: #252755; --border-dark: #0a0b1e;
    --accent-yellow: #ffc800; --accent-orange: #ff8c00; --accent-red: #ff3b3b;
    --accent-blue: #4dc3ff; --accent-green: #8bc34a; --accent-purple: #b24bff;
    --text-white: #fff;
    --rarity-common: #b2f252; --rarity-rare: #4dc3ff; --rarity-super-rare: #00e7b2;
    --rarity-epic: #d750ff; --rarity-mythic: #ff5050; --rarity-legendary: #fff150;
    --nav-height: 62px; --header-height: 50px;
}

html {
    position: fixed; width: 100%; height: 100vh; height: 100dvh; overflow: hidden;
    overscroll-behavior: none; overscroll-behavior-y: none;
    touch-action: none;
}
body {
    width: 100%; height: 100vh; height: 100dvh; overflow: hidden;
    font-family: 'Lilita One', 'Impact', 'Arial Black', sans-serif;
    background: var(--bg-dark); color: var(--text-white);
    user-select: none; -webkit-user-select: none;
    overscroll-behavior: none; overscroll-behavior-y: none;
    -ms-scroll-chaining: none;
    touch-action: none;
    -webkit-touch-callout: none;
}

/* ============ LOADING ============ */
#loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, #1a0a3e, #0d0e2b 50%, #0a1628);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; }
.loading-title {
    font-size: 64px; line-height: 1; color: var(--accent-yellow); text-align: center;
    text-shadow: 3px 3px 0 #b8860b, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 5px 10px rgba(0,0,0,0.5);
    margin-bottom: 30px; animation: titlePulse 2s ease-in-out infinite;
}
@keyframes titlePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.loading-bar-container { width: 260px; height: 20px; background: var(--bg-panel); border-radius: 10px; border: 3px solid var(--border-dark); overflow: hidden; margin: 0 auto 14px; }
.loading-bar { height: 100%; width: 0%; background: linear-gradient(180deg, var(--accent-yellow), var(--accent-orange)); border-radius: 8px; transition: width 0.3s; }
.loading-text { font-size: 18px; color: #aaa; letter-spacing: 2px; text-align: center; }

/* ============ CONTAINER ============ */
#game-container { width: 100%; height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--bg-dark); }
@media (min-width: 600px) {
    html, body { background: #030310; }
    #game-container { max-width: 560px; margin: 0 auto; box-shadow: 0 0 80px rgba(80,60,180,0.5), 0 0 0 1px rgba(100,80,200,0.2); }
}

/* ============ HEADER ============ */
#header {
    height: calc(var(--header-height) + env(safe-area-inset-top, 0px)); background: rgba(10,5,30,0.92);
    border-bottom: 2px solid rgba(100,80,200,0.25);
    display: flex; align-items: center; justify-content: space-between;
    padding: env(safe-area-inset-top, 0px) 6px 0; z-index: 10; flex-shrink: 0;
}
.currency-group { display: flex; gap: 6px; }
.header-right { display: flex; align-items: center; gap: 5px; }
.currency {
    display: flex; align-items: center; gap: 4px;
    background: rgba(0,0,0,0.45); border: 2px solid rgba(255,255,255,0.08);
    border-radius: 18px; padding: 3px 10px 3px 3px;
}
.currency-icon { width: 28px; height: 28px; object-fit: contain; }
.currency span { font-size: 18px; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); min-width: 36px; }
.level-display {
    display: flex; align-items: center; gap: 3px;
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-orange));
    border: 2px solid #b8860b; border-radius: 10px; padding: 3px 10px;
}
.level-label { font-size: 11px; color: #4a2800; }
.level-display #player-level { font-size: 20px; color: #4a2800; text-shadow: none; }
.header-actions { display: flex; gap: 4px; align-items: center; }
.header-btn { background: none; border: none; cursor: pointer; padding: 2px; display: flex; align-items: center; }
.header-btn img { height: 34px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); transition: transform 0.15s; }
.header-btn:active img { transform: scale(0.9); }
/* Header icon-style button (settings) */
.header-btn-icon { position: relative; }
.header-icon-img { height: 38px; width: auto; }
.header-btn-label {
    position: absolute; left: 58%; top: 52%; transform: translate(-50%, -50%);
    font-family: 'Lilita One', sans-serif; font-size: 13px; color: #e0e0ff;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
                 0 0 6px rgba(0,0,0,0.8);
    white-space: nowrap; pointer-events: none; letter-spacing: 0.5px;
}


/* ============ SCREENS ============ */
.screen { flex: 1; display: none; flex-direction: column; overflow: hidden; position: relative; z-index: 1; }
.screen.active { display: flex; }

/* ============ GAME SCREEN ============ */
#game-screen {
    align-items: center; justify-content: flex-start; padding: 4px 8px; gap: 3px;
    background-size: cover; background-position: center; background-repeat: no-repeat;
}

/* BACKGROUND SELECTOR */
#bg-selector {
    display: flex; gap: 5px; width: 100%; justify-content: center; flex-shrink: 0;
    position: relative; z-index: 4;
}
.bg-btn {
    flex: 1; padding: 3px 4px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.45); color: #aaa; font-family: 'Lilita One', sans-serif;
    font-size: 9px; letter-spacing: 1px; cursor: pointer; transition: all 0.2s;
    backdrop-filter: blur(4px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0; text-align: center;
}
.bg-btn.active {
    border-color: var(--accent-yellow); color: var(--accent-yellow);
    background: rgba(255,200,0,0.18); box-shadow: 0 0 8px rgba(255,200,0,0.3);
}
.bg-btn.locked { opacity: 0.4; cursor: not-allowed; }
.bg-btn-auto { flex: 0.7; font-size: 9px; }
.bg-lock { font-size: 9px; opacity: 0.8; }

/* STATS */
.stats-bar { display: flex; gap: 6px; width: 100%; justify-content: center; flex-shrink: 0; }
.stat-item {
    background: rgba(0,0,0,0.55); border: 2px solid rgba(255,200,0,0.3);
    border-radius: 8px; padding: 2px 10px; text-align: center; backdrop-filter: blur(4px);
    white-space: nowrap; overflow: hidden; min-width: 0;
}
.stat-label { display: block; font-size: 9px; color: #aaa; letter-spacing: 1px; }
.stat-value { display: block; font-size: 15px; color: var(--accent-yellow); text-shadow: 1px 1px 4px rgba(0,0,0,0.8); }

.ad-x2-btn {
    background: rgba(0,0,0,0.55); border: 2px solid rgba(255,200,0,0.3);
    border-radius: 10px; padding: 3px 12px; text-align: center; backdrop-filter: blur(4px);
    color: var(--accent-yellow); font-family: inherit; font-size: 11px; font-weight: 700;
    cursor: pointer; white-space: nowrap;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}
.ad-x2-btn:active { transform: scale(0.95); }
.ad-x2-btn.hidden { display: none; }
.ad-x2-label { display: block; font-size: 12px; color: #aaa; letter-spacing: 1px; }
.ad-x2-value { display: block; font-size: 16px; color: var(--accent-yellow); }

/* FIGHTER ARROWS */
.brawler-arrow {
    position: absolute; bottom: 30%; z-index: 5;
    background: none; border: none; cursor: pointer; padding: 4px;
    transition: transform 0.15s; -webkit-tap-highlight-color: transparent;
}
.brawler-arrow:active { transform: scale(0.85); }
.brawler-arrow img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7)); }
#brawler-arrow-left  { left: 4px; }
#brawler-arrow-right { right: 4px; }

/* CLICK AREA — BIG fighter */
#click-area-wrapper { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; flex: 1; min-height: 0; padding-bottom: 0; overflow: visible; }
#click-area {
    display: flex; align-items: flex-end; justify-content: center;
    cursor: pointer; transition: transform 0.1s; position: relative; z-index: 2;
    padding-bottom: 10px;
}
#click-area::before {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 220px; height: 70px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,200,0,0.35) 0%, rgba(255,140,0,0.12) 60%, transparent 100%);
    animation: pulse 2s ease-in-out infinite;
}
#click-area::after {
    content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
    width: 260px; height: 90px; border-radius: 50%;
    border: 2px solid rgba(255,200,0,0.18);
    animation: pulse 2s ease-in-out infinite 0.5s;
}
@keyframes pulse { 0%,100% { transform: translateX(-50%) scale(1); opacity: 0.5; } 50% { transform: translateX(-50%) scale(1.06); opacity: 1; } }
#click-area:active { transform: scale(0.9); }
#click-area.clicked { animation: bounce 0.15s ease-out; }
@keyframes bounce { 0% { transform: scale(0.88); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
#main-brawler-img {
    height: 260px; width: auto; max-width: 260px; object-fit: contain;
    filter: drop-shadow(0 8px 28px rgba(0,0,0,0.85)); pointer-events: none;
    position: relative; z-index: 3;
}
#click-area:active #main-brawler-img { filter: drop-shadow(0 8px 28px rgba(0,0,0,0.85)) brightness(1.3); }

/* Click effects */
#click-effects-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
.click-effect {
    position: absolute; font-size: 32px; font-family: 'Lilita One', sans-serif; color: var(--accent-yellow);
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    pointer-events: none; animation: floatUp 0.9s ease-out forwards; z-index: 100;
}
.click-effect-crit {
    color: #ffc800 !important;
    font-size: 42px !important;
    text-shadow: 0 0 12px #ff8c00, 2px 2px 0 #000, -1px -1px 0 #000 !important;
    animation: floatUpCrit 1s ease-out forwards !important;
}
/* п. 3.8 — иконка валюты Яндекс (в ценах) */
.price-with-icon .currency-icon { width: 16px; height: 16px; vertical-align: middle; margin-left: 2px; }
.price-with-icon { display: inline-flex; align-items: center; gap: 2px; }
@keyframes floatUpCrit {
    0% { opacity: 1; transform: translateY(0) scale(1.2); }
    30% { opacity: 1; transform: translateY(-20px) scale(1.6); }
    100% { opacity: 0; transform: translateY(-100px) scale(0.9); }
}
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(1); } 50% { opacity: 1; transform: translateY(-35px) scale(1.3); } 100% { opacity: 0; transform: translateY(-80px) scale(0.8); } }
.click-particle {
    position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-yellow);
    pointer-events: none; animation: burst 0.5s ease-out forwards;
}
@keyframes burst { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); } }

/* ============ FIGHTER STRIP — BIG icons ============ */
#active-brawlers-strip {
    width: 100%; flex-shrink: 0;
    background: rgba(0,0,0,0.55); border-radius: 10px;
    padding: 4px 6px; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.08);
}
.strip-title { font-size: 11px; color: var(--accent-yellow); letter-spacing: 2px; margin-bottom: 2px; }
#active-brawlers-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; touch-action: pan-x; }
#active-brawlers-list::-webkit-scrollbar { display: none; }
.strip-brawler { flex-shrink: 0; width: 48px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; }
.strip-brawler:active { transform: scale(0.9); }
.strip-brawler-icon {
    width: 42px; height: 42px; border-radius: 10px;
    border: 2.5px solid rgba(255,255,255,0.15); overflow: hidden; background: rgba(0,0,0,0.3);
}
.strip-brawler-icon img { width: 100%; height: 100%; object-fit: cover; }
.strip-brawler-icon.selected { border-color: var(--accent-yellow); box-shadow: 0 0 10px rgba(255,200,0,0.6); }
.strip-brawler-name { font-size: 9px; color: #ccc; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 48px; text-align: center; }
.strip-brawler.locked .strip-brawler-icon { filter: brightness(0.25); }
.strip-brawler.locked .strip-brawler-name { color: #444; }

/* ============ TROPHY ROAD — slim ============ */
#trophy-road { width: 100%; flex-shrink: 0; }
.trophy-road-bar { width: 100%; height: 12px; background: rgba(0,0,0,0.5); border-radius: 6px; border: 2px solid rgba(255,255,255,0.08); overflow: hidden; }
.trophy-road-fill { height: 100%; background: linear-gradient(180deg, var(--accent-yellow), var(--accent-orange)); border-radius: 4px; width: 0%; transition: width 0.5s; position: relative; }
.trophy-road-fill::after { content: ''; position: absolute; top: 1px; left: 4px; right: 4px; height: 4px; background: rgba(255,255,255,0.3); border-radius: 3px; }
.trophy-road-label { display: flex; justify-content: space-between; align-items: center; font-size: 11px; margin-top: 1px; padding: 0 2px; color: #aaa; }
.trophy-road-title { font-size: 11px; color: var(--accent-yellow); letter-spacing: 1px; }

/* ============ QUICK UPGRADE ============ */
#quick-upgrade {
    width: 100%; flex-shrink: 0;
    background: rgba(0,0,0,0.55); border-radius: 10px;
    padding: 4px 6px; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.08);
}
#quick-upgrade-content { display: flex; gap: 6px; }
.quick-upgrade-item {
    flex: 1; display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.05); border-radius: 8px;
    padding: 5px 8px; cursor: pointer; border: 1px solid rgba(255,255,255,0.06); min-width: 0;
}
.quick-upgrade-item:active { transform: scale(0.96); }
.quick-upgrade-item.disabled { opacity: 0.35; pointer-events: none; }
.qu-icon { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.qu-icon img { width: 100%; height: 100%; object-fit: cover; }
.qu-info { flex: 1; min-width: 0; overflow: hidden; }
.qu-name { font-size: 13px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.qu-cost { font-size: 12px; color: var(--accent-yellow); display: flex; align-items: center; gap: 3px; }
.qu-cost img { width: 14px; height: 14px; }

/* ============ FIGHTERS SCREEN ============ */
.screen-header { padding: 8px 10px 4px; flex-shrink: 0; }
.screen-title {
    font-size: 28px; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    text-align: center; letter-spacing: 3px;
}
.brawlers-scroll {
    flex: 1; overflow-y: auto; padding: 4px 8px; -webkit-overflow-scrolling: touch; touch-action: pan-y;
    background: linear-gradient(180deg, rgba(5,5,20,0.72), rgba(5,10,30,0.55) 50%, rgba(5,5,20,0.82)),
        url('i.webp') center center / cover no-repeat;
}
.brawlers-scroll::-webkit-scrollbar { width: 3px; }
.brawlers-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
#brawlers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 8px 8px 14px; }

/* FIGHTER CARD — BIG image */
.brawler-card {
    background: linear-gradient(180deg, #18093a 0%, #0d0e2b 55%, #080820 100%);
    border-radius: 20px; border: 3px solid var(--border-dark);
    overflow: hidden; position: relative;
    box-shadow: 0 6px 24px rgba(0,0,0,0.55);
    transition: transform 0.15s;
}
.brawler-card.unlocked { cursor: pointer; }
.brawler-card.locked { opacity: 0.55; }
.brawler-card:active { transform: scale(0.96); }
.brawler-card-top {
    position: relative; height: 175px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brawler-card-top::before {
    content: ''; position: absolute; width: 150px; height: 150px; border-radius: 50%;
    background: radial-gradient(circle, var(--card-glow, rgba(255,200,0,0.18)), transparent 68%);
}
.brawler-card-top::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 45%;
    background: linear-gradient(180deg, var(--card-glow, rgba(255,200,0,0.07)), transparent);
    pointer-events: none;
}
.brawler-card-img {
    width: 148px; height: 148px; object-fit: contain;
    position: relative; z-index: 1;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.7));
}
.brawler-card.locked .brawler-card-img { filter: brightness(0) drop-shadow(0 4px 10px rgba(0,0,0,0.6)); }
.brawler-lock-icon {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 46px; height: 46px; z-index: 2; object-fit: contain;
}
.brawler-card-info { padding: 8px 12px 4px; }
.brawler-name { font-size: 18px; text-shadow: 1px 1px 3px rgba(0,0,0,0.9); letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brawler-rarity { font-size: 12px; letter-spacing: 1.5px; margin-top: 2px; }
.brawler-level { font-size: 13px; color: #aaa; margin-top: 3px; }
.brawler-stats { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.brawler-stat-badge { background: rgba(0,0,0,0.45); border-radius: 8px; padding: 3px 9px; font-size: 13px; }
.brawler-stat-badge.click-stat { color: var(--accent-yellow); }
.brawler-stat-badge.auto-stat { color: var(--accent-green); }
.brawler-card-actions { padding: 8px 12px 12px; display: flex; gap: 6px; }
.btn-coin-icon { width: 16px; height: 16px; vertical-align: middle; }

/* Rarity borders + glow */
.brawler-card[data-rarity="common"]    { border-color: var(--rarity-common);     box-shadow: 0 0 12px rgba(178,242,82,0.12),   0 6px 24px rgba(0,0,0,0.55); }
.brawler-card[data-rarity="rare"]      { border-color: var(--rarity-rare);       box-shadow: 0 0 12px rgba(77,195,255,0.12),  0 6px 24px rgba(0,0,0,0.55); }
.brawler-card[data-rarity="super-rare"]{ border-color: var(--rarity-super-rare); box-shadow: 0 0 12px rgba(0,231,178,0.12),   0 6px 24px rgba(0,0,0,0.55); }
.brawler-card[data-rarity="epic"]      { border-color: var(--rarity-epic);       box-shadow: 0 0 12px rgba(215,80,255,0.15),  0 6px 24px rgba(0,0,0,0.55); }
.brawler-card[data-rarity="mythic"]    { border-color: var(--rarity-mythic);     box-shadow: 0 0 14px rgba(255,80,80,0.18),   0 6px 24px rgba(0,0,0,0.55); }
.brawler-card[data-rarity="legendary"] { border-color: var(--rarity-legendary);  box-shadow: 0 0 18px rgba(255,241,80,0.25),  0 6px 24px rgba(0,0,0,0.55); }
.brawler-card.selected::after {
    content: ''; position: absolute; top: 8px; right: 8px;
    width: 24px; height: 24px; background: var(--accent-yellow);
    border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 12px rgba(255,200,0,0.8);
}

/* ============ SHOP SCREEN ============ */
.shop-scroll {
    flex: 1; overflow-y: auto; padding: 4px 8px; -webkit-overflow-scrolling: touch; touch-action: pan-y;
    background: linear-gradient(180deg, rgba(5,5,20,0.72), rgba(5,10,30,0.55) 50%, rgba(5,5,20,0.82)),
        url('i.webp') center bottom / cover no-repeat;
}
.shop-scroll::-webkit-scrollbar { width: 3px; }
.shop-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
#shop-items { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.shop-section-title { font-size: 20px; color: var(--accent-yellow); text-shadow: 1px 1px 2px rgba(0,0,0,0.8); margin: 6px 0 2px; letter-spacing: 1px; }
.shop-item {
    background: rgba(30,32,72,0.88); border-radius: 14px; border: 2px solid rgba(255,255,255,0.06);
    padding: 12px; display: flex; align-items: center; gap: 12px; backdrop-filter: blur(4px);
}
.shop-item:active { transform: scale(0.98); }
.shop-item-icon { width: 56px; height: 56px; border-radius: 12px; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shop-item-icon img { width: 42px; height: 42px; object-fit: contain; }
.shop-item-info { flex: 1; }
.shop-item-name { font-size: 18px; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
.shop-item-desc { font-size: 13px; color: #888; margin-top: 1px; }
.shop-item-price { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.shop-item-price img { width: 22px; height: 22px; }
.shop-item-price span { font-size: 20px; color: var(--accent-yellow); }
.shop-item.disabled { opacity: 0.35; pointer-events: none; }

/* ============ BUTTONS — BIG ============ */
.btn {
    font-family: 'Lilita One', sans-serif; border: none; border-radius: 10px;
    padding: 8px 14px; font-size: 15px; cursor: pointer;
    letter-spacing: 1px;
}
.btn:active { transform: scale(0.95); }
.btn-primary {
    background: linear-gradient(180deg, var(--accent-yellow), var(--accent-orange));
    color: #4a2800; border: 3px solid #b8860b; text-shadow: none; box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.btn-unlock {
    background: linear-gradient(180deg, var(--accent-green), #5a9e1a);
    color: #1a3a00; border: 2px solid #3a6e10; text-shadow: none; width: 100%; font-size: 14px; padding: 8px 10px;
}
.btn-upgrade {
    background: linear-gradient(180deg, var(--accent-blue), #2a8ed0);
    color: #002a4a; border: 2px solid #1a6ea0; text-shadow: none; width: 100%; font-size: 13px; padding: 7px 8px;
}
.btn-select {
    background: linear-gradient(180deg, var(--accent-yellow), var(--accent-orange));
    color: #4a2800; border: 2px solid #b8860b; text-shadow: none; flex: 1; font-size: 13px; padding: 7px 8px;
}
.btn-disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }

/* ============ BOTTOM NAV ============ */
#bottom-nav {
    height: calc(var(--nav-height) + max(env(safe-area-inset-bottom, 0px), 8px));
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
    background: linear-gradient(180deg, #1a1b3e, #0d0e2b);
    border-top: 2px solid rgba(100,80,200,0.25);
    display: flex; align-items: stretch; z-index: 10; flex-shrink: 0;
}
.nav-btn {
    flex: 1; background: none; border: none;
    font-family: 'Lilita One', sans-serif; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; padding: 2px 0;
    overflow: visible;
}
.nav-btn.active::before { content: ''; position: absolute; top: 0; width: 60%; height: 3px; background: var(--accent-yellow); border-radius: 0 0 3px 3px; box-shadow: 0 0 10px rgba(255,200,0,0.6); z-index: 2; }
/* Nav button inner wrapper — fills the button, image + text overlay */
.nav-btn-inner {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
/* Nav icon images (newui) — fill the button width */
.nav-icon-img {
    width: 100%; height: auto; max-height: 56px; object-fit: contain;
    opacity: 0.8; filter: brightness(0.9); transition: all 0.2s;
}
.nav-btn.active .nav-icon-img { opacity: 1; filter: brightness(1.1); }
/* Text label positioned ON the purple bar area of the image */
.nav-label {
    position: absolute; left: 58%; top: 55%;
    transform: translate(-50%, -50%);
    font-family: 'Lilita One', sans-serif;
    font-size: 14px; line-height: 1; white-space: nowrap;
    color: #e0e0ff; transition: color 0.2s; letter-spacing: 0.8px;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
                 0 0 8px rgba(0,0,0,1), 0 0 14px rgba(0,0,0,0.7);
    pointer-events: none;
}
.nav-btn.active .nav-label { color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 0 12px rgba(255,200,0,0.5); }
/* Home button (no image, just emoji+text) */
.nav-icon-home {
    font-size: 28px; line-height: 1;
    opacity: 0.65; filter: brightness(0.85); transition: all 0.2s;
}
.nav-btn.active .nav-icon-home { opacity: 1; filter: none; }
.nav-btn-home {
    flex-direction: column; gap: 1px;
}
.nav-btn-home .nav-label {
    position: relative; left: auto; top: auto; transform: none; right: auto;
    margin-top: 0; font-size: 12px; color: #b0b0d0;
}
.nav-btn-home.active .nav-label { color: #fff; }
.nav-badge { position: absolute; top: -4px; right: -6px; background: #ff3b3b; color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.nav-badge.hidden { display: none; }

/* ============ POPUP ============ */
.popup { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.popup.hidden { display: none; }
.popup-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.75); }
.popup-content {
    position: relative; background: linear-gradient(180deg, #2a2c5e, #1a1b3e);
    border-radius: 20px; border: 4px solid var(--accent-yellow);
    padding: 24px; max-width: 320px; width: 85%; text-align: center;
    box-shadow: 0 0 40px rgba(255,200,0,0.2); animation: popIn 0.4s ease-out;
    max-height: 90vh; max-height: 90dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
.popup-title { font-size: 28px; color: var(--accent-yellow); text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; margin-bottom: 14px; }
.unlock-brawler-showcase {
    width: 140px; height: 140px; margin: 0 auto 12px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,200,0,0.2), transparent 70%);
    display: flex; align-items: center; justify-content: center;
    animation: glow 3s linear infinite;
}
@keyframes glow { 0% { box-shadow: 0 0 20px rgba(255,200,0,0.3); } 50% { box-shadow: 0 0 40px rgba(255,200,0,0.6); } 100% { box-shadow: 0 0 20px rgba(255,200,0,0.3); } }
.unlock-brawler-showcase img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
.unlock-name { font-size: 24px; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); margin-bottom: 14px; }
.popup-close-btn { font-size: 18px; padding: 10px 36px; }

/* ============ BOOST ============ */
#boost-indicator {
    background: linear-gradient(180deg, var(--accent-purple), #7b1fa2);
    border: 2px solid #e040fb; border-radius: 10px; padding: 3px 10px;
    display: flex; align-items: center; gap: 6px;
    box-shadow: 0 0 14px rgba(224,64,251,0.4); animation: bPulse 1s ease-in-out infinite;
    white-space: nowrap;
}
#boost-indicator.hidden { display: none; }
@keyframes bPulse { 0%,100% { box-shadow: 0 0 14px rgba(224,64,251,0.4); } 50% { box-shadow: 0 0 24px rgba(224,64,251,0.7); } }
#boost-text { font-size: 16px; } #boost-timer { font-size: 14px; color: #e0b0ff; }

/* ============ AUTO FLOAT ============ */
.auto-income-float {
    position: fixed; right: 14px; font-size: 16px; color: var(--accent-green);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); font-family: 'Lilita One', sans-serif;
    pointer-events: none; animation: autoFloat 1.5s ease-out forwards; z-index: 50;
}
@keyframes autoFloat { 0% { opacity: 0.8; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-25px); } }

/* ============ RESPONSIVE — ширина ============ */
@media (min-width: 480px) {
    #main-brawler-img { height: 320px; max-width: 300px; }
    .currency span { font-size: 20px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 11px; }
    .strip-brawler-icon { width: 48px; height: 48px; }
    .strip-brawler-name { font-size: 10px; max-width: 52px; }
    .qu-icon { width: 38px; height: 38px; }
    .qu-name { font-size: 14px; }
    .qu-cost { font-size: 13px; }
    .trophy-road-bar { height: 14px; }
    .trophy-road-label { font-size: 12px; }
    #bottom-nav { height: calc(64px + env(safe-area-inset-bottom, 0px)); }
    .nav-icon-img { max-height: 58px; }
    .nav-label { font-size: 15px; }
}
@media (min-width: 600px) {
    #main-brawler-img { height: 360px; max-width: 320px; }
    .currency span { font-size: 22px; }
    .currency-icon { width: 32px; height: 32px; }
    .stat-value { font-size: 24px; }
    .stat-label { font-size: 12px; }
    .strip-brawler-icon { width: 52px; height: 52px; }
    .strip-brawler-name { font-size: 11px; max-width: 56px; }
    #bottom-nav { height: calc(68px + env(safe-area-inset-bottom, 0px)); }
    .nav-icon-img { max-height: 62px; }
    .nav-label { font-size: 16px; }
    .quick-upgrade-item { padding: 6px 12px; }
    .qu-name { font-size: 15px; }
    .shop-item-name { font-size: 20px; }
    .shop-item-price span { font-size: 22px; }
    .brawler-name { font-size: 18px; }
}
@media (min-width: 768px) {
    #main-brawler-img { height: 400px; max-width: 360px; }
}

/* ============ QUESTS SCREEN ============ */
.quests-scroll {
    flex: 1; overflow-y: auto; padding: 4px 8px; -webkit-overflow-scrolling: touch; touch-action: pan-y;
    background: linear-gradient(180deg, rgba(5,5,20,0.72), rgba(5,10,30,0.55) 50%, rgba(5,5,20,0.82)),
        url('i.webp') center center / cover no-repeat;
}
.quests-scroll::-webkit-scrollbar { width: 3px; }
.quests-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
#quests-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.quest-card {
    background: rgba(30,32,72,0.88); border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.08); padding: 12px;
    display: flex; align-items: flex-start; gap: 10px; backdrop-filter: blur(4px);
}
.quest-card.done { opacity: 0.5; }
.quest-card.claimable { border-color: var(--accent-yellow); box-shadow: 0 0 10px rgba(255,200,0,0.2); }
.quest-icon { font-size: 28px; flex-shrink: 0; line-height: 1; padding-top: 2px; }
.quest-info { flex: 1; min-width: 0; }
.quest-name { font-size: 16px; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); margin-bottom: 2px; }
.quest-desc { font-size: 12px; color: #888; margin-bottom: 7px; }
.quest-progress-bar {
    height: 10px; background: rgba(0,0,0,0.4); border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 4px;
}
.quest-progress-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-green), #8bc34a);
    transition: width 0.4s;
}
.quest-progress-text { font-size: 11px; color: #777; }
.quest-reward {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    flex-shrink: 0; min-width: 56px;
}
.quest-reward img { width: 20px; height: 20px; object-fit: contain; }
.quest-reward span { font-size: 15px; color: var(--accent-yellow); }
.btn-claim {
    font-family: 'Lilita One', sans-serif; border: none; border-radius: 8px;
    padding: 5px 10px; font-size: 12px; cursor: pointer;
    letter-spacing: 0.5px;
    background: linear-gradient(180deg, var(--accent-yellow), var(--accent-orange));
    color: #4a2800; border: 2px solid #b8860b;
}
.btn-claim:active { transform: scale(0.94); }
.quest-done-label { font-size: 12px; color: var(--accent-green); letter-spacing: 1px; }

/* ============ LEADERBOARD SCREEN ============ */
.lb-scroll {
    flex: 1; overflow-y: auto; padding: 4px 8px; -webkit-overflow-scrolling: touch; touch-action: pan-y;
    background: linear-gradient(180deg, rgba(5,5,20,0.72), rgba(5,10,30,0.55) 50%, rgba(5,5,20,0.82)),
        url('i.webp') center center / cover no-repeat;
}
.lb-scroll::-webkit-scrollbar { width: 3px; }
.lb-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
#leaderboard-content { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.lb-player-card {
    background: rgba(255,200,0,0.08); border: 2px solid rgba(255,200,0,0.3);
    border-radius: 14px; padding: 10px 14px;
    display: flex; align-items: center; gap: 10px;
}
.lb-player-avatar { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: rgba(0,0,0,0.3); }
.lb-player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-player-info { flex: 1; }
.lb-player-name { font-size: 16px; }
.lb-player-stats { font-size: 12px; color: #aaa; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.lb-tabs { display: flex; gap: 4px; }
.lb-tab {
    flex: 1; padding: 7px 4px; border-radius: 10px;
    background: rgba(0,0,0,0.4); border: 2px solid rgba(255,255,255,0.08);
    color: #666; font-family: 'Lilita One', sans-serif; font-size: 11px;
    cursor: pointer; text-align: center; transition: all 0.2s;
    letter-spacing: 0.5px;
}
.lb-tab.active {
    border-color: var(--accent-yellow); color: var(--accent-yellow);
    background: rgba(255,200,0,0.12);
}
.lb-tab:active { transform: scale(0.95); }
.lb-entries { display: flex; flex-direction: column; gap: 6px; }
.lb-entry {
    background: rgba(30,32,72,0.88); border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.06); padding: 9px 14px;
    display: flex; align-items: center; gap: 10px; backdrop-filter: blur(4px);
}
.lb-entry.me { border-color: var(--accent-blue); background: rgba(77,195,255,0.08); }
.lb-rank { font-size: 20px; min-width: 32px; text-align: center; color: #aaa; }
.lb-name { flex: 1; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.lb-score { font-size: 15px; color: var(--accent-yellow); flex-shrink: 0; }
.lb-loading { text-align: center; padding: 20px; font-size: 14px; color: #666; }
.lb-offline {
    text-align: center; padding: 20px 14px; font-size: 14px; color: #666;
    background: rgba(0,0,0,0.3); border-radius: 12px; border: 2px solid rgba(255,255,255,0.05);
    line-height: 1.6;
}

/* ============ SETTINGS POPUP ============ */
.settings-popup-content { max-width: 300px; }
.settings-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.settings-label { font-size: 16px; color: #ccc; }
.toggle-switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.12); border-radius: 28px; transition: 0.3s;
    border: 2px solid rgba(255,255,255,0.08);
}
.toggle-slider::before {
    content: ''; position: absolute; height: 20px; width: 20px; left: 2px; bottom: 2px;
    background: #fff; border-radius: 50%; transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-green); border-color: #5a9e1a; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(24px); }

/* Volume sliders */
.settings-row-volume { flex-wrap: wrap; gap: 4px; }
.volume-control {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.volume-icon { font-size: 18px; flex-shrink: 0; }
.volume-slider {
    -webkit-appearance: none; appearance: none;
    flex: 1; height: 6px; border-radius: 3px;
    background: rgba(255,255,255,0.15); outline: none;
    cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(180deg, #ffc800, #ff8c00);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    cursor: pointer;
}
.volume-slider::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(180deg, #ffc800, #ff8c00);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    cursor: pointer;
}
.volume-slider::-webkit-slider-runnable-track {
    height: 6px; border-radius: 3px;
}
.volume-val {
    font-family: 'Lilita One', sans-serif;
    font-size: 14px; color: #ffc800;
    min-width: 36px; text-align: right;
}

.btn-danger {
    font-family: 'Lilita One', sans-serif; border: none; border-radius: 10px;
    padding: 9px 14px; font-size: 15px; cursor: pointer;
    letter-spacing: 1px; width: 100%; margin-top: 10px;
    background: linear-gradient(180deg, #ff5050, #c42020);
    color: #fff; border: 2px solid #8a0000; box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.btn-danger:active { transform: scale(0.95); }

/* ============ DONATE POPUP ============ */
.donate-popup-content { max-width: 320px; max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.donate-desc { font-size: 15px; color: #aaa; margin-bottom: 14px; }

/* ============ LANGUAGE TOGGLE ============ */
.lang-toggle { display: flex; gap: 4px; }
.lang-btn {
    font-family: 'Lilita One', sans-serif; border: 2px solid rgba(255,255,255,0.15);
    border-radius: 8px; padding: 4px 12px; font-size: 14px; cursor: pointer;
    background: rgba(255,255,255,0.08); color: #888; transition: all 0.2s;
}
.lang-btn.active {
    border-color: var(--accent-yellow); color: var(--accent-yellow);
    background: rgba(255,200,0,0.15);
}
.lang-btn:active { transform: scale(0.92); }

/* ============ SHOP DONATE SECTION ============ */
.shop-donate-title { color: var(--accent-purple) !important; }
.shop-donate-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px;
}
.shop-donate-item {
    background: rgba(30,32,72,0.88); border: 2px solid rgba(178,75,255,0.35);
    border-radius: 14px; padding: 10px 5px; text-align: center; cursor: pointer;
    transition: all 0.2s; backdrop-filter: blur(4px);
}
.shop-donate-item:active { transform: scale(0.95); }
.shop-donate-item img { width: 56px; height: 56px; object-fit: contain; display: block; margin: 0 auto 5px; }
.shop-donate-name { font-size: 11px; color: #fff; margin-bottom: 2px; }
.shop-donate-price { font-size: 13px; color: var(--accent-yellow); font-weight: bold; }
/* Donate popup — 2 cols for popup */
.donate-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 10px 0; }
.donate-item { background: rgba(30,32,72,0.9); border: 2px solid rgba(178,75,255,0.4); border-radius: 14px; padding: 12px 8px; text-align: center; cursor: pointer; transition: all 0.18s; }
.donate-item:active { transform: scale(0.95); }
.donate-item img { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 6px; }
.donate-item-name { font-size: 13px; color: #fff; margin-bottom: 3px; }
.donate-item-price { font-size: 16px; color: var(--accent-yellow); font-weight: bold; }

/* ============ DONATE BADGES ============ */
.donate-item { position: relative; }
.shop-donate-item { position: relative; }
.donate-badge-wrap { position: absolute; top: -8px; left: -6px; z-index: 3; pointer-events: none; }
.donate-badge-wrap img { width: 88px; height: auto; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6)); }
.donate-badge-wrap { display: flex; align-items: center; justify-content: center; }
.badge-text {
    position: absolute; left: 46%; top: 48%; transform: translate(-50%, -50%);
    font-family: 'Lilita One', sans-serif; font-size: 11px; color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,0.5);
    white-space: nowrap; pointer-events: none; letter-spacing: 0.5px;
}

/* ============ DONATE POPUP SCROLL ============ */
.donate-popup-content { max-width: 340px; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.donate-popup-content::-webkit-scrollbar { width: 3px; }
.donate-popup-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ============ DONATE CHAMPIONS SECTION ============ */
.donate-champions-title {
    font-size: 20px; color: var(--accent-yellow);
    text-shadow: 1px 1px 0 #000; margin: 16px 0 2px; letter-spacing: 1px;
    border-top: 1px solid rgba(255,255,255,0.08); padding-top: 14px;
}
.donate-champions-sub { font-size: 12px; color: #888; margin-bottom: 10px; }
#donate-heroes-section { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.donate-hero-card {
    display: flex; align-items: center; gap: 10px;
    background: rgba(15,8,35,0.95); border: 2px solid rgba(178,75,255,0.35);
    border-radius: 14px; padding: 8px 10px; cursor: pointer; transition: all 0.2s;
}
.donate-hero-card:active { transform: scale(0.97); }
.donate-hero-card.owned { opacity: 0.75; cursor: default; }
.donate-hero-card-img { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.donate-hero-card-info { flex: 1; min-width: 0; }
.donate-hero-card-name { font-size: 15px; letter-spacing: 1px; }
.donate-hero-card-bonus { font-size: 11px; color: var(--accent-yellow); margin-top: 2px; }
.donate-hero-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.donate-hero-price { font-size: 15px; color: var(--accent-yellow); font-weight: bold; }
.donate-hero-owned-tag { font-size: 12px; color: var(--accent-green); letter-spacing: 0.5px; }

/* ============ HERO POPUP ============ */
.hero-popup-content {
    position: relative;
    background: linear-gradient(160deg, #1a0830, #0d0e2b 60%, #080820);
    border-radius: 26px; border: 4px solid var(--accent-yellow);
    padding: 30px 22px 24px; max-width: 370px; width: 92%; text-align: center;
    box-shadow: 0 0 60px rgba(255,200,0,0.25), 0 24px 60px rgba(0,0,0,0.85);
    animation: popIn 0.4s ease-out;
    max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.hero-popup-content::-webkit-scrollbar { width: 3px; }
.hero-popup-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.hero-exclusive-tag {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #8b00cc, #e040fb);
    border: 2px solid #e040fb; color: #fff;
    font-size: 11px; letter-spacing: 1.5px;
    padding: 4px 18px; border-radius: 20px; white-space: nowrap;
    box-shadow: 0 2px 16px rgba(178,75,255,0.7);
}
.hero-glow-circle {
    width: 185px; height: 185px; margin: 14px auto 8px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    animation: heroGlowAnim 2.5s ease-in-out infinite;
}
@keyframes heroGlowAnim {
    0%,100% { box-shadow: 0 0 30px currentColor; }
    50% { box-shadow: 0 0 65px currentColor; }
}
.hero-glow-circle img {
    width: 165px; height: 165px; object-fit: contain;
    filter: drop-shadow(0 6px 20px rgba(0,0,0,0.7));
    animation: heroFloat 3s ease-in-out infinite;
}
@keyframes heroFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.hero-popup-name {
    font-size: 36px; letter-spacing: 3px; margin-bottom: 3px;
    text-shadow: 2px 2px 0 #000, 0 0 20px currentColor;
}
.hero-popup-rarity { font-size: 13px; letter-spacing: 3px; margin-bottom: 16px; opacity: 0.9; }
.hero-bonus-display {
    background: rgba(0,0,0,0.55); border: 2px solid rgba(255,255,255,0.15);
    border-radius: 16px; padding: 14px 18px; margin: 0 0 12px;
    font-size: 21px; color: var(--accent-yellow);
    text-shadow: 0 0 12px rgba(255,200,0,0.5); letter-spacing: 1px;
}
.hero-popup-desc { font-size: 14px; color: #aaa; margin-bottom: 20px; line-height: 1.6; }
.hero-buy-btn {
    width: 100%; padding: 14px; font-size: 18px; letter-spacing: 2px;
    background: linear-gradient(180deg, #b24bff, #7b1fa2);
    color: #fff; border: 3px solid #e040fb;
    box-shadow: 0 4px 22px rgba(178,75,255,0.55);
    margin-bottom: 10px; border-radius: 14px; transition: all 0.2s;
}
.hero-buy-btn:active { transform: scale(0.96); }
.hero-buy-btn.hero-owned {
    background: linear-gradient(180deg, var(--accent-green), #5a9e1a);
    border-color: #3a6e10; color: #1a3a00; box-shadow: none; pointer-events: none;
}
.btn-hero-close {
    font-family: 'Lilita One', sans-serif; border: 2px solid rgba(255,255,255,0.18);
    border-radius: 12px; padding: 9px 20px; font-size: 15px; cursor: pointer;
    letter-spacing: 1px; width: 100%;
    background: rgba(255,255,255,0.07); color: #aaa; transition: all 0.2s;
}
.btn-hero-close:active { transform: scale(0.95); }

/* ============ LEGENDARY PACKS SHOP SECTION ============ */
.packs-section-desc { font-size: 12px; color: #888; margin: -4px 0 10px; text-align: center; }
.packs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.legendary-pack-card {
    position: relative; background: linear-gradient(180deg, #16082a, #0d0e2b 50%, #0a0820);
    border: 2px solid rgba(100,80,200,0.35); border-radius: 18px;
    padding: 0 0 10px; text-align: center; cursor: pointer;
    transition: transform 0.15s; overflow: hidden;
}
.legendary-pack-card:active { transform: scale(0.93); }
.legendary-pack-card.owned { opacity: 0.80; }
.pack-owned-ribbon {
    position: absolute; top: 0; right: 0;
    background: linear-gradient(135deg, #8bc34a, #3d7a0e);
    font-size: 9px; letter-spacing: 0.5px; color: #1a3a00;
    padding: 3px 8px; border-radius: 0 16px 0 10px; z-index: 2;
}
.pack-char-wrap {
    width: 100%; padding: 10px 8px 4px; position: relative;
    display: flex; justify-content: center; align-items: flex-end;
    min-height: 96px;
}
.pack-char-img { width: 88px; height: 88px; object-fit: contain; position: relative; z-index: 1; }
.pack-name {
    font-size: 15px; letter-spacing: 2px; margin: 4px 0 5px;
    line-height: 1;
}
.pack-gems-row {
    display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 6px;
}
.pack-gem-icon { width: 17px; height: 17px; object-fit: contain; }
.pack-gems-count { font-size: 18px; color: var(--accent-blue); line-height: 1; }
.pack-gems-label { font-size: 11px; color: rgba(77,195,255,0.65); align-self: flex-end; margin-bottom: 1px; }
.pack-perk {
    margin: 0 8px 7px; border-radius: 8px; border: 1px solid rgba(255,200,0,0.2);
    padding: 5px 6px;
    display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.pack-perk-val { font-size: 11px; color: var(--accent-yellow); letter-spacing: 0.5px; line-height: 1.2; }
.pack-forever-tag {
    font-size: 9px; color: rgba(255,200,0,0.55); letter-spacing: 1px;
}
.pack-price-btn {
    margin: 0 8px 0; border-radius: 10px; padding: 7px 4px;
    font-size: 15px; color: #fff; border: 2px solid rgba(178,75,255,0.4);
    background: linear-gradient(180deg, rgba(178,75,255,0.45), rgba(123,31,162,0.55));
}
.pack-price-owned {
    background: linear-gradient(180deg, rgba(139,195,74,0.35), rgba(61,122,14,0.45)) !important;
    border-color: #3a6e10 !important; color: #8bc34a !important;
}

/* ============ COMPANION SLOTS (beside main brawler) ============ */
.companion-slot {
    width: 62px; height: 90px; flex-shrink: 0;
    display: none; align-items: flex-end; justify-content: center;
    align-self: center; position: relative;
}
.companion-slot-left  { margin-right: -6px; }
.companion-slot-right { margin-left: -6px; }

/* ============ COMPANION MANAGEMENT STRIP ============ */
#companions-strip {
    display: flex; gap: 8px; justify-content: center; align-items: center;
    padding: 2px 8px 0; flex-shrink: 0;
}
.companion-mini {
    width: 44px; height: 44px; border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.38); cursor: pointer;
    position: relative; display: flex; align-items: center; justify-content: center;
    transition: all 0.18s;
}
.companion-mini:active { transform: scale(0.9); }
.companion-mini-img { width: 38px; height: 38px; object-fit: contain; }
.companion-lock-icon {
    position: absolute; bottom: 1px; right: 2px; font-size: 10px; line-height: 1;
}
.companion-equipped-dot {
    position: absolute; top: -3px; right: -3px;
    width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #000;
}

/* ============ PACK POPUP ============ */
.pack-popup-content {
    position: relative;
    background: linear-gradient(160deg, #1a0830, #0d0e2b 60%, #080820);
    border-radius: 26px; border: 4px solid var(--accent-purple);
    padding: 24px 22px 20px; max-width: 340px; width: 90%; text-align: center;
    box-shadow: 0 0 60px rgba(178,75,255,0.25), 0 24px 60px rgba(0,0,0,0.85);
    animation: popIn 0.4s ease-out;
    max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.pack-popup-content::-webkit-scrollbar { width: 3px; }
.pack-popup-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
#pack-glow-circle {
    width: 160px; height: 160px; margin: 0 auto 10px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    animation: heroGlowAnim 2.5s ease-in-out infinite;
}
#pack-glow-circle img { width: 140px; height: 140px; object-fit: contain; animation: heroFloat 3s ease-in-out infinite; }
.pack-popup-gems-row {
    font-size: 16px; color: var(--accent-blue); margin: 6px 0 10px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}
.pack-buy-btn {
    width: 100%; padding: 13px; font-size: 17px; letter-spacing: 1.5px;
    background: linear-gradient(180deg, #b24bff, #7b1fa2);
    color: #fff; border: 3px solid #e040fb;
    box-shadow: 0 4px 20px rgba(178,75,255,0.5);
    margin-bottom: 8px; border-radius: 14px; transition: all 0.2s;
}
.pack-buy-btn:active { transform: scale(0.96); }
.pack-buy-btn.pack-owned {
    background: linear-gradient(180deg, var(--accent-green), #3d7a0e);
    border-color: #3a6e10; color: #1a3a00; box-shadow: none; pointer-events: none;
}
.pack-equip-btn {
    width: 100%; padding: 13px; font-size: 17px; letter-spacing: 1.5px;
    background: linear-gradient(180deg, #4dc3ff, #0070bb);
    color: #fff; border: 3px solid #4dc3ff;
    box-shadow: 0 4px 20px rgba(77,195,255,0.4);
    margin-bottom: 8px; border-radius: 14px; transition: all 0.2s;
}
.pack-equip-btn:active { transform: scale(0.96); }
.pack-equip-btn.pack-remove {
    background: linear-gradient(180deg, #ff6060, #bb1a1a);
    border-color: #ff4040; box-shadow: 0 4px 20px rgba(255,60,60,0.4);
}

/* ============ GEM UPGRADES ============ */
.gem-upgrades-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 8px 10px;
}
.gem-upgrade-card {
    background: linear-gradient(180deg, #1a1035 0%, #0e0f26 100%);
    border: 2px solid #2a1f55; border-radius: 16px; padding: 12px 10px 10px;
    text-align: center; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
    position: relative; overflow: hidden;
}
.gem-upgrade-card:not(.maxed):not(.disabled):active { transform: scale(0.94); }
.gem-upgrade-card.disabled { opacity: 0.45; }
.gem-upgrade-card.maxed { opacity: 0.6; cursor: default; }
.gem-upg-icon { font-size: 30px; margin-bottom: 5px; line-height: 1; }
.gem-upg-name { font-size: 12px; font-weight: bold; color: #fff; letter-spacing: 0.5px; margin-bottom: 3px; }
.gem-upg-desc { font-size: 10px; color: rgba(255,255,255,0.55); margin-bottom: 5px; }
.gem-upg-level { font-size: 10px; margin-bottom: 6px; font-weight: bold; }
.gem-upg-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    border: 1px solid rgba(178,75,255,0.3); border-radius: 10px;
    padding: 5px 8px; font-size: 14px; font-weight: bold; color: #fff;
    background: rgba(178,75,255,0.1);
}
.gem-upg-cost-icon { width: 14px; height: 14px; object-fit: contain; }
.gem-upg-btn.maxed-btn {
    background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.4); font-size: 11px; letter-spacing: 0.5px;
}

/* ============ TROPHY SHOP ============ */
.trophy-shop-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 8px 10px;
}
.trophy-shop-card {
    background: linear-gradient(180deg, #1e2010 0%, #0e140a 100%);
    border: 2px solid #ffc80033; border-radius: 16px; padding: 14px 10px 10px;
    text-align: center; cursor: pointer; transition: transform 0.15s;
    position: relative; overflow: hidden;
}
.trophy-shop-card:not(.disabled):active { transform: scale(0.94); }
.trophy-shop-card.disabled { opacity: 0.45; cursor: not-allowed; }
.trophy-shop-card.best  { border-color: #ffc80077; box-shadow: 0 0 14px #ffc80022; }
.trophy-shop-card.best2 { border-color: #ffc800bb; box-shadow: 0 0 20px #ffc80044; background: linear-gradient(180deg, #252510 0%, #141408 100%); }
.trophy-shop-badge {
    position: absolute; top: 6px; right: 8px;
    color: #ffc800; font-size: 13px; line-height: 1;
}
.trophy-shop-icon { width: 40px; height: 40px; object-fit: contain; margin-bottom: 5px; }
.trophy-shop-amount {
    color: #ffc800; font-size: 15px; font-weight: bold; margin-bottom: 7px;
    font-family: 'Lilita One', sans-serif; letter-spacing: 0.5px;
}
.trophy-shop-cost {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    border: 1px solid rgba(178,75,255,0.3); border-radius: 10px;
    padding: 5px 8px; font-size: 14px; font-weight: bold; color: #fff;
    background: rgba(178,75,255,0.1);
}
.trophy-shop-gem-icon { width: 14px; height: 14px; object-fit: contain; }

/* ============ INFO / CONFIRM POPUPS ============ */
#confirm-popup { z-index: 2000; }
.info-popup-content, .confirm-popup-content {
    background: linear-gradient(160deg, #1e1040, #0d0e2b);
    border-radius: 20px; border: 3px solid rgba(100,80,200,0.4);
    padding: 28px 24px 22px; max-width: 310px; width: 88%;
    text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    animation: popIn 0.3s ease-out;
}
.info-popup-text, .confirm-popup-text {
    font-size: 17px; color: #fff; line-height: 1.45;
    margin-bottom: 20px; font-family: 'Lilita One', sans-serif;
}
.confirm-popup-btns {
    display: flex; gap: 10px;
}
.confirm-popup-btns .btn { flex: 1; padding: 13px 8px; font-size: 16px; }

/* ============ DESKTOP SIDE PANELS ============ */
.dsp {
    display: none;
    position: fixed; top: 0; bottom: 0;
    width: calc(50vw - 285px);
    z-index: 0;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
}
.dsp-left  { left: 0; }
.dsp-right { right: 0; }

@media (min-width: 920px) { .dsp { display: flex; } }

.dsp-inner {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px; padding: 24px 10px;
    position: relative; width: 100%; height: 100%;
}

/* фоновое свечение */
.dsp-glow {
    position: absolute; width: 240px; height: 240px;
    border-radius: 50%; opacity: 0.18; filter: blur(70px);
    animation: dspGlow 3.5s ease-in-out infinite;
}
.dsp-glow-mortis { background: radial-gradient(#ff5050, #8b0000); }
.dsp-glow-mandy  { background: radial-gradient(#e040fb, #7b1fa2); }
@keyframes dspGlow {
    0%,100% { transform: scale(1);   opacity: 0.18; }
    50%      { transform: scale(1.5); opacity: 0.32; }
}

/* герой */
.dsp-hero {
    width: min(200px, 85%); object-fit: contain;
    filter: drop-shadow(0 10px 36px rgba(0,0,0,0.75));
    position: relative; z-index: 2;
    animation: dspFloat 4s ease-in-out infinite;
}
.dsp-hero-l { animation-delay: 0s; }
.dsp-hero-r { animation-delay: -2s; }
@keyframes dspFloat {
    0%,100% { transform: translateY(0);    }
    50%      { transform: translateY(-15px); }
}

/* текст */
.dsp-info {
    display: flex; flex-direction: column;
    align-items: center; gap: 5px;
    position: relative; z-index: 2;
}
.dsp-rarity {
    font-size: 10px; letter-spacing: 2.5px;
    padding: 3px 14px; border-radius: 30px;
    border: 1px solid;
}
.dsp-mythic { color: #ff5050; border-color: #ff5050; background: rgba(255,80,80,0.12); text-shadow: 0 0 8px #ff5050; }
.dsp-epic   { color: #d750ff; border-color: #d750ff; background: rgba(215,80,255,0.12); text-shadow: 0 0 8px #d750ff; }
.dsp-name {
    font-size: clamp(20px, 2.2vw, 30px); letter-spacing: 3px;
    color: #fff; text-shadow: 2px 2px 0 #000, 0 0 18px rgba(255,255,255,0.25);
}
.dsp-tagline {
    font-size: clamp(10px, 1vw, 13px); color: rgba(255,255,255,0.45);
    letter-spacing: 1px; line-height: 1.6; text-align: center;
    font-family: 'Lilita One', sans-serif;
}

/* тонкая граница-разделитель */
.dsp-left::after, .dsp-right::before {
    content: '';
    position: absolute; top: 15%; bottom: 15%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(100,80,200,0.3) 30%, rgba(100,80,200,0.3) 70%, transparent);
}
.dsp-left::after  { right: 0; }
.dsp-right::before { left: 0; }

/* ============ FLYING GEM ============ */
.flying-gem {
    position: fixed; z-index: 200;
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer; pointer-events: auto; touch-action: manipulation;
    user-select: none; -webkit-user-select: none;
    animation: flyGemMove 4s linear forwards;
}
.flying-gem-img {
    width: 48px; height: 48px; object-fit: contain;
    filter: drop-shadow(0 0 12px #b24bff) drop-shadow(0 0 5px rgba(178,75,255,0.6));
    animation: flyGemBob 0.65s ease-in-out infinite alternate;
}
.flying-gem-label {
    color: #fff; font-size: 15px;
    font-family: 'Lilita One', sans-serif; letter-spacing: 1px;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    margin-top: 1px;
}
@keyframes flyGemMove {
    from { transform: translateX(0);                   opacity: 1; }
    to   { transform: translateX(var(--fly-dist));     opacity: 0.85; }
}
@keyframes flyGemBob {
    from { transform: translateY(0)    rotate(-6deg); }
    to   { transform: translateY(-10px) rotate(6deg); }
}
@keyframes flyGemCatch {
    0%   { transform: scale(1);   opacity: 1; }
    55%  { transform: scale(2.2); opacity: 1; }
    100% { transform: scale(0);   opacity: 0; }
}

/* ============ PAUSE BUTTON (header) ============ */
.pause-btn {
    background: rgba(0,0,0,0.45); border: 2px solid rgba(255,255,255,0.18);
    border-radius: 9px; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    cursor: pointer; touch-action: manipulation; flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.pause-btn:active { background: rgba(255,200,0,0.18); border-color: var(--accent-yellow); }
.pause-btn .pause-bar {
    display: inline-block; width: 4px; height: 14px;
    background: #fff; border-radius: 2px;
    box-shadow: 0 0 4px rgba(255,255,255,0.5);
}
/* When paused — show play triangle */
.pause-btn.is-paused .pause-bar { display: none; }
.pause-btn.is-paused::after {
    content: '▶'; color: var(--accent-yellow); font-size: 14px;
    line-height: 1; text-shadow: 0 0 6px rgba(255,200,0,0.7);
}

/* ============ PAUSE OVERLAY ============ */
#pause-overlay {
    position: fixed; inset: 0; z-index: 600;
    background: rgba(4,0,18,0.82); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
}
#pause-overlay.active { display: flex; }
.pause-card {
    display: flex; flex-direction: column; align-items: center; gap: 18px;
    background: linear-gradient(155deg, rgba(35,5,80,0.97), rgba(8,0,35,0.99));
    border: 2px solid rgba(160,80,255,0.55);
    border-radius: 26px; padding: 36px 32px;
    box-shadow: 0 0 50px rgba(120,50,255,0.35), 0 0 100px rgba(120,50,255,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: pauseCardIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes pauseCardIn {
    from { transform: scale(0.72); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.pause-card-bars {
    display: flex; gap: 12px; margin-bottom: 4px;
}
.pause-card-bar {
    display: block; width: 18px; height: 64px;
    background: linear-gradient(180deg, #fff150 0%, #ffaa00 100%);
    border-radius: 7px;
    box-shadow: 0 0 20px rgba(255,200,0,0.65), 0 0 6px rgba(255,200,0,0.9);
}
.pause-card-title {
    font-family: 'Lilita One', sans-serif; font-size: 32px;
    color: #fff; letter-spacing: 6px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 0 20px rgba(180,100,255,0.4);
}
.pause-resume-btn {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none; border-radius: 16px; padding: 14px 38px;
    font-family: 'Lilita One', sans-serif; font-size: 20px;
    color: #2a0a00; cursor: pointer; touch-action: manipulation;
    box-shadow: 0 4px 18px rgba(255,160,0,0.55), 0 1px 0 rgba(255,255,255,0.3) inset;
    transition: transform 0.12s;
}
.pause-resume-btn:active { transform: scale(0.94); }
.pause-resume-arrow { font-size: 22px; }

/* ============ TUTORIAL (multi-step highlight) ============ */
.tut-overlay {
    position: absolute; inset: 0; z-index: 500;
    animation: tutFadeIn 0.3s ease;
}
@keyframes tutFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* SVG затемнение с вырезом */
.tut-mask-svg {
    position: absolute; inset: 0; width: 100%; height: 100%;
}
.tut-dim { fill: rgba(0,0,0,0.72); }
.tut-hole { transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); }

/* Пульсирующая рамка вокруг элемента */
.tut-highlight-ring {
    position: absolute; border-radius: 16px;
    border: 2.5px solid var(--accent-yellow);
    box-shadow: 0 0 18px rgba(255,200,0,0.45), inset 0 0 18px rgba(255,200,0,0.12);
    animation: tutRingPulse 1.5s ease-in-out infinite;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes tutRingPulse {
    0%, 100% { box-shadow: 0 0 18px rgba(255,200,0,0.45), inset 0 0 18px rgba(255,200,0,0.12); }
    50% { box-shadow: 0 0 30px rgba(255,200,0,0.7), inset 0 0 28px rgba(255,200,0,0.2); }
}

/* Тултип */
.tut-tooltip {
    position: absolute; z-index: 503;
    background: linear-gradient(145deg, #2a1b5e, #1a0f3a);
    border: 2px solid var(--accent-yellow);
    border-radius: 16px; padding: 14px 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 20px rgba(255,200,0,0.15);
    text-align: center;
    animation: tutTooltipAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tutTooltipAppear {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.tut-title {
    font-family: 'Lilita One', sans-serif;
    font-size: 22px; color: var(--accent-yellow);
    text-shadow: 1px 1px 0 #000; margin-bottom: 4px;
}
.tut-sub {
    font-family: 'Lilita One', sans-serif;
    font-size: 14px; color: #c8c8e0; line-height: 1.3;
    margin-bottom: 10px;
}
.tut-skip-btn {
    font-family: 'Lilita One', sans-serif;
    font-size: 15px; color: #fff; cursor: pointer;
    background: linear-gradient(180deg, var(--accent-yellow), var(--accent-orange));
    border: 2px solid #b8860b; border-radius: 12px;
    padding: 7px 28px; text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
    box-shadow: 0 3px 10px rgba(255,200,0,0.3);
    transition: transform 0.15s;
}
.tut-skip-btn:active { transform: scale(0.93); }

/* Стрелка-треугольник от тултипа к элементу */
.tut-arrow {
    position: absolute; left: 50%;
    width: 0; height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    transform: translateX(-50%);
    filter: drop-shadow(0 0 6px rgba(255,200,0,0.4));
}
.tut-arrow-up {
    top: -11px;
    border-bottom: 12px solid var(--accent-yellow);
}
.tut-arrow-down {
    bottom: -11px;
    border-top: 12px solid var(--accent-yellow);
}

/* Адаптив для маленьких телефонов */
@media (max-width: 360px) {
    .tut-title { font-size: 18px; }
    .tut-sub { font-size: 12px; }
    .tut-skip-btn { font-size: 13px; padding: 6px 22px; }
    .tut-tooltip { padding: 10px 14px; border-radius: 12px; }
}
@media (max-height: 540px) {
    .tut-title { font-size: 17px; }
    .tut-sub { font-size: 11px; margin-bottom: 6px; }
    .tut-skip-btn { font-size: 12px; padding: 5px 18px; }
    .tut-tooltip { padding: 8px 12px; }
}

/* ============ MOBILE HEADER FIX ============ */
@media (max-width: 420px) {
    #header { padding: 0 4px; }
    .currency-group { gap: 4px; }
    .currency { padding: 2px 6px 2px 3px; }
    .currency span { font-size: 15px; min-width: 28px; }
    .currency-icon { width: 24px; height: 24px; }
    .header-btn img { height: 28px; }
    .header-icon-img { height: 32px !important; }
    .header-btn-label { font-size: 11px; }
    .level-display { padding: 2px 6px; }
    .level-display #player-level { font-size: 16px; }
    .level-label { font-size: 10px; }
}

/* ============ TINY WIDTH SCREENS (320px) ============ */
@media (max-width: 340px) {
    .currency span { font-size: 13px; min-width: 24px; }
    .currency-icon { width: 20px; height: 20px; }
    .currency { padding: 2px 4px 2px 2px; }
    .header-btn img { height: 24px; }
    .header-icon-img { height: 28px !important; }
    .header-btn-label { font-size: 10px; }
    .nav-label { font-size: 11px; }
    .nav-icon-home { font-size: 22px; }
    .screen-header { font-size: 22px; }
}

/* ============ SHORT SCREENS ============ */
@media (max-height: 640px) {
    :root { --header-height: 44px; --nav-height: 54px; }
    #main-brawler-img { height: 200px; max-width: 200px; }
    .currency-icon { width: 22px; height: 22px; }
    .currency span { font-size: 14px; min-width: 28px; }
    .currency { padding: 2px 6px 2px 3px; }
    .header-btn img { height: 28px; }
    .header-icon-img { height: 30px !important; }
    .header-btn-label { font-size: 10px; }
    .level-display { padding: 2px 6px; }
    .level-display #player-level { font-size: 14px; }
    .level-label { font-size: 9px; }
    .stats-bar { gap: 4px; }
    .stat-item { padding: 1px 8px; }
    .stat-label { font-size: 8px; }
    .stat-value { font-size: 13px; }
    #active-brawlers-strip { padding: 3px 6px; }
    .strip-title { font-size: 9px; margin-bottom: 1px; }
    .strip-brawler { width: 42px; }
    .strip-brawler-icon { width: 36px; height: 36px; }
    .strip-brawler-name { font-size: 8px; max-width: 42px; }
    #trophy-road { margin: 1px 0; }
    .trophy-road-bar { height: 10px; }
    .trophy-road-label { font-size: 9px; }
    .trophy-road-title { font-size: 9px; }
    #quick-upgrade { padding: 3px 5px; }
    .qu-icon { width: 30px; height: 30px; }
    .qu-name { font-size: 11px; }
    .qu-cost { font-size: 10px; }
    #click-area-wrapper { min-height: 0; flex: 1; overflow: visible; }
    #bg-selector { gap: 2px; }
    .bg-btn { padding: 2px 3px; font-size: 8px; min-height: 22px; }
    #game-screen { gap: 2px; padding: 3px 6px; }
    .ad-x2-btn { padding: 2px 8px; }
    .ad-x2-label { font-size: 10px; }
    .ad-x2-value { font-size: 13px; }
    #companions-strip { display: none; }
    #click-area { padding-bottom: 6px; }
    .brawler-arrow img { width: 40px; height: 40px; }
    .nav-icon-img { max-height: 46px; }
    .nav-label { font-size: 11px; }
}
@media (max-height: 540px) {
    :root { --header-height: 40px; --nav-height: 48px; }
    #main-brawler-img { height: 170px; max-width: 170px; }
    #click-area-wrapper { min-height: 0; flex: 1; padding-bottom: 0; overflow: visible; }
    .currency-icon { width: 20px; height: 20px; }
    .currency span { font-size: 13px; min-width: 24px; }
    .header-btn img { height: 24px; }
    .header-icon-img { height: 26px !important; }
    .header-btn-label { font-size: 9px; }
    .level-display #player-level { font-size: 13px; }
    .level-label { font-size: 8px; }
    .stats-bar { display: none; }
    #bg-selector { display: none; }
    #active-brawlers-strip { display: none; }
    #trophy-road { display: none; }
    #quick-upgrade { padding: 2px 5px; }
    .qu-icon { width: 28px; height: 28px; }
    .qu-name { font-size: 10px; }
    .qu-cost { font-size: 10px; }
    #game-screen { gap: 2px; padding: 2px 6px; }
    #click-area { padding-bottom: 4px; }
    .brawler-arrow img { width: 36px; height: 36px; }
    .nav-icon-img { max-height: 40px; }
    .nav-label { font-size: 10px; }
}
@media (max-height: 480px) {
    :root { --header-height: 36px; --nav-height: 42px; }
    #main-brawler-img { height: 140px; max-width: 140px; }
    #click-area-wrapper { min-height: 0; flex: 1; overflow: visible; }
    #click-area::before, #click-area::after { display: none; }
    #quick-upgrade { display: none; }
    #game-screen { gap: 1px; padding: 2px 4px; }
    .brawler-arrow img { width: 28px; height: 28px; }
    #click-area { padding-bottom: 2px; }
    .currency-icon { width: 18px; height: 18px; }
    .currency span { font-size: 12px; min-width: 20px; }
    .header-btn img { height: 22px; }
    .header-icon-img { height: 24px !important; }
    .header-btn-label { font-size: 8px; }
    .level-display #player-level { font-size: 12px; }
    .nav-icon-img { max-height: 34px; }
    .nav-label { font-size: 9px; }
}

/* ============ STARTER BOX ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.starter-box-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.3s ease;
}
.starter-box-card {
    background: linear-gradient(145deg, #2a1b5e, #1a0f3a);
    border: 3px solid #ffc800;
    border-radius: 20px; padding: 30px 36px;
    text-align: center; max-width: 320px; width: 85%;
    box-shadow: 0 0 40px rgba(255,200,0,0.3), inset 0 0 30px rgba(255,200,0,0.05);
    animation: starterBoxAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes starterBoxAppear {
    from { transform: scale(0.3) rotate(-10deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}
.starter-box-title {
    font-family: 'Lilita One', sans-serif;
    font-size: 24px; color: #ffc800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 16px;
}
.starter-box-icon {
    font-size: 80px; line-height: 1;
    margin: 10px 0 20px;
    animation: boxBounce 1s ease infinite;
}
@keyframes boxBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}
.starter-box-explode {
    animation: boxExplode 0.6s ease forwards !important;
}
@keyframes boxExplode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8) rotate(15deg); opacity: 1; filter: brightness(3); }
    100% { transform: scale(0); opacity: 0; }
}
.starter-box-btn {
    font-family: 'Lilita One', sans-serif;
    font-size: 20px; color: #fff;
    background: linear-gradient(180deg, #ff8c00, #ff5500);
    border: none; border-radius: 14px;
    padding: 12px 40px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,85,0,0.5);
    transition: transform 0.15s;
    touch-action: manipulation;
}
.starter-box-btn:active { transform: scale(0.95); }
.starter-box-rewards {
    display: flex; flex-direction: column; gap: 12px;
    margin: 20px 0;
}
.starter-reward-item {
    font-family: 'Lilita One', sans-serif;
    font-size: 18px; color: #fff;
    background: rgba(255,255,255,0.08);
    border-radius: 10px; padding: 10px 16px;
    display: flex; align-items: center; gap: 10px;
    animation: rewardSlide 0.4s ease backwards;
}
.starter-reward-item:nth-child(1) { animation-delay: 0.1s; }
.starter-reward-item:nth-child(2) { animation-delay: 0.25s; }
.starter-reward-item:nth-child(3) { animation-delay: 0.4s; }
@keyframes rewardSlide {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.starter-box-revealed {
    animation: cardPulse 0.4s ease;
}
@keyframes cardPulse {
    0% { transform: scale(0.9); } 50% { transform: scale(1.03); } 100% { transform: scale(1); }
}

/* ============ FEVER MODE ============ */
.fever-badge {
    position: absolute; right: 8px; top: 38%; z-index: 50;
    margin-top: -30px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: linear-gradient(135deg, #ff0040, #ff8c00, #ffc800);
    background-size: 200% 200%;
    animation: feverBg 0.6s linear infinite;
    border: 2px solid #ff4500; border-radius: 12px;
    padding: 6px 12px;
    box-shadow: 0 0 14px rgba(255,60,0,0.7), 0 0 30px rgba(255,200,0,0.3);
}
@keyframes feverBg {
    from { background-position: 0% 50%; }
    to { background-position: 200% 50%; }
}
.fever-badge-text {
    font-family: 'Lilita One', sans-serif;
    font-size: 16px; color: #fff; font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    animation: feverPulse 0.3s ease infinite alternate;
}
@keyframes feverPulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}
.fever-badge-timer {
    font-family: 'Lilita One', sans-serif;
    font-size: 13px; color: #fff;
    background: rgba(0,0,0,0.4); border-radius: 8px;
    padding: 1px 5px; min-width: 18px; text-align: center;
}
.fever-ending {
    animation: fadeOut 0.5s ease forwards;
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-100%); }
}
/* Визуальные эффекты на click-area во время Fever */
#click-area.fever-active {
    animation: feverGlow 0.3s ease infinite alternate;
}
@keyframes feverGlow {
    from { filter: drop-shadow(0 0 10px rgba(255,200,0,0.4)); }
    to { filter: drop-shadow(0 0 25px rgba(255,60,0,0.7)); }
}
#click-area.fever-active .click-effect {
    color: #ffc800 !important;
    font-size: 28px !important;
    text-shadow: 0 0 15px rgba(255,200,0,0.8) !important;
}

/* ============ FEVER EXTEND MODAL ============ */
.fever-extend-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.25s ease;
}
.fever-extend-card {
    background: linear-gradient(135deg, #1a1035, #2a1050);
    border: 2px solid #ff6600;
    border-radius: 18px;
    padding: 24px 28px;
    text-align: center;
    max-width: 280px; width: 85%;
    max-height: 90vh; max-height: 90dvh; overflow-y: auto;
    box-shadow: 0 0 40px rgba(255,100,0,0.4);
    animation: popInSmall 0.3s ease;
}
@keyframes popInSmall {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.fever-extend-icon {
    font-family: 'Lilita One', sans-serif;
    font-size: 42px; color: #ffc800;
    text-shadow: 0 0 20px rgba(255,200,0,0.6);
    margin-bottom: 6px;
    animation: feverPulse 0.4s ease infinite alternate;
}
.fever-extend-title {
    font-family: 'Lilita One', sans-serif;
    font-size: 18px; color: #ff6644;
    margin-bottom: 4px;
}
.fever-extend-desc {
    font-size: 14px; color: #ddd;
    margin-bottom: 16px;
    line-height: 1.3;
}
.fever-extend-btn {
    display: block; width: 100%;
    border: none; border-radius: 12px;
    padding: 12px; margin-bottom: 8px;
    font-family: 'Lilita One', sans-serif;
    font-size: 15px; cursor: pointer;
    transition: transform 0.15s ease;
}
.fever-extend-btn:active { transform: scale(0.95); }
.fever-extend-watch {
    background: linear-gradient(135deg, #ff6600, #ffc800);
    color: #1a1035;
    box-shadow: 0 4px 15px rgba(255,100,0,0.5);
}
.fever-extend-skip {
    background: rgba(255,255,255,0.1);
    color: #999;
    font-size: 13px;
}
.fever-extend-closing {
    animation: fadeOut 0.3s ease forwards;
}

/* === Prestige Section === */
.prestige-section {
    grid-column: 1 / -1;
    margin-top: 16px;
    padding: 20px 16px;
    background: linear-gradient(135deg, #1a0a2e, #2d1050, #1a0a2e);
    border: 2px solid #ffc800;
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255,200,0,0.15), inset 0 0 30px rgba(255,200,0,0.05);
}
.prestige-section::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255,200,0,0.1) 0%, transparent 60%);
    pointer-events: none;
}
.prestige-header {
    font-family: 'Lilita One', sans-serif;
    font-size: 22px;
    color: #ffc800;
    text-shadow: 0 0 10px rgba(255,200,0,0.5);
    margin-bottom: 8px;
}
.prestige-current {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.prestige-star {
    font-size: 18px;
}
.prestige-lvl-text {
    color: #e0d0ff;
    font-size: 14px;
    font-family: 'Lilita One', sans-serif;
}
.prestige-mult-badge {
    background: linear-gradient(135deg, #ffc800, #ff8c00);
    color: #1a0a2e;
    font-family: 'Lilita One', sans-serif;
    font-size: 14px;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: bold;
}
.prestige-desc {
    color: #b0a0cc;
    font-size: 13px;
    margin-bottom: 6px;
}
.prestige-reward {
    color: #ffc800;
    font-size: 15px;
    font-family: 'Lilita One', sans-serif;
    margin-bottom: 12px;
    text-shadow: 0 0 8px rgba(255,200,0,0.3);
}
.prestige-btn {
    background: linear-gradient(135deg, #ffc800, #ff8c00) !important;
    color: #1a0a2e !important;
    font-family: 'Lilita One', sans-serif !important;
    font-size: 18px !important;
    padding: 12px 32px !important;
    border-radius: 14px !important;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255,200,0,0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: prestigePulse 2s ease-in-out infinite;
}
.prestige-btn:active {
    transform: scale(0.95) !important;
}
@keyframes prestigePulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(255,200,0,0.4); }
    50% { box-shadow: 0 4px 30px rgba(255,200,0,0.7), 0 0 40px rgba(255,200,0,0.2); }
}
.prestige-locked {
    color: #888;
    font-size: 14px;
    font-family: 'Lilita One', sans-serif;
    margin-bottom: 4px;
}
.prestige-progress {
    color: #ffc800;
    font-size: 16px;
    font-family: 'Lilita One', sans-serif;
}

/* Prestige Confirm Modal */
.prestige-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.8);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.25s ease;
}
.prestige-confirm-card {
    background: linear-gradient(135deg, #1a0a2e, #2d1050);
    border: 2px solid #ffc800;
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    max-width: 300px;
    width: 85%;
    max-height: 90vh; max-height: 90dvh; overflow-y: auto;
    box-shadow: 0 0 40px rgba(255,200,0,0.3);
    animation: popIn 0.3s ease;
}
.prestige-confirm-title {
    font-family: 'Lilita One', sans-serif;
    font-size: 24px;
    color: #ffc800;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255,200,0,0.5);
}
.prestige-confirm-stars {
    font-size: 28px;
    margin-bottom: 12px;
}
.prestige-confirm-desc {
    color: #e0d0ff;
    font-size: 14px;
    margin-bottom: 12px;
    white-space: pre-line;
    line-height: 1.5;
}
.prestige-confirm-reward {
    color: #ffc800;
    font-size: 16px;
    font-family: 'Lilita One', sans-serif;
    margin-bottom: 16px;
    text-shadow: 0 0 8px rgba(255,200,0,0.3);
}
.prestige-confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.prestige-confirm-yes {
    background: linear-gradient(135deg, #ffc800, #ff8c00) !important;
    color: #1a0a2e !important;
    font-family: 'Lilita One', sans-serif !important;
    font-size: 16px !important;
    padding: 12px !important;
    border-radius: 12px !important;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,200,0,0.4);
}
.prestige-confirm-yes:active { transform: scale(0.95); }
.prestige-confirm-no {
    background: rgba(255,255,255,0.1) !important;
    color: #999 !important;
    font-size: 13px !important;
    padding: 10px !important;
    border-radius: 12px !important;
    border: none !important;
    cursor: pointer;
}

/* Prestige Effect Overlay */
.prestige-effect-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.3s ease;
}
.prestige-effect-content {
    text-align: center;
    animation: prestigeZoom 2s ease;
}
.prestige-effect-stars {
    font-size: 48px;
    margin-bottom: 16px;
    animation: prestigeStarSpin 1.5s ease;
}
.prestige-effect-title {
    font-family: 'Lilita One', sans-serif;
    font-size: 36px;
    color: #ffc800;
    text-shadow: 0 0 20px rgba(255,200,0,0.7);
    margin-bottom: 12px;
}
.prestige-effect-mult {
    font-family: 'Lilita One', sans-serif;
    font-size: 48px;
    background: linear-gradient(135deg, #ffc800, #ff8c00, #ffc800);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: feverBg 1s linear infinite;
    text-shadow: none;
}
@keyframes prestigeZoom {
    0% { transform: scale(0.3); opacity: 0; }
    30% { transform: scale(1.2); opacity: 1; }
    50% { transform: scale(1); }
    100% { transform: scale(1); }
}
@keyframes prestigeStarSpin {
    0% { transform: rotate(-30deg) scale(0.5); opacity: 0; }
    50% { transform: rotate(10deg) scale(1.2); opacity: 1; }
    100% { transform: rotate(0deg) scale(1); }
}
@keyframes popIn {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============ UI SCALE MULTIPLIER (auto for small screens) ============ */
