:root {
    --card-bg: rgba(20, 15, 30, 0.7);
    --border-royal: rgba(197, 160, 89, 0.4);
    --gold: #C5A059;
    --royal-purple: #4a1d6a;
    --magic-cyan: #00f2ea;
    --text-main: #e0e5ff;
    --text-muted: #8b95c9;
}

/* Background handled via shared classes in home.css or local styles if needed */
.games-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -2;
    filter: brightness(0.3) contrast(1.2);
}

.games-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at top right, rgba(0, 242, 234, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(255, 0, 80, 0.05), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

.games-explorer {
    padding: 20px;
    max-width: 1400px;
    margin: 40px auto;
    position: relative;
    z-index: 10;
}

/* Search Header - Magical Portal Style */
.explorer-header {
    background: linear-gradient(135deg, rgba(10, 5, 20, 0.95), rgba(30, 20, 50, 0.8));
    backdrop-filter: blur(25px);
    border: 2px solid var(--border-royal);
    border-radius: 40px;
    padding: 80px 40px;
    margin-bottom: 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(197, 160, 89, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.9);
}

.explorer-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://www.transparenttextures.com/patterns/dark-matter.png');
    opacity: 0.4;
    pointer-events: none;
}

.explorer-header h1 {
    font-family: 'Cinzel', serif;
    font-size: 3.8rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(197, 160, 89, 0.6);
    letter-spacing: 6px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.search-box-wrap {
    max-width: 800px;
    margin: 40px auto 0;
    position: relative;
}

.search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-royal);
    border-radius: 60px;
    padding: 22px 35px 22px 80px;
    font-size: 1.2rem;
    color: #fff;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(197, 160, 89, 0.08);
    box-shadow: 0 0 35px rgba(197, 160, 89, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.6);
    transform: translateY(-5px);
}

.search-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 1.5rem;
    pointer-events: none;
    filter: drop-shadow(0 0 10px var(--gold));
}

/* Platform Filters - Ancient Artifacts */
.platform-filters {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 45px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 14px 30px;
    background: rgba(10, 5, 20, 0.6);
    border: 1px solid var(--border-royal);
    border-radius: 15px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Cinzel', serif;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.filter-chip i {
    color: var(--gold);
    font-size: 1.2rem;
}

.filter-chip:hover {
    background: rgba(197, 160, 89, 0.15);
    border-color: var(--gold);
    color: #fff;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--gold), #8a6d3b);
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 30px rgba(197, 160, 89, 0.8);
}

.filter-chip.active i {
    color: #000;
}

/* Games Grid - Empire Gates */
.empire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 50px;
    margin-top: 20px;
}

.game-card-empire {
    background: linear-gradient(180deg, rgba(40, 30, 60, 0.9), rgba(15, 10, 25, 1));
    border: 2px solid var(--border-royal);
    border-radius: 30px;
    overflow: hidden;
    transition: all 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.game-card-empire.visible {
    opacity: 1;
    transform: translateY(0);
}

.game-card-empire::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--gold), transparent, var(--royal-purple)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    pointer-events: none;
}

.game-card-empire:hover {
    transform: translateY(-20px) scale(1.03);
    border-color: var(--gold);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(197, 160, 89, 0.3);
}

.card-media {
    position: relative;
    height: 220px;
    overflow: hidden;
    border-bottom: 2px solid var(--border-royal);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s ease;
}

.game-card-empire:hover .card-media img {
    transform: scale(1.2);
}

.platform-badges {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    gap: 12px;
    z-index: 10;
}

.p-badge {
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gold);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
}

.p-badge img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.p-badge i {
    font-size: 1.4rem;
}

.card-body {
    padding: 35px;
    position: relative;
}

.card-body h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.7rem;
    color: #fff;
    margin-bottom: 15px;
    letter-spacing: 3px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

.card-body .desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
    height: 54px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 30px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 25px;
    border-top: 1px solid rgba(197, 160, 89, 0.2);
}

.price-tag {
    font-weight: 900;
    color: var(--gold);
    font-size: 1.4rem;
    letter-spacing: 2px;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 10px rgba(197, 160, 89, 0.4);
}

.btn-game-go {
    background: linear-gradient(135deg, var(--gold), #8a6d3b);
    color: #000;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(197, 160, 89, 0.5);
}

.btn-game-go:hover {
    background: #fff;
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.4);
}

/* Animations Scroll Reveal */
.loading-skeleton {
    background: rgba(30, 20, 50, 0.7);
    height: 450px;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-royal);
}

.loading-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.1), transparent);
    animation: shimmer 2.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .explorer-header {
        padding: 40px 20px;
        border-radius: 20px;
        margin-bottom: 30px;
    }

    .explorer-header h1 {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }

    .search-input {
        padding: 15px 20px 15px 60px;
        font-size: 1rem;
    }

    .search-icon {
        left: 20px;
        font-size: 1.2rem;
    }

    .platform-filters {
        gap: 10px;
    }

    .filter-chip {
        padding: 10px 15px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .empire-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .game-card-empire {
        max-width: 100%;
        border-radius: 20px;
    }

    .card-media {
        height: 180px;
    }

    .card-body {
        padding: 20px;
    }

    .card-body h3 {
        font-size: 1.4rem;
    }

    .price-tag {
        font-size: 1.1rem;
    }
}

/* Pagination Styles */
.pagination-empire {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 50px;
}

.pag-btn {
    background: rgba(30, 20, 50, 0.6);
    border: 1px solid var(--border-royal);
    color: var(--gold);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pag-btn:hover:not(:disabled) {
    background: var(--gold);
    color: #000;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.4);
    transform: translateY(-3px);
}

.pag-btn.active {
    background: var(--gold);
    color: #000;
    box-shadow: 0 0 20px rgba(197, 160, 89, 0.6);
}

.pag-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}