/* Game Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.6;
}

/* Game Header */
.game-header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.game-logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.game-logo a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.game-logo i {
    margin-right: 0.5rem;
    color: #e74c3c;
}

.game-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.score-display,
.high-score-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
}

.score-display .label,
.high-score-display .label {
    font-weight: 500;
    color: #bdc3c7;
}

#score,
#high-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1c40f;
}

/* Game Container */
.game-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.game-wrapper {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 2rem;
    align-items: start;
}

/* Game Board */
.game-board {
    background-color: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

#snake-game {
    display: block;
    margin: 0 auto;
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
}

/* Game Controls */
.game-controls {
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.control-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.start-btn {
    background-color: #27ae60;
    color: white;
}

.start-btn:hover:not(:disabled) {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.pause-btn {
    background-color: #f39c12;
    color: white;
}

.pause-btn:hover:not(:disabled) {
    background-color: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

.restart-btn {
    background-color: #e74c3c;
    color: white;
}

.restart-btn:hover:not(:disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.sound-btn,
.theme-btn {
    background-color: #3498db;
    color: white;
}

.sound-btn:hover,
.theme-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.control-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Game Instructions */
.game-instructions {
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.game-instructions h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.game-instructions ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.game-instructions li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key {
    background-color: #ecf0f1;
    color: #2c3e50;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: monospace;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid #bdc3c7;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
}

.d-pad {
    width: 100%;
    max-width: 160px;
    margin: 0 auto;
}

.d-pad-btn {
    width: 50px;
    height: 50px;
    border: none;
    background-color: #3498db;
    color: white;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.d-pad-btn:active {
    background-color: #2980b9;
    transform: scale(0.95);
}

.d-pad .up {
    display: block;
    margin: 0 auto 5px;
}

.d-pad-middle {
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.final-score p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.final-score span {
    font-weight: 700;
    color: #e74c3c;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: #27ae60;
    color: white;
}

.btn-primary:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(149, 165, 166, 0.3);
}

/* Theme Selector */
.theme-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.theme-option {
    cursor: pointer;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.theme-option:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.theme-preview {
    height: 60px;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.theme-option[data-theme="classic"] .theme-preview {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
}

.theme-option[data-theme="neon"] .theme-preview {
    background-color: #0f0f1a;
    border: 1px solid #00ffcc;
    box-shadow: 0 0 10px #00ffcc;
}

.theme-option[data-theme="nature"] .theme-preview {
    background-color: #2ecc71;
    border: 1px solid #27ae60;
}

.theme-option[data-theme="dark"] .theme-preview {
    background-color: #1a1a1a;
    border: 1px solid #333;
}

.theme-option span {
    font-size: 0.9rem;
    color: #555;
}

/* Game Footer */
.game-footer {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-links {
    max-width: 1200px;
    margin: 0 auto 1rem;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #e74c3c;
}

.copyright {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .game-wrapper {
        grid-template-columns: 1fr;
    }
    
    .game-controls {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .control-btn {
        margin-bottom: 0;
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .game-instructions {
        order: 3;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 1rem;
        text-align: center;
    }
}

@media screen and (max-width: 576px) {
    .game-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .game-stats {
        gap: 1rem;
    }
    
    .game-container {
        padding: 0 1rem;
    }
    
    #snake-game {
        width: 100%;
        max-width: 320px;
        height: auto;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}