#game-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background-color: #faf8ef;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Arial', sans-serif;
    touch-action: none; /* Prevent scrolling on mobile */
    overflow: hidden;
    padding: 20px 0;
    border-radius: 10px;
}

/* Fullscreen mode adjustments */
#game-wrapper:fullscreen {
    max-width: 100%;
    height: 100vh;
    justify-content: center;
    padding: 0;
    border-radius: 0;
    background-color: #faf8ef;
}

#top-controls {
    display: flex;
    justify-content: space-between;
    width: 320px;
    margin-bottom: 15px;
    z-index: 10;
}

#top-controls button {
    background: #8f7a66;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#top-controls button:hover {
    background: #9f8b77;
}

#ui-layer {
    position: relative;
    width: 320px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    margin-bottom: 10px;
}

.score-box {
    background-color: #bbada0;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 18px;
}

#gameCanvas {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.game-over {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(238, 228, 218, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.game-over h1 { color: #776e65; font-size: 40px; margin-bottom: 15px; }
.game-over button {
    background: #8f7a66; color: white;
    border: none; padding: 15px 30px;
    font-size: 20px; border-radius: 8px;
    cursor: pointer; font-weight: bold;
}
.game-over button:hover { background: #9f8b77; }