/* ============================
   RESET & BASE
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --topbar-h: 58px;
    --sidebar-w: 360px;
    --bg-app: #0F172A;
    --bg-topbar: #1E293B;
    --bg-sidebar: #1E293B;
    --bg-card: #263248;
    --bg-input: #2D3D55;
    --border: rgba(255,255,255,0.08);
    --text-1: #F1F5F9;
    --text-2: #94A3B8;
    --text-3: #64748B;
    --accent: #6366F1;
    --accent-hover: #4F46E5;
    --success: #10B981;
    --danger: #EF4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --transition: all 0.2s ease;
}

html, body { height: 100%; overflow: hidden; font-family: 'Outfit', sans-serif; background: var(--bg-app); color: var(--text-1); }

.hidden { display: none !important; }

/* ============================
   TOP BAR
   ============================ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    z-index: 2000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-1);
    white-space: nowrap;
    min-width: auto;
}
@media (max-width: 768px) {
    .topbar-brand .brand-text { display: none; }
    .topbar-brand { min-width: auto; }
}
.brand-text {
    background: linear-gradient(135deg, #6366F1, #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-icon {
    -webkit-text-fill-color: #A78BFA;
    font-size: 1.4rem;
}
.version-tag {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-3);
    margin-left: 0.35rem;
    padding-top: 0.2rem;
    letter-spacing: 0.02em;
}
.storage-warning-icon {
    color: var(--danger);
    font-size: 1.1rem;
    margin-left: 0.5rem;
    cursor: help;
    animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.5)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(239, 68, 68, 0)); }
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}
@media (max-width: 1024px) {
    .topbar-center { display: none; } /* Ocultar filtros en el centro en tablets/móvil */
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-2);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.filter-chip:has(select:focus),
.filter-chip:hover {
    border-color: var(--accent);
    color: var(--text-1);
    background: rgba(99,102,241,0.15);
}
.filter-chip > i { color: var(--text-3); font-size: 1rem; pointer-events: none; }
.filter-chip select {
    appearance: none;
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    max-width: 160px;
}
.filter-chip select option { background: #1E293B; color: var(--text-1); }
.chip-caret { font-size: 0.75rem; pointer-events: none; }

/* Custom Dropdown Filters */
.custom-dropdown-wrap { position: relative; cursor: pointer; user-select: none; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px;
    background: var(--bg-topbar); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 0.5rem;
    box-shadow: var(--shadow-lg); z-index: 3000; display: flex; flex-direction: column; gap: 4px;
    max-height: 350px; overflow-y: auto; text-align: left; cursor: default;
}
.dropdown-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px;
    border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--text-2); cursor: pointer; transition: var(--transition);
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.dropdown-item input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; width: 14px; height: 14px; }
.dropdown-label-content { display: flex; align-items: center; gap: 0.45rem; flex: 1; }

/* Date filter inside dropdown */
.date-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.4rem 0.3rem;
}
.date-filter-label {
    font-size: 0.75rem;
    color: var(--text-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.date-filter-input {
    padding: 0.5rem 0.7rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}
.date-filter-input:focus { border-color: var(--accent); background: rgba(99,102,241,0.08); }
.date-filter-input::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    justify-content: flex-end;
}



/* ============================
   ICON BUTTONS
   ============================ */
.btn-icon-ghost {
    background: transparent;
    border: none;
    color: var(--text-2);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-icon-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-1); }


/* ============================
   MAIN BODY
   ============================ */
.app-body {
    position: fixed;
    top: var(--topbar-h);
    left: 0; right: 0; bottom: 0;
    display: flex;
}


/* ============================
   MAPA
   ============================ */
#map-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#map { width: 100%; height: 100%; }

/* Stats flotantes sobre el mapa */
.map-stats {
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    z-index: 500;
    display: flex;
    gap: 0.5rem;
    pointer-events: none;
}
@media (max-width: 768px) {
    .map-stats {
        bottom: 1.25rem;
        left: 0.5rem;
        right: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem;
    }
    .stat-chip { padding: 0.25rem 0.6rem; font-size: 0.7rem; }
}
.stat-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15,23,42,0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 100px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: var(--text-1);
    font-weight: 500;
}
.stat-chip i { color: var(--accent); font-size: 1rem; }


/* ============================
   SIDEBAR
   ============================ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar.collapsed {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: var(--topbar-h);
        right: 0;
        bottom: 0;
        width: 100% !important;
        z-index: 2100;
        border-left: none;
        background: var(--bg-sidebar);
        transition: transform 0.3s ease-out, opacity 0.3s ease;
    }
    .sidebar-inner { width: 100%; }
    .sidebar.collapsed { 
        transform: translateX(100%); 
        opacity: 0; 
        width: 100% !important;
        display: none;
    }
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: var(--sidebar-w);
    overflow: hidden;
}

.sidebar-section { padding: 1.25rem; }
.feed-section { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 0.9rem;
}
.sidebar-section-title i { font-size: 1rem; }

.user-tag {
    background: rgba(99,102,241,0.2);
    color: var(--accent);
    border-radius: 100px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}

.entry-count {
    background: var(--bg-card);
    color: var(--text-2);
    border-radius: 100px;
    padding: 0.1rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0 1.25rem;
}


/* ============================
   SEARCH / AUTOCOMPLETE
   ============================ */
.search-box { position: relative; }

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus { border-color: var(--accent); background: rgba(99,102,241,0.08); }
.search-box input:disabled { opacity: 0.5; cursor: not-allowed; }

.search-spinner {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.1rem;
}

.hint-text {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-top: 0.5rem;
    padding-left: 0.2rem;
}

#suggestions-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; width: 100%;
    background: #1A2740;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 230px;
    overflow-y: auto;
    z-index: 3000;
    list-style: none;
    padding: 0.4rem;
}
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.9rem;
}
.suggestion-item:hover { background: rgba(99,102,241,0.2); }
.suggestion-main { color: var(--text-1); font-weight: 500; flex: 1; }
.suggestion-sub { color: var(--text-3); font-size: 0.78rem; white-space: nowrap; }
.suggestion-icon { color: var(--text-3); font-size: 1rem; flex-shrink: 0; }


/* ============================
   PLACES LIST (FEED)
   ============================ */
#places-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.place-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.8rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}
.place-item:hover { transform: translateX(-3px); border-color: rgba(255,255,255,0.18); }

.place-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

.place-info { flex: 1; min-width: 0; }
.place-name { font-weight: 600; font-size: 0.95rem; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-meta { font-size: 0.75rem; color: var(--text-3); margin-top: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.place-delete {
    background: transparent;
    border: none;
    color: var(--text-3);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    opacity: 0;
}
.place-item:hover .place-delete { opacity: 1; }
.place-delete:hover { background: rgba(239,68,68,0.2); color: var(--danger); }

.empty-feed {
    text-align: center;
    color: var(--text-3);
    font-size: 0.9rem;
    padding: 2rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}
.empty-feed i { display: block; font-size: 2.5rem; margin-bottom: 0.8rem; color: var(--text-3); }


/* ============================
   MODALS
   ============================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 5000;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6000;
    background: #1E293B;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: calc(100vw - 2rem);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 480px) {
    .modal {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        top: 0; left: 0;
        transform: none;
        border-radius: 0;
        animation: modalMobileIn 0.3s ease-out;
    }
    @keyframes modalMobileIn {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
}

@keyframes modalIn {
    from { transform: translate(-50%, -48%) scale(0.95); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 1.15rem; font-weight: 600; }

.modal-body { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1.2rem; }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-size: 0.85rem; color: var(--text-2); font-weight: 500; }
.form-group input[type="text"] {
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}
.form-group input[type="text"]:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }

.form-group textarea {
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    resize: none;
}

/* Lista de fechas en el modal */
.dates-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.date-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.date-row input[type="date"] {
    flex: 1;
    padding: 0.6rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-family: inherit;
    outline: none;
}
.date-row input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Lista de participantes en el modal */
.participants-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
    padding: 0.4rem 0;
}
.participant-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}
.participant-item:hover { border-color: var(--accent); background: rgba(99,102,241,0.08); }
.participant-item.selected { border-color: var(--accent); background: rgba(99,102,241,0.15); }

.participant-item input { display: none; }
.participant-item .mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
}
.participant-item span { font-size: 0.85rem; font-weight: 500; color: var(--text-2); }
.participant-item.selected span { color: var(--text-1); }

/* Paleta de colores */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: var(--transition);
    position: relative;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: white; box-shadow: 0 0 0 2px var(--accent); }
.color-swatch.taken { opacity: 0.25; cursor: not-allowed; }
.color-swatch.taken::after {
    content: '✕';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    font-weight: 700;
}

input[type="color"] {
    -webkit-appearance: none;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    width: 48px;
    height: 32px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
input[type="color"]:focus { border-color: var(--accent); }

/* Modal Buttons */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.35); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-2);
    border: 1px solid var(--border);
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.2); color: var(--text-1); }

.btn-danger-outline {
    width: 100%;
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.4);
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    transition: var(--transition);
}
.btn-danger-outline:hover { background: rgba(239,68,68,0.1); border-color: var(--danger); }

/* ============================
   LEAFLET OVERRIDES
   ============================ */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-md) !important;
}
.leaflet-control-zoom a {
    background: #1E293B !important;
    color: var(--text-1) !important;
    border-color: var(--border) !important;
    font-size: 1.1rem !important;
    line-height: 28px !important;
}
.leaflet-control-zoom a:hover { background: var(--bg-card) !important; color: white !important; }
.leaflet-popup-content-wrapper {
    background: #1A2740 !important;
    color: var(--text-1) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-md) !important;
}
.leaflet-popup-content {
    margin: 12px 16px !important;
    line-height: 1.4 !important;
}
.leaflet-popup-content .btn-primary {
    margin-top: 8px;
    font-size: 0.85rem;
    height: 34px;
}
.leaflet-popup-tip { background: #1A2740 !important; }
.leaflet-popup-close-button { color: var(--text-2) !important; }
.leaflet-control-attribution { background: rgba(15,23,42,0.7) !important; color: var(--text-3) !important; backdrop-filter: blur(4px); border-radius: 8px 0 0 0 !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }

/* Custom Marker */
.custom-leaflet-div-icon {
    width: 0 !important;
    height: 0 !important;
}

.tt-marker-wrapper {
    position: absolute;
    bottom: 0px; 
    left: 0px;
    transform: translateX(-50%);
    white-space: nowrap;
    padding-bottom: 4px;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tt-marker-pill {
    display: flex;
    height: 38px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border-radius: 100px;
    border: 3px solid white;
    overflow: hidden;
    align-items: stretch;
}

.conic-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.conic-inner {
    background: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1E293B;
    font-weight: 800;
    font-size: 0.95rem;
}

/* ============================
   STATS DASHBOARD
   ============================ */
.stats-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-input);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-2);
    padding: 0.6rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.tab-btn:hover { color: var(--text-1); }
.tab-btn.active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}
.stat-card i { font-size: 1.5rem; color: var(--accent); opacity: 0.8; }
.stat-val { font-size: 1.75rem; font-weight: 800; color: var(--text-1); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.stats-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stats-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.stat-row-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
}
.stat-bar-bg {
    height: 8px;
    background: var(--bg-input);
    border-radius: 100px;
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
}

.explorer-stats-panel {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.world-progress {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(167,139,250,0.1));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}
.world-progress-val { font-size: 2.5rem; font-weight: 800; color: var(--accent); }
.world-progress-label { font-size: 0.85rem; color: var(--text-2); margin-top: 0.25rem; }

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
}

.pill-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 100%;
    padding: 0 8px;
    color: white;
    font-weight: 800;
    font-size: 0.95rem;
    flex: 1;
}
.pill-segment.single {
    width: 32px;
    padding: 0;
}

@keyframes markerDrop {
    from { transform: translateY(-25px) scale(0.4); opacity: 0; }
    to   { transform: translateY(0)     scale(1);   opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
