:root {
    --primary-neon: #00f3ff;
    --secondary-neon: #bc13fe;
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --card-bg: #151520;
    --card-hover: #1e1e2d;
    --text-main: #ffffff;
    --text-muted: #8888aa;
    --spacing-unit: 8px;
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --header-height: 90px; /* Matches shared nav height */
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effects */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
}

.bg-spot {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s ease-in-out infinite;
}

.spot-1 {
    top: -10%;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-neon), transparent 70%);
}

.spot-2 {
    bottom: -10%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-neon), transparent 70%);
    animation-delay: -5s;
}

.bg-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Layout Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: block; /* Override global flex style */
    height: auto;   /* Override global height: 100% */
}

/* Hero Section */
.hero {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 30%, var(--primary-neon));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Search & Filter Bar */
.filter-bar {
    background: rgba(21, 21, 32, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.search-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    padding: 12px 16px 12px 48px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-neon);
    box-shadow: 0 0 0 2px rgba(0, 243, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.chips-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    flex: 1;
}

.chips-container::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 16px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    user-select: none;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.chip.active {
    background: var(--primary-neon);
    color: #000;
    border-color: var(--primary-neon);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.4);
}

.sort-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 0.9rem;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-top: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section Styles */
.section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 24px;
    padding: 0 8px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--secondary-neon);
}

/* Featured Carousel */
/* Featured Section Wrapper */
.featured-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
    flex-shrink: 0;
}

.scroll-btn:hover {
    background: var(--primary-neon);
    color: #000;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.4);
}

.featured-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    max-width: 100%;
}

.featured-scroll::-webkit-scrollbar {
    display: none;
}

.card-featured {
    flex: 0 0 350px;
    height: 200px;
    scroll-snap-align: start;
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.card-featured:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-neon);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4), 0 0 40px rgba(0, 243, 255, 0.1);
    z-index: 10;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

/* Generic Card Styles */
.game-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    background: var(--card-hover);
    border-color: var(--primary-neon);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4), 0 0 30px rgba(0, 243, 255, 0.1);
}

.game-card:active {
    /* Removed scaling effect */
}

.card-cover {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #2a2a35;
    overflow: hidden;
}

.card-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .card-cover img {
    /* transform: scale(1.1); Removed zoom to prevent blurriness */
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.game-card:hover .card-overlay {
    opacity: 0.4;
}

.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.badge-hot {
    background: rgba(255, 50, 50, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-new {
    background: rgba(50, 255, 100, 0.9);
    color: #000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.card-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-icons {
    display: flex;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Load More */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.btn-primary {
    background: var(--primary-neon);
    color: #000;
    border: none;
    padding: 12px 32px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 243, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 243, 255, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-row {
        flex-direction: column;
    }
    
    .btn-icon {
        width: 100%;
    }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 20px); }
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(40px); }
}
