/* Nokia 3310 Snake Game Styles */

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

body {
    font-family: 'Courier New', monospace;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Nokia phone styling */
.nokia-phone {
    width: 320px;
    max-width: 100%;
    background-color: #7d9aa8;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Phone screen */
.phone-screen {
    background-color: #c5d6a2; /* Nokia's greenish screen color */
    border: 6px solid #333;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.game-container {
    text-align: center;
}

h1 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
    text-transform: uppercase;
}

/* Score display */
.score-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

/* Game board */
.game-board {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(20, 1fr);
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px solid #333;
    background-color: #c5d6a2;
    margin: 0 auto 10px;
}

.cell {
    border: 1px solid #a7b78f;
}

.snake-head, .snake-body {
    background-color: #333;
    border: 1px solid #333;
}

.food {
    background-color: #333;
    border: 1px solid #333;
    border-radius: 0; /* Pixelated look */
}

/* Treasure chest styling */
.treasure-chest {
    background-color: #FFD700; /* Gold color */
    border: 1px solid #333;
    position: relative;
}

.treasure-chest::before {
    content: "?";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #333;
    font-weight: bold;
}

/* Status and powerup display */
.status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
    min-height: 40px;
}

.status {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.powerup {
    font-weight: bold;
    font-size: 12px;
    margin-top: 5px;
    display: none;
    padding: 2px 5px;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Phone controls */
.phone-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* D-pad styling */
.d-pad {
    position: relative;
    width: 120px;
    height: 120px;
}

.d-pad-btn {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.d-pad-btn:active {
    background-color: #555;
}

.d-pad-btn.up {
    top: 0;
    left: 40px;
}

.d-pad-btn.left {
    top: 40px;
    left: 0;
}

.d-pad-btn.right {
    top: 40px;
    right: 0;
}

.d-pad-btn.down {
    bottom: 0;
    left: 40px;
}

.d-pad-center {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 40px;
    left: 40px;
    background-color: #555;
    border-radius: 5px;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.action-btn:active {
    background-color: #555;
}

/* Difficulty selector */
.difficulty {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #333;
    font-size: 14px;
}

select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #333;
    background-color: #d0d0d0;
    font-family: 'Courier New', monospace;
}

/* Instructions */
.instructions {
    margin-top: 20px;
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    text-align: center;
}

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

.modal-content {
    background-color: #c5d6a2;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 300px;
    border: 6px solid #333;
    font-family: 'Courier New', monospace;
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #333;
}

.modal-content p {
    margin-bottom: 15px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

#playAgainBtn {
    padding: 8px 16px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

#playAgainBtn:hover {
    background-color: #555;
}

/* Responsive design */
@media (max-width: 400px) {
    .nokia-phone {
        width: 100%;
        padding: 10px;
    }
    
    .d-pad {
        width: 100px;
        height: 100px;
    }
    
    .d-pad-btn {
        width: 35px;
        height: 35px;
    }
    
    .d-pad-center {
        width: 30px;
        height: 30px;
        top: 35px;
        left: 35px;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Pixelated effect for Nokia style */
.snake-head, .snake-body, .food, .treasure-chest {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Animation for treasure chest */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.treasure-chest {
    animation: pulse 1s infinite;
}

/* Powerup effects */
.ghost-mode .snake-head,
.ghost-mode .snake-body {
    opacity: 0.5;
}

/* Extreme speed indicator */
select option[value="extreme"] {
    color: red;
    font-weight: bold;
}
