* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    overflow: hidden;
}

/* Gems theme */
.theme-gems {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-gems .game-container {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.theme-gems .slot-machine {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.theme-gems .symbol {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    color: #333;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    max-height: 95vh;
    height: auto;
    position: relative;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.game-header {
    text-align: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.game-header h1 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.balance,
.win-amount {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    min-width: 120px;
}

.slot-machine {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: inset 0 8px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.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: 8px;
    perspective: 800px;
    height: 100%;
    align-items: center;
}

.reel {
    width: 80px;
    height: 240px;
    background: linear-gradient(180deg, #ecf0f1, #bdc3c7);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid #95a5a6;
}

.symbols-container {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.symbol.winning {
    background: linear-gradient(145deg, #ffd700, #ffed4e);
    animation: pulse 0.5s infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.controls {
    margin: 15px 0;
    flex-shrink: 0;
}

.bet-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.bet-controls label {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}

.bet-slider {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.bet-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    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: 20px;
    height: 20px;
    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: 1rem;
    font-weight: bold;
    color: #333;
    min-width: 30px;
    text-align: center;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.spin-btn,
.max-bet-btn {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    min-width: 100px;
}

.spin-btn {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
}

.spin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.spin-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.max-bet-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
}

.max-bet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.win-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    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: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 15px 30px 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: 15px;
    font-size: 1.5rem;
}

.popup-content p {
    color: #333;
    margin-bottom: 20px;
    font-size: 1rem;
}

.popup-content button {
    padding: 10px 20px;
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Адаптивний дизайн */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        margin: 5px;
        max-height: 98vh;
    }

    .game-header h1 {
        font-size: 1.5rem;
    }

    .stats {
        flex-direction: column;
        align-items: center;
    }

    .balance,
    .win-amount {
        min-width: 150px;
        font-size: 0.8rem;
    }

    .reels-container {
        gap: 5px;
    }

    .reel {
        width: 60px;
        height: 180px;
    }

    .bet-controls {
        flex-direction: column;
        gap: 8px;
    }

    .bet-slider {
        width: 120px;
    }

    .buttons {
        flex-direction: column;
        align-items: center;
    }

    .spin-btn,
    .max-bet-btn {
        width: 150px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }

    .game-header h1 {
        font-size: 1.2rem;
    }

    .reel {
        width: 50px;
        height: 150px;
    }

    .spin-btn,
    .max-bet-btn {
        width: 120px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .popup-content {
        padding: 15px;
        margin: 15px;
    }

    .popup-content h2 {
        font-size: 1.2rem;
    }
}

/* Message notifications */
.message-notification {
    position: fixed;
    top: 15px;
    right: 15px;
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    font-size: 0.9rem;
}

.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;
    }
}