/* Custom style for Recently Played section */

#game-history-section {
    background: linear-gradient(120deg, #232526 0%, #414345 100%);
    border-radius: 18px;
    box-shadow: 0 4px 24px 0 rgba(44, 62, 80, 0.18);
    padding: 18px 16px 8px 16px;
    margin-bottom: 28px;
    border: 2px solid #3a3a3a;
}

@keyframes bounceHeading {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
    /* Nhún nhẹ hơn nút Play */
}


/* 🔹 Heading Recently Played */

#game-history-section .heading-section {
    text-align: center;
    margin: 6px 0 18px;
}

#game-history-section .heading-section h4 {
    display: inline-block;
    padding: 11px 26px;
    font-size: 21px;
    font-weight: 700;
    border-radius: 14px;
    background: linear-gradient(45deg, #ff6600, #ffbb33);
    color: #fff;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(255, 102, 0, 0.6), 0 0 36px rgba(255, 187, 51, 0.4);
    animation: pulseOrange 2s infinite alternate, bounceHeading 2.8s infinite ease-in-out;
}

@keyframes pulseOrange {
    0% {
        box-shadow: 0 0 12px rgba(255, 102, 0, 0.6), 0 0 24px rgba(255, 187, 51, 0.3);
    }
    100% {
        box-shadow: 0 0 28px rgba(255, 153, 0, 1), 0 0 56px rgba(255, 187, 51, 0.8);
    }
}


/* 🔹 Heading New Games */

.heading-section.new-games {
    text-align: center;
    margin: 25px 0;
}

.heading-section.new-games h4 {
    display: inline-block;
    padding: 14px 34px;
    font-size: 24px;
    font-weight: 700;
    border-radius: 14px;
    background: linear-gradient(45deg, aquamarine, lightblue);
    color: #003366;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(0, 255, 200, 0.5), 0 0 36px rgba(0, 200, 255, 0.4);
    animation: pulseBlue 2s infinite alternate, bounceHeading 2.8s infinite ease-in-out;
}

@keyframes pulseBlue {
    0% {
        box-shadow: 0 0 12px rgba(0, 255, 200, 0.5), 0 0 24px rgba(0, 200, 255, 0.3);
    }
    100% {
        box-shadow: 0 0 28px rgba(0, 255, 255, 1), 0 0 56px rgba(0, 200, 255, 0.8);
    }
}


/* 🔹 Heading Popular Games */

.heading-section.popular-games {
    text-align: center;
    margin: 25px 0;
}

.heading-section.popular-games h4 {
    display: inline-block;
    padding: 14px 34px;
    font-size: 24px;
    font-weight: 700;
    border-radius: 14px;
    background: linear-gradient(45deg, #7289da, #a77bff);
    color: #fff;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(167, 123, 255, 0.6), 0 0 40px rgba(114, 137, 218, 0.4);
    animation: pulsePurple 2s infinite alternate, bounceHeading 2.8s infinite ease-in-out;
}

@keyframes pulsePurple {
    0% {
        box-shadow: 0 0 12px rgba(114, 137, 218, 0.6), 0 0 24px rgba(167, 123, 255, 0.3);
    }
    100% {
        box-shadow: 0 0 28px rgba(167, 123, 255, 1), 0 0 56px rgba(114, 137, 218, 0.9);
    }
}


/* 🔹 Items in Recently Played */

#game-history-list .col-6,
#game-history-list .col-md-3 {
    max-width: 16.6667%;
    flex: 0 0 16.6667%;
    padding-left: 8px;
    padding-right: 8px;
}

/* The whole card is the link now (was just the <img>), so hover-zoom and
   click work anywhere on the card, not only on the thumbnail strip. */
#game-history-list .game-history-item {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

#game-history-list .game-history-item:focus-visible .item {
    outline: 2px solid #ff6600;
    outline-offset: 2px;
}

#game-history-list .item {
    background-color: #27292a;
    padding: 10px 8px 8px;
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), box-shadow 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 2px 12px 0 rgba(255, 140, 0, 0.13);
    border: 2px solid #ffb36b;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
    min-height: 0;
    will-change: transform, box-shadow;
    position: relative;
    z-index: 1;
}

#game-history-list .item:hover {
    transform: scale(1.07) translateY(-8px) rotate(-1.5deg);
    box-shadow: 0 16px 34px 0 rgba(255, 140, 0, 0.28), 0 2px 12px 0 rgba(255, 140, 0, 0.13);
    border-color: #ff6600;
    z-index: 10;
}

#game-history-list .item img {
    border-radius: 12px;
    height: 92px;
    width: 100%;
    object-fit: cover;
    margin-bottom: 0;
    transition: transform 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55), filter 0.25s;
    z-index: 1;
}

#game-history-list .item:hover img {
    transform: scale(1.13) rotate(2deg);
    filter: brightness(1.08) saturate(1.2) drop-shadow(0 4px 16px #ffb36b88);
    z-index: 1;
}

#game-history-list .recent-title {
    font-size: 12.5px;
    margin-top: 8px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: #ff6600;
    font-weight: 700;
    text-align: center;
    padding: 0 8px;
    background: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.2;
    min-height: 31px;
    max-height: 31px;
    position: relative;
    z-index: 2;
}

#game-history-list .item:hover .recent-title {
    color: #ffbb33;
    text-shadow: 0 4px 10px rgba(255, 187, 51, 0.7);
    z-index: 3;
}


/* 🔹 Responsive */

@media (max-width: 1200px) {
    #game-history-list .col-6,
    #game-history-list .col-md-3 {
        max-width: 33.3333%;
        flex: 0 0 33.3333%;
    }
}

@media (max-width: 991px) {
    #game-history-list .col-6,
    #game-history-list .col-md-3 {
        max-width: 50%;
        flex: 0 0 50%;
    }
    #game-history-list .item img {
        height: 104px;
    }
}

@media (max-width: 575px) {
    #game-history-section {
        padding: 12px 4px 4px 4px;
    }
    #game-history-list .col-6,
    #game-history-list .col-md-3 {
        max-width: 100%;
        flex: 0 0 100%;
    }
    #game-history-list .item img {
        height: 96px;
    }
}