body {
    margin: 0;
    min-height: 100vh;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-image: url('../assets/wc1-map-base-mirror.png');
    background-color: #333333;
    scrollbar-width: none;
}

html {
    background-color: #333333;
    scrollbar-width: none;
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
    width: 0;
    height: 0;
}

main {
    display: block;
    min-height: calc(100vh - 33px);
    background-color: #000;
}

.background {
    background-image: url('../assets/wc1-map-base.png');
    background-color: #000;
}

#main {
    height: 1024px;
    min-height: calc(100vh - 33px);
    width: 1024px;
    position: relative;
    background-color: #000;
}

#testSelectedIndicator {
    background-image: url('../assets/wc1-selector-outline.png');
    height: 16px;
    width: 16px;
    position: absolute;
    top: 800px;
    left: 256px;
}

/* Per-peasant starting positions are now set inline by the Livewire view
   (see resources/views/livewire/game.blade.php). The .peasant rule below
   still owns size, sprite, and z-index. */

#selectIndicator{
    background-color: rgba(15, 255, 15, 0.4);
    opacity:0.4;
    border: 1px dotted rgb(15, 182, 15);
    z-index: 3;
    position: absolute;
    display:none;
}

.unitOutlined {
    z-index: 4;
    background-image: url('../assets/wc1-selector-outline.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    height: 16px;
    width: 16px;
    position: absolute;
}

.unitSelected {
    /**
    Didn't like this method, it didn't look right.
    z-index: 4;
    border: 1px solid rgb(6,167,6) */
    /* This is so adding a border doesn't move the image */
    /*
    margin: -1px;
    **/
}

.peasant {
    z-index: 3;
    background-image: url('../assets/human/units/peasant.png');
    /* 160×416px sheet at 50% → 80×208px display; each 32px native frame = 16px tile. */
    background-size: 80px 208px;
    background-repeat: no-repeat;
    background-position: 0 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    height: 16px;
    width: 16px;
    position: absolute;
    transform-origin: 50% 50%;
}

.footman {
    z-index: 3;
    background-image: url('../assets/human/units/footman.png');
    /* 240×624px sheet at 33% → 80×208px display; each 48px native frame = 16px tile. */
    background-size: 80px 208px;
    background-repeat: no-repeat;
    background-position: 0 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    height: 16px;
    width: 16px;
    position: absolute;
    transform-origin: 50% 50%;
}

.archer {
    z-index: 3;
    background-image: url('../assets/human/units/archer.png');
    /* 160×320px sheet at 50% → 80×160px display; each 32px native frame = 16px tile. */
    background-size: 80px 160px;
    background-repeat: no-repeat;
    background-position: 0 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    height: 16px;
    width: 16px;
    position: absolute;
    transform-origin: 50% 50%;
}

.grunt {
    z-index: 3;
    background-image: url('../assets/orc/units/grunt.png');
    /* 240×624px sheet at 33% → 80×208px display; each 48px native frame = 16px tile. */
    background-size: 80px 208px;
    background-repeat: no-repeat;
    background-position: 0 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    height: 16px;
    width: 16px;
    position: absolute;
    transform-origin: 50% 50%;
}

/* Flying projectile (arrow, bolt, etc.) */
.projectile {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #8B4513;
    border-radius: 50%;
    z-index: 10;
    pointer-events: none;
}

/* Surface stone tile : sits above the terrain, below units. */
.stone {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 2;
    pointer-events: none;
}

/* Chopped tree stump : persists after harvest as atmosphere. */
.chopped-tree {
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
    z-index: 2;
}

.chopped-tree:hover {
    opacity: 1;
}

/* ── Building HP tint ────────────────────────────────────────────────────── */
/* Buildings at medium HP (25–50%) get a slight amber desaturation. */
.building[data-hp-pct="medium"] {
    filter: brightness(0.85) sepia(0.3);
}
/* Buildings at low HP (0–25%) get a strong red-orange tint to signal danger. */
.building[data-hp-pct="low"] {
    filter: brightness(0.7) sepia(0.6) saturate(2) hue-rotate(-20deg);
}

/* ── Research buttons ────────────────────────────────────────────────────── */
.building-cmd-btn.building-cmd-research {
    background-color: #2a4a6a;
    border-color: #4a8ab4;
}
.building-cmd-btn.building-cmd-research:not(:disabled):hover {
    background-color: #3a6a9a;
}
.building-cmd-btn.building-cmd-researched {
    background-color: #1a3a1a;
    border-color: #4ab44a;
    opacity: 0.75;
    cursor: default;
}
