/* ==========================================================================
   YanGame CSS Stylesheet - Synthwave & Retro-Futuristic Premium UI
   ========================================================================== */

/* --- CSS Variables & Tokens --- */
:root {
    --header-height: 4.5rem;

    /* Theme Colors */
    --body-bg: #07050f;
    --card-bg: rgba(20, 16, 38, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-color: #d1cbdc;
    --text-white: #ffffff;

    /* Neon Colors */
    --neon-cyan: #00f0ff;
    --neon-pink: #d946ef;
    --neon-purple: #8b5cf6;
    --neon-green: #39ff14;
    --neon-yellow: #facc15;

    /* Shadows & Glows */
    --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.4);
    --glow-pink: 0 0 15px rgba(217, 70, 239, 0.4);
    --glow-purple: 0 0 15px rgba(139, 92, 246, 0.4);
    --glow-text-cyan: 0 0 8px rgba(0, 240, 255, 0.6);

    /* Fonts */
    --body-font: 'Outfit', sans-serif;
    --retro-font: 'Press Start 2P', monospace;
}

/* --- Reset --- */
*, ::before, ::after {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    background-color: var(--body-bg);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    background: none;
}

/* --- Layout Utilities --- */
.container {
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.section {
    padding-block: 6rem 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-subtitle {
    display: block;
    font-family: var(--retro-font);
    font-size: 0.65rem;
    color: var(--neon-pink);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    text-shadow: var(--glow-pink);
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 1rem;
}

.section-description {
    max-width: 600px;
    margin-inline: auto;
    font-size: 1rem;
    color: #a39bb8;
}

/* --- Background Effects (Glows & Cyber Grid) --- */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.2;
}

.glow-blue {
    width: 500px;
    height: 500px;
    background: var(--neon-cyan);
    top: -10%;
    left: -10%;
}

.glow-pink {
    width: 600px;
    height: 600px;
    background: var(--neon-pink);
    bottom: -15%;
    right: -10%;
}

.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
    perspective: 500px;
    pointer-events: none;
}

.cyber-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, var(--body-bg) 80%);
}

/* --- Glassmorphism Panel --- */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 16px;
    padding: 1.5rem;
}

/* --- Header / Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(7, 5, 15, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.4s, border-bottom 0.4s;
}

.nav {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--retro-font);
    font-size: 1.1rem;
    color: var(--text-white);
    letter-spacing: -1px;
}

.nav-logo .highlight {
    color: var(--neon-cyan);
    text-shadow: var(--glow-text-cyan);
}

.nav-logo .dot {
    color: var(--neon-pink);
    animation: blink 1s infinite alternate;
}

.nav-list {
    display: flex;
    column-gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
    position: relative;
    padding-block: 0.5rem;
}

.nav-link:hover {
    color: var(--neon-cyan);
    text-shadow: var(--glow-text-cyan);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--neon-cyan);
    transition: width 0.3s;
    box-shadow: var(--glow-cyan);
}

.nav-link:hover::after,
.nav-link.active-link::after {
    width: 100%;
}

.nav-link.active-link {
    color: var(--neon-cyan);
    text-shadow: var(--glow-text-cyan);
}

.nav-back-link {
    display: inline-flex;
    align-items: center;
    color: var(--neon-pink);
    border: 1px solid rgba(217, 70, 239, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: all 0.3s;
    background: rgba(217, 70, 239, 0.05);
}

.nav-back-link:hover {
    background: rgba(217, 70, 239, 0.15);
    border-color: var(--neon-pink);
    box-shadow: var(--glow-pink);
    color: var(--text-white);
}

.nav-back-link::after {
    display: none;
}

.nav-toggle {
    font-size: 1.5rem;
    color: var(--text-white);
    display: none;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

.btn-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
    transition: transform 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    color: var(--body-bg);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
    filter: brightness(1.1);
}

.btn-primary:hover .btn-icon {
    transform: translateX(2px);
}

.btn-secondary {
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-white);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* --- Hero Section --- */
.hero-container {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    padding-top: 2rem;
}

.hero-tagline {
    display: inline-block;
    background: rgba(0, 240, 255, 0.07);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-white);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
}

.hero-description {
    font-size: 1.1rem;
    color: #a39bb8;
    margin-bottom: 2.5rem;
    max-width: 520px;
}

.hero-buttons {
    display: flex;
    column-gap: 1.25rem;
}

/* --- Hero Carousel Styles --- */
.hero-carousel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 380px;
    overflow: hidden;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.25);
    width: 100%;
    background-color: var(--card-bg);
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 25px 25px;
    animation: carousel-bg-scroll 25s linear infinite;
}

@keyframes carousel-bg-scroll {
    0% { background-position: 0 0; }
    100% { background-position: 25px 25px; }
}

.carousel-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.carousel-tag {
    font-family: var(--retro-font);
    font-size: 0.65rem;
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.carousel-slides {
    position: relative;
    flex: 1;
    width: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transform: translateX(15px);
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.carousel-slide-content {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.carousel-slide-img {
    flex: 0.8;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--neon-pink);
    box-shadow: var(--glow-pink);
    position: relative;
    transition: transform 0.3s ease;
}

.carousel-slide:hover .carousel-slide-img {
    transform: scale(1.03) rotate(1deg);
}

.carousel-slide-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.carousel-desc {
    color: #a39bb8;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4rem;
}

.carousel-btn-play {
    align-self: flex-start;
    background: linear-gradient(135deg, var(--neon-green), #059669);
    color: #030208;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
    font-family: var(--retro-font);
    font-size: 0.7rem;
    padding: 0.7rem 1.4rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.carousel-btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.7);
    filter: brightness(1.1);
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.carousel-control-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s;
}

.carousel-control-btn:hover {
    background: var(--neon-cyan);
    color: var(--body-bg);
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

.carousel-indicators {
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    transform: scale(1.2);
}

.carousel-info-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    text-align: center;
    padding: 2rem;
}

.mini-loader {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 240, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--neon-cyan);
    animation: spin 1s linear infinite;
    margin-bottom: 0.75rem;
}

/* --- Arcade Cabinet Visual Mockup --- */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.cabinet-container {
    position: relative;
    width: 280px;
    height: 420px;
}

.cabinet-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    filter: blur(40px);
    opacity: 0.3;
    z-index: -1;
}

.cabinet {
    width: 100%;
    height: 100%;
    background-color: #110d21;
    border: 3px solid var(--neon-cyan);
    border-radius: 20px 20px 8px 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), var(--glow-cyan);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background-image: 
        linear-gradient(rgba(217, 70, 239, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(217, 70, 239, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: cabinet-bg-scroll 20s linear infinite;
}

@keyframes cabinet-bg-scroll {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

.cabinet::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 50%, rgba(255,255,255,0.02) 50%);
    pointer-events: none;
}

.cabinet-screen-area {
    margin: 20px;
    background-color: #030208;
    border: 2px solid var(--neon-pink);
    border-radius: 12px;
    height: 250px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), var(--glow-pink);
}

.screen-scanlines {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    ), linear-gradient(
        90deg,
        rgba(255, 0, 0, 0.03),
        rgba(0, 255, 0, 0.01),
        rgba(0, 0, 255, 0.03)
    );
    background-size: 100% 3px, 3px 100%;
    z-index: 5;
    pointer-events: none;
    animation: scroll-scan 8s linear infinite;
}

.screen-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.screen-logo {
    font-family: var(--retro-font);
    font-size: 1.25rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-text-cyan);
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    animation: pulse 1.5s infinite alternate;
}

.screen-sub {
    font-family: var(--retro-font);
    font-size: 0.35rem;
    line-height: 1.5;
    color: var(--neon-yellow);
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
    animation: flash 0.8s infinite steps(2);
    text-transform: uppercase;
}

.screen-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-family: var(--retro-font);
    font-size: 0.45rem;
    color: var(--neon-green);
    position: absolute;
    bottom: 15px;
    padding-inline: 15px;
}

.cabinet-controls {
    background-color: #0b0816;
    border-top: 2px solid var(--neon-cyan);
    height: calc(100% - 290px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-inline: 1.5rem;
}

.joystick {
    width: 40px;
    height: 40px;
    background-color: #1e1b2f;
    border-radius: 50%;
    position: relative;
    border: 2px solid var(--border-color);
}

.joystick-ball {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--neon-pink);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--glow-pink);
    animation: joystick-move 4s ease-in-out infinite alternate;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.cab-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.cab-btn.red { background-color: var(--neon-pink); box-shadow: 0 0 5px var(--neon-pink); }
.cab-btn.yellow { background-color: var(--neon-yellow); box-shadow: 0 0 5px var(--neon-yellow); }
.cab-btn.green { background-color: var(--neon-green); box-shadow: 0 0 5px var(--neon-green); }
.cab-btn.blue { background-color: var(--neon-cyan); box-shadow: 0 0 5px var(--neon-cyan); }

/* --- Catalog Section & Controls --- */
.catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3.5rem;
}

.search-box {
    position: relative;
    width: 320px;
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #8b83a3;
}

.search-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    background-color: rgba(255, 255, 255, 0.04);
}

.filter-buttons-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
    padding-block: 0.25rem;
}

.filter-buttons {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    animation: categories-marquee 30s linear infinite;
}

.filter-buttons-wrapper:hover .filter-buttons {
    animation-play-state: paused;
}

@keyframes categories-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-50% - 0.375rem));
    }
}

.filter-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #a39bb8;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    user-select: none;
    flex-shrink: 0;
}

.filter-btn:hover {
    color: var(--text-white);
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    color: var(--body-bg);
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    text-shadow: none;
}

/* --- Games Grid & Cards --- */
.games-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.game-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 10px 25px rgba(0, 240, 255, 0.08);
}

.game-img-wrapper {
    position: relative;
    height: 140px;
    overflow: hidden;
}

.game-mock-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s;
    position: relative;
}

.game-card:hover .game-mock-img {
    transform: scale(1.05);
}

.game-mock-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(7, 5, 15, 0.9) 0%, transparent 80%);
}

/* Specific game mock gradients styling */
.synthwave-gradient { background: linear-gradient(135deg, #f43f5e, #8b5cf6); }
.cyber-gradient { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.neon-gradient { background: linear-gradient(135deg, #10b981, #d946ef); }
.matrix-gradient { background: linear-gradient(135deg, #10b981, #064e3b); }

.game-card-icon {
    font-size: 3.5rem;
    color: var(--text-white);
    opacity: 0.85;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.4));
}

.game-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(7, 5, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: 0.5px;
    z-index: 2;
}

.game-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-description {
    font-size: 0.85rem;
    color: #a39bb8;
    margin-bottom: 1.25rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.6rem; /* Enforce uniform description area */
    line-height: 1.2rem;
}

.game-actions {
    display: flex;
}

.game-actions .btn-play-game {
    width: 100%;
    padding: 0.75rem;
}

/* --- Catalog Footer --- */
.catalog-footer {
    display: flex;
    justify-content: center;
    margin-top: 3.5rem;
}

/* --- Features Section --- */
.features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.feature-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.feature-icon-wrapper i {
    font-size: 1.8rem;
    color: inherit;
    display: block;
    line-height: 1;
}

.feature-icon-wrapper.cyan-glow { color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.feature-icon-wrapper.pink-glow { color: var(--neon-pink); box-shadow: var(--glow-pink); }
.feature-icon-wrapper.green-glow { color: var(--neon-green); box-shadow: 0 0 15px rgba(57, 255, 20, 0.3); }

.feature-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.75rem;
}

.feature-card-desc {
    font-size: 0.95rem;
    color: #a39bb8;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border-color);
    background-color: rgba(5, 4, 10, 0.9);
    padding-block: 2.5rem;
    margin-top: 6rem;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: var(--retro-font);
    font-size: 0.95rem;
    color: var(--text-white);
}

.footer-logo span {
    color: var(--neon-pink);
    animation: blink 1s infinite alternate;
}

.footer-copy {
    font-size: 0.85rem;
    color: #8b83a3;
}

.footer-copy a {
    color: var(--neon-cyan);
}

.footer-copy a:hover {
    text-shadow: var(--glow-text-cyan);
}

/* --- Animations --- */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes pulse {
    0% { transform: scale(1); text-shadow: 0 0 8px rgba(0, 240, 255, 0.5); }
    100% { transform: scale(1.05); text-shadow: 0 0 20px rgba(0, 240, 255, 0.8); }
}

@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0.3; }
}

@keyframes scroll-scan {
    0% { background-position: 0px 0px, 0px 0px; }
    100% { background-position: 0px 300px, 0px 0px; }
}

@keyframes joystick-move {
    0% { top: 50%; left: 50%; }
    20% { top: 35%; left: 35%; }
    40% { top: 50%; left: 50%; }
    60% { top: 60%; left: 65%; }
    80% { top: 40%; left: 50%; }
    100% { top: 50%; left: 50%; }
}

/* --- Responsive Layout Breakpoints --- */

@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 968px) {
    .hero-container {
        grid-template-columns: 1fr;
        row-gap: 3.5rem;
    }

    .hero-carousel-container {
        height: auto;
        padding: 1.25rem;
    }

    .carousel-slide {
        flex-direction: column-reverse;
        gap: 1rem;
        height: auto;
        position: relative;
        opacity: 0;
        visibility: hidden;
        display: none;
    }
    
    .carousel-slide.active {
        opacity: 1;
        visibility: visible;
        display: flex;
        transform: none;
    }

    .carousel-slide-content {
        align-items: center;
        text-align: center;
    }

    .carousel-slide-img {
        width: 180px;
        height: 120px;
        flex: none;
    }

    .carousel-title {
        font-size: 1.75rem;
        margin-top: 0.5rem;
    }

    .carousel-desc {
        height: auto;
        -webkit-line-clamp: 2;
        margin-bottom: 1rem;
    }

    .carousel-btn-play {
        align-self: center;
    }

    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: none;
        margin-inline: auto;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 750px;
        margin-inline: auto;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 4rem;
    }

    .nav-menu {
        position: fixed;
        top: 4rem;
        left: 0;
        width: 100%;
        background-color: rgba(7, 5, 15, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        padding-block: 1.5rem;
        border-bottom: 2px solid var(--neon-cyan);
        box-shadow: 0 10px 20px rgba(0, 240, 255, 0.15);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 99;
        transform: translateY(-150%);
    }

    .nav-menu.show-menu {
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        row-gap: 1.25rem;
    }

    .nav-toggle {
        display: block;
        cursor: pointer;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .footer-container {
        flex-direction: column;
        row-gap: 1.5rem;
        text-align: center;
    }

    .catalog-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.25rem;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }

    .filter-buttons-wrapper {
        mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
        width: 100%;
    }

    .filter-buttons {
        animation: categories-marquee 20s linear infinite;
        padding-bottom: 0.5rem;
    }

    .filter-btn {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: none;
    }

    .game-img-wrapper {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin-inline: auto;
    }
}

/* ==========================================================================
   GamePix Integration Styles - Modal & Dynamic Loader
   ========================================================================== */

/* --- Catalog Loader --- */
.catalog-loader {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-block: 4rem;
    text-align: center;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 240, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--neon-cyan);
    border-bottom-color: var(--neon-pink);
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: var(--glow-cyan), inset 0 0 10px rgba(0, 240, 255, 0.2);
    margin-bottom: 1.5rem;
}

.loader-text {
    font-family: var(--body-font);
    font-size: 1.1rem;
    color: #a39bb8;
    letter-spacing: 0.5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Game Modal Player --- */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
}

.game-modal.show-modal {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 2, 8, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1100px;
    background: rgba(14, 11, 26, 0.98);
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), var(--glow-cyan);
    padding: 0;
    overflow: hidden;
    z-index: 1002;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
}

.game-modal.show-modal .modal-content {
    transform: scale(1);
}

/* Header del Modal */
.modal-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #0b0816;
    border-bottom: 1px solid var(--border-color);
    height: 48px;
}

.modal-game-title {
    font-family: var(--retro-font);
    font-size: 0.65rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-text-cyan);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-control-btn {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.modal-control-btn:hover {
    background-color: var(--neon-cyan);
    color: var(--body-bg);
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-cyan);
}

.modal-close {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s;
}

.modal-close:hover {
    background-color: var(--neon-pink);
    color: var(--body-bg);
    border-color: var(--neon-pink);
    box-shadow: var(--glow-pink);
    transform: rotate(90deg);
}

/* Cuerpo del Modal con layout Flex */
.modal-body-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    background-color: #030208;
}

.modal-iframe-wrapper {
    flex: 3.2;
    position: relative;
    height: 520px;
    background-color: #000;
}

.iframe-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.15) 50%
    );
    background-size: 100% 4px;
    z-index: 1005;
    pointer-events: none;
}

.game-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 1004;
}

.modal-sidebar {
    flex: 1.2;
    background-color: #0b0816;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    height: 520px;
    overflow-y: auto;
}

.sidebar-title {
    font-family: var(--retro-font);
    font-size: 0.6rem;
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
    margin-bottom: 1rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.recommended-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rec-game-card {
    display: flex;
    gap: 0.75rem;
    background-color: rgba(20, 16, 38, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    align-items: center;
    overflow: hidden;
}

.rec-game-card:hover {
    border-color: var(--neon-cyan);
    background-color: rgba(20, 16, 38, 0.8);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
    transform: translateX(3px);
}

.rec-game-img {
    width: 60px;
    height: 45px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.rec-game-info {
    flex: 1;
    overflow: hidden;
}

.rec-game-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.rec-game-category {
    font-size: 0.7rem;
    color: var(--neon-pink);
    font-weight: 500;
}

/* --- How To Play Section --- */
.how-to-play-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.how-card {
    text-align: center;
    padding: 2.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.how-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(217, 70, 239, 0.4);
    box-shadow: 0 10px 25px rgba(217, 70, 239, 0.15), var(--glow-pink);
}

.how-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    position: relative;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.how-icon-wrapper.cyan-glow { color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.how-icon-wrapper.pink-glow { color: var(--neon-pink); box-shadow: var(--glow-pink); }
.how-icon-wrapper.green-glow { color: var(--neon-green); box-shadow: 0 0 15px rgba(57, 255, 20, 0.3); }
.how-icon-wrapper.yellow-glow { color: var(--neon-yellow); box-shadow: 0 0 15px rgba(250, 204, 21, 0.3); }

.how-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.75rem;
}

.how-card-desc {
    font-size: 0.88rem;
    color: #a39bb8;
    line-height: 1.5;
}

/* --- Responsive Modal Adjustments --- */
@media (max-width: 768px) {
    .game-modal.show-modal .modal-content {
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
    }
    
    .modal-header-bar {
        height: 48px;
        padding-inline: 1rem;
    }
    
    .modal-body-layout {
        flex-direction: column;
        height: calc(100vh - 48px);
    }
    
    .modal-iframe-wrapper {
        flex: 1;
        height: 100%;
        width: 100%;
    }
    
    .modal-sidebar {
        display: none !important; /* Ocultar recomendados en móvil */
    }
    
    .modal-game-title {
        font-size: 0.55rem;
        max-width: 50%;
    }

    .how-to-play-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .how-to-play-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin-inline: auto;
    }
}

/* ==========================================================================
   Fullscreen Custom Styling
   ========================================================================== */
#modal-content:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    border: none;
    background: #000;
}

#modal-content:fullscreen .modal-body-layout {
    height: 100vh;
    width: 100vw;
}

#modal-content:fullscreen .modal-iframe-wrapper {
    width: 100vw;
    height: 100vh;
    flex: 1;
}

#modal-content:fullscreen .modal-sidebar {
    display: none !important;
}

#modal-content:fullscreen .modal-header-bar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(7, 5, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

#modal-content:fullscreen .modal-game-title,
#modal-content:fullscreen .modal-close,
#modal-content:fullscreen #btn-toggle-volume {
    display: none !important;
}

#modal-content:fullscreen .modal-controls {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#modal-content:fullscreen #btn-fullscreen {
    background: transparent;
    border: none;
    color: var(--neon-pink);
    box-shadow: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Webkit / Safari Compatibility */
#modal-content:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    border: none;
    background: #000;
}
#modal-content:-webkit-full-screen .modal-body-layout { height: 100vh; width: 100vw; }
#modal-content:-webkit-full-screen .modal-iframe-wrapper { width: 100vw; height: 100vh; flex: 1; }
#modal-content:-webkit-full-screen .modal-sidebar { display: none !important; }
#modal-content:-webkit-full-screen .modal-header-bar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(7, 5, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}
#modal-content:-webkit-full-screen .modal-game-title,
#modal-content:-webkit-full-screen .modal-close,
#modal-content:-webkit-full-screen #btn-toggle-volume {
    display: none !important;
}
#modal-content:-webkit-full-screen .modal-controls { margin: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
#modal-content:-webkit-full-screen #btn-fullscreen { background: transparent; border: none; color: var(--neon-pink); box-shadow: none; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* Mozilla / Firefox Compatibility */
#modal-content:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    border: none;
    background: #000;
}
#modal-content:-moz-full-screen .modal-body-layout { height: 100vh; width: 100vw; }
#modal-content:-moz-full-screen .modal-iframe-wrapper { width: 100vw; height: 100vh; flex: 1; }
#modal-content:-moz-full-screen .modal-sidebar { display: none !important; }
#modal-content:-moz-full-screen .modal-header-bar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(7, 5, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}
#modal-content:-moz-full-screen .modal-game-title,
#modal-content:-moz-full-screen .modal-close,
#modal-content:-moz-full-screen #btn-toggle-volume {
    display: none !important;
}
#modal-content:-moz-full-screen .modal-controls { margin: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
#modal-content:-moz-full-screen #btn-fullscreen { background: transparent; border: none; color: var(--neon-pink); box-shadow: none; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
