.zone-role {
    position: relative;
    transition: all 0.3s ease;
}

.zone-role.highlighted {
    animation: highlightGlow 2s ease-in-out infinite;
}

@keyframes highlightGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.6));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.9));
    }
}

@keyframes smoothSnap {
    0% {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    }

    100% {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
    }
}

.zone-popup {
    top: 170px;
    width: 280px;
    left: 60%;
    transform: translateX(-50%) !important;
    right: auto;
}

.zone-popup .popup-arrow {
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-top: 8px solid rgba(0, 0, 0, 0.9);
    border-bottom: none;
    border-right: 8px solid transparent;
    border-left: 8px solid transparent;
}

.town-popup {
    top: 490px;
    width: 280px;
    left: 78%;
    transform: translateX(-50%) !important;
    right: auto;
}

.town-popup .popup-arrow {
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-top: 8px solid rgba(0, 0, 0, 0.9);
    border-bottom: none;
    border-right: 8px solid transparent;
    border-left: 8px solid transparent;
}

.zone-roll-img {
    width: 120px;
    position: absolute;
    right: 114px;
    top: 262px;
    user-select: none;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    transition: filter 0.3s ease;
    cursor: grab;
}

.zone-roll-img:active {
    cursor: grabbing;
}

.zone-roll-img.snapping {
    animation: smoothSnap 0.5s ease-in-out;
}

.town-roll-img {
    width: 120px;
    position: absolute;
    right: 0;
    top: 0px;
    user-select: none;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    transition: filter 0.3s ease;
    cursor: grab;
}

.town-roll-img:active {
    cursor: grabbing;
}

.town-roll-img.snapping {
    animation: smoothSnap 0.5s ease-in-out;
}

/* Ensure proper positioning in left panel */
.left-panel .zone-role:first-of-type {
    position: absolute;
    top: 415px;
    right: 43px;
    width: 120px;
    height: 120px;
}

.left-panel .zone-role:last-of-type {
    position: absolute;
    top: 747px;
    right: 13px;
    width: 120px;
    height: 120px;
}

/* Instruction popups for town and parameter selectors */
.town-popup,
.parameter-popup {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    max-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.town-popup {
    top: -130px;
    left: 70%;
}

.parameter-popup {
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
}

.parameter-popup .popup-arrow {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.9);
}

.town-popup .popup-arrow {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.9);
}

/* Highlight state for town and parameter elements */

.body-box-right-container-inner-bottom.highlighted {
    position: relative;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.5);
    border-radius: 8px;
    padding: 5px;
}