/* ============================================
   Mapa Historico — Historical Map with Playback
   Video-player UX: all controls overlay the map
   ============================================ */

/* ---- Map Container (full-bleed) ---- */
.hmap-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    border-top: 3px solid var(--color-border);
    border-bottom: 3px solid var(--color-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
#hmap-map {
    width: 100%;
    height: 82vh;
    min-height: 550px;
    max-height: 850px;
    z-index: 1;
    background: var(--color-cream);
}

/* ---- Period Filter Pills (above the map) ---- */
.hmap-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.hmap-filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-brown-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.hmap-filter-pill {
    padding: 0.35rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 20px;
    border: 2px solid var(--color-border);
    background: transparent;
    color: var(--color-brown);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.hmap-filter-pill:hover {
    background: var(--color-cream);
    border-color: #b8a88e;
}
.hmap-filter-pill.active {
    color: #fff;
    border-color: transparent;
}

/* ============================================
   PLAYBACK BAR — overlays bottom of the map
   Like a video player control bar
   ============================================ */
.hmap-playback {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1.2rem;
    background: rgba(20, 15, 10, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
}

.hmap-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--color-gold);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.hmap-play-btn:hover {
    background: var(--color-gold-dark);
    transform: scale(1.08);
}
.hmap-play-btn.playing {
    background: #B22222;
}

.hmap-event-counter {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
}

.hmap-scrubber-wrap {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    position: relative;
}
.hmap-scrubber {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.hmap-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-gold);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.15s;
}
.hmap-scrubber::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}
.hmap-scrubber::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-gold);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    cursor: pointer;
}
.hmap-scrubber-dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    pointer-events: none;
}
.hmap-scrubber-dot {
    position: absolute;
    top: -1px;
    width: 4px;
    height: 8px;
    border-radius: 1px;
    background: rgba(255,255,255,0.45);
    transform: translateX(-50%);
    pointer-events: none;
}
.hmap-scrubber-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}

.hmap-speed-group {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}
.hmap-speed-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 5px;
    border: 1.5px solid rgba(255,255,255,0.25);
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.hmap-speed-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.hmap-speed-btn.active {
    background: var(--color-gold);
    color: #fff;
    border-color: var(--color-gold);
}

/* ============================================
   EVENT CARD — floating overlay, bottom-left,
   sits ABOVE the playback bar
   ============================================ */
.hmap-event-card {
    position: absolute;
    bottom: 65px;
    left: 16px;
    z-index: 1001;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: rgba(255,255,255,0.96);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    border-left: 5px solid var(--color-gold);
    overflow: hidden;
    display: none;
    animation: hmapCardIn 0.35s ease;
}
.hmap-event-card.visible {
    display: block;
}

.hmap-event-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.hmap-event-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.hmap-event-card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--color-heading);
    font-weight: bold;
    margin: 0;
    line-height: 1.25;
}
.hmap-event-card-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    color: #fff;
    margin-top: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hmap-event-card-body {
    padding: 0.6rem 1rem 0.8rem;
}
.hmap-event-card-desc {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.55;
    margin-bottom: 0.5rem;
}
.hmap-event-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.hmap-event-card-verse {
    font-size: 0.78rem;
    color: var(--color-muted);
    font-style: italic;
    font-weight: 600;
}
.hmap-event-card-duration {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 12px;
    background: var(--color-cream-dark);
    color: var(--color-brown);
}
.hmap-event-card-people {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}
.hmap-person-tag {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 12px;
    background: var(--color-cream-dark);
    color: var(--color-brown);
    border: 1px solid var(--color-border);
}

.hmap-event-card-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--color-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem;
    transition: color 0.15s;
}
.hmap-event-card-close:hover {
    color: var(--color-heading);
}

/* ============================================
   YEAR + EVENT TITLE LABEL — top-left overlay
   ============================================ */
.hmap-year-label {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1000;
    background: rgba(20, 15, 10, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    pointer-events: none;
    display: none;
    animation: hmapFadeIn 0.3s ease;
    max-width: 340px;
}
.hmap-year-label.visible {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.hmap-year-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: bold;
    white-space: nowrap;
}
.hmap-year-event-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    line-height: 1.3;
}

/* ---- Custom Markers ---- */
/* IMPORTANT: Do NOT transition 'transform' — Leaflet uses CSS transform
   to position markers. Transitioning it makes markers "fly" across the map
   during panning. Only transition opacity and box-shadow. */
.hmap-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    font-size: 14px;
    text-align: center;
    line-height: 1;
    transition: opacity 0.4s ease, box-shadow 0.3s ease;
    opacity: 0;
}
.hmap-marker.visible {
    opacity: 1;
}
.hmap-marker.active {
    z-index: 1000 !important;
    box-shadow: 0 0 0 4px var(--color-gold, #c8a44e), 0 4px 16px rgba(0,0,0,0.3);
}
.hmap-marker:hover {
    z-index: 1000 !important;
    box-shadow: 0 0 0 3px var(--color-gold, #c8a44e), 0 3px 12px rgba(0,0,0,0.3);
}

/* Marker type backgrounds */
.hmap-marker-city       { background: #8B6914; }
.hmap-marker-mountain   { background: #6B8E23; }
.hmap-marker-water      { background: #4682B4; }
.hmap-marker-battle     { background: #B22222; }
.hmap-marker-miracle    { background: #9B59B6; }
.hmap-marker-altar      { background: #D4A017; }
.hmap-marker-home       { background: #8B4513; }
.hmap-marker-garden     { background: #228B22; }
.hmap-marker-camp       { background: #CD853F; }
.hmap-marker-well       { background: #5B9BD5; }
.hmap-marker-destruction{ background: #DC143C; }
.hmap-marker-star       { background: #FFD700; color: #333; }
.hmap-marker-fire       { background: #FF6347; }
.hmap-marker-oasis      { background: #3CB371; }
.hmap-marker-palace     { background: #8B4789; }

/* ---- Water Body Labels ---- */
.hmap-water-label-wrapper {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}
.hmap-water-label {
    color: #1a5e8a;
    font-style: italic;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.7;
    text-shadow:
        1px 1px 2px rgba(255,255,255,0.9),
        -1px -1px 2px rgba(255,255,255,0.9),
        0 0 4px rgba(255,255,255,0.6);
    font-family: Georgia, 'Times New Roman', serif;
}

/* ---- Popup ---- */
.hmap-popup .leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    padding: 0;
    overflow: hidden;
}
.hmap-popup .leaflet-popup-content {
    margin: 0;
    min-width: 220px;
    max-width: 300px;
}
.hmap-popup-header {
    background: linear-gradient(135deg, var(--color-brown-dark), var(--color-brown));
    color: var(--color-gold);
    padding: 0.6rem 1rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: bold;
}
.hmap-popup-body {
    padding: 0.6rem 1rem;
}
.hmap-popup-desc {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: 0.3rem;
}
.hmap-popup-verse {
    font-size: 0.78rem;
    color: var(--color-muted);
    font-style: italic;
}

/* ---- Events List Below Map ---- */
.hmap-events-list {
    margin-top: 1.5rem;
}
.hmap-events-list h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-heading);
    margin-bottom: 1rem;
}

.hmap-event-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    background: var(--color-card-bg);
    border-radius: 10px;
    margin-bottom: 0.6rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border-left: 4px solid var(--color-gold);
    cursor: pointer;
    transition: all 0.2s;
}
.hmap-event-row:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateX(3px);
}
.hmap-event-row.active {
    border-left-width: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.hmap-event-row.dimmed {
    opacity: 0.4;
}

.hmap-event-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.hmap-event-row-info {
    flex: 1;
    min-width: 0;
}
.hmap-event-row-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0 0 0.15rem;
}
.hmap-event-row-verse {
    font-size: 0.8rem;
    color: var(--color-muted);
    font-style: italic;
}

.hmap-event-row-year {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-brown-light);
    white-space: nowrap;
}

/* ---- Legend ---- */
.hmap-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.8rem 1.2rem;
    background: var(--color-card-bg);
    border-top: 2px solid var(--color-border);
    font-size: 0.85rem;
}
.hmap-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-brown-light);
}
.hmap-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ============================================
   LAYERS PANEL — "Capas" button + tile switcher
   Same as book maps (Moderno/Satelite/Terreno/Antiguo)
   ============================================ */
.hmap-layers-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: all 0.2s;
    font-family: var(--font-body);
}
.hmap-layers-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}

.hmap-layers-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1002;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    width: 270px;
    max-height: calc(100% - 60px);
    overflow-y: auto;
    display: none;
}
.hmap-layers-panel.open {
    display: block;
}
.hmap-layers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #e8e8e8;
    font-weight: 700;
    font-size: 0.88rem;
    color: #333;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 10px 10px 0 0;
}
.hmap-layers-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #aaa;
    padding: 0 0.1rem;
    line-height: 1;
    transition: color 0.15s;
}
.hmap-layers-close:hover {
    color: #333;
}
.hmap-layers-section {
    padding: 0.6rem 0.9rem;
}
.hmap-layers-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #999;
    font-weight: 700;
    margin-bottom: 0.45rem;
}
.hmap-tile-options {
    display: flex;
    gap: 0.3rem;
}
.hmap-tile-option {
    flex: 1;
    padding: 0.4rem 0.2rem;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    background: #f9f9f9;
    color: #555;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.hmap-tile-option.active {
    background: var(--color-gold);
    color: #fff;
    border-color: var(--color-gold);
}
.hmap-tile-option:hover:not(.active) {
    background: #eee;
    border-color: #ccc;
}

/* ---- Route Travel Info Label ---- */
.hmap-route-label {
    position: absolute;
    top: 55px;
    right: 16px;
    z-index: 1000;
    background: rgba(20, 15, 10, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    pointer-events: none;
    display: none;
    animation: hmapSlideIn 0.35s ease;
    max-width: 300px;
    border-left: 3px solid var(--color-gold);
}
.hmap-route-label.visible {
    display: block;
}
.hmap-route-label-name {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
}
.hmap-route-label-travel {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
    font-style: italic;
}
.hmap-route-label-icon {
    display: inline-block;
    margin-right: 0.3rem;
    font-size: 0.85rem;
}

/* ---- Animations ---- */
@keyframes hmapCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes hmapFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes hmapSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes hmapPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 164, 78, 0.5); }
    50% { box-shadow: 0 0 0 10px rgba(200, 164, 78, 0); }
}
.hmap-marker.pulse {
    animation: hmapPulse 1.5s ease infinite;
}

/* ---- Responsive: Tablet ---- */
@media (max-width: 900px) {
    #hmap-map { height: 72vh; min-height: 450px; max-height: 700px; }
    .hmap-event-card { width: 280px; bottom: 60px; left: 12px; }
    .hmap-event-card-title { font-size: 0.95rem; }
    .hmap-event-card-desc { font-size: 0.85rem; }
    .hmap-playback { gap: 0.5rem; padding: 0.5rem 1rem; }
    .hmap-play-btn { width: 36px; height: 36px; font-size: 15px; }
    .hmap-year-label { max-width: 280px; }
    .hmap-route-label { max-width: 240px; top: 55px; right: 12px; }
    .hmap-layers-panel { width: 240px; }
    .hmap-layers-btn { top: 10px; right: 10px; }
}

/* ---- Responsive: Mobile ---- */
@media (max-width: 500px) {
    #hmap-map { height: 65vh; min-height: 380px; max-height: 550px; }

    /* Event card goes full width above playback */
    .hmap-event-card {
        width: calc(100% - 20px);
        max-width: none;
        bottom: 56px;
        left: 10px;
        right: 10px;
        border-radius: 10px;
    }
    .hmap-event-card-header { padding: 0.6rem 0.8rem; gap: 0.5rem; }
    .hmap-event-card-icon { width: 34px; height: 34px; font-size: 14px; }
    .hmap-event-card-title { font-size: 0.9rem; }
    .hmap-event-card-body { padding: 0.5rem 0.8rem 0.6rem; }
    .hmap-event-card-desc { font-size: 0.82rem; }

    /* Playback bar compact */
    .hmap-playback { gap: 0.35rem; padding: 0.45rem 0.7rem; }
    .hmap-play-btn { width: 32px; height: 32px; font-size: 13px; }
    .hmap-event-counter { font-size: 0.7rem; min-width: 42px; }
    .hmap-speed-btn { padding: 0.2rem 0.4rem; font-size: 0.65rem; }
    .hmap-scrubber-labels { font-size: 0.55rem; }

    /* Year label */
    .hmap-year-label { max-width: 220px; padding: 0.4rem 0.7rem; }
    .hmap-year-text { font-size: 1rem; }
    .hmap-year-event-name { font-size: 0.72rem; }

    /* Route label */
    .hmap-route-label { max-width: 180px; top: 50px; right: 10px; padding: 0.4rem 0.7rem; }
    .hmap-route-label-name { font-size: 0.78rem; }
    .hmap-route-label-travel { font-size: 0.68rem; }

    /* Layers */
    .hmap-layers-panel { width: 220px; max-height: calc(100% - 30px); }
    .hmap-layers-btn { top: 8px; right: 8px; padding: 0.4rem 0.6rem; font-size: 0.8rem; }

    /* Filters */
    .hmap-filters { gap: 0.35rem; }
    .hmap-filter-pill { padding: 0.25rem 0.6rem; font-size: 0.75rem; }

    /* Event rows */
    .hmap-event-row { padding: 0.7rem 0.9rem; gap: 0.7rem; }
    .hmap-event-row-icon { width: 30px; height: 30px; font-size: 13px; }
    .hmap-event-row-title { font-size: 0.88rem; }
}

/* ---- Dark Mode ---- */
[data-theme="dark"] .hmap-playback {
    background: rgba(15, 10, 5, 0.88);
}
[data-theme="dark"] .hmap-scrubber {
    background: rgba(255,255,255,0.12);
}
[data-theme="dark"] .hmap-speed-btn {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
}
[data-theme="dark"] .hmap-speed-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
[data-theme="dark"] .hmap-filter-pill:hover {
    background: #352a1e;
    border-color: #4d4035;
}
[data-theme="dark"] .hmap-event-card {
    background: rgba(30, 24, 18, 0.96);
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
[data-theme="dark"] .hmap-event-card-header {
    border-bottom-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .hmap-event-card-close {
    color: #908878;
}
[data-theme="dark"] .hmap-event-card-close:hover {
    color: #ddd0c0;
}
[data-theme="dark"] .hmap-event-card-duration {
    background: #2a2018;
    color: #c0b098;
}
[data-theme="dark"] .hmap-person-tag {
    background: #2a2018;
    color: #c0b098;
    border-color: #3d3025;
}
[data-theme="dark"] .hmap-year-label {
    background: rgba(10, 8, 5, 0.85);
}
[data-theme="dark"] .hmap-route-label {
    background: rgba(10, 8, 5, 0.88);
}
[data-theme="dark"] .hmap-layers-btn {
    background: #2a2018;
    color: #ddd0c0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
[data-theme="dark"] .hmap-layers-btn:hover {
    background: #352a1e;
}
[data-theme="dark"] .hmap-layers-panel {
    background: #241c14;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
[data-theme="dark"] .hmap-layers-header {
    background: #241c14;
    color: #ddd0c0;
    border-bottom-color: #3d3025;
}
[data-theme="dark"] .hmap-layers-close {
    color: #908878;
}
[data-theme="dark"] .hmap-layers-close:hover {
    color: #ddd0c0;
}
[data-theme="dark"] .hmap-layers-section {
    border-bottom-color: #3d3025;
}
[data-theme="dark"] .hmap-layers-section-title {
    color: #908878;
}
[data-theme="dark"] .hmap-tile-option {
    background: #1a1410;
    color: #c0b098;
    border-color: #3d3025;
}
[data-theme="dark"] .hmap-tile-option:hover:not(.active) {
    background: #2a2018;
    border-color: #4d4035;
}
[data-theme="dark"] .hmap-marker {
    border-color: #1a1410;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
[data-theme="dark"] .hmap-water-label {
    color: #5b9bd5;
    text-shadow:
        1px 1px 3px rgba(0,0,0,0.8),
        -1px -1px 3px rgba(0,0,0,0.8);
}
[data-theme="dark"] .hmap-popup .leaflet-popup-content-wrapper {
    background: #241c14;
    color: #ddd0c0;
}
[data-theme="dark"] .hmap-popup .leaflet-popup-tip {
    background: #241c14;
}
[data-theme="dark"] .hmap-popup-desc { color: #ddd0c0; }
[data-theme="dark"] .hmap-popup-verse { color: #908878; }
[data-theme="dark"] .hmap-event-row {
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
[data-theme="dark"] .hmap-event-row:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
[data-theme="dark"] .hmap-legend {
    border-top-color: var(--color-border);
}
[data-theme="dark"] .hmap-legend-item { color: #c0b098; }
[data-theme="dark"] .hmap-legend-dot { border-color: #1a1410; }
