/**
 * Arcade Games Shared Styles
 * Common styles for canvas-based arcade games
 * Enhanced with better visual effects
 */

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: var(--spacing-lg);
    position: relative; /* Establish positioning context for canvas wrapper */
}

/* Canvas wrapper for scanline overlay */
.game-container > div {
    position: relative;
}

#game-canvas {
    border: 4px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 
        0 0 30px rgba(74, 144, 226, 0.3),
        0 0 60px rgba(74, 144, 226, 0.1),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    background: linear-gradient(135deg, #0a0e27 0%, #15192d 100%);
    transition: box-shadow 0.3s ease;
    image-rendering: pixelated; /* Crisp pixel art */
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: block;
}

#game-canvas:hover {
    box-shadow: 
        0 0 40px rgba(74, 144, 226, 0.5),
        0 0 80px rgba(74, 144, 226, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Gamepad Status Widget */
.gamepad-widget {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    background: var(--secondary-bg);
    border-radius: 8px;
    margin-bottom: var(--spacing-md);
}

.gamepad-widget.no-controller {
    opacity: 0.6;
}

.gamepad-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--tertiary-bg);
    transition: all 0.3s;
}

.gamepad-player.active {
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.gamepad-player.inactive {
    opacity: 0.4;
}

.player-num {
    font-weight: bold;
    font-size: 0.9rem;
}

.gamepad-icon {
    font-size: 1.5rem;
}

.gamepad-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Control Hints */
.control-hint {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: var(--secondary-bg);
    border-radius: 8px;
    font-size: 0.9rem;
    width: 100%;
    max-width: 800px;
}

.control-hint h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.control-hint p {
    margin: 4px 0;
    color: var(--text-secondary);
}

.control-hint kbd {
    background: var(--tertiary-bg);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Game Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
}

/* Instructions */
.instructions {
    background: var(--secondary-bg);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary-color);
    max-width: 800px;
    width: 100%;
}

.instructions h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.instructions ul {
    list-style-position: inside;
    color: var(--text-secondary);
}

.instructions li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 850px) {
    #game-canvas {
        width: 100%;
        height: auto;
    }
    
    .control-hint {
        grid-template-columns: 1fr;
    }
}

/* Game Over / Menu Overlays handled in JS */
