/* Enhanced Snake Game - Scoped CSS */
.snake-game-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
}

.snake-decoration {
    position: absolute;
    top: 20px;
    right: 20px;
    animation: snakeFloat 3s ease-in-out infinite;
    z-index: 10;
}

@keyframes snakeFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.game-title {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
    to { text-shadow: 2px 2px 20px rgba(255,255,255,0.5); }
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.score-display {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.score-display:hover {
    transform: translateY(-2px);
}

.score-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.score-value {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.score-value.animate {
    animation: scoreBounce 0.6s ease-out;
}

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

.game-board {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.game-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.05) 50%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

#gameSvg {
    display: block;
    border-radius: 10px;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
    background: rgba(0, 0, 0, 0.9);
}

.game-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

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

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

.game-btn.primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.game-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.game-btn.secondary {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.game-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.game-instructions {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
}

.game-instructions h2 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.game-instructions p {
    color: rgba(255, 255, 255, 0.9);
    margin: 8px 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.5s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 20px;
}

.final-score {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Snake and Food SVG Styles */
.snake-segment {
    fill: url(#snakeGradient);
    stroke: #2e7d32;
    stroke-width: 1;
    filter: url(#glow);
    transition: all 0.1s ease;
    opacity: 1;
}

.snake-head {
    fill: url(#snakeGradient);
    stroke: #1b5e20;
    stroke-width: 2;
    filter: url(#glow);
    opacity: 1;
}

.food-item {
    fill: url(#foodGradient);
    stroke: #d32f2f;
    stroke-width: 1;
    filter: url(#glow);
    animation: foodPulse 2s ease-in-out infinite;
    opacity: 1;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .snake-decoration {
        display: none; /* Hide decoration on mobile */
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    #gameSvg {
        width: 300px;
        height: 300px;
    }
    
    .game-board {
        padding: 15px;
    }
    
    .modal-content {
        padding: 30px;
        margin: 20px;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .snake-game-container {
        padding: 10px;
    }
    
    #gameSvg {
        width: 250px;
        height: 250px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .game-btn {
        width: 200px;
    }
} 