/* Основні стилі для мінігор */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.game-icon {
    font-size: 48px;
    padding: 20px;
    text-align: center;
}

.game-info {
    padding: 15px;
    color: white;
}

.game-info h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.game-info p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

.btn-play {
    margin: 10px 15px 15px;
    width: calc(100% - 30px);
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-white {
    background: white;
    color: #333;
}

.btn-white:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.btn-yellow {
    background: #f39c12;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-yellow:hover {
    background: #e67e22;
}

/* Стилі для оверлею ігор */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-container {
    width: 90%;
    max-width: 500px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
}

.game-header h2 {
    color: white;
    margin: 0;
    font-size: 22px;
}

.game-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#game-content {
    padding: 30px;
    color: white;
    text-align: center;
}

/* Стилі для слотів */
.slots-machine {
    position: relative;
}

.slots-reels {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.reel {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.slots-result {
    font-size: 20px;
    margin-bottom: 25px;
    font-weight: 600;
    min-height: 30px;
}

.coin {
    position: absolute;
    top: -10px;
    font-size: 24px;
    animation: falling 2s ease-in forwards;
}

@keyframes falling {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(200px);
        opacity: 0;
    }
}

/* Стилі для гри в кості */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.die {
    width: 80px;
    height: 80px;
    background: white;
    color: #333;
    border-radius: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.dice-result {
    font-size: 20px;
    margin-bottom: 25px;
    font-weight: 600;
    min-height: 30px;
}

/* Стилі для кнопки мінігор */
.btn-games {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    margin-right: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-games:hover {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.games-icon {
    font-size: 24px;
    cursor: pointer;
    margin-left: 15px;
    transition: transform 0.2s ease;
    position: relative;
}

.games-icon:hover {
    transform: scale(1.2);
}

/* Стилі для адаптивності */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-container {
        width: 95%;
    }
    
    .slots-reels {
        gap: 10px;
    }
    
    .reel {
        width: 70px;
        height: 70px;
        font-size: 35px;
    }
}

/* Стилі для гри в гонки */
.race-game {
    position: relative;
    overflow: hidden;
}

.race-track {
    height: 180px;
    background: #333;
    position: relative;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 4px solid #444;
    overflow: hidden;
}

.race-track:before {
    content: '';
    position: absolute;
    top: 33%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 50px 0 rgba(255, 255, 255, 0.2);
}

.finish-line {
    position: absolute;
    right: 10%;
    top: 0;
    bottom: 0;
    width: 5px;
    background: repeating-linear-gradient(
        to bottom,
        white,
        white 10px,
        black 10px,
        black 20px
    );
    z-index: 2;
}

.racer {
    position: absolute;
    font-size: 32px;
    transition: left 0.05s linear;
    left: 0;
}

#racer1 {
    top: 20px;
}

#racer2 {
    top: 70px;
}

#racer3 {
    top: 120px;
}

.racer.race-start {
    animation: raceStart 0.3s ease-in-out;
}

.racer.winner {
    animation: winnerPulse 0.5s infinite;
}

@keyframes raceStart {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.1); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes winnerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.race-controls {
    padding: 10px 0;
}

.race-selection h3 {
    margin: 0 0 15px;
    font-size: 16px;
}

.racer-select {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-racer {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-racer:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-racer.active {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    transform: scale(1.05);
}

.race-result {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
    min-height: 30px;
}

/* Confetti animation for race win */
.confetti {
    position: absolute;
    opacity: 0;
    animation: confettiFall 3s ease-in forwards;
    z-index: 10;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
    100% {
        transform: translateY(300px) rotate(720deg);
        opacity: 0;
    }
}

/* Add this to your media queries */
@media (max-width: 768px) {
    .racer-select {
        flex-direction: column;
        align-items: center;
    }
    
    .race-track {
        height: 150px;
    }
    
    .racer {
        font-size: 28px;
    }
    
    #racer1 {
        top: 15px;
    }
    
    #racer2 {
        top: 55px;
    }
    
    #racer3 {
        top: 95px;
    }
}

