* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

.header {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    position: relative;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.level-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-selector label {
    font-weight: 500;
    color: #fff;
}

#level-select {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#level-select:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.toggle-controls {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #fff;
    border-radius: 25px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.toggle-btn.active {
    background: #ffd700;
    color: #333;
    border-color: #ffd700;
}

.toggle-btn .icon {
    font-size: 16px;
}

.zoom-controls {
    display: flex;
    gap: 5px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.map-container {
    height: calc(100vh - 80px);
    position: relative;
    overflow: hidden;
    background: #000;
}

.map-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    position: relative;
}

.map-viewport:active {
    cursor: grabbing;
}

.map-wrapper {
    position: relative;
    transform-origin: top left;
    transition: transform 0.01s ease;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

#map-image {
    display: block;
    max-width: none;
    user-select: none;
    pointer-events: none;
	/* prevent all native dragging of the image */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    user-drag: none;
}

.markers-layer {
    position: absolute;
    top: -24px;
    left: -30px;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.quest-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    background: #ffd700;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.quest-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6);
}

.quest-marker::before {
    content: '!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.creature-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    /**border: 2px solid #ff4444;
    border-radius: 4px;*/
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    /**background: rgba(255, 68, 68, 0.2);
    backdrop-filter: blur(2px);*/
}

.creature-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    /*border-color: #ff6666;
    background: rgba(255, 68, 68, 0.7);*/
}

.creature-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 15px;
    max-width: 300px;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-title {
    color: #ffd700;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.tooltip-images {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tooltip-images img {
    width: 40px;
    height: 40px;
    border: 1px solid #666;
    border-radius: 4px;
    object-fit: cover;
}

.tooltip-description {
    color: #ccc;
    font-size: 14px;
    line-height: 1.4;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #ffd700;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #fff;
    font-size: 16px;
}

.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .map-container {
        height: calc(100vh - 120px);
    }
    
    .tooltip {
        max-width: 250px;
        font-size: 12px;
    }
}


/* Enhanced Creature Marker Styles */
.creature-marker {
    /*position: relative;*/
    cursor: pointer;
    z-index: 100;
}

.creature-main-image {
    width: 32px;
    height: 32px;
    /*border: 2px solid #ff6b35;*/
    /*border-radius: 4px;*/
    /*background: rgba(0, 0, 0, 0.8);*/
    display: block;
}

.creature-plus-symbol {
    position: absolute;
    top: 5px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #ff0000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.creature-expanded-view {
    position: absolute;
    top: 2px;
    left: 28px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff6b35;
    border-radius: 8px;
    padding: 4px;
    display: none;
    flex-direction: column;
	align-items: center;
    gap: 4px;
    /*box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);*/
    z-index: 9999 !important;
	pointer-events: auto;
    white-space: nowrap;
}

.creature-expanded-view::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #ff0000;
}

.creature-item {
    position: relative;
    width: 24px;
    height: 24px;
    /*border: 1px solid #ff6b35;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.8);*/
    overflow: visible;
    transition: transform 0.2s ease;
}

.creature-item:hover {
    transform: scale(1.2);
    z-index: 300;
    /*border-color: #ffd700;*/
}

.creature-small-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.creature-marker.expanded .creature-main-image {
    /*border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);*/
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .creature-expanded-view {
        left: -50px;
        top: 40px;
        flex-direction: row;
        max-width: 200px;
        flex-wrap: wrap;
    }
    
    .creature-expanded-view::before {
        top: -8px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid #ff0000;
        border-top: none;
    }
}


#map-image {
    user-select: none; /* Standard */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE/Edge */
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-drag: none; /* Webkit browsers */
}

/* Forçar tamanho fixo de 24x24 em todas as imagens de criaturas */
.creature-marker img,
.creature-main-image,
.creature-small-image {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
}

/* Correção específica para mostrar nomes acima de criaturas expandidas */
.creature-name-label {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    color: #ffed00;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
	text-shadow: 0.5px 0.5px 0px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 999;
}

/* Ativa exibição quando o mouse está sobre o marcador principal */
.creature-marker:hover .creature-name-label,
.creature-marker.expanded .creature-name-label {
    opacity: 1;
}

/* Nomes das criaturas pequenas (dentro do "+") com fonte menor */
.creature-expanded-view .creature-name-label {
    font-size: 8px;
    transform: translateX(-50%) translateY(14px);
}