/* ─────────────────── GENERAL ─────────────────── */
body {
    font-family: "Georgia", serif;
    background-color: #f4e4c1;
    color: #3e2723;
    margin: 0;
    padding: 0;
}

/* ─────────────────── NAVBAR ─────────────────── */
nav {
    background: #5c3b1e;
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
nav button {
    background: #d4a373;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
}
nav button:hover {
    background: #a87142;
}

/* ─────────────────── RESOURCE BAR ─────────────────── */
.resources-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background: #8d6e63;
    padding: 10px;
    color: #fff;
    font-size: 16px;
    gap: 10px;
    text-align: center;
}
.resources-bar img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}
@media (max-width: 600px) {
    .resources-bar {
        font-size: 14px;
        flex-direction: column;
        align-items: center;
    }
}

/* ─────────────────── TROOPS SECTION ─────────────────── */
.troop {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.troop-icon {
  width: 30px;
  height: 30px;
}

/* ─────────────────── VILLAGE SECTION ─────────────────── */
#village {
    text-align: center;
    padding: 20px;
}
.building {
    background: #d7ccc8;
    padding: 15px;
    margin: 10px;
    border-radius: 10px;
    display: inline-block;
    width: 200px;
    box-shadow: 2px 2px 8px rgba(0 0 0 / 20%);
}
.building button {
    background: #8d6e63;
    border: none;
    padding: 8px 12px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
}
.building button:hover {
    background: #5c3b1e;
}

#village-image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px; /* adjust to fit your image size */
    height: auto;
    transform: translate(-50%, -50%); /* center on map */
    background-image: url("village_level1.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2; /* higher than map, lower than UI */
    pointer-events: none; /* so it doesn't block UI interactions */
}

/* ─────────────────── GAME DISPLAY (Map + Leaderboard) ─────────────────── */
#game-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
}
@media (max-width: 768px) {
    #game-display {
        flex-direction: column;
        align-items: center;
    }
}

/* ─────────────── WORLD MAP (pan / zoom) ─────────────── */
#world-map {
    flex: 1 1 400px;
    max-width: 600px;
    text-align: center;
    padding: 20px;
}

/* visible viewport */
#map-wrapper {
    width: 100vw;
    height: 300px;             /* adjust if you want taller */
    overflow: hidden;
    position: relative;
    touch-action: none;        /* allow custom touch gestures */
    background: #c8b9a7;
    border-radius: 10px;
    touch-action: none;
}

/* giant scrollable surface */

#map-world {
    width: 3000px;
    height: 3000px;
    position: absolute;
    left: 0;
    top: 0;
    background: url("World_Map.png") top left / cover no-repeat;
    transform-origin: 0 0;
}


/* a village icon */
.village-tile {
    position: absolute;
    width: 60px;
    height: 60px;
    background: url("village2.png") center/contain no-repeat;
    cursor: pointer;
}
/* tooltip on hover / tap */
.village-tile:hover::after {
    content: attr(data-username) " (" attr(data-score) ")";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #5c3b1e;
    color: #fff;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ─────────────────── LEADERBOARD ─────────────────── */
#leaderboard {
    flex: 1 1 300px;
    max-width: 400px;
    text-align: center;
    padding: 20px;
}
#leaderboard-list {
    list-style: none;
    padding: 0;
}
#leaderboard-list li {
    background: #fff3e0;
    margin: 5px auto;
    padding: 10px;
    width: 100%;
    max-width: 250px;
    border-radius: 5px;
    box-shadow: 1px 1px 5px rgba(0 0 0 / 20%);
}
