@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Open+Sans:wght@400;600&display=swap');

body {
    font-family: 'Open Sans', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #e9e2d0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4c8a8' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

#game-container {
    background-color: #f7f3e8;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    max-width: 90%;
    width: 500px;
}

h1 {
    font-family: 'Merriweather', serif;
    color: #4a4a4a;
    text-align: center;
    margin-bottom: 20px;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(15, 25px);
    gap: 2px;
    margin: 0 auto 20px;
    padding: 10px;
    background-color: #d4c8a8;
    border-radius: 10px;
}

#message-container {
    max-width: 100%;
    margin: 20px auto;
    padding: 15px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#message {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

#actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

#actions button, #movement-controls button, #instructions-button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #6b8e23;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#actions button:hover, #movement-controls button:hover, #instructions-button:hover {
    background-color: #556b2f;
}

.cell {
    width: 25px;
    height: 25px;
    border: 1px solid #b0a080;
    transition: background-color 0.3s ease;
}

.player {
    background-color: #d9534f;
    border-radius: 50%;
}

.explored {
    background-color: #c7b68a;
}

.supply-cache {
    background-color: #5bc0de;
}

#movement-controls {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

#movement-controls button {
    width: 40px;
    height: 40px;
    font-size: 18px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.popup-content {
    background-color: #f7f3e8;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #333;
    text-decoration: none;
}

#instructions-button {
    margin-top: 20px;
    width: 100%;
}

#resources {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 14px;
}

.resource {
    text-align: center;
    background-color: #e0d5b8;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}