/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Inter', sans-serif;
    color: #f0f0f0;
    background-color: #1a1a1a;
    overflow: hidden;
}

/* Typography Options */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
}

/* Map Container */
#map {
    width: 100%;
    height: 100%;
    z-index: 1; /* Below the overlays */
}

/* Removed sepia filter from the map tile layer as requested */

/* Glassmorphism Panels */
.glass-panel {
    position: absolute;
    z-index: 1000;
    background: rgba(30, 30, 35, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 12px;
    padding: 15px 25px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Specific Panel Positions */
.title-panel {
    top: 20px;
    left: 20px;
    max-width: 350px;
}

.title-panel h1 {
    font-size: 1.5rem;
    color: #d4af37; /* Gold color */
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.title-panel p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.branding-panel {
    bottom: 25px;
    right: 25px;
    font-size: 0.9rem;
}

.branding-panel strong {
    color: #d4af37;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.branding-panel:hover {
    background: rgba(40, 40, 45, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.5);
    color: #fff;
}

/* Battle Icon Animation */
.battle-icon {
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.5));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.battle-icon:hover {
    transform: scale(1.3);
}

/* Leaflet Popup Override - Dark Glassmorphism */
.leaflet-popup-content-wrapper {
    background: rgba(25, 25, 30, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #f0f0f0;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    padding: 0;
}

.leaflet-popup-tip {
    background: rgba(25, 25, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.leaflet-popup-content {
    margin: 15px;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #d4af37;
    padding: 10px;
    font-size: 20px;
    font-weight: bold;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #fff;
}

/* Custom Popup Content Styling */
.popup-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.popup-header h2 {
    font-family: 'Cinzel', serif;
    color: #d4af37;
    margin: 0 0 5px 0;
    font-size: 1.3rem;
}

.popup-header .rank {
    font-size: 0.8rem;
    background: #d4af37;
    color: #111;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 5px;
}

.popup-details {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.popup-details p {
    margin: 4px 0;
}

.popup-details span.label {
    font-weight: 600;
    color: #aaa;
}

.popup-desc {
    font-size: 0.85rem;
    color: #ccc;
    font-style: italic;
    margin-bottom: 15px;
    max-height: 120px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for popup desc */
.popup-desc::-webkit-scrollbar {
    width: 4px;
}
.popup-desc::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05); 
}
.popup-desc::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5); 
    border-radius: 4px;
}

/* YouTube Button */
.youtube-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #cc0000 0%, #aa0000 100%);
    color: white !important;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3);
}

.youtube-btn svg {
    margin-right: 8px;
    fill: currentColor;
}

.youtube-btn:hover {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(204, 0, 0, 0.5);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .title-panel {
        max-width: 250px;
    }
    .title-panel h1 {
        font-size: 1.2rem;
    }
    .branding-panel {
        bottom: 20px;
        left: 20px; /* Move to left to avoid leaflet controls */
        right: auto;
    }
    .leaflet-popup-content {
        width: 250px !important;
    }
}

/* Battle Labels (Tooltips shown on zoom) */
.battle-label {
    opacity: 0 !important;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background: rgba(25, 25, 30, 0.85);
    color: #e0e0e0;
    border: 1px solid #cc0000;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border-radius: 6px;
    padding: 6px 10px;
    pointer-events: none; /* Let clicks pass through to the marker */
}

/* Make tooltip pointer match */
.battle-label.leaflet-tooltip-top:before {
    border-top-color: #cc0000;
}

/* Show labels when map has show-labels class */
.show-labels .battle-label {
    opacity: 1 !important;
    visibility: visible;
}

/* Popup Image Header */
.popup-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Leaflet Layer Control Dark Glass Theme */
.leaflet-control-layers {
    background: rgba(30, 30, 35, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37) !important;
}
.leaflet-control-layers-expanded {
    padding: 10px 15px !important;
}
.leaflet-control-layers-list label {
    margin-bottom: 5px;
    cursor: pointer;
}
.leaflet-control-layers-selector {
    accent-color: #cc0000;
    margin-right: 8px;
    cursor: pointer;
}
.leaflet-control-layers-separator {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}
