/* ============================================
   Snake Game - Styles
   ============================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    overflow: hidden;
}

/* Game Container */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 440px;
    width: 100%;
    padding: 20px;
}

/* Header Section */
.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.game-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    margin-bottom: 15px;
    color: #00ff88;
}

.score-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.score-box {
    background: rgba(22, 33, 62, 0.8);
    border: 2px solid #00ff88;
    border-radius: 10px;
    padding: 10px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.high-score-box {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.score-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 5px;
}

.score-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: #00ff88;
}

.high-score-box .score-value {
    color: #ffd700;
}

/* Game Area */
.game-area {
    position: relative;
    background: #1a1a2e;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 
        0 0 30px rgba(0, 255, 136, 0.15),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    border: 3px solid #16213e;
}

#game-canvas {
    display: block;
    border-radius: 10px;
    background: #1a1a2e;
}

/* Overlay Styles */
.overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 30px;
}

.overlay-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.overlay-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 6px;
    color: #00ff88;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.overlay-subtitle {
    font-size: 1rem;
    color: #888;
    letter-spacing: 3px;
    margin-bottom: 25px;
}

/* Game Over Specific Styles */
.game-over-icon {
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.game-over-title {
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.final-score-display {
    background: rgba(255, 107, 107, 0.1);
    border: 2px solid #ff6b6b;
    border-radius: 15px;
    padding: 15px 40px;
    margin: 20px 0;
    display: inline-block;
}

.final-score-label {
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 5px;
}

.final-score-value {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff6b6b;
}

.new-high-score {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    padding: 10px 20px;
    border-radius: 5px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffd700;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.new-high-score.hidden {
    display: none;
}

.trophy {
    font-size: 1.5rem;
}

/* Button Styles */
.game-btn {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.primary-btn {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #0f0f23;
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.3);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
}

.game-over-buttons {
    margin-top: 20px;
}

/* Instructions */
.instructions {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions-title {
    font-size: 0.8rem;
    color: #666;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.key-hints {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.key-hint {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 5px 10px;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    min-width: 30px;
    display: inline-flex;
    justify-content: center;
}

.key-desc {
    font-size: 0.75rem;
    color: #666;
    margin-left: 5px;
}

.or-text {
    font-size: 0.7rem;
    color: #555;
    margin: 5px 0;
}

.game-objective {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #888;
    line-height: 1.5;
}

/* Pause Indicator */
.pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border-radius: 15px;
    text-align: center;
    z-index: 15;
    border: 2px solid #00ff88;
}

.pause-indicator.hidden {
    display: none;
}

.pause-indicator span:first-child {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: #00ff88;
    display: block;
    margin-bottom: 10px;
}

.pause-hint {
    font-size: 0.85rem;
    color: #888;
}

/* Footer */
.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    padding: 10px 5px;
}

.controls-info {
    display: flex;
    gap: 20px;
}

.control-item {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
}

.game-info {
    display: flex;
    gap: 15px;
}

.info-item {
    font-size: 0.8rem;
    color: #666;
    font-family: 'Orbitron', monospace;
}

/* Responsive Design */
@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 1.8rem;
        letter-spacing: 5px;
    }
    
    .score-container {
        gap: 10px;
    }
    
    .score-box {
        padding: 8px 15px;
        min-width: 90px;
    }
    
    .score-value {
        font-size: 1.4rem;
    }
    
    .overlay-title {
        font-size: 1.8rem;
    }
    
    .game-btn {
        font-size: 0.85rem;
        padding: 12px 20px;
    }
    
    .key-hints {
        transform: scale(0.9);
    }
    
    .game-footer {
        flex-direction: column;
        gap: 10px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 136, 0.6); }
}
