.game-top {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 5;
}
.bet-label {
    font-size: 24px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.bet-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 30px;
}
.bet-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #A52A2A;
    color: white;
    font-size: 24px;
    font-weight: bold;
    
}
.bet-btn:active {
    transform: scale(0.9);
}
#bet-amount,
#bet-amount-suit,
#bet-amount-highlow,
#bet-amount-naprstki,
#bet-amount-risk,
#bet-amount-blackjack {
    font-size: 24px;
    font-weight: bold;
    color: #FFFF00;
    min-width: 60px;
    text-align: center;
}

.game-middle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    width: 100%;
}
.game-middle-highlow {
    gap: 10px;
}

.game-card {
    width: 120px;
    height: auto;
}

.game-buttons {
    display: flex;
    flex-direction: row;
    gap: 20px;
}
.color-btn {
    background: none;
    border: none;
    padding: 0;
    
    width: 80px;
    height: 80px;
}

.color-btn-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.color-btn:active {
    transform: scale(0.9);
}
.game-buttons-suit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.card-front-open {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.game-buttons-highlow {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#btn-up {
    animation: floatUp 1.5s ease-in-out infinite;
}
#btn-down {
    animation: floatDown 1.5s ease-in-out infinite;
}
@keyframes floatUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes floatDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}
.game-bottom {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 5;
}
.card-container {
    position: relative;
    width: 120px;
    height: 180px;
    flex-shrink: 0;
    perspective: 1000px;
}

.card-back, .card-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transition: transform 0.6s;
}

.card-front {
    transform: rotateY(180deg);
}

.card-container.flipped .card-back {
    transform: rotateY(180deg);
}

.card-container.flipped .card-front {
    transform: rotateY(0deg);
}
.color-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.color-btn.loading::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 3px solid rgba(255, 255, 0, 0.2);
    border-top-color: #FFFF00;
    border-right-color: #FFFF00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.coin-animation {
    position: fixed;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 100;
    animation: coinFly 1s ease-out forwards;
}

@keyframes coinFly {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-50px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(20px) scale(0.5);
        opacity: 0;
    }
}
.coin-lose {
    position: fixed;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 100;
    animation: coinFall 1s ease-in forwards;
}

@keyframes coinFall {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(300px) scale(0.3);
        opacity: 0;
    }
}
.draw-x3 {
    position: fixed;
    top: 30%;
    left: 50%;
    width: 100px;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 250;
    pointer-events: none;
    animation: drawShake 2s ease-out forwards;
}

@keyframes drawShake {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    10%  { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    20%  { transform: translate(-60%, -50%) scale(1.1) rotate(-5deg); }
    30%  { transform: translate(-40%, -50%) scale(1.1) rotate(5deg); }
    40%  { transform: translate(-55%, -50%) scale(1.05) rotate(-3deg); }
    50%  { transform: translate(-45%, -50%) scale(1.05) rotate(3deg); }
    60%  { transform: translate(-60%, -50%) scale(1.1) rotate(-5deg); }
    70%  { transform: translate(-40%, -50%) scale(1.1) rotate(5deg); }
    80%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}


/* === ДРОП === */
/* === ДРОП ПРИ ПОБЕДЕ === */
.drop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: dropFadeIn 0.3s ease-out;
}
.drop-overlay.fade-out { animation: dropFadeOut 0.4s ease-out forwards; }
@keyframes dropFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes dropFadeOut { from { opacity: 1; } to { opacity: 0; } }

.drop-flash {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    opacity: 0.7;
    animation: dropFlash 3.5s ease-out;
    filter: blur(40px);
}

@keyframes dropFlash {
    0%   { transform: scale(0);   opacity: 0; }
    20%  { transform: scale(1.2); opacity: 0.8; }
    70%  { transform: scale(1.4); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}
.drop-flash[data-element="fire"]  { background: radial-gradient(circle, #ff4d00, transparent 80%); }
.drop-flash[data-element="water"] { background: radial-gradient(circle, #00aaff, transparent 80%); }
.drop-flash[data-element="earth"] { background: radial-gradient(circle, #00cc44, transparent 80%); }
.drop-flash[data-element="air"]   { background: radial-gradient(circle, #ffffff, transparent 80%); }


.drop-paw-block {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 300px;
}
.drop-paw-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: flyAndBreathe 4.5s linear infinite;
}

@keyframes flyAndBreathe {
    0%   { transform: scale(0.01); opacity: 0; }
    5%   { opacity: 1; }
    20%  { transform: scale(1.08); }
    30%  { transform: scale(1.03); }
    40%  { transform: scale(0.98); }
    50%  { transform: scale(1.03); }
    60%  { transform: scale(1.08); }
    70%  { transform: scale(1.03); }
    80%  { transform: scale(0.98); }
    90%  { transform: scale(1.03); }
    100% { transform: scale(1.08); }
}
.drop-paw-label {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}


.drop-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    opacity: 0.5;
    animation: dropGlow 2s ease-in-out infinite;
    filter: blur(30px);
}
.drop-glow[data-element="fire"]  { background: radial-gradient(circle, #ff4d00, transparent 70%); }
.drop-glow[data-element="water"] { background: radial-gradient(circle, #00aaff, transparent 70%); }
.drop-glow[data-element="earth"] { background: radial-gradient(circle, #00cc44, transparent 70%); }
.drop-glow[data-element="air"]   { background: radial-gradient(circle, #ffffff, transparent 70%); }
@keyframes dropGlow {
    0%, 100% { transform: scale(1);   opacity: 0.4; }
    50%      { transform: scale(1.2); opacity: 0.7; }
}

.drop-cat-block {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: dropCatAppear 0.6s ease-out;
}
.drop-cat-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 40%;
    animation: dropCatPulse 1.5s ease-in-out infinite;
}
.drop-cat-img[data-element="fire"]  { filter: drop-shadow(0 0 25px rgba(255, 77, 0, 0.9)); }
.drop-cat-img[data-element="water"] { filter: drop-shadow(0 0 25px rgba(0, 170, 255, 0.9)); }
.drop-cat-img[data-element="earth"] { filter: drop-shadow(0 0 25px rgba(0, 204, 68, 0.9)); }
.drop-cat-img[data-element="air"]   { filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.9)); }
.drop-cat-name {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}
@keyframes dropCatAppear {
    0%   { transform: scale(0);   opacity: 0; }
    50%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1);   opacity: 1; }
}
@keyframes dropCatPulse {
    0%, 100% { transform: scale(1) rotate(0); }
    50%      { transform: scale(1.06) rotate(2deg); }
}
.drop-overlay .daily-anim-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFD700, transparent 70%);
    opacity: 0.5;
    animation: dropGlow 2s ease-in-out infinite;
    filter: blur(30px);
}

.drop-overlay .daily-anim-img {
    position: relative;
    width: 90px;
    height: 90px;
    object-fit: contain;
    animation: flyAndBreathe 4.5s linear infinite;
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.9));
}
.menu-note {
    text-align: center;
    color: #FFFF00;
    font-size: 14px;
    margin: -8px 0 6px 0;
}
/* === НАПЁРСТКИ === */
.naprstki-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    margin-top: 40px;
}

.naprstok {
    width: 200px;
    height: 200px;
    
    position: relative;
}

.naprstok .ball {
    position: absolute;
    inset: 0;
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.naprstok.open .ball {
    opacity: 1;
}

.naprstok .cup {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.naprstok.open .cup {
    transform: translateY(100px);
}

.naprstok:active {
    transform: translateY(3px);
}

.naprstok.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* === БЛЭКДЖЕК === */
#bj-deck-container {
    align-self: center;
}

.bj-hands {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bj-layout {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 0;
}

#bj-deck-container {
    flex-shrink: 0;
}

.bj-hand-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
#bj-deck-back {
    width: 95px;
    height: 150px;
    object-fit: fill;
}
.bj-hand-label {
    font-size: 16px;
    font-weight: bold;
    color: #FFFF00;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.bj-hand {
    display: flex;
    min-height: 120px;
    align-items: center;
}

.bj-hand .bj-card-wrap:not(:first-child) {
    margin-left: -30px;
}
.bj-card-wrap.bj-fall {
    animation: bjFall 0.7s ease-in forwards;
}

@keyframes bjFall {
    0%   { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(500px); opacity: 0; }
}
.bj-hand-block {
    transition: opacity 0.5s ease;
}

.bj-hand-block.bj-hide {
    opacity: 0;
}

.bj-controls {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 5;
}

.bj-btn {
    position: relative;
    width: 140px;
    height: 60px;
    padding: 0;
    border: none;
    background-image: url('/zabrat.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border-radius: 0;
    
    overflow: hidden;
}

.bj-btn-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    white-space: nowrap;
}

.bj-btn:active {
    transform: scale(0.95);
}
.bj-card-wrap {
    position: relative;
    width: 65px;
    height: 100px;
    transform-style: preserve-3d;
    transition: transform 0.4s ease-out;
}
.bj-card {
    width: 65px;
    height: 100px;
    object-fit: fill;
}
.bj-card-wrap.flipped {
    transform: rotateY(180deg);
}

.bj-card-wrap .bj-card-back,
.bj-card-wrap .bj-card-front {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    backface-visibility: hidden;
}

.bj-card-wrap .bj-card-front {
    transform: rotateY(180deg);
}


/* === РИСК-КАРТА === */
.risk-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.risk-bot-card {
    perspective: 800px;
}

.bot-card-flip {
    position: relative;
    width: 80px;
    height: 120px;
    transform-style: preserve-3d;
    transition: transform 1s;
}

.bot-card-flip.flipped {
    transform: rotateY(180deg);
}

.bot-card-back,
.bot-card-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    object-fit: contain;
}

.bot-card-front {
    transform: rotateY(180deg);
}

.risk-bank {
    font-size: 22px;
    font-weight: bold;
    color: #FFFF00;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.risk-cards {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.risk-card {
    width: 80px;
    
    perspective: 800px;
}

.risk-card.appear {
    opacity: 0;
    transform: translateY(20px);
    animation: riskCardAppear 0.4s ease-out forwards;
}

.risk-card.appear:nth-child(1) { animation-delay: 0.1s; }
.risk-card.appear:nth-child(2) { animation-delay: 0.2s; }
.risk-card.appear:nth-child(3) { animation-delay: 0.3s; }
.risk-card.appear:nth-child(4) { animation-delay: 0.4s; }

@keyframes riskCardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-flip {
    position: relative;
    width: 100%;
    height: 105px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-flip.flipped {
    transform: rotateY(180deg);
}

.card-back,
.card-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    object-fit: contain;
}

.card-front {
    transform: rotateY(180deg);
}

.risk-card:active {
    transform: scale(0.92);
}
.risk-card.fall {
    animation: riskFall 0.7s ease-in forwards !important;
}
@keyframes riskFall {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(400px); }
}

.risk-bot-card.fall,
.risk-bank.fall {
    animation: riskFadeOut 0.7s ease-in forwards !important;
}
@keyframes riskFadeOut {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

.risk-cashout {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    padding: 0;
    background-image: url('/zabrat.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    border-radius: 0;
    width: 200px;
    height: 60px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    
    z-index: 5;
}

.risk-cashout::after {
    content: '';
    position: absolute;
    top: 10%;
    left: -75%;
    width: 50%;
    height: 80%;
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: riskShine 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes riskShine {
    0%   { left: -75%; }
    60%  { left: 125%; }
    100% { left: 125%; }
}

.risk-cashout:disabled::after {
    animation: none;
}

.risk-cashout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.risk-cashout:active:not(:disabled) {
    transform: translateX(-50%) scale(0.95);
}
