body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(to bottom, #f0f0f0, #d0d0d0);
    text-align: center;
    padding: 20px;
}

h1 {
    color: #222;
    margin-bottom: 10px;
}

#game {
    display: grid;
    grid-template-columns: repeat(20, 40px);
    gap: 2px;
    margin: 20px auto;
    justify-content: center;
}

.cell {
    width: 40px;
    height: 40px;
    background: #fafafa;
    border: 1px solid #aaa;
    border-radius: 6px;
    position: relative; /* Added for absolute positioning of icons */
    overflow: hidden; /* Ensures nothing spills out */
}

/* Icon styling */
.cell::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    line-height: 1;
}

.player::before { content: "🚶"; color: dodgerblue; }
.enemy::before { content: "👹"; color: crimson; }
.star::before { content: "⭐"; }
.exit::before { content: "🚪"; color: green; }

.wall { background: #333; }
.star { background: gold; }
.exit { background: #e0ffe0; } /* Lighter green for better contrast */

#status {
    font-size: 18px;
    margin: 10px 0;
    font-weight: bold;
}

#restart {
    background: royalblue;
    color: white;
    font-size: 16px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

#restart:hover {
    background: darkblue;
}

.controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.controls button {
    width: 50px;
    height: 50px;
    font-size: 20px;
    border: none;
    border-radius: 8px;
    background: royalblue;
    color: white;
    cursor: pointer;
}

.controls button:hover {
    background: darkblue;
}