body {
    font-family: 'Arial', sans-serif;
    background: rgba(48, 8, 4, 0.9);
    color: white;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-decoration: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    z-index: -1;
}

.btn:hover::before {
    width: 100%;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}


.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.game-container {
    text-align: center;
    max-width: 800px;
}

h1 {
    color: #f1c40f;
    margin-bottom: 20px;
}

.slot-machine {
    background: rgba(48, 8, 4, 0.4);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

canvas {
    background: rgba(48, 8, 4, 0.4);
    border-radius: 5px;
    display: block;
    margin: 0 auto;
}

.controls {
    background: rgba(48, 8, 4, 0.4);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.balance, .bet, .win {
    font-size: 18px;
    margin: 10px 0;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

button {
    background: #f1c40f;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background: #f39c12;
}

#spinButton {
    padding: 10px 40px;
    font-weight: bold;
}

.paytable {
    background: rgba(48, 8, 4, 0.4);
    padding: 15px;
    border-radius: 10px;
}

.symbols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.symbols div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.symbols img {
    width: 30px;
    height: 30px;
}

.message {
    margin-top: 15px;
    font-size: 18px;
    min-height: 27px;
}

.win-message {
    color: #2ecc71;
    font-weight: bold;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* Базовые мобильные стили */
@media (max-width: 768px) {
    body {
        padding: 10px;
        min-height: 100vh;
        height: auto;
    }

    .game-container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    #slotCanvas {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }

    .controls {
        padding: 10px;
    }

    .balance, .bet, .win {
        font-size: 16px;
        margin: 8px 0;
    }

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

    button {
        width: 80%;
        margin: 5px 0;
        padding: 12px;
    }

    #spinButton {
        order: -1;
        margin-bottom: 15px;
    }

    .paytable {
        padding: 10px;
    }

    .symbols {
        grid-template-columns: repeat(2, 1fr);
    }

    .symbols div {
        flex-direction: column;
        text-align: center;
    }

    .symbols img {
        width: 25px;
        height: 25px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .symbols {
        grid-template-columns: 1fr;
    }

    button {
        width: 100%;
    }
}

/* Портретный режим */
@media (max-height: 700px) and (orientation: portrait) {
    #slotCanvas {
        max-height: 40vh;
    }
    
    .game-container {
        padding-top: 5px;
    }
    
    .controls {
        padding: 8px;
    }
}

.button-touch {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Убираем подсветку при тапе на iOS */
button, input, textarea {
    -webkit-tap-highlight-color: transparent;
}

/* Улучшаем рендеринг на мобильных */
#slotCanvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
}