/**
 * Classic Snake Game - 90s Retro Style
 * Responsive design with pixel art aesthetics
 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    color: #00ff00;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* Header Styles */
header {
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite alternate;
}

.game-title {
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 
        0 0 10px #00ff00,
        0 0 20px #00ff00,
        0 0 30px #00ff00,
        0 0 40px #00ff00;
    letter-spacing: 5px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #00cc00;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Glow Animation */
@keyframes glow {
    from {
        text-shadow: 
            0 0 10px #00ff00,
            0 0 20px #00ff00,
            0 0 30px #00ff00;
    }
    to {
        text-shadow: 
            0 0 20px #00ff00,
            0 0 30px #00ff00,
            0 0 40px #00ff00,
            0 0 50px #00ff00;
    }
}

/* Game Info Panel */
.game-info {
    margin-bottom: 20px;
}

.info-panel {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.score-display,
.level-display,
.highscore-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.label {
    font-size: 0.8rem;
    color: #00cc00;
    text-transform: uppercase;
}

.value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

/* Game Container */
.game-container {
    position: relative;
    display: inline-block;
    margin: 0 auto;
    background: #000000;
    border: 4px solid #00ff00;
    border-radius: 10px;
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.5),
        inset 0 0 20px rgba(0, 255, 0, 0.1);
    overflow: hidden;
}

/* Canvas */
#gameCanvas {
    display: block;
    background: #000000;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Overlay Screens */
.start-screen,
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    z-index: 10;
}

.start-screen h2,
.game-over-screen h2 {
    font-size: 2.5rem;
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.instructions {
    font-size: 0.9rem;
    color: #00cc00;
    margin: 5px 0;
}

.final-score {
    font-size: 1.5rem;
    color: #00ff00;
    margin: 10px 0;
}

.game-over-message {
    font-size: 1rem;
    color: #ffff00;
    margin: 10px 0;
}

/* Buttons */
.btn-start,
.btn-restart {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #000000;
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    border: 3px solid #00ff00;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.btn-start:hover,
.btn-restart:hover {
    background: linear-gradient(135deg, #00ff00 0%, #00ff00 100%);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
}

.btn-start:active,
.btn-restart:active {
    transform: scale(0.95);
}

/* Controls Info */
.controls-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid #00ff00;
    border-radius: 10px;
}

.controls-info h3 {
    font-size: 1.2rem;
    color: #00ff00;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.control-keys {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.key-row {
    display: flex;
    gap: 10px;
}

.key {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    border-radius: 5px;
    font-size: 1.5rem;
    color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.mobile-note {
    font-size: 0.9rem;
    color: #00cc00;
    font-style: italic;
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    #gameCanvas {
        max-width: 100%;
        height: auto;
    }

    .info-panel {
        flex-direction: column;
        gap: 15px;
    }

    .score-display,
    .level-display,
    .highscore-display {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .value {
        font-size: 1.2rem;
    }

    .start-screen h2,
    .game-over-screen h2 {
        font-size: 2rem;
    }

    .btn-start,
    .btn-restart {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .key {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .game-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    .info-panel {
        padding: 10px;
    }

    .label {
        font-size: 0.7rem;
    }

    .value {
        font-size: 1rem;
    }

    .instructions {
        font-size: 0.8rem;
    }

    .controls-info {
        padding: 15px;
    }

    .controls-info h3 {
        font-size: 1rem;
    }
}

/* Pixel Perfect Rendering */
canvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
