* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --purple-dark: #1a0033;
    --purple-medium: #4a0080;
    --purple-light: #7b2cbf;
    --neon-blue: #00d4ff;
    --neon-purple: #b400ff;
    --black: #0a0014;
    --white: #ffffff;
    --gray: #cccccc;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--black);
    color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
}

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--purple-dark) 0%, var(--black) 50%, var(--purple-medium) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.animated-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(180, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(123, 44, 191, 0.1) 0%, transparent 50%);
    animation: cloudFloat 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

.header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    position: relative;
}

.logo-container {
    display: inline-block;
    position: relative;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(180, 0, 255, 0.5);
    letter-spacing: 0.1em;
    animation: neonPulse 2s ease-in-out infinite;
}

.tagline {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: var(--neon-blue);
    letter-spacing: 0.3em;
    margin-top: -0.5rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

@keyframes neonPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out;
}

.welcome-text {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--neon-blue);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

.subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--gray);
    font-weight: 300;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1.2s ease-out;
}

.game-search {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(145deg, rgba(74, 0, 128, 0.4), rgba(26, 0, 51, 0.6));
    border: 2px solid var(--neon-blue);
    border-radius: 50px;
    color: var(--white);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.game-search::placeholder {
    color: rgba(204, 204, 204, 0.6);
}

.game-search:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 20px rgba(180, 0, 255, 0.4), 0 0 40px rgba(0, 212, 255, 0.2);
    transform: scale(1.02);
}

.no-results {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeInUp 0.5s ease-out;
}

.no-results p {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--neon-purple);
    text-shadow: 0 0 20px rgba(180, 0, 255, 0.6);
}

.game-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-card {
    background: linear-gradient(145deg, rgba(74, 0, 128, 0.3), rgba(26, 0, 51, 0.5));
    border: 2px solid transparent;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    animation: fadeInUp 0.6s ease-out backwards;
    backdrop-filter: blur(10px);
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }
.game-card:nth-child(6) { animation-delay: 0.6s; }

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--neon-blue);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.4), 0 0 20px rgba(180, 0, 255, 0.3);
}

.game-card:hover::before {
    opacity: 0.1;
}

.game-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
}

.game-info {
    padding: 1.5rem;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.game-console {
    font-size: 0.85rem;
    color: var(--neon-purple);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.play-button {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--purple-light), var(--purple-medium));
    border: 2px solid var(--neon-blue);
    border-radius: 8px;
    color: var(--white);
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.play-button:hover {
    background: linear-gradient(135deg, var(--neon-purple), var(--purple-light));
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.5);
    transform: scale(1.05);
}

.play-button:active {
    transform: scale(0.98);
}

.emulator-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.emulator-container.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.emulator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--purple-dark), var(--black));
    border-bottom: 2px solid var(--neon-blue);
}

#currentGameTitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--neon-blue);
}

.close-emulator {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0044;
    border-radius: 8px;
    color: var(--white);
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-emulator:hover {
    background: rgba(255, 0, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 0, 68, 0.5);
}

#emulatorFrame {
    flex: 1;
    width: 100%;
    background: #000;
}

.footer {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(180deg, transparent, rgba(26, 0, 51, 0.5));
    color: var(--gray);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .game-catalog {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .header {
        padding: 2rem 1rem 1rem;
    }
    
    .main-content {
        padding: 0 1rem 2rem;
    }
    
    .emulator-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    #currentGameTitle {
        font-size: 1.2rem;
    }
}
