/* Snake Game - Neon Edition Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Consolas', monospace;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Background grid effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.game-container {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1;
}

/* Header */
.game-header {
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 3rem;
    color: #00ff00;
    text-shadow: 
        0 0 5px #00ff00,
        0 0 10px #00ff00,
        0 0 20px #00ff00,
        0 0 40px #00ff00;
    letter-spacing: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.subtitle {
    font-size: 1rem;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    letter-spacing: 4px;
    margin-top: 5px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Screens */
.screen {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
}

.screen.hidden {
    display: none;
}

/* Start Screen */
#startScreen h2 {
    color: #ff00ff;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #ff00ff;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.difficulty-btn.easy {
    border-color: #00ff00;
    color: #00ff00;
}

.difficulty-btn.easy:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: scale(1.02);
}

.difficulty-btn.normal {
    border-color: #ffff00;
    color: #ffff00;
}

.difficulty-btn.normal:hover {
    background: rgba(255, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.5);
    transform: scale(1.02);
}

.difficulty-btn.hard {
    border-color: #ff0066;
    color: #ff0066;
}

.difficulty-btn.hard:hover {
    background: rgba(255, 0, 102, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 102, 0.5);
    transform: scale(1.02);
}

.diff-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.diff-name {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 3px;
}

.diff-desc {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 5px;
}

.controls-info {
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    padding-top: 20px;
    color: #888;
}

.controls-info h3 {
    color: #00ffff;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #00ffff;
}

.controls-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Game Area */
.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffff;
    border-radius: 8px;
    min-width: 100px;
}

.stat-label {
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 2px;
}

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

.canvas-container {
    position: relative;
    display: inline-block;
    margin: 15px 0;
}

#gameCanvas {
    border: 3px solid #00ff00;
    border-radius: 5px;
    box-shadow: 
        0 0 10px rgba(0, 255, 0, 0.5),
        0 0 30px rgba(0, 255, 0, 0.2),
        inset 0 0 30px rgba(0, 255, 0, 0.1);
    background: #0a0a0f;
    display: block;
}

/* Pause Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    color: #ffff00;
    font-size: 2rem;
    text-shadow: 0 0 20px #ffff00;
    margin-bottom: 10px;
}

.overlay p {
    color: #888;
    font-size: 1rem;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.control-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid #00ffff;
    border-radius: 8px;
    color: #00ffff;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* Game Over Screen */
.game-over-title {
    font-size: 2.5rem;
    color: #ff0066;
    text-shadow: 
        0 0 10px #ff0066,
        0 0 20px #ff0066,
        0 0 40px #ff0066;
    margin-bottom: 25px;
    animation: flicker 1.5s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
    75% { opacity: 0.9; }
}

.final-stats {
    margin-bottom: 25px;
}

.final-stat {
    margin: 15px 0;
}

.final-label {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 5px;
}

.final-value {
    font-size: 2rem;
    color: #00ffff;
    text-shadow: 0 0 15px #00ffff;
}

.new-record {
    color: #ffff00;
    font-size: 1.5rem;
    text-shadow: 0 0 20px #ffff00;
    animation: bounce 0.5s ease infinite;
}

.new-record.hidden {
    display: none;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.action-btn {
    padding: 15px 40px;
    border: 2px solid;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 200px;
}

.action-btn.play-again {
    border-color: #00ff00;
    color: #00ff00;
}

.action-btn.play-again:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.action-btn.menu {
    border-color: #ff00ff;
    color: #ff00ff;
}

.action-btn.menu:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

/* Responsive */
@media (max-width: 450px) {
    .game-header h1 {
        font-size: 2rem;
        letter-spacing: 4px;
    }
    
    #gameCanvas {
        width: 300px;
        height: 300px;
    }
    
    .stat-box {
        min-width: 80px;
        padding: 8px 10px;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .game-over-title {
        font-size: 1.8rem;
    }
}
