/* CSS Variables Extension */
:root {
    --all-games-tmpl-font-display: 'Titan One', cursive;
    --all-games-tmpl-font-body: 'Fredoka', sans-serif;
    --all-games-tmpl-accent-green: #00E676;
    --all-games-tmpl-accent-orange: #FF5722;
    --all-games-tmpl-accent-yellow: #FFEB3B;
    --all-games-tmpl-accent-blue: #29B6F6;
    --all-games-tmpl-accent-pink: #EC407A;
    --all-games-tmpl-accent-purple: #AB47BC;
    --all-games-tmpl-accent-white: #FFFFFF;
    --all-games-tmpl-text-dark: #212121;
    --all-games-tmpl-tag-bg: #F5F5F5;
    --all-games-tmpl-primary-bg: #EEEEEE;
    --all-games-tmpl-img-placeholder: #E0E0E0;
    --all-games-tmpl-game-border: 3px solid #212121;
}

/* Full-width Main Wrapper with outer padding gaps */
.all-games-tmpl {
    width: 100%;
    padding: 24px;
    box-sizing: border-box;
}

/* Redesigned Arcade Pop Hero Banner */
.all-games-tmpl .hero-banner {
    background: #180A29;
    background-image:
            radial-gradient(circle at 15% 20%, rgba(236, 64, 122, 0.35) 0%, transparent 45%),
            radial-gradient(circle at 85% 80%, rgba(0, 230, 118, 0.25) 0%, transparent 45%),
            repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 12px, transparent 12px, transparent 24px);
    border: var(--all-games-tmpl-game-border);
    border-radius: 28px;
    padding: 52px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 8px 8px 0px var(--all-games-tmpl-text-dark);
}

.all-games-tmpl .hero-banner::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    width: 140px;
    height: 140px;
    background: var(--all-games-tmpl-accent-yellow);
    border-radius: 50%;
    border: var(--all-games-tmpl-game-border);
    opacity: 0.9;
    z-index: 0;
}

.all-games-tmpl .hero-banner::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -30px;
    width: 180px;
    height: 180px;
    background: var(--all-games-tmpl-accent-purple);
    border-radius: 30px;
    transform: rotate(15deg);
    border: var(--all-games-tmpl-game-border);
    opacity: 0.85;
    z-index: 0;
}

.all-games-tmpl .hero-text {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.all-games-tmpl .hero-text h1 {
    font-family: var(--all-games-tmpl-font-display);
    font-size: 60px;
    color: var(--all-games-tmpl-accent-green);
    line-height: 1.05;
    margin-bottom: 20px;
    text-transform: uppercase;
    text-shadow:
            4px 4px 0px var(--all-games-tmpl-text-dark),
            -2px -2px 0px var(--all-games-tmpl-text-dark),
            2px -2px 0px var(--all-games-tmpl-text-dark),
            -2px 2px 0px var(--all-games-tmpl-text-dark),
            0px 8px 0px var(--all-games-tmpl-accent-pink);
    letter-spacing: 2px;
}

.all-games-tmpl .hero-text h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--all-games-tmpl-text-dark);
    background: var(--all-games-tmpl-accent-white);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    border: var(--all-games-tmpl-game-border);
    margin: 0;
    box-shadow: 4px 4px 0px var(--all-games-tmpl-text-dark);
    transform: rotate(-1.5deg);
}
.all-games-tmpl .hero-text h2 .hero-title-icon {
    width: 24px;
    height: 24px;
    fill: #FF5722; /* 图标颜色，可改用 var(--categories-tmpl-accent-orange) */
    flex-shrink: 0;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.15));
}

/* Standardized Game Grid - Uniform Standard Cards */
.all-games-tmpl .game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-auto-rows: minmax(170px, auto);
    gap: 24px;
    padding: 16px 8px;
}

/* Cartoon Game Card */
.all-games-tmpl .game-card {
    background: transparent;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    z-index: 1;
    box-sizing: border-box;
}

/* Base Transform Reset */
.all-games-tmpl .game-card:nth-child(n) {
    transform: translateY(0);
    grid-column: span 1;
    grid-row: span 1;
    margin-top: 0;
}

/* Featured / Highlighted Large Cards */
.all-games-tmpl .game-card.card-featured {
    grid-column: span 2;
    grid-row: span 2;
}

.all-games-tmpl .game-card:hover {
    transform: translateY(-8px) scale(1.03) !important;
    z-index: 10;
}

.all-games-tmpl .card-thumb-wrapper {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 140px;
    position: relative;
    background-color: var(--all-games-tmpl-img-placeholder);
    overflow: hidden;
    border: var(--all-games-tmpl-game-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.all-games-tmpl .card-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.all-games-tmpl .game-card:hover .card-thumb-wrapper img {
    transform: scale(1.08);
}

.all-games-tmpl .badge-hot {
    position: absolute;
    top: 12px;
    left: 12px;
    color: var(--all-games-tmpl-accent-white);
    font-family: var(--all-games-tmpl-font-display);
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid var(--all-games-tmpl-text-dark);
    z-index: 2;
    text-transform: uppercase;
}

.all-games-tmpl .badge-hot.badge-tag-hot {
    background: var(--all-games-tmpl-accent-orange);
    color: var(--all-games-tmpl-accent-white);
}

.all-games-tmpl .badge-hot.badge-tag-new {
    background: var(--all-games-tmpl-accent-green);
    color: var(--all-games-tmpl-text-dark);
}

.all-games-tmpl .badge-hot.badge-tag-top {
    background: var(--all-games-tmpl-accent-yellow);
    color: var(--all-games-tmpl-text-dark);
}

.all-games-tmpl .card-info {
    position: relative;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    border-top: 2px solid var(--all-games-tmpl-text-dark);
    z-index: 2;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.all-games-tmpl .game-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.all-games-tmpl .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.all-games-tmpl .game-tag {
    font-size: 12px;
    font-weight: 700;
    background: var(--all-games-tmpl-primary-bg);
    padding: 4px 10px;
    border-radius: 8px;
    border: 2px solid var(--all-games-tmpl-text-dark);
    text-transform: uppercase;
}

.all-games-tmpl .game-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.all-games-tmpl .star-icon {
    color: #FFC107;
    font-size: 16px;
}
.all-games-tmpl .star-icon::after{
    content: "★";
}

/* Small Card Text Size Adjustment */
.all-games-tmpl .game-card:not(.card-featured) .game-title {
    font-size: 13px;
    margin-bottom: 4px;
}

.all-games-tmpl .game-card:not(.card-featured) .game-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
}

.all-games-tmpl .game-card:not(.card-featured) .game-rating {
    font-size: 11px;
}

.all-games-tmpl .game-card:not(.card-featured) .star-icon {
    font-size: 13px;
}

.all-games-tmpl .game-card:not(.card-featured) .card-info {
    padding: 8px;
}

.all-games-tmpl .game-card:not(.card-featured) .card-meta {
    margin-top: 4px;
}

/* Responsive Design Rules */
@media (max-width: 1100px) {
    .all-games-tmpl .game-card:nth-child(1 of .card-featured){
        grid-column: span 1;
    }
}
@media (max-width: 910px) {
    .all-games-tmpl .game-card:nth-child(1 of .card-featured){
        grid-column: span 2;
    }
    .all-games-tmpl .game-card:nth-child(2 of .card-featured){
        grid-row: span 1;
    }
    .all-games-tmpl .game-card:nth-child(3 of .card-featured){
        grid-row: span 1;
    }
}
@media (max-width: 768px) {
    .all-games-tmpl {
        padding: 16px;
    }
    .all-games-tmpl .hero-banner {
        padding: 32px 20px;
        flex-direction: column;
        text-align: center;
    }
    .all-games-tmpl .hero-text h1 {
        font-size: 38px;
    }
    .all-games-tmpl .hero-text h2 {
        font-size: 16px;
    }
    .all-games-tmpl .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-auto-rows: minmax(180px, auto);
        gap: 16px;
    }
    .all-games-tmpl .game-card.card-featured {
        grid-column: span 2;
        grid-row: span 2;
    }
    .all-games-tmpl .game-title {
        font-size: 15px;
    }
    .all-games-tmpl .game-card:not(.card-featured) .game-title {
        font-size: 12px;
    }
}
@media (max-width: 700px) {
    .all-games-tmpl .game-card:nth-child(1 of .card-featured){
        grid-row: span 1;
    }
    .all-games-tmpl .game-card:nth-child(2 of .card-featured){
        grid-row: span 2;
    }
}
@media (max-width: 550px) {
    .all-games-tmpl .game-card:nth-child(1 of .card-featured){
        grid-row: span 2;
        grid-column: span 1;
    }
}
@media (max-width: 530px) {
    .all-games-tmpl .game-card:nth-child(3 of .card-featured){
        grid-row: span 2;
        grid-column: span 1;
    }
    .all-games-tmpl .game-card:nth-child(4 of .card-featured){
        grid-column: span 1;
    }
}