/* ==================== SLOT MACHINE STYLES ==================== */

.slot-machine-container {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #4CAF50;
    position: relative;
    overflow: visible; /* Позволяет конфетти выходить за границы */
}

/* Дополнительные визуальные эффекты */
.slot-machine-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4CAF50, #2196F3, #9C27B0, #FF5722);
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    animation: gradientShift 3s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.slot-machine-container:hover::before {
    opacity: 0.3;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.slot-machine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #4CAF50;
}

.slot-machine-header h2 {
    color: #fff;
    font-size: 2.5em;
    margin: 0;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.slot-balance {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.balance-label {
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
}

.balance-value {
    color: #fff;
    font-weight: bold;
    font-size: 1.3em;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.balance-currency {
    color: #fff;
    font-size: 1.2em;
}

/* Барабаны */
.slot-reels {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border-radius: 15px;
    border: 3px solid #4CAF50;
    box-shadow: inset 0 0 20px rgba(76, 175, 80, 0.2);
}

.reel-container {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #333, #222);
    border-radius: 15px;
    border: 3px solid #4CAF50;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.reel {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease;
}

.symbol {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    background: linear-gradient(135deg, #444, #333);
    border-bottom: 1px solid #555;
    transition: all 0.3s ease;
}

.symbol:hover {
    background: linear-gradient(135deg, #555, #444);
    transform: scale(1.05);
}

/* Анимация вращения барабанов */
@keyframes spinReel {
    0% { transform: translateY(0); }
    100% { transform: translateY(-960px); }
}

/* Быстрая анимация для оптимизации */
@keyframes spinReelFast {
    0% { transform: translateY(0); }
    100% { transform: translateY(-480px); }
}

/* Реалистичная анимация барабанов */
@keyframes realisticSpin {
    0% { 
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    70% { 
        transform: translateY(-600px);
        animation-timing-function: ease-in;
    }
    100% { 
        transform: translateY(-720px);
        animation-timing-function: ease-out;
    }
}

/* Замедление барабана */
@keyframes slowdownSpin {
    0% { 
        transform: translateY(-600px);
        animation-timing-function: ease-out;
    }
    100% { 
        transform: translateY(-720px);
        animation-timing-function: ease-out;
    }
}

/* Эффект выигрыша - подсветка символов */
@keyframes winGlow {
    0% { 
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 40px rgba(76, 175, 80, 1);
        transform: scale(1.1);
    }
    100% { 
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
        transform: scale(1);
    }
}

/* Частицы выигрыша */
@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}

/* Анимация конфетти */
@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(50vh) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.confetti {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Улучшенный эффект выигрыша */
@keyframes jackpotPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.5);
    }
}

.jackpot-win {
    animation: jackpotPulse 0.5s ease-in-out 3;
}

/* Пульсация для выигрышных символов */
.win-highlight {
    animation: winGlow 1s ease-in-out infinite;
}

/* Эффект размытия во время вращения */
.reel.spinning {
    filter: blur(1px);
    transition: filter 0.3s ease;
}

/* Эффект свечения во время вращения */
.reel.glowing {
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.6);
    transition: box-shadow 0.3s ease;
}

/* Оптимизированная анимация для лучшей производительности */
.reel {
    will-change: transform;
    transform: translateZ(0); /* Принудительное аппаратное ускорение */
}

.symbol {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Результат */
.slot-result {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border-radius: 15px;
    border: 2px solid #4CAF50;
}

.result-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.result-symbol {
    font-size: 4em;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
    animation: symbolGlow 2s ease-in-out infinite alternate;
}

@keyframes symbolGlow {
    0% { box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4); }
    100% { box-shadow: 0 5px 25px rgba(76, 175, 80, 0.8); }
}

.result-text {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Управление */
.slot-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
}

.bet-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.bet-selector label {
    color: #fff;
    font-size: 1.2em;
    font-weight: bold;
}

.bet-buttons {
    display: flex;
    gap: 15px;
}

.bet-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #666, #555);
    color: #fff;
    border: 2px solid #777;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.bet-btn:hover {
    background: linear-gradient(135deg, #777, #666);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.bet-btn.active {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-color: #4CAF50;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
    transform: translateY(-2px);
}

.spin-btn {
    padding: 20px 40px;
    background: linear-gradient(135deg, #FF5722, #E64A19);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.spin-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #FF7043, #FF5722);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 87, 34, 0.6);
}

.spin-btn:disabled {
    background: linear-gradient(135deg, #666, #555);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.spin-text {
    display: block;
    animation: pulse 1s ease-in-out infinite;
    will-change: transform;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Оптимизированная анимация свечения символов */
@keyframes symbolGlow {
    0% { 
        box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
        transform: translateZ(0);
    }
    100% { 
        box-shadow: 0 5px 25px rgba(76, 175, 80, 0.8);
        transform: translateZ(0);
    }
}

/* Дополнительные опции слота */
.slot-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

.turbo-option,
.sound-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #444, #333);
    border-radius: 25px;
    border: 2px solid #555;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-weight: bold;
}

.turbo-option:hover,
.sound-option:hover {
    background: linear-gradient(135deg, #555, #444);
    border-color: #4CAF50;
    transform: translateY(-2px);
}

.turbo-option input,
.sound-option input {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.turbo-option input:checked + span,
.sound-option input:checked + span {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Статистика */
.slot-stats {
    display: flex;
    gap: 30px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #333, #222);
    border-radius: 15px;
    border: 2px solid #4CAF50;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    color: #aaa;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    color: #4CAF50;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

/* Таблица выплат */
.payout-table {
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #4CAF50;
}

.payout-table h3 {
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.payout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Информация о шансах */
.odds-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border-radius: 10px;
    border: 2px solid #4CAF50;
}

.rtp-info, .house-edge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.rtp-label, .edge-label {
    color: #aaa;
    font-size: 0.9em;
    font-weight: bold;
}

.rtp-value {
    color: #4CAF50;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.edge-value {
    color: #FF5722;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 87, 34, 0.5);
}

.payout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #444, #333);
    border-radius: 10px;
    border: 1px solid #555;
    transition: all 0.3s ease;
    position: relative;
}

.payout-item:hover {
    background: linear-gradient(135deg, #555, #444);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Цвета для разных типов выигрышей */
.payout-item.jackpot {
    border-color: #FFD700;
    background: linear-gradient(135deg, #FFD700, #FFA000);
}

.payout-item.epic {
    border-color: #9C27B0;
    background: linear-gradient(135deg, #9C27B0, #673AB7);
}

.payout-item.rare {
    border-color: #2196F3;
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.payout-item.uncommon {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.payout-item.common {
    border-color: #FF9800;
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.payout-item.double {
    border-color: #607D8B;
    background: linear-gradient(135deg, #607D8B, #455A64);
}

.payout-item.single {
    border-color: #795548;
    background: linear-gradient(135deg, #795548, #5D4037);
}

.combo {
    font-size: 1.1em;
    color: #fff;
    font-weight: bold;
    flex: 1;
}

.multiplier {
    color: #FFD700;
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    margin: 0 10px;
}

.chance {
    color: #aaa;
    font-size: 0.8em;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.warning-text {
    text-align: center;
    color: #FF5722;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 87, 34, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 87, 34, 0.3);
}

/* Уведомления */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .slot-machine-container {
        margin: 10px;
        padding: 15px;
        border-radius: 15px;
    }
    
    .slot-machine-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .slot-machine-header h2 {
        font-size: 2em;
    }
    
    .slot-reels {
        gap: 10px;
        padding: 15px;
    }
    
    .reel-container {
        width: 80px;
        height: 80px;
    }
    
    .symbol {
        height: 80px;
        font-size: 2em;
        /* Оптимизация для мобильных */
        will-change: auto;
        transform: translateZ(0);
    }
    
    /* Отключаем тяжелые анимации на слабых устройствах */
    .reel {
        will-change: auto;
    }
    
    .result-symbol {
        animation: none; /* Убираем анимацию свечения на мобильных */
    }
    
    .result-symbol {
        font-size: 2.5em;
        padding: 8px 12px;
    }
    
    .result-text {
        font-size: 1.2em;
    }
    
    .bet-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bet-btn {
        padding: 10px 16px;
        font-size: 1em;
    }
    
    .spin-btn {
        padding: 15px 30px;
        font-size: 1.2em;
    }
    
    .slot-stats {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .payout-grid {
        grid-template-columns: 1fr;
    }
    
    .payout-item {
        padding: 10px 15px;
    }
    
    .combo {
        font-size: 1em;
    }
    
    .multiplier {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .slot-machine-container {
        margin: 5px;
        padding: 10px;
    }
    
    .slot-machine-header h2 {
        font-size: 1.5em;
    }
    
    .slot-balance {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .slot-reels {
        gap: 8px;
        padding: 10px;
    }
    
    .reel-container {
        width: 60px;
        height: 60px;
    }
    
    .symbol {
        height: 60px;
        font-size: 1.5em;
    }
    
    .result-display {
        gap: 10px;
    }
    
    .result-symbol {
        font-size: 2em;
        padding: 6px 10px;
    }
    
    .result-text {
        font-size: 1em;
    }
    
    .bet-btn {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .spin-btn {
        padding: 12px 24px;
        font-size: 1em;
    }
    
    .payout-table {
        padding: 15px;
    }
    
    .payout-table h3 {
        font-size: 1.2em;
    }
    
    .payout-item {
        padding: 8px 12px;
    }
    
    .combo {
        font-size: 0.9em;
    }
    
    .multiplier {
        font-size: 0.9em;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .slot-machine-header h2 {
        font-size: 1.3em;
    }
    
    .slot-balance {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .reel-container {
        width: 50px;
        height: 50px;
    }
    
    .symbol {
        height: 50px;
        font-size: 1.2em;
        /* Максимальная оптимизация для слабых устройств */
        will-change: auto;
        backface-visibility: visible;
        transform: none;
    }
    
    .result-symbol {
        font-size: 1.5em;
        padding: 4px 8px;
        animation: none; /* Убираем все анимации */
    }
    
    .result-text {
        font-size: 0.9em;
    }
    
    .bet-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    
    .spin-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .spin-text {
        animation: none; /* Убираем пульсацию кнопки */
    }
    
    .payout-table h3 {
        font-size: 1.1em;
    }
    
    .payout-item {
        padding: 6px 10px;
    }
    
    .combo {
        font-size: 0.8em;
    }
    
    .multiplier {
        font-size: 0.8em;
    }
    
    /* Отключаем все анимации для максимальной производительности */
    * {
        animation-duration: 0s !important;
        animation-delay: 0s !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
}
