body {
    font-family: Calibri;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f0f0f0;
}
header {
    background-color: #cac2c2;
    padding: 10px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 2px solid #191919;
}
#objective-panel {
    background: #ffffff;
    border: 2px solid #191919;
    border-radius: 8px;
    padding: 8px 14px;
    max-width: 420px;
    margin: 10px auto 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-size: 0.9rem;
}
#objective-panel.objective-complete {
    border-color: #27ae60;
    background: #e9f7ef;
}
.objective-title {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #2c3e50;
}
#objective-description {
    margin-top: 4px;
    font-size: 0.95rem;
    color: #1a1a1a;
}
#objective-progress {
    margin-top: 6px;
    color: #2c3e50;
    line-height: 1.3;
    font-size: 0.85rem;
}
.stat-box {
    font-weight: bold;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 7px;
    padding: 4px 8px;
}
.positive {
    color: #1f8a48;
}
.negative {
    color: #a82828;
}
#game-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items:  center;
    background-color: #9f9c9c;
    overflow: hidden;
    position: relative;
    min-height: 280px;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#agent-layer {
    position: absolute;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}
.tile {
    width: 40px;
    height: 40px;
    background-color: rgb(117, 212, 117);
    cursor: pointer;
    position: relative;
}
.tile:hover {
    opacity: 0.8;
    outline: 2px solid white;
    z-index: 10;
}
.tile.road {
    background-color: #555555;
}
.tile.house1 {
    background-color: #d55555;
}
.tile.house2 {
    background-color: #a53030;
}
.tile.house3 {
    background-color: #601010;
}
.tile.commercial {
    background-color: rgb(72, 72, 216);
}
.tile.industry {
    background-color: rgb(211, 211, 71);
}
.tile.park {
    background-color: rgb(31, 121, 31);
}
.tile.water {
    background-color: rgb(73, 73, 229);
    cursor: not-allowed;
}
.tile.house::after {
    content: 'H';
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 40px;
    color: white;
    font-weight: bold;
}
.tile.commercial::after {
    content: 'M';
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 40px;
    color: white;
    font-weight: bold;
}
.tile.industry::after {
    content: 'I';
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 40px;
    color: black;
    font-weight: bold;
}
.tile.park::after {
    content: 'P';
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 40px;
    color: white;
    font-weight: bold; 
}
footer {
    background-color: #dad5d5;
    padding: 10px;
    z-index: 10;
    border-top: 2px solid #000000;
}
#controls {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}
#debug-info {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: monospace;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    pointer-events: none;
}
.tool-button {
    background-color: #eae3e3;
    border: 1px solid #000000;
    padding: 5px 10px;
    cursor: pointer;
    min-width: 60px;
}
.tool-button:hover {
    background-color: #dddddd;
}
.tool-button.active {
    background-color: #a39d9d;
    font-weight: bold;
    border: 2px solid #000000;
}
.tool-cost {
    display: block;
    font-size: 0.8em;
    color: #4f4e4e;
}
#message-log {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    border: 2px solid black;
    padding: 5px;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
#minimap-container {
    position: absolute;
    bottom: 22px;
    right: 22px;
    width: 150px;
    height: 150px;
    background: #000;
    border: 2px solid #555;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
#minimap {
    width: 100%;
    height: 100%;
    display: block;
}
.system-button {
    background-color: #2980b9;
}
.system-button:hover {
    background-color: #3498db;
}
.spacer {
    width: 10px;
}
#start-screen {
    position: fixed;
    inset: 0;
    background: rgba(38, 60, 81, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.4s ease;
}
.start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}
.start-content {
    text-align: center;
    color: #ecf0f1;
    padding: 2.5rem 3rem;
     background: rgba(0, 0, 0, 0.35);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.start-content h1 {
    margin-bottom: 0.75rem;
    font-size: 2.5rem;
    letter-spacing: 0.05em;
}
.start-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}
.start-content .tool-button {
    padding: 0.75rem 1.75rem;
    font-size: 1.05rem;
}
.tile-tooltip {
    position: absolute;
    background: #3e3c3c;
    color: #e4f1f4;
    border: 1px solid #324960;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 0.85rem;
    min-width: 140px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 50;
}
.tile-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal {
    position: fixed;
    inset: 0;
    background: rgba(16, 20, 26, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    transition: opacity 0.2s ease;
}
.modal-content {
    background: #ffffff;
    padding: 18px 22px;
    border-radius: 12px;
    border: 2px solid #191919;
    min-width: 260px;
    text-align: center;
}
.modal-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

@media (max-width: 900px) {
    header {
        justify-content: flex-start;
        padding: 8px;
    }
    .stat-box {
        font-size: 0.8rem;
    }
    #objective-panel {
        max-width: calc(100% - 16px);
        margin-top: 8px;
    }
    #minimap-container {
        width: 120px;
        height: 120px;
        bottom: 14px;
        right: 14px;
    }
}