:root {
    --bg-color: #060B14;
    --text-color: #F8FAFC;
    --hint-color: #94A3B8;
    --button-color: #00E5FF;
    --button-text-color: #060B14;
    --secondary-bg-color: #060B14;
    --accent: #00E5FF;
    --background: #060B14;
    --foreground: #F8FAFC;
    --muted: #94A3B8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* touch-action: none; -- REMOVED to allow scrolling */
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    background: radial-gradient(circle at 50% 50%, #0c1221 0%, #060b14 100%);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbFloat 25s infinite alternate ease-in-out;
}

.orb-1 {
    width: 350px;
    height: 350px;
    background: var(--accent);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 450px;
    height: 450px;
    background: #7000ff;
    bottom: -150px;
    left: -150px;
    animation-delay: -5s;
}

.orb-3 {
    width: 280px;
    height: 280px;
    background: #00e5ff;
    top: 30%;
    left: 10%;
    opacity: 0.15;
    animation-delay: -12s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.1); }
}

.game-container {
    width: 100%;
    height: 100vh;
    background-color: transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-overflow-scrolling: none;
    overscroll-behavior: none;
    touch-action: none;
}

.top-panel {
    padding: 0 12px 0 16px !important;
    color: var(--foreground);
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    height: 70px !important;
    border: none;
    margin: 12px;
    border-radius: 20px;
    gap: 8px;
}

.info-header-btn {
    width: 44px !important;
    height: 44px !important;
    flex: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--accent) !important;
    transition: all 0.3s ease !important;
}

.info-header-btn:active {
    transform: scale(0.9) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.info-header-btn .tab-icon {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    opacity: 1 !important;
}

.user-info:empty {
    display: none;
}

.balance-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    flex: 1 !important;
    margin-right: 4px !important;
    text-align: right !important;
}

.coins-display {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: var(--foreground) !important;
    text-align: right !important;
}

.dollars-display {
    font-size: 13px !important;
    color: var(--hint-color) !important;
    font-weight: 600 !important;
    text-align: right !important;
}

.coins-icon {
    margin-right: 12px;
    font-size: 36px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* --- Unified Modal Design System --- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(0, 242, 255, 0.2);
    border-radius: 32px;
    padding: 24px;
    width: 92%;
    max-width: 420px;
    max-height: 80vh;
    max-height: 80dvh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    margin: auto !important;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.modal-content h2 {
    margin: 0 0 24px 0;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #22c55e;
    position: relative;
    padding-bottom: 16px;
}

.modal-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #22c55e;
    border-radius: 2px;
}


.main-game-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: transparent;
    position: relative;
    min-height: calc(100vh - 120px);
    overflow: hidden;
    -webkit-overflow-scrolling: none;
    overscroll-behavior: none;
    touch-action: none;
}

.main-game-area::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
}

.main-game-area::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    /* background: 
        linear-gradient(90deg, #000000 1px, transparent 1px),
        linear-gradient(0deg, #000000 1px, transparent 1px); */
    /* background: 
        linear-gradient(90deg, #02c28f 1px, transparent 1px),
        linear-gradient(0deg, #02c28f 1px, transparent 1px); */
    background-size: 40px 40px;
    opacity: 0.3;
    animation: gridMove 15s linear infinite;
    z-index: 0;
    transform-origin: center;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, 20px) rotate(0.5deg);
    }
    50% {
        transform: translate(0, 40px) rotate(0deg);
    }
    75% {
        transform: translate(-20px, 20px) rotate(-0.5deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.05;
        transform: scale(1) rotate(0deg);
    }
    25% {
        opacity: 0.08;
        transform: scale(1.1) rotate(1deg);
    }
    50% {
        opacity: 0.05;
        transform: scale(1) rotate(0deg);
    }
    75% {
        opacity: 0.08;
        transform: scale(1.1) rotate(-1deg);
    }
}

.click-button {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(0, 242, 255, 0.4);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transform-origin: center;
    touch-action: manipulation;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.click-button:active {
    transform: scale(0.92);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 242, 255, 0.4);
}

.click-button::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, transparent 50%, var(--accent-purple) 100%);
    opacity: 0.3;
    z-index: -1;
}

.click-button::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

@keyframes shine {
    0% {
        background-position: 0% 50%;
        box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 35px rgba(0, 229, 255, 0.4);
    }
    100% {
        background-position: 0% 50%;
        box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    }
}

.click-button:active {
    transform: scale(0.95);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2),
                inset 0 -4px 8px rgba(0, 0, 0, 0.2),
                0 0 10px rgba(76, 175, 80, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.click-button:not(:active) {
    transform: scale(1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2),
                inset 0 -8px 16px rgba(0, 0, 0, 0.2),
                0 0 20px rgba(76, 175, 80, 0.3);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.click-animation {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    position: absolute;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.5; }
}

.withdraw-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    margin-top: 10px;
}

#withdraw-amount {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: var(--foreground);
    font-size: 18px;
    text-align: center;
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
}

#withdraw-amount:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.withdraw-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-modern.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-modern.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--foreground);
}

.withdraw-footer {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    font-size: 13px;
}

.footer-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-item .label {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
}

.footer-item .value {
    color: var(--foreground);
    font-weight: 600;
}

.footer-item .value.accent {
    color: var(--accent);
}

.bottom-panel {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 94%;
    max-width: 500px;
    display: flex !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    padding: 10px 0;
    z-index: 1000;
    height: 90px !important;
    border-radius: 28px !important;
    background: rgba(10, 15, 25, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
}

.tab-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    padding: 0;
    min-width: 0;
}

.tab-button .tab-icon {
    width: 28px;
    height: 28px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--accent);
}

.tab-button.active .tab-icon {
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--accent));
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

.tab-icon {
    font-size: 20px;
    margin-bottom: 2px;
    color: #00ac9c;
    transition: color 0.2s;
}

.tab-text {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}


.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 4px;
    overflow-y: auto;
    flex: 1;
    margin: 0;
    -webkit-overflow-scrolling: touch;
}

.upgrade-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.premium-upgrade {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9) 0%, rgba(255, 165, 0, 0.9) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #060B14 !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.upgrade-name {
    color: #22c55e;
    font-size: 17px;
    font-weight: 700;
}

.upgrade-level {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.upgrade-level-premium {
    color: #382b04;
    font-size: 14px;
    font-weight: 500;
}

.upgrade-description {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 5px;
}

.upgrade-description-premium {
    color: #382b04;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 5px;
}

.upgrade-effect {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 12px;
    color: #22c55e;
    font-size: 13px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.upgrade-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.upgrade-price {
    color: #eab308;
    font-weight: 700;
    font-size: 15px;
}

.upgrade-price-premium {
    color: #382b04;
    font-weight: 700;
    font-size: 15px;
}

.upgrade-button {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.upgrade-button:active:not(:disabled) {
    transform: scale(0.96);
}

.upgrade-button:disabled {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .upgrade-card {
        padding: 16px;
        gap: 10px;
        margin-bottom: 12px;
        border-radius: 14px;
    }
    
    .upgrade-name {
        font-size: 16px;
    }
    
    .upgrade-description {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .upgrade-effect {
        padding: 10px;
        font-size: 12px;
    }
    
    .upgrade-price {
        font-size: 14px;
    }
    
    .upgrade-button {
        padding: 7px 14px;
        font-size: 13px;
    }
}

.upgrade-button .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    display: none;
}

.upgrade-button.loading .spinner {
    display: block;
}

.upgrade-button.loading span {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes particleFloatUp {
    0% { transform: translateY(0) scale(0); opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-110vh) scale(1.5); opacity: 0; }
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    animation: particleFloatUp var(--duration) var(--delay) infinite ease-in;
}

/* Coin animation */
@keyframes coinAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.coin-animation {
    animation: coinAnimation 0.3s ease-in-out;
}

/* Новые элементы дизайна */
.stats-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stats-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.stats-item:last-child {
    margin-bottom: 0;
}

.stats-icon {
    margin-right: 8px;
    font-size: 16px;
    color: var(--button-color);
}

.click-effect {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: clickEffect 0.5s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes clickEffect {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--button-color), var(--button-color));
    width: 0%;
    transition: width 0.3s ease;
}

.notification {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translate(-50%, -20px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 242, 255, 0.3);
    color: var(--foreground);
    padding: 12px 24px;
    border-radius: 16px;
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    max-width: 80vw;
}

@keyframes notificationSlide {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.coin-popup {
    position: absolute;
    color: var(--accent);
    font-size: 28px;
    font-weight: 900;
    pointer-events: none;
    z-index: 1000;
    animation: floatUp 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.8), 0 0 30px rgba(0, 229, 255, 0.4);
}

@keyframes floatUp {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(0, -150px) scale(1.5);
        opacity: 0;
    }
}

.coin-popup.critical-hit {
    color: #4CAF50;
    font-size: 36px;
    text-shadow: 0 2px 4px rgba(76, 175, 80, 0.3),
                 0 0 10px rgba(76, 175, 80, 0.5);
    animation: criticalPopup 1.5s ease-out forwards;
}

@keyframes criticalPopup {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1) blur(0);
    }
    50% {
        transform: translate(var(--tx), var(--ty)) scale(1.8) rotate(180deg);
        opacity: 0.8;
        filter: brightness(1.5) blur(0);
    }
    100% {
        transform: translate(calc(var(--tx) * 1.5), calc(var(--ty) * 1.5)) scale(0) rotate(360deg);
        opacity: 0;
        filter: brightness(2) blur(2px);
    }
}

/* Адаптивный дизайн */
@media (max-width: 480px) {
    .click-button {
        width: 200px;
        height: 200px;
    }
    
    /* .coins-display {
        font-size: 24px;
    } */
    
    .stats-panel {
        top: 10px;
        right: 10px;
        padding: 10px;
    }

    .main-game-area::before {
        background-size: 150% auto;
    }
}

@media (max-width: 360px) {
    .main-game-area::before {
        background-size: 150% auto;
    }
}

@keyframes desktopVibrate {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-2px, 2px) rotate(-1deg); }
    50% { transform: translate(2px, -2px) rotate(1deg); }
    75% { transform: translate(-2px, 2px) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.upgrade-effect {
    font-size: 0.9em;
    color: var(--button-color);
    margin: 8px 0;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    text-align: center;
}

.withdraw-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    border-radius: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.withdraw-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--foreground);
    margin-bottom: 12px;
    font-size: 14px;
}

.withdraw-form input:focus {
    outline: none;
    border-color: var(--button-color);
}

.withdraw-form input::placeholder {
    color: var(--hint-color);
}

.withdraw-button {
    background-color: var(--button-color);
    color: var(--button-text-color);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    font-size: 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.withdraw-button:hover {
    opacity: 0.9;
}

.withdraw-button:disabled {
    background: #2d3748;
    cursor: not-allowed;
    opacity: 0.7;
}

.withdraw-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.withdraw-button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.withdraw-info {
    color: var(--hint-color);
    text-align: center;
    margin-top: 15px;
}

.withdraw-error {
    color: #ff4d4f;
    font-size: 14px;
    margin-top: 5px;
    text-align: center;
}

.withdraw-success {
    color: #52c41a;
    font-size: 14px;
    margin-top: 5px;
    text-align: center;
}

/* Медиа-запрос для маленьких экранов */
@media screen and (max-width: 500px) {
    .main-game-area {
        padding-bottom: 140px;
    }
    
    .bottom-panel {
        height: 100px;
    }
}

/* Медиа-запрос для устройств с большой системной панелью */
@media screen and (min-width: 500px) {
    .game-container {
        padding-bottom: 140px;
    }
    
    .bottom-panel {
        height: 80px;
    }
}


.info-content {
    color: var(--text-color);
    line-height: 1.5;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.info-content p {
    margin-bottom: 12px;
    color: var(--hint-color);
    font-size: 14px;
}

.upgrade-level {
    color: var(--hint-color);
    font-size: 14px;
}

button, 
.click-button,
.upgrade-button,
.withdraw-button,
.tab-button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Разрешаем скролл для модальных окон */
.modal-content,
.upgrades-list,
.withdraw-form,
.info-content {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.energy-container {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    padding: 0 20px;
    z-index: 100;
}

.energy-bar {
    position: relative;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.energy-progress {
    height: 100%;
    background: linear-gradient(90deg, #00E5FF, #00A3FF);
    width: 100%;
    transition: width 0.3s ease, background 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.energy-value {
    position: absolute;
    top: -24px;
    right: 0;
    color: var(--foreground);
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.energy-text {
    position: absolute;
    top: -24px;
    left: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loading-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #00ac9c;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.balance-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.info-section, .leaderboard-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-section h3, .leaderboard-section h3 {
    color: var(--button-color);
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333333;
}

.info-text {
    color: var(--hint-color);
    font-size: 14px;
    line-height: 1.5;
}

.info-text p {
    margin-bottom: 12px;
}


.withdraw-info-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
}

.withdraw-info-popup.active {
    display: flex;
}

.withdraw-info-content {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 24px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.conversion-info {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
}

.conversion-info p {
    margin: 5px 0;
    color: var(--text-color);
    font-size: 11px;
    line-height: 1.4;
}

.conversion-info p:first-child {
    color: #4CAF50;
    font-weight: bold;
    font-size: 16px;
}

.withdraw-info-button {
    background: var(--button-color);
    color: var(--background-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.withdraw-info-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.withdraw-info-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.withdraw-info-button .timer {
    font-weight: bold;
}

.withdraw-details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin: 16px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.withdraw-details p {
    margin: 8px 0;
    color: var(--text-color);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.withdraw-details p span:first-child {
    color: var(--hint-color);
}

.withdraw-details p span:last-child {
    font-weight: 500;
    color: var(--button-color);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 1001;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--foreground);
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
}

.info-content p {
    margin: 0;
}

.bonus-info {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 16px;
    padding: 16px;
    margin-top: 8px;
    color: #00F2FF;
    font-weight: 600;
    box-shadow: inset 0 0 20px rgba(0, 242, 255, 0.05);
}

.faq-section {
    text-align: left;
    margin-bottom: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
}

.faq-section h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: var(--foreground);
    text-align: center;
}

.faq-item {
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.faq-item h4 {
    margin: 0;
    padding: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--foreground);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.faq-item h4:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-item h4::after {
    content: '+';
    color: var(--accent);
    font-size: 20px;
    font-weight: 400;
    transition: transform 0.3s;
}

.faq-item.active h4::after {
    transform: rotate(45deg);
}

.faq-item p {
    margin: 0;
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.faq-item.active p {
    padding: 0 16px 16px 16px;
    max-height: 300px;
}

.join-channel-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: #04080F;
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 242, 255, 0.3);
}

.join-channel-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 242, 255, 0.5);
}

.top-players-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.top-player-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.top-player-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-player-item::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: 0.5s;
}

.top-player-item:hover::before {
    left: 100%;
}

.top-player-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.player-rank {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--foreground);
    border-radius: 12px;
    font-weight: 800;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.player-rank.gold {
    background: linear-gradient(135deg, #FFE066 0%, #F2A900 100%);
    color: #1A1A1A;
    box-shadow: 0 0 25px rgba(242, 169, 0, 0.4);
    border: none;
}

.player-rank.silver {
    background: linear-gradient(135deg, #F0F0F0 0%, #A0A0A0 100%);
    color: #1A1A1A;
    box-shadow: 0 0 20px rgba(160, 160, 160, 0.3);
    border: none;
}

.player-rank.bronze {
    background: linear-gradient(135deg, #E69D66 0%, #AD5C24 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(173, 92, 36, 0.3);
    border: none;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.player-name {
    color: var(--foreground);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-earnings {
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-coins {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
}

.chat-button {
    background: rgba(0, 242, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 242, 255, 0.2);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    width: 100%; /* Full width for mobile */
    text-align: center;
}

.chat-button:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 255, 0.3);
}

.no-players {
    text-align: center;
    color: var(--hint-color);
    padding: 20px;
    font-style: italic;
}

.requisites-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

#requisites-input {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #333333;
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    background-color: #1a1a1a;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

#requisites-input:focus {
    outline: none;
    border-color: var(--button-color);
}

#requisites-input::placeholder {
    color: var(--hint-color);
}

.requisites-button {
    background: var(--button-color);
    color: var(--button-text-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.requisites-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.conversion-details {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    margin: 15px 0;
}

.conversion-details p {
    margin: 10px 0;
    color: #333;
}

.conversion-button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    width: 100%;
    margin-top: 15px;
}

.conversion-button:hover {
    background: #1976D2;
}

.requisites-info {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color);
}

.requisites-examples {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.requisites-examples p {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--accent-color);
}

.requisites-examples ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requisites-examples li {
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
    font-size: 13px;
    color: var(--text-color);
    opacity: 0.9;
}

.requisites-examples li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.paypal-requirements {
    margin-top: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.paypal-requirements p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-line;
}

/* --- Consolidated Transactions & Modal Specifics --- */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.transaction-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-time {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.transaction-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 600;
}

.transaction-amount {
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.transaction-amount.positive { color: #10b981; }
.transaction-amount.negative { color: #ef4444; }

.transaction-icon {
    font-size: 18px;
}

/* --- Support Button --- */
.support-button {
    background: var(--accent);
    color: var(--background);
    border: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.support-button:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}
.support-button:active {
    transform: scale(0.98);
}