:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --accent: #e94560;
    --accent-green: #00d9ff;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
}

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

body {
    font-family: 'Courier New', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--bg-secondary);
    padding: 40px 0;
    text-align: center;
    border-bottom: 4px solid var(--accent);
}

.brand h1 {
    font-size: 3rem;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent);
    margin-bottom: 10px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.game-card {
    background: var(--bg-card);
    border: 2px solid var(--accent-green);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 217, 255, 0.3);
    border-color: var(--accent);
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.game-card h2 {
    color: var(--accent-green);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.game-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.play-btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-secondary);
    border: 3px solid var(--accent-green);
    border-radius: 15px;
    padding: 20px;
    position: relative;
    max-width: 90vw;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--accent);
}

.close:hover {
    color: white;
}

#gameCanvas {
    border: 2px solid var(--accent-green);
    background: black;
    display: block;
    margin: 20px auto;
    max-width: 100%;
}

.game-controls {
    text-align: center;
    padding: 10px;
}

.game-controls button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.game-controls button:hover {
    background: var(--accent-green);
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    padding: 30px 0;
    text-align: center;
    border-top: 4px solid var(--accent);
    margin-top: 50px;
}

.site-footer p {
    color: var(--text-secondary);
    margin: 5px 0;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    padding: 10px;
}

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.dpad-row {
    display: flex;
    gap: 5px;
}

.dpad-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background: rgba(0, 217, 255, 0.2);
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.dpad-btn:active {
    background: var(--accent-green);
    color: black;
}

.action-buttons {
    display: flex;
    justify-content: center;
    padding: 10px;
}

.action-btn {
    width: 120px;
    height: 60px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.action-btn:active {
    background: var(--accent-green);
}

/* Show mobile controls on touch devices */
@media (hover: none) and (pointer: coarse) {
    .mobile-controls {
        display: block;
    }
}

/* Mobile responsive canvas */
@media (max-width: 768px) {
    .brand h1 {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 0;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .game-icon {
        font-size: 3rem;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 100%;
    }
}
