/* Общие стили */
body {
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(26, 26, 46, 0.9) 50%, 
        rgba(0, 0, 0, 0.8) 100%);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 2;
}

.header::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.1), 
        rgba(255, 215, 0, 0.2), 
        rgba(255, 215, 0, 0.1));
    border-radius: 17px;
    z-index: -1;
    animation: borderGlow 3s infinite alternate;
}

@keyframes borderGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

h1 {
    margin: 0;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                 0 0 20px rgba(255, 215, 0, 0.3),
                 0 0 30px rgba(255, 215, 0, 0.2);
    font-size: 2.5em;
    letter-spacing: 1px;
}

.balance-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

.balance {
    font-size: 2em;
    font-weight: bold;
    color: #4CAF50;
    margin-left: 10px;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.free-spins-badge {
    background: linear-gradient(45deg, #ff4081, #f50057);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    display: none;
    box-shadow: 0 0 15px rgba(245, 0, 87, 0.5);
    animation: badgePulse 2s infinite;
}

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

.btn-reset {
    background: linear-gradient(45deg, #ff5722, #ff9800);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(255, 87, 34, 0.3);
}

.btn-reset:hover {
    background: linear-gradient(45deg, #ff7043, #ffb74d);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 112, 67, 0.5);
}

/* Игровая зона */
.game-area {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.slot-machine {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(26, 26, 46, 0.8) 50%, 
        rgba(0, 0, 0, 0.7) 100%);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.slot-machine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, 
        rgba(255, 215, 0, 0.1) 0%, 
        transparent 70%);
    pointer-events: none;
}

.reels-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    perspective: 1000px;
    position: relative;
}

.reel {
    width: 100px;
    height: 300px;
    background: linear-gradient(180deg, 
        rgba(44, 62, 80, 0.9) 0%, 
        rgba(52, 73, 94, 0.95) 100%);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8),
                0 0 20px rgba(52, 152, 219, 0.3);
    border: 3px solid #3498db;
    z-index: 100;
    transition: all 0.3s;
}

.reel:hover {
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8),
                0 0 30px rgba(52, 152, 219, 0.5);
    transform: translateY(-5px);
}

.reel-symbol {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 101;
    transition: all 0.3s;
}

.reel-symbol.persistent-win {
    z-index: 102;
}

.win-display {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #ffd700;
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.1), 
        rgba(255, 215, 0, 0.2));
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
    animation: winDisplayPulse 2s infinite;
}

@keyframes winDisplayPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    }
}

/* Панель управления */
.control-panel {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(26, 26, 46, 0.8) 50%, 
        rgba(0, 0, 0, 0.7) 100%);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 2;
}

.bet-controls, .lines-controls {
    margin-bottom: 25px;
}

h3 {
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 8px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    letter-spacing: 0.5px;
}

.bet-buttons, .lines-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.bet-btn, .line-btn {
    flex: 1;
    min-width: 60px;
    padding: 12px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.bet-btn:hover, .line-btn:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.bet-btn.active, .line-btn.active {
    background: linear-gradient(45deg, #2196F3, #21CBF3);
    border-color: #2196F3;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.5),
                inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.current-bet, .total-bet {
    text-align: center;
    font-size: 1.2em;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

/* Кнопки спина */
.spin-control {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-spin, .btn-auto {
    flex: 1;
    padding: 20px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-spin {
    background: linear-gradient(45deg, #4CAF50, #8BC34A);
    color: white;
}

.btn-spin:hover {
    background: linear-gradient(45deg, #66BB6A, #9CCC65);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.btn-auto {
    background: linear-gradient(45deg, #FF9800, #FFB74D);
    color: white;
}

.btn-auto:hover {
    background: linear-gradient(45deg, #FFA726, #FFCC80);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.4);
}

.btn-auto.active {
    background: linear-gradient(45deg, #F44336, #E91E63);
}

/* Таблица выплат */
.paytable {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(26, 26, 46, 0.8) 50%, 
        rgba(0, 0, 0, 0.7) 100%);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 2;
}

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

.payout-item {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #3498db;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

.payout-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-left: 4px solid #ffd700;
}

.symbol-name {
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.payout-amount {
    color: #4CAF50;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Информация о выигрышных линиях */
.winning-lines {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(26, 26, 46, 0.8) 50%, 
        rgba(0, 0, 0, 0.7) 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 120px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 2;
}

.win-header {
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.1), 
        rgba(255, 215, 0, 0.2));
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.win-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #4CAF50;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

.win-line:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.win-line-details {
    text-align: right;
}

.win-symbol {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.win-amount {
    font-size: 1.2em;
    color: #4CAF50;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.no-win {
    text-align: center;
    padding: 40px;
    color: #aaa;
    font-style: italic;
}

/* Анимации */
@keyframes symbolGlow {
    0%, 100% { 
        box-shadow: 0 0 5px #ffd700, 
                   inset 0 0 5px #ffd700;
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 20px #ffd700, 
                   0 0 30px #ffd700,
                   inset 0 0 10px #ffd700;
        transform: scale(1.1);
    }
}

.winning-symbol {
    animation: symbolGlow 0.6s ease-in-out 2;
    position: relative;
    z-index: 101;
}

/* Анимация для постоянно подсвеченных символов */
@keyframes persistentSymbolGlow {
    0% { 
        box-shadow: 0 0 10px #ffd700, 
                   inset 0 0 10px #ffd700;
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 25px #ffd700, 
                   0 0 40px #ffd700,
                   inset 0 0 15px #ffd700;
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 0 10px #ffd700, 
                   inset 0 0 10px #ffd700;
        transform: scale(1);
    }
}

.persistent-win {
    animation: persistentSymbolGlow 2s infinite !important;
}

/* Отладочная информация */
.debug-info {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(26, 26, 46, 0.8) 50%, 
        rgba(0, 0, 0, 0.7) 100%);
    padding: 15px;
    border-radius: 10px;
    font-size: 0.9em;
    color: #aaa;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
    z-index: 2;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .game-area {
        grid-template-columns: 1fr;
    }
    
    .reel {
        width: 80px;
        height: 240px;
    }
    
    .reel-symbol {
        font-size: 2.5em;
    }
    
    h1 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .reel {
        width: 60px;
        height: 180px;
    }
    
    .reel-symbol {
        font-size: 2em;
        height: 60px;
    }
    
    .spin-control {
        flex-direction: column;
    }
    
    .celebration-text {
        font-size: 2em !important;
    }
    
    h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header, .slot-machine, .control-panel, .paytable, .winning-lines, .debug-info {
        padding: 15px;
    }
    
    .reel {
        width: 50px;
        height: 150px;
    }
    
    .reel-symbol {
        font-size: 1.5em;
        height: 50px;
    }
    
    .bet-buttons, .lines-buttons {
        gap: 5px;
    }
    
    .bet-btn, .line-btn {
        min-width: 40px;
        padding: 8px;
        font-size: 0.9em;
    }
}
