/*-------------------------------------------------------------------------------------------------*/
/* CSS for the games cards and gaming view controls */
/*-------------------------------------------------------------------------------------------------*/


/*-------------------------------------------------------------------------------------------------*/
/* Theme-aware games card colors */
/*-------------------------------------------------------------------------------------------------*/
:root {
    --game-card-media-text: rgb(245, 250, 255);

    --game-card-media-start:
        color-mix(in srgb,
            var(--article-accent-border-strong, rgb(184, 1, 200)) 78%,
            rgb(24, 50, 78));

    --game-card-media-end:
        color-mix(in srgb,
            var(--article-accent-border-strong, rgb(184, 1, 200)) 44%,
            rgb(8, 20, 36));

    --game-card-surface:
        color-mix(in srgb,
            var(--article-accent-bg, rgba(204, 0, 255, 0.10)) 82%,
            transparent);

    --game-card-surface-highlight:
        color-mix(in srgb,
            var(--site-text-color) 7%,
            transparent);

    --game-card-meta-surface:
        color-mix(in srgb,
            var(--site-text-color) 5%,
            transparent);
}


/*-------------------------------------------------------------------------------------------------*/
/* Hidden gaming elements */
/*-------------------------------------------------------------------------------------------------*/
#current-games-section[hidden],
#number-of-games-section[hidden],
.current-games-navigation-button[hidden],
.games-view-controls[hidden],
.games-cards-view[hidden],
.games-table-container[hidden],
.games-cards-footer[hidden],
.show-more-games-button[hidden] {
    display: none !important;
}



/*-------------------------------------------------------------------------------------------------*/
/* Games view controls */
/*-------------------------------------------------------------------------------------------------*/
.games-view-controls {
    margin: 24px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.games-view-buttons {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    border-radius: 999px;
    background: var(--article-accent-bg, rgba(204, 0, 255, 0.10));
}

.games-view-button {
    min-width: 110px;
    padding: 10px 18px;
    border: none;
    border-radius: 999px;
    color: inherit;
    background: transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.games-view-button:hover,
.games-view-button:focus-visible {
    outline: none;
    background: var(--article-accent-bg, rgba(204, 0, 255, 0.18));
}

.games-view-button.is-active {
    color: white;
    background: var(--article-accent-border-strong, rgb(184, 1, 200));
}



/*-------------------------------------------------------------------------------------------------*/
/* Current games section */
/*-------------------------------------------------------------------------------------------------*/
#current-games-section {
    margin: 34px 0 10px;
    padding: 24px;
    border: 1px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    border-radius: 28px;
    background:
        linear-gradient(145deg,
            var(--article-accent-bg, rgba(204, 0, 255, 0.12)),
            rgba(0, 0, 0, 0.06));
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.14);
}

#current-games-heading {
    margin: 0 0 20px;
    text-align: center;
}

.current-games-slider {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.current-games-viewport {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 4px 18px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.current-games-viewport::-webkit-scrollbar {
    display: none;
}

.current-games-viewport:focus-visible {
    outline: 3px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    outline-offset: 3px;
    border-radius: 22px;
}

.current-games-track {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.current-games-track>.game-card {
    flex: 0 0 calc((100% - 48px) / 3);
    scroll-snap-align: start;
}

.current-games-navigation-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    border-radius: 50%;
    color: inherit;
    background: var(--article-accent-bg, rgba(204, 0, 255, 0.12));
    font: inherit;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease;
}

.current-games-navigation-button:hover:not(:disabled),
.current-games-navigation-button:focus-visible:not(:disabled) {
    outline: none;
    transform: scale(1.08);
    border-color: var(--card-hover-border-color, rgb(220, 0, 230));
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.22);
}

.current-games-navigation-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.current-games-position {
    margin: 10px 0 0;
    font-weight: 700;
    text-align: center;
}



/*-------------------------------------------------------------------------------------------------*/
/* Current game badge */
/*-------------------------------------------------------------------------------------------------*/
.game-card-current-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    color: white;
    background:
        var(--article-accent-border-strong, rgb(184, 1, 200));
    box-shadow:
        0 5px 16px rgba(0, 0, 0, 0.28);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}



/*-------------------------------------------------------------------------------------------------*/
/* Games cards grid */
/*-------------------------------------------------------------------------------------------------*/
.games-cards-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 24px;
}



/*-------------------------------------------------------------------------------------------------*/
/* Game card */
/*-------------------------------------------------------------------------------------------------*/
.game-card {
    position: relative;
    isolation: isolate;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    border-radius: 24px;
    background:
        linear-gradient(155deg,
            var(--game-card-surface-highlight),
            transparent 44%),
        var(--game-card-surface);

    box-shadow:
        0 20px 46px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    text-align: left;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.game-card::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(135deg,
            transparent,
            var(--article-accent-bg, rgba(204, 0, 255, 0.16)),
            transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    content: "";
}

.game-card:hover,
.game-card:focus-within {
    transform: translateY(-6px);
    border-color:
        var(--card-hover-border-color, rgb(220, 0, 230));
    box-shadow:
        0 18px 38px rgba(0, 0, 0, 0.24),
        0 0 24px var(--article-accent-bg, rgba(204, 0, 255, 0.18));
}

.game-card::after {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 12%;
    left: 12%;
    height: 2px;
    border-radius: 999px;
    background:
        linear-gradient(90deg,
            transparent,
            var(--article-accent-border-strong, rgb(184, 1, 200)),
            transparent);
    box-shadow:
        0 0 12px var(--article-accent-border-strong, rgb(184, 1, 200));
    opacity: 0.55;
    pointer-events: none;
    transition:
        right 180ms ease,
        left 180ms ease,
        opacity 180ms ease;
    content: "";
}

.game-card:hover::after,
.game-card:focus-within::after,
.game-card[open]::after {
    right: 5%;
    left: 5%;
    opacity: 1;
}

.game-card:hover::before,
.game-card:focus-within::before,
.game-card[open]::before {
    opacity: 1;
}

.game-card[open] {
    border-color:
        var(--card-hover-border-color, rgb(220, 0, 230));
}



/*-------------------------------------------------------------------------------------------------*/
/* Game card summary */
/*-------------------------------------------------------------------------------------------------*/
.game-card-summary {
    position: relative;
    z-index: 1;
    display: block;
    list-style: none;
    cursor: pointer;
}

.game-card-summary::-webkit-details-marker {
    display: none;
}

.game-card-summary::marker {
    display: none;
    content: "";
}

.game-card-summary:focus-visible {
    outline: 3px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    outline-offset: -4px;
    border-radius: 22px;
}

.game-card-summary-content {
    min-height: inherit;
    display: flex;
    flex-direction: column;
}



/*-------------------------------------------------------------------------------------------------*/
/* Game card image and placeholder */
/*-------------------------------------------------------------------------------------------------*/
.game-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    color: var(--game-card-media-text);

    background:
        radial-gradient(circle at 22% 18%,
            color-mix(in srgb,
                var(--article-accent-border-strong, rgb(184, 1, 200)) 88%,
                transparent),
            transparent 42%),
        radial-gradient(circle at 78% 82%,
            color-mix(in srgb,
                var(--site-text-color) 18%,
                transparent),
            transparent 36%),
        linear-gradient(135deg,
            var(--game-card-media-start),
            var(--game-card-media-end));

    box-shadow:
        inset 0 -1px 0 rgba(255, 255, 255, 0.13);
}

.game-card-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 260ms ease;
}

.game-card:hover .game-card-image,
.game-card:focus-within .game-card-image {
    transform: scale(1.04);
}

.game-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--game-card-media-text);
    opacity: 1;
    text-shadow:
        0 2px 12px rgba(0, 0, 0, 0.48);
}

.game-card-placeholder-icon {
    font-size: clamp(2.7rem, 5vw, 4rem);
    filter:
        drop-shadow(0 0 14px rgba(255, 255, 255, 0.34)) drop-shadow(0 5px 10px rgba(0, 0, 0, 0.30));
    transition:
        transform 180ms ease,
        filter 180ms ease;
}

.game-card:hover .game-card-placeholder-icon,
.game-card:focus-within .game-card-placeholder-icon {
    transform:
        translateY(-2px) scale(1.06);
    filter:
        drop-shadow(0 0 19px rgba(255, 255, 255, 0.52)) drop-shadow(0 7px 13px rgba(0, 0, 0, 0.34));
}

.game-card-placeholder-text {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}



/*-------------------------------------------------------------------------------------------------*/
/* Game card body */
/*-------------------------------------------------------------------------------------------------*/
.game-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 20px 18px;
}

.game-card-title {
    min-height: 2.4em;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-align: center;
}



/*-------------------------------------------------------------------------------------------------*/
/* Game card badges */
/*-------------------------------------------------------------------------------------------------*/
.game-card-badge-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-card-badges--genres,
.game-card-badges--play {
    width: 100%;
}

.game-card-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
}

.game-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.game-card-badge-icon {
    flex: 0 0 auto;
    font-size: 0.88em;
    opacity: 0.76;
}

.game-card-badge--genre {
    border-color:
        var(--article-accent-border-strong, rgb(184, 1, 200));
    background:
        var(--article-accent-bg, rgba(204, 0, 255, 0.14));
}

.game-card-badge--played-on {
    border-color: rgba(56, 189, 248, 0.64);
    background: rgba(56, 189, 248, 0.13);
}

.game-card-badge--mode {
    border-color: rgba(167, 139, 250, 0.68);
    background: rgba(167, 139, 250, 0.14);
}

.game-card-date-information {
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb,
            var(--article-accent-border-strong, rgb(184, 1, 200)) 28%,
            transparent);
    border-radius: 15px;
    background:
        var(--game-card-meta-surface);
}



/*-------------------------------------------------------------------------------------------------*/
/* Release and completion status */
/*-------------------------------------------------------------------------------------------------*/
.game-card-release,
.game-card-last-played,
.game-card-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.87rem;
    font-weight: 700;
    text-align: center;
}

.game-card-release,
.game-card-last-played {
    width: 100%;
    justify-content: flex-start;
    align-self: stretch;
    padding: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
}

.game-card-last-played {
    padding-top: 7px;
    border-top: 1px solid color-mix(in srgb,
            var(--article-accent-border-strong, rgb(184, 1, 200)) 20%,
            transparent);
}

.game-card-status {
    border: 1px solid transparent;
}

.game-card-status-symbol {
    font-size: 1.1em;
    font-weight: 900;
}

.game-card-status.is-finished {
    border-color: rgba(34, 197, 94, 0.65);
    background: rgba(34, 197, 94, 0.13);
}

.game-card-status.is-finished .game-card-status-symbol {
    color: rgb(34, 197, 94);
}

.game-card-status.is-unfinished {
    border-color: rgba(249, 115, 22, 0.66);
    background: rgba(249, 115, 22, 0.13);
}

.game-card-status.is-unfinished .game-card-status-symbol {
    color: rgb(249, 115, 22);
}

.game-card-status.is-endless {
    border-color: rgba(59, 130, 246, 0.66);
    background: rgba(59, 130, 246, 0.13);
}

.game-card-status.is-endless .game-card-status-symbol {
    color: rgb(59, 130, 246);
}



/*-------------------------------------------------------------------------------------------------*/
/* Details toggle */
/*-------------------------------------------------------------------------------------------------*/
.game-card-toggle {
    min-height: 46px;
    margin-top: auto;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid color-mix(in srgb,
            var(--article-accent-border-strong, rgb(184, 1, 200)) 42%,
            transparent);
    border-radius: 14px;
    background:
        color-mix(in srgb,
            var(--article-accent-bg, rgba(204, 0, 255, 0.10)) 72%,
            transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    font-weight: 800;
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease;
}

.game-card-summary:hover .game-card-toggle,
.game-card-summary:focus-visible .game-card-toggle {
    border-color:
        var(--card-hover-border-color, rgb(220, 0, 230));
    background:
        color-mix(in srgb,
            var(--article-accent-bg, rgba(204, 0, 255, 0.18)) 86%,
            transparent);
    box-shadow:
        0 0 16px var(--article-accent-bg, rgba(204, 0, 255, 0.18));
}

.game-card-toggle-text--open {
    display: none;
}

.game-card[open] .game-card-toggle-text--closed {
    display: none;
}

.game-card[open] .game-card-toggle-text--open {
    display: inline;
}

.game-card-toggle-icon {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    background:
        var(--article-accent-border-strong, rgb(184, 1, 200));
    box-shadow:
        0 0 10px var(--article-accent-bg, rgba(204, 0, 255, 0.22));
    font-size: 1.05rem;
    line-height: 1;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease;
}

.game-card[open] .game-card-toggle-icon {
    transform: rotate(180deg);
}



/*-------------------------------------------------------------------------------------------------*/
/* Expanded game card details */
/*-------------------------------------------------------------------------------------------------*/
.game-card-details {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    background: rgba(0, 0, 0, 0.08);
}

.game-card-comment {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
    line-height: 1.5;
}





/*-------------------------------------------------------------------------------------------------*/
/* Games cards footer */
/*-------------------------------------------------------------------------------------------------*/
.games-cards-footer {
    margin-top: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.games-cards-progress {
    margin: 0;
    font-weight: 700;
    text-align: center;
}

.show-more-games-button {
    padding: 11px 20px;
    border: 1px solid var(--article-accent-border-strong, rgb(184, 1, 200));
    border-radius: 999px;
    color: inherit;
    background: var(--article-accent-bg, rgba(204, 0, 255, 0.10));
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.show-more-games-button:hover,
.show-more-games-button:focus-visible {
    outline: none;
    transform: translateY(-2px);
    border-color: var(--card-hover-border-color, rgb(220, 0, 230));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.20);
}



/*-------------------------------------------------------------------------------------------------*/
/* Responsive games cards */
/*-------------------------------------------------------------------------------------------------*/
@media screen and (max-width: 850px) {

    .current-games-track>.game-card {
        flex-basis: calc((100% - 24px) / 2);
    }

    .games-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 600px) {

    #current-games-section {
        padding: 18px 10px;
    }

    .current-games-slider {
        gap: 8px;
    }

    .current-games-track {
        gap: 16px;
    }

    .current-games-track>.game-card {
        flex-basis: 100%;
    }

    .current-games-navigation-button {
        width: 38px;
        height: 38px;
        font-size: 1.55rem;
    }

    .games-view-controls {
        flex-direction: column;
    }

    .games-cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .game-card-body {
        padding: 18px 16px 16px;
    }

    .game-card-details {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .game-card,
    .game-card::before,
    .game-card::after,
    .game-card-image,
    .game-card-placeholder-icon,
    .game-card-toggle,
    .game-card-toggle-icon,
    .current-games-navigation-button,
    .show-more-games-button {
        transition: none;
    }

    .game-card:hover,
    .game-card:hover .game-card-placeholder-icon,
    .game-card:focus-within,
    .game-card:focus-within .game-card-placeholder-icon,
    .show-more-games-button:hover,
    .show-more-games-button:focus-visible {
        transform: none;
    }
}