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

body {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.game-card {
    aspect-ratio: 1;
    background: white;
    border-radius: 30px;
    padding: 40px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    animation: float 3s ease-in-out infinite;
}

/* Анімація плавання */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

.game-card:nth-child(2) {
    animation-delay: 0.5s;
}

.game-card:nth-child(3) {
    animation-delay: 1s;
}

.game-card:nth-child(4) {
    animation-delay: 1.5s;
}

.game-card:nth-child(5) {
    animation-delay: 2s;
}

.game-card:nth-child(6) {
    animation-delay: 2.5s;
}

/* Ефект свічення при наведенні */
.game-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.game-card:hover::before {
    width: 500px;
    height: 500px;
}

.game-card:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 50px rgba(255, 255, 255, 0.3);
}

.game-card:active {
    transform: scale(1.05) rotate(1deg);
}

/* Стилі для окремих карток */
.drawing-card {
    background: linear-gradient(135deg, #fff 0%, #ffe5e5 100%);
}

.drawing-card:hover {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(255, 107, 107, 0.6);
}

.music-card {
    background: linear-gradient(135deg, #fff 0%, #e5f3ff 100%);
}

.music-card:hover {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(107, 107, 255, 0.6);
}

.animals-card {
    background: linear-gradient(135deg, #fff 0%, #e5ffe5 100%);
}

.animals-card:hover {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(107, 255, 107, 0.6);
}

.shapes-card {
    background: linear-gradient(135deg, #fff 0%, #fff3e5 100%);
}

.shapes-card:hover {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(255, 193, 107, 0.6);
}

.farm-card {
    background: linear-gradient(135deg, #fff 0%, #e5ffe5 100%);
}

.farm-card:hover {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(139, 195, 74, 0.6);
}

.sorter-card {
    background: linear-gradient(135deg, #fff 0%, #ffe5f5 100%);
}

.sorter-card:hover {
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(255, 107, 157, 0.6);
}

.card-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-content svg {
    width: 80%;
    height: 80%;
    color: #333;
    filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.game-card:hover .card-content svg {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(8px 8px 15px rgba(0, 0, 0, 0.3));
}

/* Пульсація SVG */
@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.card-content svg {
    animation: pulse-icon 2s ease-in-out infinite;
}

/* Адаптивність */

/* Великі десктопи */
@media (min-width: 1400px) {
    .games-grid {
        gap: 40px;
    }

    .game-card {
        padding: 50px;
    }
}

/* Середні десктопи та landscape планшети */
@media (min-width: 1024px) and (max-width: 1399px) {
    .games-grid {
        gap: 25px;
        max-width: 1200px;
    }

    .game-card {
        padding: 35px;
    }
}

/* Portrait планшети та малі landscape */
@media (min-width: 768px) and (max-width: 1023px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        max-width: 800px;
    }

    .game-card {
        padding: 30px;
    }

    .game-card:hover {
        transform: scale(1.08) rotate(2deg);
    }
}

/* Мобільні portrait */
@media (max-width: 767px) {
    .container {
        padding: 20px 15px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        max-width: 500px;
    }

    .game-card {
        padding: 30px;
    }

    .game-card:hover {
        transform: scale(1.05) rotate(2deg);
    }

    /* Зменшуємо анімацію float для мобільних */
    @keyframes float {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-8px);
        }
    }
}

/* Дуже малі мобільні */
@media (max-width: 480px) {
    .container {
        padding: 15px 10px;
    }

    .games-grid {
        gap: 20px;
        max-width: 400px;
    }

    .game-card {
        padding: 25px;
        border-radius: 25px;
    }

    .card-content svg {
        width: 75%;
        height: 75%;
    }
}

/* Спеціально для landscape мобільних */
@media (max-width: 896px) and (orientation: landscape) {
    .container {
        padding: 15px;
    }

    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        max-width: 100%;
    }

    .game-card {
        padding: 20px;
    }

    /* Вимикаємо float анімацію в landscape */
    .game-card {
        animation: none;
    }
}

/* Ефект рипл при кліку */
@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}
