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

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
}

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

header {
    text-align: center;
    padding: 40px 0;
}

header h1 {
    font-size: 2.5rem;
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88, 0 0 20px #00ff88, 0 0 30px #00ff88;
    margin-bottom: 15px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #00ff88, 0 0 20px #00ff88; }
    to { text-shadow: 0 0 20px #00ff88, 0 0 30px #00ff88, 0 0 40px #00ff88; }
}

.subtitle {
    font-size: 0.7rem;
    color: #888;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #333;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: #00ff88;
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.game-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.game-card:hover .game-icon {
    transform: scale(1.15);
}

.snake-icon { background: linear-gradient(135deg, #4CAF50, #8BC34A); }
.pong-icon { background: linear-gradient(135deg, #2196F3, #03A9F4); }
.breakout-icon { background: linear-gradient(135deg, #FF5722, #FF9800); }
.flappy-icon { background: linear-gradient(135deg, #FFEB3B, #FFC107); }
.tetris-icon { background: linear-gradient(135deg, #9C27B0, #E91E63); }
.asteroids-icon { background: linear-gradient(135deg, #607D8B, #455A64); }
.invaders-icon { background: linear-gradient(135deg, #00BCD4, #009688); }
.pacman-icon { background: linear-gradient(135deg, #FFEB3B, #FFC107); }
.memory-icon { background: linear-gradient(135deg, #E91E63, #F06292); }
.brick-icon { background: linear-gradient(135deg, #FF6B6B, #FF8E53); }
.mine-icon { background: linear-gradient(135deg, #636e72, #2d3436); }
.num-icon { background: linear-gradient(135deg, #f39c12, #e74c3c); }
.bomb-icon { background: linear-gradient(135deg, #2c3e50, #e74c3c); }
.race-icon { background: linear-gradient(135deg, #00b894, #00cec9); }
.tank-icon { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.geometry-icon { background: linear-gradient(135deg, #00d2d3, #54a0ff); }
.solitaire-icon { background: linear-gradient(135deg, #10ac84, #1dd1a1); }
.sudoku-icon { background: linear-gradient(135deg, #5f27cd, #341f97); }
.tower-icon { background: linear-gradient(135deg, #ee5253, #ff6b6b); }
.monopoly-icon { background: linear-gradient(135deg, #c0392b, #e74c3c); }

.game-card h2 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #00ff88;
}

.game-card p {
    font-size: 0.6rem;
    color: #888;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: #555;
    font-size: 0.5rem;
}

/* Game Page Styles */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}

.back-btn {
    background: #333;
    color: #00ff88;
    border: 2px solid #00ff88;
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.back-btn:hover {
    background: #00ff88;
    color: #1a1a2e;
}

.score-display {
    font-size: 0.8rem;
}

.score-display span {
    color: #00ff88;
}

.game-canvas-container {
    border: 3px solid #00ff88;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.game-controls {
    margin-top: 20px;
    text-align: center;
}

.game-controls p {
    font-size: 0.5rem;
    color: #888;
    margin: 5px 0;
}

.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.game-over-overlay h2 {
    color: #ff4444;
    font-size: 2rem;
    margin-bottom: 20px;
}

.game-over-overlay p {
    color: #fff;
    margin: 10px 0;
    font-size: 0.8rem;
}

.restart-btn {
    background: #00ff88;
    color: #1a1a2e;
    border: none;
    padding: 15px 30px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.restart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px #00ff88;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .game-card {
        padding: 15px;
    }

    .game-icon {
        width: 50px;
        height: 50px;
    }

    .game-card h2 {
        font-size: 0.7rem;
    }
}

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