* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Custom theme */
.theme-custom {
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
}

.theme-custom .game-container {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #4a90e2;
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.3);
}

.theme-custom .slot-machine {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 2px solid #4a90e2;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

.theme-custom .symbol {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    color: #4a90e2;
    text-shadow: 0 0 10px #4a90e2;
}

.game-container {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    position: relative;
    backdrop-filter: blur(10px);
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.balance,
.win-amount {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 150px;
}

.slot-machine {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: inset 0 10px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.slot-machine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.reels-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    perspective: 1000px;
}

.reel {
    width: 120px;
    height: 360px;
    background: linear-gradient(180deg, #ecf0f1, #bdc3c7);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid #95a5a6;
}

.symbol {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-bottom: 2px solid #ddd;
    transition: all 0.3s ease;
    position: relative;
}

.symbols-container {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.symbols-container .symbol {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    transform: translateY(0);
}

.symbol.winning {
    background: linear-gradient(145deg, #ffd700, #ffed4e);
    animation: pulse 0.5s infinite;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.controls {
    margin: 30px 0;
}

.bet-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bet-controls label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

.bet-slider {
    width: 200px;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.bet-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.bet-slider::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#betValue {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    min-width: 40px;
    text-align: center;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.spin-btn,
.auto-spin-btn,
.max-bet-btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-width: 120px;
}

.spin-btn {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
}

.spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.spin-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.auto-spin-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.max-bet-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
}

.auto-spin-btn:hover,
.max-bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.win-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ffed4e, #ffd700);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.win-line.show {
    opacity: 1;
    animation: winLine 1s ease-in-out;
}

@keyframes winLine {
    0% {
        transform: translateY(-50%) scaleX(0);
    }

    50% {
        transform: translateY(-50%) scaleX(1);
    }

    100% {
        transform: translateY(-50%) scaleX(1);
    }
}

.win-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.win-popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: linear-gradient(145deg, #ffd700, #ffed4e);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.5);
    transition: transform 0.3s ease;
}

.win-popup.show .popup-content {
    transform: scale(1);
}

.popup-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2rem;
}

.popup-content p {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.2rem;
}

.popup-content button {
    padding: 15px 30px;
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Адаптивний дизайн */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .stats {
        flex-direction: column;
        align-items: center;
    }

    .balance,
    .win-amount {
        min-width: 200px;
        font-size: 1rem;
    }

    .reels-container {
        gap: 5px;
    }

    .reel {
        width: 80px;
        height: 240px;
    }

    .symbol {
        height: 80px;
        font-size: 2rem;
    }

    .bet-controls {
        flex-direction: column;
        gap: 10px;
    }

    .bet-slider {
        width: 150px;
    }

    .buttons {
        flex-direction: column;
        align-items: center;
    }

    .spin-btn,
    .auto-spin-btn,
    .max-bet-btn {
        width: 200px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 1.5rem;
    }

    .reel {
        width: 60px;
        height: 180px;
    }

    .symbol {
        height: 60px;
        font-size: 1.5rem;
    }

    .spin-btn,
    .auto-spin-btn,
    .max-bet-btn {
        width: 150px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .popup-content {
        padding: 20px;
        margin: 20px;
    }

    .popup-content h2 {
        font-size: 1.5rem;
    }
}

/* Анімації для слотів */
.spinning {
    animation: spin 0.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-120px);
    }
}

/* Покращена анімація обертання */
.reel.spinning .symbol {
    animation: symbolSpin 0.1s linear infinite;
}

@keyframes symbolSpin {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-120px);
    }
}

/* Забезпечення безперервного обертання */
.reel {
    position: relative;
}

.reel .symbols-container {
    position: relative;
    transition: transform 0.1s ease-out;
}

.reel .symbols-container.spinning {
    animation: continuousSpin 0.1s linear infinite;
}

@keyframes continuousSpin {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-120px);
    }
}

/* Ефекти для виграшних комбінацій */
.win-animation {
    animation: winPulse 0.5s ease-in-out 3;
}

@keyframes winPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Message notifications */
.message-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.message-notification.error {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.message-notification.info {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

@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;
    }
}

/* Auto-spin button states */
.auto-spin-btn.active {
    background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
}