/* Video Map Page Styles */

/* Flip Container */
.flip-container {
    position: relative;
    width: 100%;
    height: 700px;
    perspective: 2000px;
    margin: 20px 0;
    overflow: hidden;
}

.flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1.000);
}

.flip-container.flipped .flipper {
    transform: rotateY(180deg);
}

.flip-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-front {
    z-index: 2;
}

.flip-back {
    transform: rotateY(180deg);
    overflow: hidden;
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 2px solid #333;
}

/* Video Player Side */
.video-player-side {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    background: #1a1a1a;
    border-radius: 12px;
    border: 2px solid #333;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

.video-player-side::-webkit-scrollbar {
    width: 8px;
}

.video-player-side::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.video-player-side::-webkit-scrollbar-thumb {
    background: #ff0000;
    border-radius: 4px;
}

.video-player-side::-webkit-scrollbar-thumb:hover {
    background: #cc0000;
}

.flip-back-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff0000;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.flip-back-btn:hover {
    background: #ff0000;
    transform: scale(1.05);
}

.video-player-content {
    padding: 60px 20px 20px 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.video-player-content * {
    max-width: 100%;
    box-sizing: border-box;
}

.video-player-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.4;
}

.video-js {
    width: 100%;
    max-width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.video-stats-social-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
    gap: 16px;
    flex-wrap: wrap;
}

.social-share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    color: #fff;
}

.share-btn.whatsapp { background: #25D366; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.instagram { background: #E4405F; }
.share-btn.telegram { background: #0088cc; }
.share-btn.copylink { background: #666; }

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.video-stats-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.views-count {
    color: #bbb;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-votes {
    display: flex;
    gap: 12px;
    align-items: center;
}

.posted-date-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #c9c9c9;
    font-size: 14px;
    white-space: nowrap;

    .video-player-title-wrap {
        position: relative;
        flex: 1;
        min-width: 0;
    }
    font-family: 'BulletproofBB', system-ui, sans-serif !important;
    text-transform: uppercase;
}

.posted-date-label span {
    font-family: 'BulletproofBB', system-ui, sans-serif !important;
}

.posted-date-label i {
    font-size: 14px;
        cursor: pointer;
}

    .video-player-title-tooltip {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        max-width: min(92vw, 760px);
        background: rgba(12, 12, 12, 0.96);
        border: 1px solid rgba(255, 0, 0, 0.35);
        color: #f2f2f2;
        font-size: 13px;
        line-height: 1.4;
        padding: 10px 12px;
        border-radius: 8px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
        z-index: 1400;
        pointer-events: none;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .video-player-title-tooltip.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    @media (max-width: 768px) {
        .video-player-title-tooltip {
            max-width: calc(100vw - 22px);
            font-size: 12px;
            padding: 8px 10px;
            right: 0;
        }
    }

    html[data-theme="light"] .video-player-title-tooltip {
        background: rgba(255, 255, 255, 0.98);
        border-color: rgba(204, 0, 0, 0.38);
        color: #1f1f1f;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    }

    .vote-btn {
        padding: 8px 16px;
        background: #1a1a1a;
        border: 1px solid #333;
        border-radius: 6px;
        color: #e0e0e0;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 14px;
        transition: all 0.2s;
    }

.vote-btn:hover:not(:disabled) {
    border-color: #ff0000;
    background: #111;
}

.vote-btn.up.voted {
    background: #1a4d1a;
    border-color: #2d7a2d;
    color: #7fff7f;
}

.vote-btn.down.voted {
    background: #4d1a1a;
    border-color: #7a2d2d;
    color: #ff7f7f;
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 18px;
    color: #ff0000;
}

.bookmark-btn:hover {
    background: rgba(255, 0, 0, 0.1);
}

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

.bookmark-btn.favorited {
    color: #ffd700;
}

.bookmark-btn.favorited:hover {
    color: #ffed4e;
}

.video-description {
    color: #e6e6e6;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.video-description .description-content {
    display: block;
    white-space: normal;
}

.video-description .show-more-btn {
    background: none;
    border: none;
    color: #ff0000;
    cursor: pointer;
    font: inherit;
    padding: 0;
    margin-left: 2px;
    font-weight: inherit;
    text-decoration: none;
}

.video-description .show-more-btn:hover {
    text-decoration: none;
    color: #ff0000;
}
.desc-extra-block { display:none; }
.desc-extra-block.desc-open { display:inline; animation:fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.desc-ellipsis { white-space:nowrap; }

.stats-separator {
    height: 1px;
    background: linear-gradient(to right, #000, #ff0000 50%, #000);
    margin: 16px 0;
}

.show-comments-btn {
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin: 16px 0;
}

.show-comments-btn:hover {
    border-color: #ff0000;
    background: #111;
}

.show-comments-btn.active {
    background: #1a0000;
    border-color: #ff0000;
}


.leaflet-popup-content-wrapper {
    background: #1a1a1a;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 250px;
}

.video-popup {
    padding: 12px;
}

.video-popup-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.video-popup-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #fff;
}

.map-premium-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    vertical-align: middle;
}

.map-premium-lock--locked {
    color: #ff3b30;
    text-shadow: 0 0 8px rgba(255, 59, 48, 0.35);
}

.map-premium-lock--unlocked {
    color: #26d765;
    text-shadow: 0 0 8px rgba(38, 215, 101, 0.35);
}

.map-premium-lock i {
    font-size: 0.95em;
    line-height: 1;
}

.video-popup-location {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-popup-views {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-popup-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #ff0000;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.video-popup-btn:hover {
    background: #cc0000;
}

.leaflet-popup-tip {
    background: #1a1a1a;
}

.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 10px;
}

.loading-overlay.show {
    display: flex;
}

.map-theme-selector {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.map-theme-select {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid #ff0000;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.map-theme-select:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff3333;
}

.map-theme-select:focus {
    border-color: #ff0000;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

.map-theme-select option {
    background: #1a1a1a;
    color: #fff;
    padding: 8px;
}

/* Map Video Info and Comments Sections */
.map-video-info-section,
.map-video-comments-section {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.map-video-info-section > div,
.map-video-comments-section > div {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    border: none;
}

/* ── Light theme: Leaflet popups — keep dark card with white text ──── */
html[data-theme="light"] .leaflet-popup-content-wrapper {
    background: #1a1a1a;
    color: #e6e6e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
html[data-theme="light"] .leaflet-popup-tip {
    background: #1a1a1a;
}
html[data-theme="light"] .video-popup-title {
    color: #ffffff;
}
html[data-theme="light"] .map-premium-lock {
    text-shadow: none;
}
html[data-theme="light"] .map-premium-lock--locked {
    color: #d61f17;
}
html[data-theme="light"] .map-premium-lock--unlocked {
    color: #1f9f50;
}
html[data-theme="light"] .video-popup-location {
    color: #bbb;
}
html[data-theme="light"] .video-popup-views {
    color: #bbb;
}

/* ── Light theme: loading overlay ────────────────────────────────────── */
html[data-theme="light"] .loading-overlay {
    background: rgba(255,255,255,0.9);
    color: #1a1a1a;
}



/* ----- map.php ----- */


    /* Video Map Page Styles - Inline for immediate loading */

    @media (max-width: 768px) {
        html, body { overflow-x: hidden; background: #000; }
        .leaflet-container { background: #000 !important; }
    }

    /* Red gradient line beneath tab bar */
    .homepage-tabs-inner {
        border-bottom: 1px solid;
        border-image: linear-gradient(to right, #000, #ff0000 50%, #000) 1;
    }

    /* Flip Container */
    .flip-container {
        position: relative;
        width: 100%;
        height: 700px;
        perspective: 2000px;
        margin: 20px 0;
        overflow: hidden;
    }

    .flipper {
        position: relative;
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;
        transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1.000);
    }

    .flip-container.flipped .flipper {
        transform: rotateY(180deg);
    }

    .flip-container.flipped {
        margin-bottom: 0;
    }

    .flip-face {
        position: absolute;
        width: 100%;
        height: 100%;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .flip-front {
        z-index: 2;
    }

    .flip-back {
        transform: rotateY(180deg);
        overflow: hidden;
    }

    .map-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
    }

    #map {
        width: 100%;
        height: 100%;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        border: 2px solid #333;
    }

    /* Video Player Side */
    .video-player-side {
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        height: 100%;
        background: #000;
        border: none;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        overflow: hidden;
        position: relative;
        display: flex;
        padding: 0;
        box-sizing: border-box;
    }

    .video-player-side::-webkit-scrollbar {
        width: 8px;
    }

    .video-player-side::-webkit-scrollbar-track {
        background: #1a1a1a;
    }

    .video-player-side::-webkit-scrollbar-thumb {
        background: #ff0000;
        border-radius: 4px;
    }

    .video-player-side::-webkit-scrollbar-thumb:hover {
        background: #cc0000;
    }

    .video-player-main {
        flex: 1;
        overflow: hidden;
        background: transparent;
        position: relative;
        border-top-right-radius: 12px;
        border-bottom-right-radius: 12px;
    }

    .video-player-main::-webkit-scrollbar {
        width: 8px;
    }

    .video-player-main::-webkit-scrollbar-track {
        background: #1a1a1a;
    }

    .video-player-main::-webkit-scrollbar-thumb {
        background: #ff0000;
        border-radius: 4px;
    }

    .video-player-main::-webkit-scrollbar-thumb:hover {
        background: #cc0000;
    }

    .video-player-sidebar {
        width: clamp(210px, 24vw, 290px);
        min-width: 210px;
        background: #000;
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 8px;
    }

    .video-player-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .video-player-sidebar::-webkit-scrollbar-track {
        background: #1a1a1a;
    }

    .video-player-sidebar::-webkit-scrollbar-thumb {
        background: #ff0000;
        border-radius: 3px;
    }

    .video-player-sidebar::-webkit-scrollbar-thumb:hover {
        background: #cc0000;
    }

    .flip-back-btn {
        position: static;
        top: auto;
        right: auto;
        z-index: auto;
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #ff0000;
        color: #fff;
        padding: 8px 12px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s;
    }

    .flip-back-btn:hover {
        background: #ff0000;
        transform: scale(1.05);
    }

    .video-player-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        gap: 16px;
    }

    .video-player-title-wrap {
        position: relative;
        flex: 1;
        min-width: 0;
    }

    .video-player-content {
        padding: 20px 40px 0 40px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .video-player-content * {
        max-width: 100%;
        box-sizing: border-box;
    }

    .video-player-title {
        font-size: 18px;
        font-weight: 600;
        color: #fff;
        margin: 0;
        line-height: 1.4;
        flex: 1;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        cursor: pointer;
    }

    .video-player-title-tooltip {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        max-width: min(92vw, 760px);
        background: rgba(12, 12, 12, 0.96);
        border: 1px solid rgba(255, 0, 0, 0.35);
        color: #f2f2f2;
        font-size: 13px;
        line-height: 1.4;
        padding: 10px 12px;
        border-radius: 8px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
        z-index: 1400;
        pointer-events: none;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .video-player-title-tooltip.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .video-player-wrapper {
        width: 100%;
        margin: 0 0 12px 0;
        aspect-ratio: 16/9;
        background: #000;
        border-radius: 4px;
        overflow: hidden;
    }

    .video-player-wrapper .video-js {
        width: 100% !important;
        height: 100% !important;
    }

    .video-js {
        border-radius: 4px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .video-stats-social-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 40px 0 40px;
        gap: 16px;
        flex-wrap: wrap;
    }

    .social-share-buttons {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    .share-btn {
        padding: 8px 12px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
        transition: all 0.2s;
        color: #fff;
    }

    .share-btn.whatsapp { background: #25D366; }
    .share-btn.facebook { background: #1877F2; }
    .share-btn.twitter { background: #1DA1F2; }
    .share-btn.instagram { background: #E4405F; }
    .share-btn.telegram { background: #0088cc; }
    .share-btn.copylink { background: #666; }

    .share-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }

    .video-stats-bar {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }

    .stats-buttons-row {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .video-votes {
        display: flex;
        gap: 8px;
        align-items: center;
    }
    .views-count {
        color: #d8d8d8;
        font-size: 18px;
        font-family: 'BulletproofBB', system-ui, sans-serif;
        padding: 1px;
        display: flex;
        align-items: center;
        gap: 6px;
        -webkit-text-stroke: 0.6px black;
        paint-order: stroke fill;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .views-count i {
        font-size: 11px;
    }

    .vote-btn {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border-radius: 4px;
        transition: background 0.2s;
    }

    .vote-btn:hover:not(:disabled) {
        background: rgba(255,255,255,0.08);
        border: none;
    }

    .vote-btn.up.voted,
    .vote-btn.up.voted:hover {
        background: none;
        border: none;
        color: #28a745;
    }

    .vote-btn.down.voted,
    .vote-btn.down.voted:hover {
        background: none;
        border: none;
        color: #e74c3c;
    }

    .vote-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .vote-btn.up i {
        color: #28a745;
        font-size: 18px;
    }

    .vote-btn.down i {
        color: #e74c3c;
        font-size: 18px;
    }

    .vote-btn .count {
        color: #e6e6e6;
        font-size: 14px;
        font-weight: 600;
    }

    .bookmark-btn {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border-radius: 4px;
        transition: all 0.2s;
        font-size: 18px;
        color: #ff0000;
    }

    .bookmark-btn:hover {
        background: rgba(255, 0, 0, 0.1);
    }

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

    .bookmark-btn.favorited {
        color: #ffd700;
    }

    .bookmark-btn.favorited:hover {
        color: #ffed4e;
    }

    .report-btn {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border-radius: 4px;
        transition: all 0.2s;
        font-size: 18px;
        color: #ff9800;
    }

    .report-btn:hover {
        background: rgba(255, 152, 0, 0.1);
    }

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

    .submit-coords-btn {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border-radius: 4px;
        transition: all 0.2s;
        font-size: 18px;
        color: #4caf50;
    }

    .submit-coords-btn:hover {
        background: rgba(76, 175, 80, 0.1);
    }

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

    /* Map Context Menu */
    .map-context-menu {
        position: fixed;
        background: #2a2a2a;
        border: 1px solid #444;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        min-width: 180px;
        overflow: hidden;
    }

    .context-menu-item {
        padding: 10px 16px;
        color: #e0e0e0;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        transition: background 0.2s;
    }

    .context-menu-item:hover {
        background: #3a3a3a;
    }

    .context-menu-item i {
        color: #4caf50;
        width: 16px;
    }

    .video-description {
        color: #e6e6e6;
        margin: 0 0 16px 0;
        line-height: 1.6;
    }

    .video-description .description-content {
        display: block;
        white-space: normal;
    }

    .video-description .show-more-btn {
        background: none;
        border: none;
        color: #ff0000;
        cursor: pointer;
        font: inherit;
        padding: 0;
        margin-left: 4px;
        font-weight: 600;
        text-decoration: none;
        display: inline;
    }

    .video-description .show-more-btn:hover {
        text-decoration: underline;
    }

    .stats-separator {
        height: 1px;
        background: linear-gradient(to right, #000, #ff0000 50%, #000);
        margin: 16px 0;
    }

    .show-comments-btn {
        width: 100%;
        padding: 14px;
        background: #1a1a1a;
        border: 2px solid #333;
        border-radius: 8px;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s;
        margin: 16px 0;
    }

    .show-comments-btn:hover {
        border-color: #ff0000;
        background: #111;
    }

    .show-comments-btn.active {
        background: #1a0000;
        border-color: #ff0000;
    }

    /* Leaflet Popup Styles - FIXED */
    .leaflet-popup-content-wrapper {
        background: rgba(0, 0, 0, 0.5) !important;
        color: #fff;
        border-radius: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.5);
        padding: 8px;
        border: none;
        overflow: visible !important;
    }

    /* Red circle close button hanging off top-right corner */
    .leaflet-popup-close-button {
        width: 26px !important;
        height: 26px !important;
        background: #cc0000 !important;
        border: 2px solid #fff !important;
        border-radius: 50% !important;
        color: #fff !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        line-height: 22px !important;
        text-align: center !important;
        padding: 0 !important;
        top: -13px !important;
        right: -13px !important;
        text-decoration: none !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.5) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .leaflet-popup-close-button:hover {
        background: #ff0000 !important;
        color: #fff !important;
    }

    .leaflet-popup-content {
        margin: 0 !important;
        min-width: 180px;
        max-width: 280px;
    }

    .video-popup {
        padding: 8px;
        background: transparent;
    }

    .video-popup-thumb {
        width: 100%;
        height: 100px;
        object-fit: cover;
        object-position: center;
        border-radius: 0;
        margin-top: 10px;
        margin-bottom: 3px;
        display: block;
    }

    .video-popup-title {
        font-size: 12px;
        font-weight: 600;
        margin: 6px 0 6px 0;
        line-height: 1.3;
        color: #fff;
    }

    .video-popup-location {
        font-size: 10px;
        color: #999;
        margin: 0 0 6px 0;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .video-popup-views {
        font-size: 10px;
        color: #bbb;
        margin: 0 0 8px 0;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .video-popup-btn {
        display: block;
        width: 100%;
        padding: 8px;
        background: #ff0000;
        color: #fff;
        text-align: center;
        text-decoration: none;
        border-radius: 0;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.15;
        transition: background 0.2s;
        border: none;
        cursor: pointer;
        font-family: 'BulletproofBB', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
        margin-top: 3px;
        -webkit-text-stroke: 0.6px black;
    }

    .video-popup-btn:hover {
        background: #cc0000;
    }

    .video-popup-notice {
        font-size: 10px;
        padding: 5px 8px;
        border-radius: 3px;
        margin-top: 4px;
        text-align: center;
        font-weight: 600;
        line-height: 1.3;
    }
    .video-popup-notice--login {
        background: rgba(255,0,0,0.12);
        color: #ff6666;
        border: 1px solid rgba(255,0,0,0.3);
    }
    .video-popup-notice--limit {
        background: rgb(0, 0, 0);
        color: #ffaa33;
        border: 1px solid rgba(255,160,0,0.3);
    }
    html[data-theme="light"] .video-popup-notice--limit {
        background: rgb(0, 0, 0);
    }
    .video-popup-notice--limit a {
        color: #ffd080;
        text-decoration: underline;
    }
    .video-popup-notice--limit a:hover {
        color: #fff;
    }

    .leaflet-popup-tip {
        background: rgba(0, 0, 0, 0.5) !important;
        border: none !important;
    }

    /* Admin Popup Fields */
    .video-popup-admin {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #444;
    }

    .video-popup-admin-label {
        font-size: 9px;
        color: #888;
        text-transform: uppercase;
        margin-bottom: 4px;
        font-weight: 600;
        -webkit-text-stroke: 0;
    }

    .video-popup-description {
        font-size: 10px;
        color: #bbb;
        margin-bottom: 8px;
        max-height: 120px;
        overflow-y: auto;
        line-height: 1.4;
        padding: 6px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 4px;
        word-wrap: break-word;
    }

    .video-popup-meta {
        font-size: 10px;
        color: #999;
        margin-bottom: 6px;
    }

    .video-popup-coord-input {
        width: calc(100% - 4px);
        padding: 6px 8px;
        background: #1a1a1a;
        border: 1px solid #444;
        color: #fff;
        font-size: 10px;
        border-radius: 4px;
        font-family: 'Courier New', monospace;
        margin-bottom: 8px;
    }

    .video-popup-coord-input:focus {
        outline: none;
        border-color: #ff0000;
        background: #222;
    }

    .video-popup-save-btn {
        display: block;
        width: 100%;
        padding: 6px;
        background: #00aa00;
        color: #fff;
        text-align: center;
        border: none;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        font-family: 'BulletproofBB', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
        -webkit-text-stroke: 0.6px black;
        transition: background 0.2s;
    }

    .video-popup-save-btn:hover {
        background: #008800;
    }

    .video-popup-save-btn:disabled {
        background: #555;
        cursor: not-allowed;
    }

    .loading-overlay {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1001;
        background: rgba(0, 0, 0, 0.92);
        color: #fff;
        padding: 30px 40px;
        border-radius: 12px;
        font-size: 15px;
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 0, 0, 0.3);
        min-width: 300px;
    }

    .loading-overlay.show {
        display: flex;
    }

    .loading-overlay-content {
        display: flex;
        align-items: center;
        gap: 12px;
        font-weight: 500;
    }

    .loading-overlay-spinner {
        font-size: 18px;
        color: #ff0000;
    }

    .loading-progress-bar {
        width: 100%;
        height: 4px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
        overflow: hidden;
        position: relative;
    }

    .loading-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #ff0000, #ff4444, #ff0000);
        background-size: 200% 100%;
        border-radius: 2px;
        animation: loadingProgress 1.5s ease-in-out infinite;
        width: 100%;
    }

    @keyframes loadingProgress {
        0% {
            transform: translateX(-100%);
            background-position: 0% 50%;
        }
        50% {
            background-position: 100% 50%;
        }
        100% {
            transform: translateX(100%);
            background-position: 0% 50%;
        }
    }

    @keyframes comment-loader-slide {
        0%   { transform: translateX(-100%); }
        100% { transform: translateX(350%); }
    }

    .map-theme-selector {
        position: absolute;
        bottom: 20px;
        left: 20px;
        z-index: 1000;
    }

    .map-theme-select {
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(10px);
        color: #fff;
        border: 1px solid #ff0000;
        border-radius: 6px;
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        outline: none;
        transition: all 0.2s;
    }

    .map-theme-select:hover {
        background: rgba(255, 0, 0, 0.1);
        border-color: #ff3333;
    }

    .map-theme-select:focus {
        border-color: #ff0000;
        box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
    }

    .map-theme-select option {
        background: #1a1a1a;
        color: #fff;
        padding: 8px;
    }

    /* Map Control Panel */
    .map-controls-container {
        display: flex;
        gap: 20px;
        width: 100%;
        height: 100%;
    }

    .map-control-panel {
        width: 280px;
        min-width: 280px;
        background: #1a1a1a;
        border-radius: 8px;
        border: 1px solid #333;
        overflow: visible;
        padding: 16px;
        color: #e6e6e6;
    }

    .map-content-area {
        flex: 1;
        position: relative;
        min-width: 0;
    }

    .control-section {
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid #444;
    }

    .control-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .control-label {
        font-size: 12px;
        font-weight: 600;
        color: #fff;
        margin-bottom: 8px;
        display: block;
    }

    .control-input-group {
        margin-bottom: 10px;
    }

    /* Theme Selector in Control Panel */
    .control-theme-select {
        width: 100%;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        border: 1px solid #ff0000;
        border-radius: 6px;
        padding: 8px 10px;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        outline: none;
        transition: all 0.2s;
    }

    .control-theme-select:hover {
        background: rgba(255, 0, 0, 0.1);
        border-color: #ff3333;
    }

    .control-theme-select:focus {
        border-color: #ff0000;
        box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
    }

    .control-theme-select option {
        background: #1a1a1a;
        color: #fff;
        padding: 8px;
    }

    /* Zoom Slider */
    .zoom-slider-container {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .zoom-slider {
        flex: 1;
        -webkit-appearance: none;
        appearance: none;
        height: 5px;
        background: #1a1a1a;
        border-radius: 3px;
        outline: none;
        border: 1px solid #444;
    }

    .zoom-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 16px;
        height: 16px;
        background: #ff0000;
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid #fff;
        transition: all 0.2s;
    }

    .zoom-slider::-webkit-slider-thumb:hover {
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    }

    .zoom-slider::-moz-range-thumb {
        width: 16px;
        height: 16px;
        background: #ff0000;
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid #fff;
        transition: all 0.2s;
    }

    .zoom-slider::-moz-range-thumb:hover {
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    }

    .zoom-level-display {
        min-width: 30px;
        text-align: center;
        font-size: 12px;
        font-weight: 600;
        color: #ff0000;
    }

    /* Joystick Control */
    .joystick-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .joystick-pad {
        width: 100px;
        height: 100px;
        background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 100%);
        border: 2px solid #444;
        border-radius: 50%;
        position: relative;
        box-shadow: inset 0 3px 6px rgba(0,0,0,0.5), 0 3px 10px rgba(0,0,0,0.3);
        margin: 3px auto;
        cursor: grab;
        overflow: hidden;
    }

    .joystick-pad:active {
        cursor: grabbing;
    }

    /* Direction indicators */
    .joystick-indicator {
        position: absolute;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #555;
        font-size: 10px;
        pointer-events: none;
        transition: color 0.15s;
    }

    .joystick-indicator.active {
        color: #ff0000;
        font-size: 12px;
        text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    }

    .joy-ind-n { top: 4px; left: 50%; transform: translateX(-50%); }
    .joy-ind-ne { top: 10px; right: 10px; }
    .joy-ind-e { top: 50%; right: 4px; transform: translateY(-50%); }
    .joy-ind-se { bottom: 10px; right: 10px; }
    .joy-ind-s { bottom: 4px; left: 50%; transform: translateX(-50%); }
    .joy-ind-sw { bottom: 10px; left: 10px; }
    .joy-ind-w { top: 50%; left: 4px; transform: translateY(-50%); }
    .joy-ind-nw { top: 10px; left: 10px; }

    /* The draggable stick */
    .joystick-stick {
        width: 30px;
        height: 30px;
        background: radial-gradient(circle at 30% 30%, #ff3333, #ff0000, #cc0000);
        border: 2px solid #fff;
        border-radius: 50%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        box-shadow: 0 2px 8px rgba(0,0,0,0.6), inset 0 1px 3px rgba(255,255,255,0.3);
        cursor: grab;
        z-index: 10;
        transition: transform 0.1s ease-out;
        user-select: none;
    }

    .joystick-stick:active {
        cursor: grabbing;
    }

    .joystick-stick::before {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 8px;
        height: 8px;
        background: radial-gradient(circle, rgba(255,255,255,0.4), transparent);
        border-radius: 50%;
    }

    .joystick-stick::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 4px;
        background: radial-gradient(ellipse, rgba(0,0,0,0.5), transparent);
        border-radius: 50%;
        filter: blur(2px);
    }

    /* Control Buttons */
    .control-btn {
        width: 100%;
        padding: 6px;
        background: #1a1a1a;
        border: 2px solid #444;
        border-radius: 6px;
        color: #fff;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.15;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        transition: all 0.2s;
        margin-bottom: 5px;
        font-family: 'BulletproofBB', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
        -webkit-text-stroke: 0.6px black;
    }

    .control-btn:hover {
        border-color: #ff0000;
        background: #111;
    }

    .control-btn:active {
        transform: scale(0.98);
    }

    .control-btn:last-child {
        margin-bottom: 0;
    }

    .control-btn i {
        font-size: 11px;
    }

    .control-btn-primary {
        background: linear-gradient(145deg, #ff0000, #cc0000);
        border-color: #ff0000;
    }

    .control-btn-primary:hover {
        background: linear-gradient(145deg, #ff3333, #ff0000);
        box-shadow: 0 0 12px rgba(255, 0, 0, 0.4);
    }

    /* Speed Control */
    .speed-control {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .speed-slider-container {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .speed-slider {
        flex: 1;
        -webkit-appearance: none;
        appearance: none;
        height: 5px;
        background: #1a1a1a;
        border-radius: 3px;
        outline: none;
        border: 1px solid #444;
    }

    .speed-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 16px;
        height: 16px;
        background: #ff0000;
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid #fff;
        transition: all 0.2s;
    }

    .speed-slider::-webkit-slider-thumb:hover {
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    }

    .speed-slider::-moz-range-thumb {
        width: 16px;
        height: 16px;
        background: #ff0000;
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid #fff;
        transition: all 0.2s;
    }

    .speed-slider::-moz-range-thumb:hover {
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    }

    .speed-label {
        min-width: 50px;
        text-align: center;
        font-size: 11px;
        font-weight: 600;
        color: #ff0000;
    }

    .speed-btn {
        flex: 1;
        padding: 6px;
        background: #1a1a1a;
        border: 2px solid #444;
        border-radius: 6px;
        color: #fff;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .speed-btn.active {
        background: #ff0000;
        border-color: #ff0000;
    }

    .speed-btn:hover:not(.active) {
        border-color: #ff0000;
    }

    /* Nearby videos sidebar - heading */
    .map-nearby-heading {
        margin: 0 0 12px 0;
        padding: 12px 16px 10px 16px;
        background: #000;
        font-family: 'BulletproofBB', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
        font-size: 20px;
        font-weight: normal;
        color: #ff0000;
        text-transform: uppercase;
        text-align: center;
        letter-spacing: -0.5px;
        -webkit-text-stroke: 1.5px #ffffff;
        paint-order: stroke fill;
        -webkit-font-smoothing: antialiased;
        border-top: 1px solid;
        border-image: linear-gradient(to right, #000, #ff0000 50%, #000) 1;
    }

    /* Nearby videos sidebar items */
    .map-nearby-video-item {
        display: flex;
        gap: 12px;
        margin: 0 0 8px 0;
        padding: 8px;
        cursor: pointer;
        transition: background 0.2s;
        color: #e6e6e6;
        border-radius: 6px;
        border: 1px solid rgba(255,255,255,0.04);
        background: rgba(0,0,0,0.25);
    }
    .map-nearby-video-item:hover { background: rgba(255,255,255,0.08); }
    .map-nearby-thumb {
        width: 120px;
        height: 68px;
        flex-shrink: 0;
        overflow: hidden;
        background: #1a1a1a;
    }
    .map-nearby-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .map-nearby-info {
        flex: 1;
        min-width: 0;
    }
    .map-nearby-title {
        margin: 0 0 6px 0;
        font-size: 14px;
        font-weight: 500;
        color: #e6e6e6;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .map-nearby-meta {
        font-size: 12px;
        color: #bfbfbf;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    .map-nearby-meta span i {
        display: inline-block;
        width: 1.1em;
        text-align: center;
    }

    /* Map Video Info and Comments Sections */
    .map-video-info-section,
    .map-video-comments-section {
        max-width: 1400px;
        margin: 4px auto 20px;
        padding: 0;
    }

    .map-video-info-section > div,
    .map-video-comments-section > div {
        background: #000;
        padding: 10px 20px 20px;
        border-radius: 8px;
        border: none;
    }

    /* ─── Mobile map toggle button + overlay ─────────────────────── */
    .mobile-controls-toggle { display: none; }
    .mobile-slide-panel { display: none; }
    .mobile-map-theme-wrap { display: none; }
    .mobile-panel-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.52);
        z-index: 2000;
    }
    .mobile-panel-overlay.show { display: block; }

    /* ─── Mobile responsive (≤ 768px) ───────────────────────────── */
    @media (max-width: 768px) {

        /* Site inner padding */
        .site-inner { padding: 0 !important; }

        /* ── Flip container ── */
        .flip-container {
            height: 52vh;
            min-height: 280px;
            max-height: 380px;
            margin: 0;
            border-radius: 0;
        }

        /* ── Black background top bar on mobile only ── */
        .homepage-tabs-bar { background: #000; }

        /* ── Remove rounded corners / border so no grey peeks through ── */
        #map {
            border-radius: 0 ;
            border: none;
            box-shadow: none;
        }
        .map-wrapper { background: #000; }
        .flip-container, .flipper, .flip-face, .map-controls-container, .map-content-area { background: #000; }

        /* ── Map front: control panel → fixed slide-out drawer ── */
        .map-controls-container { gap: 0; }

        .map-control-panel {
            position: fixed;
            top: 0;
            left: -310px;
            width: 270px;
            height: 100%;
            z-index: 2001;
            min-width: 0;
            border-radius: 0;
            border-right: 1px solid #444;
            background: #000;
            transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            overflow: hidden;
            padding: 16px 14px 60px;
            box-shadow: none;
        }

        .map-control-panel.mobile-open {
            left: 0;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            box-shadow: 4px 0 24px rgba(0, 0, 0, 0.7);
        }

        .map-content-area { width: 100%; }

        /* ── Floating controls toggle button ── */
        .mobile-controls-toggle {
            display: flex;
            position: absolute;
            top: auto;
            left: auto;
            bottom: 10px;
            right: 10px;
            z-index: 500;
            width: 38px;
            height: 38px;
            background: rgba(0, 0, 0, 0.78);
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 6px;
            color: #fff;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            -webkit-tap-highlight-color: transparent;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
        }
        .mobile-controls-toggle:active { background: rgba(200, 0, 0, 0.7); }

        /* ── Joystick: hide on mobile (in desktop panel) ── */
        .joystick-container { display: none; }

        /* ── Hide Leaflet built-in zoom controls on mobile ── */
        .leaflet-control-zoom { display: none !important; }

        /* ── Mobile slide-up panel ── */
        .mobile-slide-panel {
            display: block;
            position: absolute;
            bottom: 55px;
            right: 8px;
            width: 185px;
            background: rgba(8, 8, 8, 0.97);
            border: 1px solid #2d2d2d;
            border-radius: 10px;
            z-index: 499;
            transform: translateY(10px);
            opacity: 0;
            pointer-events: none;
            transition: transform 0.22s ease, opacity 0.22s ease;
            box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.75);
            overflow: hidden;
        }
        .mobile-slide-panel.open {
            transform: translateY(0);
            opacity: 1;
            pointer-events: auto;
        }
        .mobile-slide-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 6px 10px;
            background: #111;
            border-bottom: 1px solid #2a2a2a;
            font-size: 10px;
            color: #aaa;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        .mobile-slide-close {
            background: none;
            border: none;
            color: #777;
            font-size: 13px;
            cursor: pointer;
            padding: 0;
            line-height: 1;
            -webkit-tap-highlight-color: transparent;
        }
        .mobile-slide-panel-body {
            padding: 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }
        .mobile-panel-zoom-row {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            width: 100%;
        }
        .mobile-zoom-label {
            color: #666;
            font-size: 9px;
            letter-spacing: 0.07em;
            text-transform: uppercase;
        }
        .mobile-zoom-slider {
            -webkit-appearance: none;
            appearance: none;
            width: 100%;
            height: 4px;
            background: #2d2d2d;
            border-radius: 2px;
            outline: none;
            cursor: pointer;
        }
        .mobile-zoom-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            background: #cc0000;
            border-radius: 50%;
            cursor: pointer;
        }
        .mobile-zoom-slider::-moz-range-thumb {
            width: 16px;
            height: 16px;
            background: #cc0000;
            border-radius: 50%;
            border: none;
            cursor: pointer;
        }
        .mobile-panel-action-row {
            display: flex;
            gap: 5px;
            width: 100%;
        }
        .mobile-panel-action-btn {
            flex: 1;
            padding: 5px 3px;
            background: #1c1c1c;
            border: 1px solid #444;
            border-radius: 6px;
            color: #e6e6e6;
            font-size: 9px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 3px;
            white-space: nowrap;
            -webkit-tap-highlight-color: transparent;
        }
        .mobile-panel-action-btn:active { background: rgba(200, 0, 0, 0.5); }
        /* Joystick visible and smaller inside mobile slide panel */
        .mobile-slide-panel .joystick-container {
            display: flex !important;
        }
        .mobile-slide-panel .joystick-pad {
            width: 65px;
            height: 65px;
        }
        /* Hide the verbose speed text label (Slow/Medium/Fast) in mobile panel */
        .mobile-slide-panel .speed-label { display: none; }

        /* ── Mobile floating map type selector (bottom-left) ── */
        .mobile-map-theme-wrap {
            display: block;
            position: absolute;
            bottom: 10px;
            left: 8px;
            z-index: 499;
        }
        .mobile-map-theme-wrap select {
            background: rgba(8,8,8,.88);
            color: #e6e6e6;
            border: 1px solid rgba(255,255,255,.2);
            border-radius: 6px;
            padding: 5px 8px;
            font-size: 11px;
            cursor: pointer;
            -webkit-appearance: none;
            appearance: none;
        }

        /* ── Video player back face: single column, scrolls inside fixed container ── */
        .video-player-side {
            flex-direction: column;
            padding: 0;
            gap: 0;
            height: 100%;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            border-radius: 0 !important;
            box-shadow: none !important;
        }
        .video-player-sidebar { display: none; }
        .video-player-main { overflow: visible; flex: none; width: 100%; border-radius: 0; }
        .video-player-content { padding: 8px 10px 0; }
        .video-player-title { font-size: 14px; }
        .flip-back-btn { padding: 5px 8px; font-size: 11px; }
        .video-player-header { margin-bottom: 6px; gap: 6px; }

        /* ── Social share + stats: single row, share on left, stats on right ── */
        .social-share-buttons {
            position: static !important;
            padding: 4px 4px 4px 8px !important;
            border-top: none !important;
            gap: 4px !important;
            flex-wrap: nowrap !important;
            display: flex;
            align-items: center;
            flex: 0 0 auto;
        }
        .video-stats-bar {
            position: static !important;
            padding: 4px 8px 4px 4px !important;
            border-top: none !important;
            display: flex !important;
            flex-direction: column !important;
            align-items: flex-end !important;
            gap: 4px !important;
            flex: 1 1 0 !important;
            min-width: 0 !important;
            width: auto !important;
        }
        .stats-buttons-row {
            display: flex !important;
            flex-wrap: wrap !important;
            justify-content: flex-end !important;
            align-content: flex-start !important;
            gap: 3px !important;
        }
        /* Wrapper row: single border line, flex row */
        #mapStatsRow {
            flex-direction: row !important;
            flex-wrap: nowrap !important;
            align-items: flex-start !important;
            border-top: 1px solid #222 !important;
            padding: 0 !important;
            margin: 0 !important;
            gap: 0 !important;
        }
        /* Shrink share button circles */
        .social-share-buttons .share-btn {
            width: 26px !important;
            height: 26px !important;
            font-size: 12px !important;
            flex-shrink: 0;
            padding: 0 !important;
        }
        .views-count { font-size: 16px !important; font-family: 'BulletproofBB', system-ui, sans-serif !important; padding: 1px !important; white-space: nowrap; }
        /* Views drops below vote buttons on mobile */
        #mapVideoStatsBar .video-votes { flex-shrink: 0; }
        #mapVideoStatsBar .views-count { display: flex; justify-content: flex-end; }
        .vote-btn .count { font-size: 11px !important; }
        .vote-btn { padding: 2px 4px !important; }
        .vote-btn i { font-size: 14px !important; }
        .bookmark-btn, .report-btn, .submit-coords-btn { padding: 2px 4px !important; font-size: 15px !important; }
        .posted-date-label { font-size: 12px !important; gap: 5px !important; max-width: 116px; overflow: hidden; text-overflow: ellipsis; }
        .posted-date-label i { font-size: 12px !important; }

        /* ── Emoji picker ── */
        #map-emoji-picker-modal {
            width: calc(100vw - 28px) !important;
            max-width: 300px;
        }
        #map-emoji-grid { grid-template-columns: repeat(8, 1fr) !important; }

        /* ── Map popup ── */
        .leaflet-popup-content-wrapper { padding: 0 !important; }
        .leaflet-popup-content { max-width: 200px !important; min-width: 160px; margin: 0 !important; }
        .video-popup { padding: 5px; }
        .video-popup-thumb { height: 55px; margin-top: 4px; margin-bottom: 3px; object-fit: cover; object-position: center; }
        .video-popup-title { font-size: 10px; margin-bottom: 5px; margin-top: 3px; }
        .video-popup-location, .video-popup-views { font-size: 9px; margin-bottom: 2px; }
        .video-popup-views { margin-bottom: 2px; }
        .video-popup-btn { padding: 5px; font-size: 10px; margin-top: 5px; }

        /* ── Description & comments: flush against map container, no gap ── */
        .map-video-info-section,
        .map-video-comments-section {
            padding: 0 !important;
            margin: 0 !important;
            max-width: 100% !important;
            width: 100% !important;
        }
        .map-video-info-section > div,
        .map-video-comments-section > div {
            padding: 0 14px 14px 14px !important;
            border-radius: 0 !important;
            border: none !important;
        }

        /* ── Stats: unified single-card look ── */
        .map-stats-dashboard { padding: 0 !important; margin: 0 !important; }
        .map-info-inner { padding-top: 0 !important; padding-bottom: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; }
        #mapDescTopSeparator { margin-top: 0 !important; }
        .stats-grid {
            grid-template-columns: 1fr 1fr 1fr !important;
            gap: 0 !important;
            margin-bottom: 0 !important;
            background: #1a1a1a !important;
            border-radius: 8px 8px 0 0;
            overflow: hidden;
        }
        .stat-card {
            background: transparent !important;
            border: none !important;
            border-radius: 0 !important;
            padding: 10px 8px !important;
            box-shadow: none !important;
            border-right: 1px solid #3a3a3a !important;
        }
        .stat-card:last-child { border-right: none !important; }
        .stat-card > div { margin-bottom: 0 !important; gap: 6px !important; }
        .stat-card i { font-size: 16px !important; }
        .stat-card div[style*="font-size:28px"] { font-size: 18px !important; }
        .stat-card div[style*="font-size:11px"] { font-size: 9px !important; }
        .cat-breakdown-row:hover { background: rgba(255,255,255,0.05); }
        .cat-breakdown-row:active { background: rgba(255,0,0,0.1); }
        .category-breakdown-card {
            border-radius: 0 0 8px 8px !important;
            border-left: none !important;
            border-right: none !important;
            border-top: 1px solid #3a3a3a !important;
            margin-bottom: 0 !important;
            padding: 12px !important;
        }

        /* ── Comments form ── */
        #map-comment-form textarea { font-size: 14px; }
    }

    /* ── Map-page only: timer sits inside the tab bar (between its border lines).
       Remove the artificial gap, overlay timer into the bar, push tab items below it. ── */
    @media (max-width: 600px) {
        header.site-header { overflow: visible !important; }

        .one-day-pass-timer {
            top: 80px !important;
            z-index: 500 !important;
        }
        .site-header:has(.one-day-pass-timer) ~ .homepage-tabs-bar {
            margin-top: 0 !important;
        }
        .site-header:has(.one-day-pass-timer) ~ .homepage-tabs-bar .homepage-tabs-inner {
            padding-top: 30px !important;
            min-height: auto !important;
        }
    }

    /* ── Map page: light mode overrides ──────────────────────────────── */
    html[data-theme="light"] body { background: #f0f0f0; color: #1a1a1a; }

    /* Map border + container */
    html[data-theme="light"] #map { border-color: #ccc; }

    /* Control panel */
    html[data-theme="light"] .map-control-panel {
        background: #ffffff;
        border-color: #ddd;
        color: #1a1a1a;
    }
    html[data-theme="light"] .control-section {
        border-bottom-color: #ddd;
    }
    html[data-theme="light"] .control-label {
        color: #1a1a1a;
    }
    html[data-theme="light"] .control-btn {
        background: #1a1a1a;
        border-color: #444;
        color: #fff;
        -webkit-text-stroke: 0.6px black;
    }
    html[data-theme="light"] .control-btn:hover {
        background: #111;
        border-color: #ff0000;
    }
    html[data-theme="light"] .control-theme-select {
        background: #f0f0f0;
        color: #1a1a1a;
    }
    html[data-theme="light"] .control-theme-select option {
        background: #ffffff;
        color: #1a1a1a;
    }
    html[data-theme="light"] .zoom-slider,
    html[data-theme="light"] .speed-slider {
        background: #ddd;
        border-color: #ccc;
    }
    html[data-theme="light"] .joystick-pad {
        background: radial-gradient(circle, #e0e0e0 0%, #cccccc 100%);
        border-color: #bbb;
        box-shadow: inset 0 3px 6px rgba(0,0,0,0.15), 0 3px 10px rgba(0,0,0,0.1);
    }
    html[data-theme="light"] .joystick-indicator { color: #aaa; }
    html[data-theme="light"] .speed-btn {
        background: #f0f0f0;
        border-color: #ccc;
        color: #1a1a1a;
    }
    html[data-theme="light"] .speed-btn.active { background: #ff0000; border-color: #ff0000; color: #fff; }

    /* Video player side */
    html[data-theme="light"] .video-player-side { background: #ffffff; border-radius: 0; }
    html[data-theme="light"] .video-player-main { background: #ffffff; }
    html[data-theme="light"] .video-player-sidebar { background: #ffffff; }
    html[data-theme="light"] .map-nearby-heading {
        background: #ffffff;
        -webkit-text-stroke: 1.5px #000000;
        border-image: linear-gradient(to right, #ffffff, #ff0000 50%, #ffffff) 1;
    }
    html[data-theme="light"] .map-nearby-heading {
        -webkit-text-stroke: 1.5px #ffffff;
        paint-order: stroke fill;
    }
    html[data-theme="light"] .map-nearby-title { color: #111111; }
    html[data-theme="light"] .map-nearby-meta { color: #555555; }
    html[data-theme="light"] .map-nearby-video-item {
        color: #111111;
        background: #f8f8f8;
        border-color: rgba(0,0,0,0.08);
    }
    html[data-theme="light"] .map-nearby-video-item:hover { background: #eeeeee; }
    html[data-theme="light"] .map-nearby-thumb { background: #dee2e6; }
    html[data-theme="light"] .video-player-title { color: #1a1a1a; }
    html[data-theme="light"] .video-description { color: #333; }
    html[data-theme="light"] .views-count { color: #555; -webkit-text-stroke: 0; }
    html[data-theme="light"] .vote-btn .count { color: #1a1a1a; }
    html[data-theme="light"] .video-player-wrapper { background: #e0e0e0; }

    html[data-theme="light"] .show-comments-btn {
        background: #f0f0f0;
        border-color: #ccc;
        color: #1a1a1a;
    }
    html[data-theme="light"] .show-comments-btn:hover {
        border-color: #ff0000;
        background: #e8e8e8;
    }
    html[data-theme="light"] .show-comments-btn.active {
        background: #fff0f0;
        border-color: #ff0000;
    }

    /* Stats separator */
    html[data-theme="light"] .stats-separator {
        background: linear-gradient(to right, #f0f0f0, #ff0000 50%, #f0f0f0);
    }

    /* Info / comments below map — override both wrapper divs and inner containers */
    html[data-theme="light"] .map-video-info-section .map-info-inner,
    html[data-theme="light"] .map-video-info-section > div,
    html[data-theme="light"] .map-video-comments-section .comments-section,
    html[data-theme="light"] .map-video-comments-section > div {
        background: #ffffff !important;
        border: none !important;
        color: #1a1a1a !important;
    }
    html[data-theme="light"] .map-video-comments-section .comments-section h3 {
        color: #1a1a1a !important;
    }

    /* Context menu */
    html[data-theme="light"] .map-context-menu {
        background: #fff;
        border-color: #ccc;
    }
    html[data-theme="light"] .context-menu-item {
        color: #1a1a1a;
    }
    html[data-theme="light"] .context-menu-item:hover {
        background: #f0f0f0;
    }

    /* Loading overlay */
    html[data-theme="light"] .loading-overlay {
        background: rgba(255,255,255,0.95);
        color: #1a1a1a;
        border-color: rgba(255,0,0,0.3);
    }

    /* Mobile slide panel */
    html[data-theme="light"] .mobile-slide-panel {
        background: rgba(255,255,255,0.97);
        border-color: #ccc;
    }
    html[data-theme="light"] .mobile-slide-panel-header {
        background: #f5f5f5;
        border-bottom-color: #ddd;
        color: #555;
    }
    html[data-theme="light"] .mobile-panel-action-btn {
        background: #f0f0f0;
        border-color: #ccc;
        color: #1a1a1a;
    }

    /* Stats grid + stat cards + category breakdown: all screen sizes */
    html[data-theme="light"] .stats-grid { background: #f0f0f0 !important; }
    html[data-theme="light"] .stat-card {
        background: #ffffff !important;
        border-color: #ddd !important;
        color: #1a1a1a !important;
    }
    html[data-theme="light"] .stat-card * { color: #1a1a1a !important; -webkit-text-stroke: 0 !important; }
    html[data-theme="light"] .stat-card i { color: #ff0000 !important; }
    html[data-theme="light"] .category-breakdown-card {
        background: #ffffff !important;
        border-color: #ddd !important;
        color: #1a1a1a !important;
    }
    html[data-theme="light"] .category-breakdown-card h3 {
        color: #1a1a1a !important;
        -webkit-text-stroke: 0 !important;
    }
    html[data-theme="light"] .category-breakdown-card .cat-breakdown-row span { color: #1a1a1a !important; -webkit-text-stroke: 0 !important; }

    .stats-grid .stat-card:nth-child(2),
    .stats-grid .stat-card:nth-child(3) { display: none !important; }

    /* Hide category breakdown on desktop */
    @media (min-width: 769px) {
        .category-breakdown-card { display: none !important; }
    }

    /* Mobile: control panel drawer */
    /* Mobile-only location search bar above stats */
    .mobile-map-search-bar { display: none; }
    @media (max-width: 768px) {
        html[data-theme="light"] .map-control-panel {
            background: #ffffff;
            border-right-color: #ddd;
        }
        html[data-theme="light"] .stats-grid { grid-template-columns: 1fr 1fr 1fr !important; }
        .mobile-map-search-bar {
            display: block;
            background: #1e1e1e;
            border: 1px solid #333;
            border-radius: 8px 8px 0 0;
            padding: 10px 12px;
        }
        .stats-grid {
            border-top-left-radius: 0 !important;
            border-top-right-radius: 0 !important;
        }
        .mobile-map-search-row {
            display: flex;
            gap: 6px;
            align-items: center;
        }
        .mobile-map-search-row input {
            flex: 1;
            padding: 9px 10px;
            background: #2a2a2a;
            border: 1px solid #444;
            border-radius: 6px;
            color: #e6e6e6;
            font-size: 13px;
            min-width: 0;
        }
        .mobile-map-search-row input::placeholder { color: #777; }
        .mobile-map-search-btn {
            flex-shrink: 0;
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #2a2a2a;
            border: 1px solid #444;
            border-radius: 6px;
            color: #e6e6e6;
            font-size: 14px;
            cursor: pointer;
        }
        .mobile-map-search-btn:active { background: #3a3a3a; }
        .mobile-map-search-status {
            font-size: 11px;
            color: #999;
        }
        html[data-theme="light"] .mobile-map-search-bar { background: #f5f5f5; border-color: #ddd; }
        html[data-theme="light"] .mobile-map-search-row input { background: #fff; border-color: #ccc; color: #222; }
        html[data-theme="light"] .mobile-map-search-btn { background: #eee; border-color: #ccc; color: #222; }
    }
    


@font-face {
    font-family: 'DS-DIGI';
    src: url('../fonts/DS-DIGI.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'BulletproofBB';
    src: url('../fonts/bulletproof.bb.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Hide Leaflet attribution in coordinate submission minimap */
#coord-minimap .leaflet-control-attribution {
    display: none !important;
}

/* Emoji button hover effect */
#map-emoji-btn:hover {
    background: #444 !important;
    transform: scale(1.1);
}
@media (pointer: coarse) {
    #map-emoji-btn, .emoji-toggle-btn { display: none !important; }
}

/* Comment form styling */
.comment-form {
    padding-top: 10px;
}

.comment-form button {
    margin: 0;
}

    /* Smooth transition for comment section */
    #mapVideoComments {
        display: block;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
        transition: max-height 0.25s ease-out, opacity 0.2s ease-out, transform 0.25s ease-out;
    }

    #mapVideoComments.show {
        max-height: 10000px;
        opacity: 1;
        transform: scaleY(1);
        transition: max-height 0.3s ease-in, opacity 0.25s ease-in, transform 0.3s ease-in;
    }

    /* Smooth transition for comment replies */
    #map-comments-list .replies {
        display: block;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
        transition: max-height 0.25s ease-out, opacity 0.2s ease-out, transform 0.25s ease-out;
    }

    #map-comments-list .replies.show {
        max-height: 5000px;
        opacity: 1;
        transform: scaleY(1);
        transition: max-height 0.3s ease-in, opacity 0.25s ease-in, transform 0.3s ease-in;
    }
    
