/* ====== КНОПКА-МОНЕТА (ИГРА) ====== */
.tg-tap-coin {
    position: fixed;
    right: 20px;
    bottom: 150px; /* выше телеграм-виджета */
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffdd55 0%, #ff9900 75%);
    box-shadow: 0 0 35px rgba(255, 190, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tg-tap-coin img {
    width: 60%;
    pointer-events: none;
    transition: transform 0.12s ease;
}
.tg-tap-coin:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 45px rgba(255, 210, 0, 1);
}
.tg-bounce {
    transform: scale(1.25) !important;
}
.tg-shake {
    animation: tgShake 0.22s ease;
}
.tg-super-glow {
    box-shadow: 0 0 60px rgba(255, 255, 160, 1) !important;
}
@keyframes tgShake {
    0% { transform: translateX(0) scale(1.2); }
    25% { transform: translateX(-4px) scale(1.2); }
    50% { transform: translateX(4px) scale(1.2); }
    75% { transform: translateX(-2px) scale(1.2); }
    100% { transform: translateX(0) scale(1.2); }
}
.tg-score {
    position: absolute;
    bottom: -20px;
    width: 100%;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

/* ====== ПАНЕЛЬ СТАТОВ ====== */
.tg-game-panel {
    position: fixed;
    right: 20px;
    bottom: 260px;
    min-width: 190px;
    padding: 10px 12px 12px;
    border-radius: 14px;
    background: rgba(5, 5, 10, 0.9);
    color: #fff;
    font-size: 12px;
    box-shadow: 0 0 18px rgba(0,0,0,0.6);
    z-index: 99998;
}
.tg-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}
.tg-row span:first-child {
    opacity: 0.75;
}
.tg-xp-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
    margin-bottom: 5px;
}
#tgXpFill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg,#00e0ff,#00ff88);
}

/* КРУПНЫЙ ЯРКИЙ КРЕСТИК ЗАКРЫТИЯ ИГРЫ (Х) */
.tg-game-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #ff3b3b;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(255, 59, 59, 0.9);
    transition: 0.2s ease;
    z-index: 100000;
}
.tg-game-close:hover {
    transform: scale(1.15);
    box-shadow: 0 0 24px rgba(255, 80, 80, 1);
}

/* КНОПКА ОТКРЫТИЯ ИГРЫ 🎮 */
.tg-game-open-btn {
    position: fixed;
    right: 20px;
    bottom: 115px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #050b12;
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
    z-index: 99993;
}

/* КНОПКА CLAIM */
.tg-claim-btn {
    margin-top: 6px;
    width: 100%;
    border-radius: 999px;
    border: none;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(90deg,#00e0ff,#00ff88);
    color: #041019;
    box-shadow: 0 0 12px rgba(0,224,255,0.6);
}
.tg-claim-btn:hover {
    filter: brightness(1.08);
}

/* ====== БАННЕР РЕДКОСТИ ====== */
.tg-rarity-banner {
    position: fixed;
    right: 120px;
    bottom: 165px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    z-index: 99997;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.tg-rarity-banner.tg-show {
    animation: tgBannerIn 0.6s ease-out;
}
@keyframes tgBannerIn {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-6px); }
}

/* ====== ДОЖДЬ БОЛЬШИХ МОНЕТ ====== */
.tg-coin-particle {
    position: fixed;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle,#ffdd55 0%,#ff9900 80%);
    box-shadow: 0 0 16px rgba(255,190,0,0.9);
    opacity: 0.95;
    pointer-events: none;
    z-index: 99990;
    animation: tgCoinFall 4s ease-out forwards;
}
@keyframes tgCoinFall {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(220px) scale(0.8); opacity: 0; }
}

/* ====== CLAIM MODAL ====== */
.tg-claim-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}
.tg-claim-overlay.tg-show {
    display: flex;
}
.tg-claim-modal {
    background: #0b1018;
    border-radius: 16px;
    padding: 18px 20px;
    color: #fff;
    max-width: 260px;
    width: 100%;
    box-shadow: 0 0 25px rgba(0,0,0,0.8);
    text-align: center;
    font-size: 13px;
}
.tg-claim-modal h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}
.tg-claim-link {
    display: block;
    margin-top: 10px;
    padding: 7px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg,#00bfff,#0088ff);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
.tg-claim-link:hover {
    filter: brightness(1.08);
}
.tg-claim-close {
    margin-top: 8px;
    border-radius: 999px;
    border: none;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    background: #222836;
    color: #fff;
}

/* ====== TELEGRAM CONTACT WIDGET СНИЗУ ====== */
.tg-contact-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 0 25px rgba(0,0,0,0.3);
    z-index: 99991;
    width: 320px;
    max-width: 320px;
}
.tg-contact-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: radial-gradient(circle,#00bfff 0%,#0088ff 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    animation: tgLogoPulse 2s infinite;
}
.tg-contact-icon img {
    width: 65%;
    height: 65%;
    object-fit: contain;
}
@keyframes tgLogoPulse {
    0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(0,136,255,0.6); }
    70%  { transform: scale(1.07); box-shadow: 0 0 14px 4px rgba(0,136,255,0); }
    100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(0,136,255,0); }
}

.tg-contact-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}
.tg-contact-title {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tg-contact-btn {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    background: #0088ff;
}

/* ====== МОБИЛЬНАЯ АДАПТАЦИЯ ====== */
@media (max-width: 480px) {
    .tg-tap-coin {
        right: 14px;
        bottom: 140px;
        width: 78px;
        height: 78px;
    }
    .tg-game-panel {
        right: 14px;
        bottom: 235px;
        min-width: 170px;
        font-size: 11px;
    }
    .tg-rarity-banner {
        right: 95px;
        bottom: 145px;
        font-size: 11px;
    }
    .tg-score {
        bottom: -16px;
        font-size: 14px;
    }
    .tg-contact-widget {
        right: 12px;
        bottom: 18px;
        padding: 6px 10px;
        width: 300px;
        max-width: 300px;
    }
    .tg-game-open-btn {
        right: 14px;
        bottom: 110px;
    }
}
