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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    overflow: hidden;
}

.game-container {
    position: relative;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.title {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ffffff, #ffffff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 5px rgba(0, 245, 255, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(0, 245, 255, 0.8)); }
}

.score-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00f5ff;
    margin-bottom: 20px;
}

.game-board {
    position: relative;
    width: 600px;
    height: 600px;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #00f5ff;
    border-radius: 10px;
    box-shadow: 
        0 0 30px rgba(0, 245, 255, 0.5),
        inset 0 0 30px rgba(0, 245, 255, 0.1);
    overflow: hidden;
}

.snake-segment {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00ff00, #00cc00);
    border-radius: 3px;
    border: 1px solid #00ff00;
    box-shadow: 
        0 0 10px rgba(0, 255, 0, 0.5),
        inset 0 0 5px rgba(255, 255, 255, 0.3);
    transition: all 0.1s ease;
}

.snake-head {
    background: linear-gradient(45deg, #ffff00, #ff8800);
    border-color: #ffff00;
    box-shadow: 
        0 0 15px rgba(255, 255, 0, 0.7),
        inset 0 0 8px rgba(255, 255, 255, 0.4);
}

.food {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #ff0080, #ff4040);
    border-radius: 50%;
    border: 2px solid #ff0080;
    box-shadow: 
        0 0 20px rgba(255, 0, 128, 0.8),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    animation: pulse 1s ease-in-out infinite;
}

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

.controls {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #ccc;
}

.game-over, .start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 15px;
    width: 70%;
    height: 70%;
    text-align: center;
    border: 2px solid #00f5ff;
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
    display: none;
}

.game-over {
    border-color: #ff0080;
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.5);
}

.start-screen {
    display: block;
}

.start-screen h2 {
    font-size: 2rem;
    color: #00f5ff;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

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

.start-btn, .restart-btn {
    background: linear-gradient(45deg, #00f5ff, #0080ff);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 245, 255, 0.3);
    margin: 5px;
    margin-top: 20px;
}

.start-btn:hover, .restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 245, 255, 0.5);
}

.instructions {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.6;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #00f5ff;
    border-radius: 50%;
    animation: float 3s linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}