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

body {
    font-family: 'VT323', monospace;
    background-color: #9CB86F;
    color: #2C3E0A;
    overflow: hidden;
}

#logo-container {
    display: flex;
    justify-content: center;
    padding: 20px 0 10px 0;
}

#logo {
    height: 60px;
    width: auto;
}

#gameContainer {
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.ad-space {
    width: 160px;
    background-color: #9CB86F;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

#gameArea {
    width: 720px;
    height: 540px;
    position: relative;
    display: flex;
    flex-direction: column;
}

#gameCanvas {
    width: 100%;
    height: calc(100% - 50px);
    background: radial-gradient(ellipse 90% 60% at center, #B0CC75 0%, #A5C470 40%, #8FA85C 80%, #7A9450 100%);
    border: 4px solid #2C3E0A;
    box-sizing: border-box;
    image-rendering: pixelated;
    box-shadow: inset 0 0 30px rgba(44, 62, 10, 0.4), inset 0 0 60px rgba(176, 204, 117, 0.2);
    border-radius: 12px;
    filter: contrast(1.1) brightness(1.05);
}

.menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    background: radial-gradient(ellipse 90% 60% at center, #B0CC75 0%, #A5C470 40%, #8FA85C 80%, #7A9450 100%);
    border: 4px solid #2C3E0A;
    box-shadow: inset 0 0 30px rgba(44, 62, 10, 0.4), inset 0 0 60px rgba(176, 204, 117, 0.2);
    border-radius: 12px;
    filter: contrast(1.1) brightness(1.05);
}

.menu h1 {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
}

.menu h2 {
    font-size: 28px;
    margin-bottom: 30px;
}

.menu h3 {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
}

.difficulty-btn, button {
    background-color: #6B7A4F;
    color: #2C3E0A;
    border: 2px solid #2C3E0A;
    padding: 10px 20px;
    margin: 5px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.difficulty-btn:hover, button:hover {
    background-color: #4A5C2A;
    color: #A5C470;
}

.difficulty-btn.selected {
    background-color: #2C3E0A;
    color: #A5C470;
}

#gameUI {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    height: 40px;
    align-items: center;
    margin-bottom: 10px;
    background: transparent;
}

#gameSoundToggle {
    background-color: #2C3E0A;
    border: none;
    color: #A5C470;
    padding: 5px 8px;
    font-size: 16px;
    cursor: pointer;
    pointer-events: auto;
}

#gameSoundToggle:hover {
    opacity: 0.8;
}

#gameSoundToggle.muted {
    background-color: #A5C470;
    color: #2C3E0A;
}

#scoreDisplay {
    font-size: 24px;
    font-weight: bold;
}

#levelDisplay {
    font-size: 18px;
}

#powerUpIndicator {
    position: absolute;
    top: calc(50% + 25px);
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1F2B0A;
    color: #A5C470;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 14px;
}

#pauseOverlay, #gameOverOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(44, 62, 10, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #A5C470;
    font-size: 24px;
}

#pauseOverlay div {
    margin: 10px 0;
}

#highScores {
    margin: 20px 0;
    text-align: center;
}

#scoresTable {
    margin: 10px auto;
    border-spacing: 10px 5px;
    font-size: 16px;
}

#scoresTable td:first-child {
    text-align: right;
    font-weight: bold;
}

#scoresTable td:last-child {
    text-align: left;
    color: #6B7A4F;
}

#highScoreNotice {
    margin: 10px 0;
    text-align: center;
}

.high-score-banner {
    color: #A5C470;
    font-size: 24px;
    font-weight: bold;
    animation: pulse 1s infinite;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(44, 62, 10, 0.8);
}

#shareBtn {
    background-color: #4A5C2A;
    color: #A5C470;
    border: 2px solid #2C3E0A;
    padding: 8px 16px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    cursor: pointer;
}

#shareBtn:hover {
    background-color: #2C3E0A;
}

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

@keyframes blink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

@keyframes foodSpawn {
    0% { transform: scale(0.5) rotate(0deg); opacity: 0.5; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
    100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

#difficultySelector {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#difficultySelector .difficulty-btn {
    display: inline-block;
}

#difficultySelector {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.difficulty-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

.game-over-buttons {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Mobile responsiveness */
@media (max-width: 1200px) {
    .ad-space {
        display: none;
    }
    
    #gameContainer {
        justify-content: center;
    }
}

@media (max-width: 850px) {
    #gameArea {
        width: 95vw;
        height: 70vh;
    }
}

@media (max-width: 600px) {
    .menu h1 {
        font-size: 24px;
    }
    
    .difficulty-btn, button {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    #scoreDisplay {
        font-size: 20px;
    }
    
    #levelDisplay {
        font-size: 16px;
    }
    
    .difficulty-buttons {
        flex-direction: column;
    }
    
    .game-over-buttons {
        flex-direction: column;
        gap: 10px;
    }
}