:root {
    --neon-cyan: #00f0ff;
    --neon-pink: #ff00e5;
    --neon-green: #39ff14;
    --neon-yellow: #ffff00;
    --neon-orange: #ff6600;
    --dark-bg: #0a0a1a;
    --card-bg: #12122a;
}

* { box-sizing: border-box; }

body {
    background: var(--dark-bg);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.arcade-title {
    font-family: 'Press Start 2P', cursive;
}

.orbitron {
    font-family: 'Orbitron', sans-serif;
}

/* Neon glow effects */
.neon-text-cyan {
    color: var(--neon-cyan);
    text-shadow: 0 0 7px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 42px var(--neon-cyan);
}

.neon-text-pink {
    color: var(--neon-pink);
    text-shadow: 0 0 7px var(--neon-pink), 0 0 20px var(--neon-pink), 0 0 42px var(--neon-pink);
}

.neon-text-green {
    color: var(--neon-green);
    text-shadow: 0 0 7px var(--neon-green), 0 0 20px var(--neon-green);
}

.neon-border {
    border: 1px solid var(--neon-cyan);
    box-shadow: 0 0 5px var(--neon-cyan), inset 0 0 5px rgba(0, 240, 255, 0.1);
}

.neon-border-pink {
    border: 1px solid var(--neon-pink);
    box-shadow: 0 0 5px var(--neon-pink), inset 0 0 5px rgba(255, 0, 229, 0.1);
}

/* Game card styles */
.game-card {
    transition: all 0.3s ease;
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
    min-height: 260px;
    justify-content: center;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, transparent, transparent, var(--neon-cyan));
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

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

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), 0 20px 40px rgba(0, 0, 0, 0.5);
}

.game-card > * {
    position: relative;
    z-index: 1;
}

/* Animations */
@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes flicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% { opacity: 1; }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% { opacity: 0.4; }
}

.flicker {
    animation: flicker 3s infinite;
}

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

.float-anim {
    animation: float 3s ease-in-out infinite;
}

/* Stars */
.stars {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--dark-bg); }
::-webkit-scrollbar-thumb { background: var(--neon-cyan); border-radius: 4px; }

/* Modal */
#gameModal {
    transition: opacity 0.3s ease;
}

#gameModal:not(.hidden) {
    display: flex !important;
}

/* Game canvas */
canvas {
    border-radius: 8px;
    display: block;
    max-width: 100%;
    height: auto;
}

/* Mobile D-Pad buttons */
.mobile-btn {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    background: var(--card-bg);
    min-height: 48px;
}

.mobile-btn:active {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 15px var(--neon-cyan);
}

/* Memory card styles */
.memory-card {
    aspect-ratio: 1;
    perspective: 800px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.memory-card-back {
    background: var(--card-bg);
    border: 2px solid var(--neon-pink);
    box-shadow: 0 0 8px rgba(255, 0, 229, 0.3);
    color: var(--neon-pink);
    font-family: 'Orbitron', sans-serif;
}

.memory-card-front {
    background: #1a1a3a;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-front {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.5);
    background: #1a2a1a;
}

/* Responsive */
@media (max-width: 640px) {
    .game-card {
        min-height: 180px;
    }
    
    .arcade-title {
        font-size: 0.7rem !important;
    }
    
    #gameModal > div {
        padding: 1rem;
        margin: 0.5rem;
    }
}

@media (max-width: 400px) {
    .game-card {
        min-height: 150px;
        padding: 1rem;
    }
    
    .game-card .text-6xl {
        font-size: 2.5rem;
    }
}