/* World Map fullscreen window */
.world-map-window {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 12000;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Shared bottom controls (close + home); keep in sync with #world-map-home-button */
    --wm-bottom-inset: 18px;
    --wm-bottom-btn-size: 46px;
    --wm-bottom-btn-gap: 12px;
    /* padding: 20px; */
}

.world-map-window-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ffffff;
    /* border-radius: 14px; */
    overflow: hidden;
}

/* Go to coordinates — immediately left of Close (same size as Close). */
.world-map-goto {
    position: absolute;
    top: auto;
    left: auto;
    bottom: var(--wm-bottom-inset);
    right: calc(var(--wm-bottom-inset) + var(--wm-bottom-btn-size) + var(--wm-bottom-btn-gap));
    z-index: 3;
    width: var(--wm-bottom-btn-size);
    height: var(--wm-bottom-btn-size);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.world-map-goto:hover {
    background: rgba(0, 0, 0, 0.68);
    border-color: rgba(255, 255, 255, 0.38);
}

.world-map-goto i {
    font-size: 20px;
}

/* Bottom bar: Close rightmost; Goto; then Home further left. */
.world-map-window-close {
    position: absolute;
    top: auto;
    left: auto;
    bottom: var(--wm-bottom-inset);
    right: var(--wm-bottom-inset);
    z-index: 3;
    width: var(--wm-bottom-btn-size);
    height: var(--wm-bottom-btn-size);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.world-map-window-close:hover {
    background: rgba(0, 0, 0, 0.68);
    border-color: rgba(255, 255, 255, 0.38);
}

.world-map-window-close i {
    font-size: 22px;
}

/* Map rendering */
#world-map-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    user-select: none;
}

/* Shared pill style for map coordinate readouts */
.world-map-coords {
    padding: 6px 10px;
    border-radius: 4px;
    font-family: Oswald;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 12px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    max-width: min(220px, calc(100% - 24px));
}

/* Camera center tile — fixed top-right above the radar */
#world-map-coords.world-map-coords {
    position: absolute;
    top: 15px;
    right: 15px;
    left: auto;
    z-index: 50;
    background: rgba(0, 0, 0, 0.48);
}

/*
 * Clicked tile info: anchored at tile center by JS (left/top).
 * translate() sits the pill above the tile so it doesn’t cover the click point.
 */
#world-map-click-coords.world-map-coords {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    z-index: 55;
    transform: translate(-50%, calc(-100% - 10px));
    background: rgba(0, 0, 0, 0.42);
    border-color: rgba(255, 255, 255, 0.28);
}

/* Tile click popover: coords + bookmark / share / teleport */
#world-map-click-coords.world-map-click-coords-popover {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 12px;
    min-width: 200px;
    max-width: min(92vw, 280px);
    pointer-events: auto;
}

.world-map-click-coords-label {
    font-family: Oswald, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    line-height: 1.25;
}

.world-map-click-coords-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

button.world-map-click-coords-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    margin: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(30, 34, 42, 0.92);
    color: #f3f4f6;
    font-family: Oswald, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

button.world-map-click-coords-btn:hover {
    background: rgba(50, 56, 68, 0.95);
    border-color: rgba(255, 255, 255, 0.5);
}

button.world-map-click-coords-btn:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.95);
    outline-offset: 2px;
}

button.world-map-click-coords-btn i {
    font-size: 12px;
    opacity: 0.95;
}

/* Ephemeral “Sent Mine / Monster …” feedback when sharing location to public chat */
#world-map-send-toast.world-map-send-toast {
    position: fixed;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 13100;
    margin: 0;
    padding: 10px 18px;
    border-radius: 8px;
    color: #fff;
    font-family: Oswald, system-ui, sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

#world-map-send-toast.world-map-send-toast.world-map-send-toast--visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#world-map-send-toast.world-map-send-toast.world-map-send-toast--out {
    opacity: 0;
}

#world-map-click-coords.world-map-coords.world-map-coords--glow {
    background: rgba(255, 210, 80, 0.28);
    border-color: rgba(255, 225, 130, 0.9);
    box-shadow: 0 0 10px rgba(255, 210, 80, 0.75), 0 0 20px rgba(255, 210, 80, 0.45);
    animation: wmCoordPulse 0.8s ease-in-out infinite;
}

@keyframes wmCoordPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 210, 80, 0.65), 0 0 14px rgba(255, 210, 80, 0.35);
    }
    50% {
        box-shadow: 0 0 14px rgba(255, 225, 130, 0.95), 0 0 26px rgba(255, 225, 130, 0.6);
    }
}

#world-map-click-coords[hidden] {
    display: none !important;
}

#world-map-route-info-layer {
    position: absolute;
    inset: 0;
    z-index: 58;
    pointer-events: none;
}

.world-map-route-info {
    position: absolute;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: #fff;
    font-family: Oswald;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.world-map-route-info--going {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(125, 211, 252, 0.72);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
}

.world-map-route-info--returning {
    background: rgba(56, 17, 17, 0.74);
    border-color: rgba(251, 146, 60, 0.78);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.34);
}

.world-map-route-info-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.16);
}

.world-map-route-info-eta {
    line-height: 1;
}

/* Home button: pan back to your current position (tile coords). Left of Goto on bottom bar. */
#world-map-home-button {
    position: absolute;
    bottom: var(--wm-bottom-inset);
    right: calc(var(--wm-bottom-inset) + 2 * (var(--wm-bottom-btn-size) + var(--wm-bottom-btn-gap)));
    top: auto;
    left: auto;
    z-index: 3;
    width: var(--wm-bottom-btn-size);
    height: var(--wm-bottom-btn-size);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

#world-map-home-button:hover {
    background: rgba(0, 0, 0, 0.68);
    border-color: rgba(255, 255, 255, 0.38);
}

#world-map-home-button i {
    font-size: 24px;
}

/* `hidden` must win over display:flex (otherwise button never disappears). */
#world-map-home-button[hidden] {
    display: none !important;
}

/* Bottom-left stack: monster battle (top) + bookmarks + workers (bottom); column-reverse = workers anchored to bottom inset. */
#world-map-left-stack {
    position: absolute;
    left: var(--wm-bottom-inset);
    bottom: var(--wm-bottom-inset);
    top: auto;
    right: auto;
    z-index: 4;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    width: 200px;
    max-width: calc(100% - var(--wm-bottom-inset) * 2 - var(--wm-bottom-btn-size) * 2 - var(--wm-bottom-btn-gap));
    pointer-events: none;
    align-items: stretch;
}

#world-map-left-stack > * {
    pointer-events: auto;
}

/* Minimized ribbons: full stack width so Workers / Bookmarks / Monster battle align. */
#world-map-occupied-panel.world-map-occupied-panel--minimized,
#bookmark-panel.world-map-bookmark-panel--minimized,
#monster-battle-panel.world-map-monster-battle-panel--minimized {
    max-height: none;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Monster battle: list user's world_monster_battles with status; click coords to pan. */
#monster-battle-panel {
    flex-shrink: 0;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(251, 146, 60, 0.45);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    font-family: Oswald, sans-serif;
    padding: 0;
    overflow: hidden;
}

.world-map-monster-battle-panel-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    flex-shrink: 0;
    cursor: default;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.world-map-monster-battle-panel-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
}

#monster-battle-panel.world-map-monster-battle-panel--minimized .world-map-monster-battle-panel-header {
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 8px 12px;
    gap: 8px;
    cursor: default;
    width: 100%;
    box-sizing: border-box;
}

#monster-battle-panel.world-map-monster-battle-panel--minimized .world-map-monster-battle-panel-title {
    flex: 0 0 auto;
    text-align: left;
    white-space: nowrap;
}

#monster-battle-panel.world-map-monster-battle-panel--minimized .world-map-monster-battle-list {
    display: none !important;
}

.world-map-monster-battle-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(32vh, 220px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    -webkit-overflow-scrolling: touch;
}

#monster-battle-panel .world-map-monster-battle-list > .world-map-monster-battle-row {
    flex-shrink: 0;
}

.world-map-monster-battle-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.world-map-monster-battle-row:first-of-type {
    border-top: none;
}

.world-map-monster-battle-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 8px 10px;
}

.world-map-monster-battle-status-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2em;
    line-height: 1.2;
}

.world-map-monster-battle-status {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.2;
}

.world-map-monster-battle-eta {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.58);
}

.world-map-monster-battle-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.02em;
}

/* Giant Monster dialog + battle panel: resolved wave result */
.wm-monster-outcome {
    box-sizing: border-box;
    margin-top: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    font-family: Oswald, sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.25;
}

/* Monster Won = danger/red (players lost); Monster Eliminated = success/green (monster defeated) */
.wm-monster-outcome--won {
    color: #fff7f7;
    background: linear-gradient(145deg, rgba(220, 38, 38, 0.48), rgba(127, 29, 29, 0.78));
    border: 2px solid rgba(248, 113, 113, 0.9);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 4px 18px rgba(239, 68, 68, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.wm-monster-outcome--eliminated {
    color: #ecfdf5;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.42), rgba(4, 120, 87, 0.72));
    border: 2px solid rgba(52, 211, 153, 0.85);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 4px 18px rgba(16, 185, 129, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

#monster-battle-panel .wm-monster-outcome--panel {
    display: block;
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    border-radius: 6px;
    text-align: left;
}

button.world-map-monster-battle-coord {
    flex-shrink: 0;
    width: auto;
    min-width: 6.5em;
    margin: 0;
    padding: 10px 12px;
    border: none;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.06);
    color: #fdba74;
    font-family: Oswald, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

button.world-map-monster-battle-coord:hover:not(:disabled) {
    background: rgba(251, 146, 60, 0.18);
    color: #fff;
}

button.world-map-monster-battle-coord:focus-visible {
    outline: 2px solid rgba(251, 146, 60, 0.85);
    outline-offset: -2px;
}

button.world-map-monster-battle-coord:disabled {
    cursor: default;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.04);
}

#monster-battle-panel[hidden] {
    display: none !important;
}

/* Bookmarks: saved tile coords (localStorage); between Workers and Monster battle. */
#bookmark-panel {
    flex-shrink: 0;
    width: 100%;
    min-height: 0;
    max-height: min(28vh, 220px);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    font-family: Oswald, sans-serif;
}

#bookmark-panel .world-map-bookmark-panel-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    flex-shrink: 0;
    cursor: default;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#bookmark-panel .world-map-bookmark-panel-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
}

#bookmark-panel.world-map-bookmark-panel--minimized .world-map-bookmark-panel-header {
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 8px 12px;
    gap: 8px;
    cursor: default;
    width: 100%;
    box-sizing: border-box;
}

#bookmark-panel.world-map-bookmark-panel--minimized .world-map-bookmark-panel-title {
    flex: 0 0 auto;
    text-align: left;
    white-space: nowrap;
}

#bookmark-panel.world-map-bookmark-panel--minimized .world-map-bookmark-panel-body {
    display: none !important;
}

/* Same flex + min-height chain as Workers panel so the list gets a real scrollbox. */
#bookmark-panel .world-map-bookmark-panel-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 10px;
    gap: 6px;
}

#bookmark-panel .world-map-bookmark-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(22vh, 180px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
}

/* Column flex items default to flex-shrink: 1 — rows were squishing instead of scrolling. */
#bookmark-panel .world-map-bookmark-list > .world-map-bookmark-row-wrap {
    flex-shrink: 0;
}

#bookmark-panel .world-map-bookmark-list > .world-map-bookmark-empty {
    flex-shrink: 0;
}

.world-map-bookmark-row-wrap {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
}

#bookmark-panel .world-map-bookmark-empty {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.35;
    padding: 4px 2px 2px;
}

button.world-map-bookmark-row {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 8px 8px 8px 10px;
    text-align: left;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease;
}

.world-map-bookmark-row-wrap:hover button.world-map-bookmark-row {
    background: rgba(96, 165, 250, 0.16);
}

button.world-map-bookmark-row:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.85);
    outline-offset: -2px;
}

.world-map-bookmark-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.world-map-bookmark-row-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.world-map-bookmark-row-coords {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(147, 197, 253, 0.95);
}

button.world-map-bookmark-remove {
    flex-shrink: 0;
    width: 32px;
    min-height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

button.world-map-bookmark-remove:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fff;
}

button.world-map-bookmark-remove:focus-visible {
    outline: 2px solid rgba(248, 113, 113, 0.9);
    outline-offset: 1px;
}

button.world-map-bookmark-remove i {
    font-size: 13px;
    line-height: 1;
}

/* Bottom-left: occupied mine coordinates (click to pan). Minimizable via header toggle. */
#world-map-occupied-panel {
    position: relative;
    left: auto;
    bottom: auto;
    top: auto;
    right: auto;
    z-index: auto;
    width: 100%;
    max-width: none;
    max-height: min(42vh, 280px);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    font-family: Oswald, sans-serif;
}

#world-map-occupied-panel.world-map-occupied-panel--minimized .world-map-occupied-panel-header {
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 8px 12px;
    gap: 8px;
    cursor: default;
    width: 100%;
    box-sizing: border-box;
}

#world-map-occupied-panel.world-map-occupied-panel--minimized .world-map-occupied-panel-title {
    flex: 0 0 auto;
    text-align: left;
    white-space: nowrap;
}

/* Hide list when minimized (must use !important: .world-map-occupied-panel-body sets display:flex). */
#world-map-occupied-panel.world-map-occupied-panel--minimized .world-map-occupied-panel-body {
    display: none !important;
}

.world-map-occupied-panel-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    flex-shrink: 0;
    cursor: default;
    user-select: none;
}

.world-map-occupied-panel-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
    flex: 1;
    min-width: 0;
}

button.world-map-occupied-toggle {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

button.world-map-occupied-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
}

button.world-map-occupied-toggle:focus-visible {
    outline: 2px solid rgba(100, 180, 255, 0.85);
    outline-offset: 2px;
}

button.world-map-occupied-toggle i {
    font-size: 14px;
    line-height: 1;
}

.world-map-occupied-panel-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0 12px 10px;
    gap: 6px;
}

.world-map-occupied-list {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    max-height: min(36vh, 240px);
    -webkit-overflow-scrolling: touch;
}

.world-map-occupied-empty {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.35;
    padding: 2px 0;
}

.world-map-occupied-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    text-align: left;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    transition: background 0.15s ease, border-color 0.15s ease;
}

button.world-map-occupied-item {
    cursor: pointer;
}

div.world-map-occupied-item {
    cursor: default;
    opacity: 0.75;
}

.world-map-occupied-item .spot-label {
    display: block;
    font-size: 14px;
    text-transform: uppercase;
}

.world-map-occupied-item .worker-status {
    display: block;
    font-size: 12px;
    font-weight: 400;
    margin-top: 3px;
}

.worker-status--idle {
    color: rgba(255, 255, 255, 0.45);
    font-style: italic;
}

.worker-status--occupied {
    color: rgba(110, 231, 183, 0.9);
}

.worker-status--going {
    color: rgba(147, 197, 253, 0.9);
}

.worker-status--returning {
    color: rgba(253, 186, 116, 0.9);
}

.worker-status--busy {
    color: rgba(255, 255, 200, 0.7);
}

.worker-mine-plain {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #fff;
    margin-top: 2px;
}

.worker-eta {
    font-weight: 600;
    opacity: 0.85;
}

.worker-panel-avatar {
    border-radius: 50%;
}

button.world-map-occupied-item:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
}

/* Mine on-screen (same tile band as map mine culling); yellow — no separate click-only state. */
.world-map-occupied-item--highlighted {
    background: rgba(250, 204, 21, 0.22);
    border-color: rgba(250, 204, 21, 0.6);
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.25);
}

.world-map-occupied-item--highlighted .spot-label,
.world-map-occupied-item--highlighted .worker-mine-plain {
    color: #fde68a;
}

.world-map-occupied-item--highlighted .worker-panel-avatar {
    border: 2px solid rgba(250, 204, 21, 0.55);
    box-sizing: border-box;
}

button.world-map-occupied-item--highlighted:hover {
    background: rgba(250, 204, 21, 0.28);
    border-color: rgba(250, 204, 21, 0.65);
}

button.world-map-occupied-item:focus-visible {
    outline: 2px solid rgba(100, 180, 255, 0.85);
    outline-offset: 2px;
}

/* Go-to modal uses global .custom-dialog-overlay (showAlert); keep above map canvas */
.world-map-goto-overlay.custom-dialog-overlay {
    z-index: 13001;
}

/* Giant Monster + Mine CustomDialog: content is normally solid white — hide it so the glass panel shows the map */
body.wm-monster-dialog-open .world-map-window-content {
    background: transparent;
}

/* IDs beat generic .custom-dialog rules; monster + mine detail stay visibly frosted over the canvas */
#custom-dialog-overlay.custom-dialog-overlay--monster-detail {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#custom-dialog.custom-dialog--monster-detail {
    background: rgba(255, 255, 255, 0.36);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    box-shadow: 0 14px 52px rgba(0, 0, 0, 0.32);
    border-radius: 8px;
    overflow: hidden;
}

#custom-dialog.custom-dialog--monster-detail .custom-dialog-header {
    background: rgba(255, 255, 255, 0.2);
    border-bottom-color: rgba(0, 0, 0, 0.12);
    border-radius: 8px 8px 0 0;
}

#custom-dialog.custom-dialog--monster-detail .custom-dialog-title {
    color: #020617;
}

#custom-dialog.custom-dialog--monster-detail .custom-dialog-body {
    background: transparent;
    color: #0f172a;
}

/* World portal detail (Send worker / stats): lists + dynamic block inside glass dialog */
#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic {
    margin-top: 0.65rem;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic > p:first-child {
    margin-top: 0;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic p {
    margin: 0.5rem 0;
    line-height: 1.55;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-balance {
    margin: 0 0 0.6rem 0;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    line-height: 1.45;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-balance strong {
    color: #020617;
}

/* Match .world-portal-dialog-hint: soft tint + dashed frame for every list in portal body */
#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic ul {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0.55rem 0.7rem;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 8px;
    border: 1px dashed rgba(15, 23, 42, 0.12);
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic ul:first-child {
    margin-top: 0;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic ul li {
    margin: 0;
    padding: 0.5rem 0.15rem 0.5rem 1.15rem;
    line-height: 1.5;
    font-size: 0.9375rem;
    color: #0f172a;
    position: relative;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic ul li + li {
    border-top: 1px dashed rgba(15, 23, 42, 0.1);
    margin-top: 0.05rem;
    padding-top: 0.55rem;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic ul li::before {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.95em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fdba74, #ea580c);
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.22);
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-dynamic ul li strong {
    color: #020617;
    font-weight: 600;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-leave-wrap {
    margin: 0.65rem 0 0.35rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-leave-wrap .dialog-btn {
    padding: 8px 18px;
    font-size: 13px;
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-hint {
    margin: 0.65rem 0 0;
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #0f172a;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 8px;
    border: 1px dashed rgba(15, 23, 42, 0.12);
}

#custom-dialog.custom-dialog--monster-detail .world-portal-dialog-hint strong {
    color: #0f172a;
}

#custom-dialog.custom-dialog--monster-detail .custom-dialog-footer {
    background: rgba(255, 255, 255, 0.22);
    border-top-color: rgba(0, 0, 0, 0.12);
    border-radius: 0 0 8px 8px;
}

/* World-map inline modals (Go to tile, mine/monster radar): match #custom-dialog monster-detail glass */
#world-map-goto-modal.custom-dialog-overlay--monster-detail,
#world-map-mine-scan-modal.custom-dialog-overlay--monster-detail,
#world-map-monster-scan-modal.custom-dialog-overlay--monster-detail {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#world-map-goto-modal .custom-dialog.custom-dialog--monster-detail,
#world-map-mine-scan-modal .custom-dialog.custom-dialog--monster-detail,
#world-map-monster-scan-modal .custom-dialog.custom-dialog--monster-detail {
    background: rgba(255, 255, 255, 0.36);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    box-shadow: 0 14px 52px rgba(0, 0, 0, 0.32);
    border-radius: 8px;
    overflow: hidden;
}

#world-map-goto-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-header,
#world-map-mine-scan-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-header,
#world-map-monster-scan-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-header {
    background: rgba(255, 255, 255, 0.2);
    border-bottom-color: rgba(0, 0, 0, 0.12);
    border-radius: 8px 8px 0 0;
}

#world-map-goto-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-title,
#world-map-mine-scan-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-title,
#world-map-monster-scan-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-title {
    color: #020617;
}

#world-map-goto-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-body,
#world-map-mine-scan-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-body,
#world-map-monster-scan-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-body {
    background: transparent;
    color: #0f172a;
}

#world-map-goto-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-footer,
#world-map-mine-scan-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-footer,
#world-map-monster-scan-modal .custom-dialog.custom-dialog--monster-detail .custom-dialog-footer {
    background: rgba(255, 255, 255, 0.22);
    border-top-color: rgba(0, 0, 0, 0.12);
    border-radius: 0 0 8px 8px;
}

.world-map-goto-overlay.custom-dialog-overlay--monster-detail .world-map-goto-hint {
    color: #1e293b;
}

.world-map-goto-overlay.custom-dialog-overlay--monster-detail .world-map-goto-input {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

.world-map-goto-overlay.custom-dialog-overlay--monster-detail .world-map-goto-input:focus {
    border-color: rgba(201, 162, 39, 0.75);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.22);
}

#world-map-mine-scan-modal .world-map-scan-hint,
#world-map-monster-scan-modal .world-map-scan-hint {
    color: #1e293b;
}

#world-map-mine-scan-modal .world-map-scan-range,
#world-map-monster-scan-modal .world-map-scan-range {
    accent-color: #0f172a;
}

#world-map-mine-scan-modal .world-map-scan-level-readout,
#world-map-monster-scan-modal .world-map-scan-level-readout {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    min-width: 5.5rem;
}

/* Challenger avatars: no-photo initial + empty slot — dark translucent panels */
#custom-dialog.custom-dialog--monster-detail .monster-trip-avatar-placeholder {
    background: rgba(15, 23, 42, 0.58);
    color: rgba(241, 245, 249, 0.92);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-empty-slot {
    border: 2px dashed rgba(100, 116, 139, 0.55);
    background: rgba(15, 23, 42, 0.42);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Claimable battle reward (API: claimable_reward_preview on GET /world-monsters/:id/battles) */
#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner {
    margin: -4px 0 14px 0;
    padding: 12px 12px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.96) 0%, rgba(253, 230, 138, 0.9) 42%, rgba(251, 191, 36, 0.38) 100%);
    border: 1px solid rgba(180, 83, 9, 0.38);
    box-shadow: 0 4px 18px rgba(180, 83, 9, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Preview before any win / claim (API: claimable_reward_preview.hypothetical) */
#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner--hypothetical {
    background: linear-gradient(135deg, rgba(254, 249, 195, 0.98) 0%, rgba(254, 240, 138, 0.92) 45%, rgba(250, 204, 21, 0.42) 100%);
    border: 3px solid rgba(161, 98, 7, 0.88);
    box-shadow: 0 4px 18px rgba(180, 83, 9, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner--hypothetical .wm-monster-reward-banner__title {
    color: #713f12;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__title {
    font-family: Oswald, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #78350f;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__mvp {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(180deg, #f59e0b, #b45309);
    padding: 3px 8px;
    border-radius: 999px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(180, 83, 9, 0.35);
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__mvp .fa-crown {
    font-size: 10px;
    opacity: 0.95;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__tier {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    line-height: 1.35;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__pending {
    margin: 10px 0 0;
    font-size: 12px;
    font-weight: 500;
    color: #78350f;
    line-height: 1.45;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__body {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__line {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__line--coin {
    align-items: center;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #78350f;
    opacity: 0.92;
    flex-shrink: 0;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__val {
    font-family: Oswald, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.02em;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__pill {
    font-size: 11px;
    font-weight: 600;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(180, 83, 9, 0.24);
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-reward-banner__pill strong {
    font-weight: 800;
    color: #b45309;
}

/* Challenger grid: DMGP + DMGL when they differ; single DMGP/L line when equal; MVP from landed when present else dmg */
#custom-dialog.custom-dialog--monster-detail .wm-monster-dmg-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}
#custom-dialog.custom-dialog--monster-detail .wm-monster-challenger-dead {
    line-height: 1;
    color: #fff;
    font-size: 16px;
}
#custom-dialog.custom-dialog--monster-detail .wm-monster-challenger-dead .fa-skull-crossbones {
    vertical-align: middle;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-dmg-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 100%;
    text-align: center;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-dmg-text {
    font-size: 10px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-dmg-row--landed {
    margin-top: 1px;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-dmg-landed-text {
    font-size: 9px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-dmg-landed-text.wm-monster-dmg-landed-text--zero,
#custom-dialog.custom-dialog--monster-detail .wm-monster-dmg-text.wm-monster-dmg-text--dmgl-zero {
    color: #b91c1c;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-mvp-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #fff;
    background: linear-gradient(180deg, #f59e0b, #d97706);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Top damage when the wave was lost (Monster Won) — cool grey vs gold when players cleared the boss */
#custom-dialog.custom-dialog--monster-detail .wm-monster-mvp-badge.wm-monster-mvp-badge--monster-won {
    color: #f1f5f9;
    background: linear-gradient(180deg, #64748b, #475569);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Weather (from RPG / world_monsters), above Fortified DMG */
#custom-dialog.custom-dialog--monster-detail .wm-monster-weather-sep {
    margin-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-weather-block {
    padding-top: 10px;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-weather-label {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-weather-name {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-weather-desc {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    line-height: 1.35;
}

/* Fortified DMG: sum(DMGL) minus HP lost from base → current (DMGP if no landed data) */
#custom-dialog.custom-dialog--monster-detail .wm-monster-fortified-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

#custom-dialog.custom-dialog--monster-detail .wm-monster-fortified-row--after-weather {
    border-top: none;
    margin-top: 12px;
    padding-top: 0;
}
#custom-dialog.custom-dialog--monster-detail .wm-monster-fortified-text {
    flex: 1;
    min-width: 0;
}
#custom-dialog.custom-dialog--monster-detail .wm-monster-fortified-label {
    font-size: 11px;
    font-weight: 700;
    color: #020617;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}
#custom-dialog.custom-dialog--monster-detail .wm-monster-fortified-value {
    font-size: 18px;
    font-weight: 800;
    color: #020617;
    line-height: 1.2;
}
#custom-dialog.custom-dialog--monster-detail .wm-monster-fortified-avatar {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #1f2937;
}

/* ── World-map loading overlay ── */
#world-map-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0e17;
    transition: opacity 0.35s ease;
    border-radius: inherit;
}

#world-map-loading-overlay.world-map-loading--done {
    opacity: 0;
    pointer-events: none;
}

.world-map-loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    user-select: none;
}

.world-map-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: #64b4ff;
    border-radius: 50%;
    animation: wmSpinnerSpin 0.8s linear infinite;
}

@keyframes wmSpinnerSpin {
    to { transform: rotate(360deg); }
}

.world-map-loading-text {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.3px;
}

.world-map-loading-bar-track {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.world-map-loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #64b4ff);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Floating "+N Coins" text that rises and fades on mine leave */
/* Giant monster: attack request in flight (% under HP bar) */
.wm-monster-attack-progress {
    position: absolute;
    pointer-events: none;
    z-index: 13010;
    transform: translate(-50%, 0);
    left: 0;
    top: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: 0.02em;
    text-shadow: 0 0 6px #0f172a, 0 1px 2px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
}

.wm-floating-coin-text {
    position: absolute;
    pointer-events: none;
    z-index: 13000;
    transform: translate(-50%, -50%);
    font-family: inherit;
    font-size: 18px;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7), 0 0 12px rgba(251,191,36,0.4);
    white-space: nowrap;
    opacity: 1;
    transition: transform 2s ease-out, opacity 1.8s ease-in;
    will-change: transform, opacity;
}

.wm-floating-coin-text i {
    margin-right: 4px;
    font-size: 16px;
}

.wm-floating-coin-text--animate {
    transform: translate(-50%, -50%) translateY(-80px);
    opacity: 0;
}

/* Giant monster claim rewards — stacked lines, colors aligned with endless-tower / inventory tiers */
.wm-floating-reward-text {
    position: absolute;
    pointer-events: none;
    z-index: 13000;
    transform: translate(-50%, -50%);
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    opacity: 1;
    transition: transform 2s ease-out, opacity 1.85s ease-in;
    will-change: transform, opacity;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.78), 0 0 10px rgba(0, 0, 0, 0.35);
}

.wm-floating-reward-text i {
    margin-right: 5px;
    font-size: 14px;
}

.wm-floating-reward-text--animate {
    transform: translate(-50%, -50%) translateY(-96px);
    opacity: 0;
}

/* Coins — match mine float gold */
.wm-floating-reward-text.wm-float-reward--coin {
    color: #fbbf24;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75), 0 0 12px rgba(251, 191, 36, 0.35);
}

/* Gemstones — match .endless-tower-level-card .level-reward-* */
.wm-floating-reward-text.wm-float-reward--gem-hp {
    color: #2e7d32;
}
.wm-floating-reward-text.wm-float-reward--gem-atk {
    color: #c62828;
}
.wm-floating-reward-text.wm-float-reward--gem-spd {
    color: #f57f17;
}
.wm-floating-reward-text.wm-float-reward--gem-acc {
    color: #ec3981;
}
.wm-floating-reward-text.wm-float-reward--gem-def {
    color: #5d4037;
}
.wm-floating-reward-text.wm-float-reward--gem-nrg {
    color: #0277bd;
}

/* Crystals — match .crystal-inventory-name.level-reward-* */
.wm-floating-reward-text.wm-float-reward--crystal-rare {
    color: #1565c0;
}
.wm-floating-reward-text.wm-float-reward--crystal-epic {
    color: #6a1b9a;
}
.wm-floating-reward-text.wm-float-reward--crystal-legendary {
    color: #996515;
}
.wm-floating-reward-text.wm-float-reward--crystal-mythic {
    color: #b71c1c;
}

.wm-floating-reward-text.wm-float-reward--hero-token {
    color: #a78bfa;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75), 0 0 10px rgba(124, 58, 237, 0.35);
}

/* Top-left mine / monster radar cooldown (DOM, not Phaser) */
.world-map-scan-radar-stack {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

.world-map-scan-radar-stack.world-map-scan-radar-stack--hidden {
    display: none;
}

.world-map-scan-radar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
}

.world-map-bar-meter {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.world-map-bar-meter-label {
    font-family: Oswald, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.world-map-bar-meter-track {
    width: 100px;
    height: 10px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.world-map-bar-meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    /* 4-stop: amber → lime → emerald → deep green */
    background: linear-gradient(
        90deg,
        #facc15 0%,
        #419ad6 33%,
        #22c55e 66%,
        #ec30c4 100%
    );
    transition: width 0.35s ease-out;
}

#monster-bar-meter .world-map-bar-meter-fill {
    /* 4-stop: soft pink → rose → violet → purple */
    background: linear-gradient(
        90deg,
        #fbcfe8 0%,
        #f472b6 33%,
        #e4d830 66%,
        #e63030 100%
    );
}

/* Match #world-map-home-button (bottom bar): size vars + glass circle treatment */
.world-map-scan-ready-btn {
    flex-shrink: 0;
    box-sizing: border-box;
    width: var(--wm-bottom-btn-size);
    height: var(--wm-bottom-btn-size);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.world-map-scan-ready-btn:hover {
    background: rgba(0, 0, 0, 0.68);
    border-color: rgba(255, 255, 255, 0.38);
}

.world-map-scan-ready-btn i {
    font-size: 24px;
}

.world-map-scan-modal-overlay.custom-dialog-overlay {
    z-index: 13001;
}

.world-map-scan-hint {
    margin: 0 0 10px;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.45;
}

.world-map-scan-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}

.world-map-scan-slider-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.world-map-scan-range {
    flex: 1;
    min-width: 0;
    height: 28px;
    cursor: pointer;
}

.world-map-scan-level-readout {
    flex-shrink: 0;
    font-family: Oswald, sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #0f172a;
}
