body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Montserrat', sans-serif;
    background: #000 !important;
    box-sizing: border-box;
    overflow-x: hidden;
}

#cesiumContainer {
    width: 100%;
    height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide the entire Cesium built-in toolbar */
.cesium-viewer-toolbar { display: none !important; }

.cesium-infoBox-camera {
    display: none !important;
}

.cesium-widget-credits {
    display: none !important;
}

/* ── Overlay buttons (Full Screen when inside panel is positioned by .golf-left-controls) ── */
#fullScreenButton {
    position: static;
    left: auto;
    top: auto;
    margin: 0 0 8px 0;
    z-index: 11000;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(12,24,42,0.88) 0%, rgba(18,45,70,0.85) 100%);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 11px;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.55);
}
#fullScreenButton:hover {
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 6px 20px rgba(0,0,0,0.7), 0 0 0 3px rgba(0,209,255,0.18);
}

/* Course Info button — styled to match nav panel, positioned by panel layout */
.golf-panel-btn {
    width: 110px;
    padding: 8px 14px;
    font-family: 'Inter', 'Montserrat', Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, rgba(12,24,42,0.88) 0%, rgba(18,45,70,0.85) 100%);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 11px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
    cursor: pointer;
    outline: none;
    text-align: center;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease;
    position: static !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
}
.golf-panel-btn:hover {
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.7), 0 0 0 3px rgba(0,209,255,0.18);
}
.golf-panel-btn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, rgba(0,120,180,0.88) 0%, rgba(0,80,130,0.85) 100%);
}
.golf-panel-btn-active {
    background: linear-gradient(135deg, rgba(0,140,200,0.92) 0%, rgba(0,90,150,0.88) 100%) !important;
    border-color: rgba(0,209,255,0.6) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.55), 0 0 0 3px rgba(0,209,255,0.25) !important;
}

/* ── Ruler hint ── */
#ruler-hint {
    display: none;
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 38, 0.9);
    color: #fff;
    font-family: 'Inter', 'Montserrat', Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 18px rgba(0,0,0,0.5);
    z-index: 11500;
    pointer-events: none;
    white-space: nowrap;
}

/* ── Info popup overlay + sidebar ── */
.info-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10990;
    cursor: pointer;
}
.info-popup-overlay.hidden {
    display: none !important;
}
#sidebar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 85%;
    width: auto;
    z-index: 11000;
    background: transparent !important;
    padding: 0 !important;
    opacity: 1 !important;
    pointer-events: none;
}
#sidebar:not(.hidden) { pointer-events: auto; }
#sidebar .tour-info-card { pointer-events: auto; }
#sidebar.hidden {
    transform: translate(-600%, -50%);
    pointer-events: none;
}
.info-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 1rem;
}
.info-popup-actions .btn-ai,
.info-popup-actions .btn-maps {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.info-popup-actions .btn-ai {
    background: linear-gradient(120deg, #154034, #23705b);
    color: #fff;
}
.info-popup-actions .btn-ai:hover {
    background: linear-gradient(120deg, #1a5044, #2a8068);
    color: #fff;
    transform: translateY(-1px);
}
.info-popup-actions .btn-maps {
    background: linear-gradient(120deg, #0f3d74, #1686a0);
    color: #fff;
}
.info-popup-actions .btn-maps:hover {
    background: linear-gradient(120deg, #0d3468, #1270a0);
    color: #fff;
    transform: translateY(-1px);
}
.info-popup-actions .btn-close-popup {
    margin-top: 0.5rem;
    padding: 6px 14px;
    font-size: 0.88rem;
    color: #6c757d;
    background: #f0f0f0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
}
.info-popup-actions .btn-close-popup:hover {
    background: #e5e5e5;
    color: #495057;
}

/* ── Course top bar: white text on transparent grey, compact (no full-width), no black strip ── */
.course-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 10001;
    pointer-events: none;
    padding-top: 0;
    background: transparent;
    border: none;
}
.course-top-bar .course-name-text,
#course-name-p.course-name-text {
    display: inline-block !important;
    width: fit-content !important;
    max-width: 95vw;
    background: rgba(0, 0, 0, 0.45) !important;
    color: #ffffff !important;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    line-height: 1.3;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    margin: 0 0 4px 0;
    text-align: center;
    pointer-events: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}
.course-top-bar .course-location-text,
#course-location-p.course-location-text {
    display: inline-block !important;
    width: fit-content !important;
    max-width: 95vw;
    background: rgba(0, 0, 0, 0.45) !important;
    color: #ffffff !important;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    line-height: 1.3;
    border: none;
    border-radius: 6px;
    padding: 4px 14px;
    margin: 0;
    text-align: center;
    pointer-events: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}

/* ── Hole selector bar (above progress bar) ── */
.yt-hole-number-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 52px;
    width: 100vw;
    z-index: 99998;
    display: none;
    justify-content: center;
    pointer-events: none;
}
#yt-hole-select {
    min-width: 380px;
    min-height: 52px;
    padding: 14px 44px 14px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f9fffd;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23d6f4ea' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        linear-gradient(135deg, rgba(9, 32, 48, 0.9) 0%, rgba(17, 67, 79, 0.95) 45%, rgba(21, 104, 90, 0.98) 100%);
    background-repeat: no-repeat, no-repeat;
    background-position: right 16px center, 0 0;
    background-size: 14px, auto;
    border: 1.5px solid rgba(189, 226, 214, 0.85);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    pointer-events: auto;
    text-align: center;
    text-align-last: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
#yt-hole-select:hover,
#yt-hole-select:focus {
    border-color: rgba(209, 244, 231, 0.95);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(129, 230, 217, 0.3);
    transform: translateY(-1px);
}
#yt-hole-select option {
    background: #0b1c29;
    color: #f7fffb;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 1rem;
}

/* ── YT controls row ── */
.yt-controls-row {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 14px;
    width: 100vw;
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    box-sizing: border-box;
    padding: 0 24px;
}
.yt-progress-bar {
    width: 100%;
    max-width: 900px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background: transparent;
    padding: 0;
    pointer-events: auto;
}

/* ── Play/pause button (left of progress bar) ── */
.yt-playpause-btn {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 50%;
    background: linear-gradient(120deg, #d72424, #ff4d2d);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    margin: 0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.yt-playpause-btn:hover {
    background: linear-gradient(120deg, #c01e1e, #e04020);
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.7), 0 0 0 3px rgba(255,60,60,0.25);
}
.yt-playpause-btn:active { transform: scale(0.95); }
.yt-playpause-btn svg { width: 18px; height: 18px; fill: #fff; }

/* ── Action bubble (always visible above play button: "Tour Playing" / "Tour Stopped") ── */
.tour-action-bubble {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(22,30,42,0.95);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 3;
}
.tour-action-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(22,30,42,0.95) transparent transparent transparent;
}

/* ── Progress track ── */
.yt-progress-track {
    flex: 1 1 0;
    height: 8px;
    background: rgba(255,255,255,0.45);
    border-radius: 8px;
    position: relative;
    margin: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.yt-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 8px;
    background: linear-gradient(90deg, #f63e2f, #ffc143);
    border-radius: 8px;
    z-index: 1;
    pointer-events: none;
    transition: width 0.2s;
}
.yt-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: #fff;
    border: 3px solid #ff0000;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: left 0.2s;
    box-sizing: border-box;
    touch-action: none;
    user-select: none;
}
.yt-progress-thumb:hover, .yt-progress-thumb.dragging { width: 26px; height: 26px; }
.yt-progress-thumb-label {
    position: absolute;
    top: -44px;
    left: 0;
    transform: translateX(-50%);
    background: #222;
    color: #ffe600;
    font-size: 1.1em;
    font-weight: bold;
    padding: 6px 18px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    border: 2px solid #ffe600;
}
.yt-progress-thumb-label.active { opacity: 1; }

/* ── Center play overlay (above left panel so red play button is visible) ── */
#center-play-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 12000;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.16);
}
#center-play-btn {
    background: #ff0000;
    border: none;
    border-radius: 18px;
    width: 130px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    animation: center-play-pulse 1.35s ease-in-out infinite;
}
#center-play-btn:hover { background: #d10000; transform: scale(1.05); }
#center-play-btn .center-play-triangle {
    width: 0;
    height: 0;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-left: 26px solid #ffffff;
    margin-left: 4px;
}
@keyframes center-play-pulse {
    0%   { transform: scale(1); }
    70%  { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* ── Golfapedia logo + copyright (bottom right): hidden until spinner is removed ── */
#logo-copyright-overlay.logo-copyright-overlay {
    position: fixed;
    bottom: 0;
    right: 6px;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 8px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
#logo-copyright-overlay.logo-copyright-overlay.visible {
    visibility: visible;
    opacity: 1;
}
#logo-copyright-overlay .logo-copyright-logo {
    width: 17px;
    height: 17px;
    display: block;
}
#logo-copyright-overlay .logo-copyright-text {
    color: #ffffff;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

/* ── Fallback hide for body class ── */
body.hide-yt-controls .yt-controls-row,
body.hide-yt-controls .yt-hole-number-bar { display: none !important; }

/* ── Sidebar card styles ── */
.sidebar-card, .tour-info-card {
    background: #fff !important;
    border-radius: 18px !important;
    border: 1.5px solid #e0e4ea !important;
    padding: 2rem 2.5rem;
    min-width: 260px;
    max-width: 90vw;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sidebar-title { color: #1e3c72 !important; font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5em; }
.sidebar-address { color: #6c757d !important; font-size: 1.05rem; font-weight: 500; margin-bottom: 1em; }

/* ── Mobile responsive ── */
@media (max-width: 900px) {
    .golf-panel-btn {
        width: 86px !important;
        padding: 6px 10px !important;
        font-size: 0.72rem !important;
        border-radius: 9px !important;
    }
    .yt-controls-row {
        left: 0 !important;
        right: 0 !important;
        bottom: 10px !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 14px 0 14px !important;
        justify-content: flex-start !important;
    }
    .yt-progress-bar {
        width: 100% !important;
        max-width: none !important;
        gap: 8px !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
    }
    /* Don't set display here — bar stays hidden until setYTControlsVisibility(true) after load */
    .yt-hole-number-bar {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        bottom: 52px !important;
        /* Bring combobox even further left, but still clear of the bubble + play button */
        justify-content: flex-start !important;
        padding-left: 68px !important;
        padding-right: 12px !important;
    }
    #yt-hole-select {
        display: block !important;
        min-width: 0 !important;
        width: auto !important;
        /* Leave ~68px for bubble/play + a bit of breathing room */
        max-width: calc(100vw - 112px) !important;
        transform: none !important;
        flex: 0 0 auto !important;
        min-height: 44px !important;
        /* Slightly smaller text to help long labels fit */
        font-size: 0.7rem !important;
        padding: 10px 44px 10px 12px !important;
    }
    #yt-hole-select option {
        font-size: 0.70rem !important;
    }
    .yt-playpause-btn {
        width: 44px !important;
        height: 44px !important;
        flex: 0 0 44px !important;
        min-width: 0 !important;
    }
    .yt-playpause-btn svg { width: 16px !important; height: 16px !important; }
    .yt-progress-track {
        min-width: 0 !important;
    }
    .course-top-bar { padding-top: 0 !important; top: 0 !important; }
    #center-play-btn { width: 90px !important; height: 60px !important; }
    #center-play-btn .center-play-triangle {
        border-top: 12px solid transparent !important;
        border-bottom: 12px solid transparent !important;
        border-left: 20px solid #fff !important;
    }
    .tour-action-bubble {
        font-size: 13px !important;
        padding: 7px 12px !important;
        bottom: calc(100% + 8px) !important;
        /* Shift bubble slightly right so it isn't cut off on very small screens */
        transform: translateX(-30%) translateY(0) !important;
    }
    /* Golfapedia copyright: keep bottom-right on mobile */
    #logo-copyright-overlay.logo-copyright-overlay {
        right: 6px !important;
        bottom: 0 !important;
        padding: 5px 8px !important;
        gap: 6px !important;
        border-radius: 8px !important;
    }
    #logo-copyright-overlay .logo-copyright-logo {
        width: 17px !important;
        height: 17px !important;
    }
    #logo-copyright-overlay .logo-copyright-text {
        font-size: 10px !important;
        line-height: 1 !important;
    }
    /* INFO popup: centered with left/right margins on mobile */
    #sidebar {
        top: 50% !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none !important;
        transform: translateY(-50%) !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }
    #sidebar.hidden {
        transform: translateY(-100vh) !important;
    }
    #sidebar .tour-info-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 1.5rem 1.25rem !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    .info-popup-actions {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        margin-top: 1rem !important;
    }
    .info-popup-actions .btn-ai,
    .info-popup-actions .btn-maps,
    .info-popup-actions .btn-close-popup {
        width: 100% !important;
        max-width: 260px !important;
        margin-top: 0 !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    #golf-tour-panel { left: 4px !important; }
    .yt-controls-row { bottom: 8px !important; }
    .yt-hole-number-bar { bottom: 52px !important; }
    .yt-playpause-btn { width: 42px !important; height: 42px !important; flex: 0 0 42px !important; }
    .yt-playpause-btn svg { width: 15px !important; height: 15px !important; }
}

/* ── Loading spinner overlay (from Tour3D_DO_NOT_USE) ── */
#tour-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20000;
    background: linear-gradient(135deg, #23395d 0%, #1e6076 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: opacity 0.7s ease;
}
#tour-spinner-overlay.hiding {
    opacity: 0;
    pointer-events: none;
}
.golf-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0.8rem 0 1.2rem 0;
}
.dual-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.outer-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid #3575ec;
    border-top: 3px solid #38f9d7;
    opacity: 0.7;
    animation: spin-outer 1.2s linear infinite;
}
@keyframes spin-outer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.inner-arc {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-bottom: 5px solid #43e97b;
    border-left: 5px solid #43e97b;
    opacity: 0.85;
    animation: spin-inner 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes spin-inner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}
.center-ball {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 30% 30%, #fff 0%, #f0f0f0 60%, #e0e0e0 100%);
    border-radius: 50%;
    border: 2px solid #e9ecef;
    transform: translate(-50%, -50%);
    animation: ball-pulse 1.3s ease-in-out infinite;
}
@keyframes ball-pulse {
    0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
}
.spinner-text {
    text-align: center;
    color: #fff;
    font-family: 'Inter', Arial, sans-serif;
}
#tour-spinner-overlay .loading-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0;
}
#tour-spinner-overlay .course-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.3rem;
}
#tour-spinner-overlay .course-location {
    font-size: 1.05rem;
    color: #a0bfd4;
    margin-top: 0.1rem;
}
@media (max-width: 600px) {
    .dual-spinner { width: 44px; height: 44px; }
    .outer-ring { width: 44px; height: 44px; border-width: 2px; }
    .inner-arc { width: 28px; height: 28px; border-width: 3px; top: 8px; left: 8px; }
    .center-ball { width: 12px; height: 12px; border-width: 1.2px; }
}

/* ── Hide the cesium-navigation plugin entirely (replaced by custom compass + controls) ── */
.compass,
.compass-outer-ring,
.compass-outer-ring-background,
.compass-gyro,
.compass-gyro-background,
.compass-rotation-marker,
.navigation-controls,
.distance-legend {
    display: none !important;
}

/* ── Tour controls panel — Full Screen + 3 buttons at top, nav vertically centered, left-aligned ── */
#golf-tour-panel {
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 28px;
    transform: none;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    pointer-events: auto;
}
/* Top four buttons: even vertical spacing (Full Screen, AI Chat, Google Map, Ruler) */
.golf-top-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}
#golf-tour-panel.golf-left-controls .golf-top-buttons .golf-panel-btn,
#golf-tour-panel.golf-left-controls .golf-top-buttons #fullScreenButton {
    margin-bottom: 0;
}
/* Compass + nav controls: centered vertically in panel (equal space above/below) */
#golf-tour-panel.golf-left-controls .golf-nav-section {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    /* Very subtle light grey box only around compass + nav buttons so they stay visible over imagery */
    background: rgba(235, 240, 248, 0.18);
    padding: 12px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ── Custom compass ── */
#golf-compass {
    width: 72px;
    height: 72px;
    position: relative;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, rgba(20,40,65,0.88) 0%, rgba(8,16,28,0.92) 100%);
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
#golf-compass:hover {
    border-color: rgba(255,255,255,0.55);
    box-shadow: 0 4px 24px rgba(0,0,0,0.8), 0 0 0 3px rgba(0,209,255,0.15);
}
#golf-compass svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transition: transform 0.15s ease-out;
}
#golf-compass .compass-tick-ring {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 50%;
}

/* ── Nav button grid ──
   Layout:  [+] [-]       zoom in / out
            [◀] [▶]       rotate L / R
*/
#golf-nav-controls {
    display: grid;
    grid-template-columns: 40px 40px;
    grid-template-rows:    40px 40px;
    gap: 5px;
}

/* ── D-pad star for panning ──
   Layout:       [▲]
            [←]       [→]
                 [▼]
   Left/Right centered vertically between Up/Down
*/
#golf-dpad {
    display: grid;
    grid-template-columns: 40px 40px 40px;
    grid-template-rows:    40px 40px;
    gap: 5px;
    justify-items: center;
    align-items: center;
}
#golf-dpad .golf-nav-btn:nth-child(1) { grid-column: 2; grid-row: 1; }
#golf-dpad .golf-nav-btn:nth-child(2) { grid-column: 1; grid-row: 1 / 3; }
#golf-dpad .golf-nav-btn:nth-child(3) { grid-column: 2; grid-row: 2; }
#golf-dpad .golf-nav-btn:nth-child(4) { grid-column: 3; grid-row: 1 / 3; }

/* ── Hole selector dropdown (below controls) ── */
#golf-hole-select-wrap {
    position: relative;
}
#golf-hole-select {
    width: 190px;
    padding: 8px 22px 8px 10px;
    font-family: 'Inter', 'Montserrat', Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background-color: #0c1a2e;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 11px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
    text-align: left;
}
#golf-hole-select:hover, #golf-hole-select:focus {
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 6px 20px rgba(0,0,0,0.7), 0 0 0 3px rgba(0,209,255,0.18);
}
#golf-hole-select option {
    background: #0c1a2e;
    color: #fff;
    padding: 8px;
    font-weight: 600;
}

.golf-nav-btn {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(12,24,42,0.88) 0%, rgba(18,45,70,0.85) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.golf-nav-btn:hover {
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.7), 0 0 0 3px rgba(0,209,255,0.18);
}
.golf-nav-btn:active {
    transform: scale(0.93);
    background: linear-gradient(135deg, rgba(0,120,180,0.88) 0%, rgba(0,80,130,0.85) 100%);
}
.golf-nav-btn svg {
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

/* ── Mobile panel toggle button — hidden on desktop ── */
#golf-panel-toggle {
    display: none;
}

/* ── Mobile responsive ── */
@media (max-width: 600px) {
    #golf-tour-panel {
        left: 6px; /* minimal left padding on cellphone so nav controls box is anchored left */
        top: 76px; /* below course name + location so buttons don't block the text */
        bottom: auto;
        height: auto;
        gap: 0;
        align-items: flex-start;
        transition: none;
    }
    .golf-panel-sliding {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }
    .golf-panel-sliding.golf-sliding-collapsed {
        transform: translateX(-120%);
        pointer-events: none;
    }
    /* Compass + nav directly under the top buttons (Google Map, etc.) */
    #golf-tour-panel.golf-left-controls .golf-nav-section {
        position: static;
        transform: none;
        top: auto;
        left: auto;
        margin-top: 10px;
    }
    #golf-compass { width: 52px; height: 52px; }
    .golf-panel-btn {
        width: 68px !important;
        padding: 5px 7px !important;
        font-size: 0.66rem !important;
        border-radius: 8px !important;
    }
    /* old panel hole select removed — bottom bar combobox handles it now */
    .golf-nav-btn { width: 32px; height: 32px; border-radius: 8px; }
    #golf-nav-controls { grid-template-columns: 32px 32px; grid-template-rows: 32px 32px; gap: 3px; }
    /* Mobile: 2x2 grid — Up/Down next to each other, Left/Right next to each other (no star/cross) */
    #golf-dpad {
        grid-template-columns: 32px 32px;
        grid-template-rows: 32px 32px;
        gap: 3px;
    }
    #golf-dpad .golf-nav-btn:nth-child(1) { grid-column: 1; grid-row: 1; }   /* Up */
    #golf-dpad .golf-nav-btn:nth-child(2) { grid-column: 1; grid-row: 2; }   /* Left */
    #golf-dpad .golf-nav-btn:nth-child(3) { grid-column: 2; grid-row: 1; }   /* Down */
    #golf-dpad .golf-nav-btn:nth-child(4) { grid-column: 2; grid-row: 2; }   /* Right */

    /* Toggle under pan left/right: sleek chevron pill, in flow */
    #golf-panel-toggle.golf-panel-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 12px;
        width: 100%;
        max-width: 68px;
        height: 36px;
        padding: 0;
        border: 1.5px solid rgba(255,255,255,0.25);
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(18,35,55,0.92) 0%, rgba(10,22,38,0.95) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
        color: rgba(255,255,255,0.9);
        cursor: pointer;
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }
    #golf-panel-toggle.golf-panel-toggle-btn:hover {
        border-color: rgba(255,255,255,0.4);
        box-shadow: 0 3px 14px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,209,255,0.12);
    }
    #golf-panel-toggle.golf-panel-toggle-btn:active {
        transform: scale(0.96);
    }
    #golf-panel-toggle .golf-toggle-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-family: 'Inter', 'Montserrat', Arial, sans-serif;
        font-size: 0.6rem;
        font-weight: 600;
        line-height: 1;
    }
    #golf-panel-toggle .golf-toggle-chevron {
        pointer-events: none;
    }
    #golf-panel-toggle .golf-toggle-label {
        pointer-events: none;
    }
}

/* ── Custom tooltips ── */
[data-tooltip] {
    position: relative;
}
[data-tooltip]:hover {
    z-index: 12001;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: rgba(10, 20, 38, 0.94);
    color: #fff;
    font-family: 'Inter', 'Montserrat', Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 18px rgba(0,0,0,0.55);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 12002;
}
[data-tooltip]:hover::after {
    opacity: 1;
}
#golf-nav-controls .golf-nav-btn:nth-child(odd)[data-tooltip]::after {
    left: calc(200% + 20px);
}
#golf-dpad .golf-nav-btn[data-tooltip]::after {
    left: calc(100% + 10px);
}
#golf-dpad .golf-nav-btn:nth-child(2)[data-tooltip]::after {
    left: calc(300% + 25px);
}
@media (max-width: 900px) {
    [data-tooltip]::after { font-size: 0.78rem; padding: 6px 10px; }
}
@media (max-width: 600px) {
    [data-tooltip]::after { display: none !important; }
}

/* Desktop: course name & location — white text on transparent grey, fit-content */
@media (min-width: 901px) {
    .course-top-bar .course-name-text,
    #course-name-p.course-name-text {
        font-size: 1.875rem !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        letter-spacing: 0.02em;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: geometricPrecision;
    }
    .course-top-bar .course-location-text,
    #course-location-p.course-location-text {
        font-size: 1.25rem !important;
        font-weight: 600 !important;
        color: #ffffff !important;
        letter-spacing: 0.02em;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: geometricPrecision;
    }
    /* Desktop: panel under course name, even vertical spacing, all buttons same width */
    #golf-tour-panel {
        top: 82px;
        left: 28px;
        align-items: flex-start;
    }
    #golf-tour-panel .golf-panel-sliding {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        min-width: 0;
    }
    #golf-tour-panel .golf-top-buttons {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin: 0 0 12px 0;
        padding: 0;
        width: 140px;
        min-width: 140px;
    }
    #golf-tour-panel .golf-top-buttons .golf-panel-btn,
    #golf-tour-panel .golf-top-buttons #fullScreenButton {
        margin: 0 !important;
        flex-shrink: 0;
        width: 100% !important;
        min-width: 0;
        box-sizing: border-box;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   Welcome / Help modal — shown once on first visit
   ══════════════════════════════════════════════════════════════════════════ */

.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 250000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: welcome-fade-in 0.35s ease;
}
@keyframes welcome-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.welcome-overlay.welcome-hiding {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.welcome-card {
    width: min(440px, 92vw);
    max-height: 90dvh;
    overflow-y: auto;
    background: linear-gradient(160deg, #0d1f3c 0%, #102a4a 40%, #0b2540 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 255, 255, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    animation: welcome-card-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes welcome-card-up {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-header {
    text-align: center;
    padding: 1.8rem 1.5rem 0.8rem;
}
.welcome-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin-bottom: 0.6rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.welcome-title {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #fff 30%, #7fd4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.welcome-subtitle {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.5rem 1.2rem;
}
.welcome-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background 0.15s ease;
}
.welcome-feature:hover {
    background: rgba(255, 255, 255, 0.04);
}
.welcome-feature-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 180, 255, 0.12);
    color: #5ec4ff;
}
.welcome-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.welcome-feature-text strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
}
.welcome-feature-text span {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

.welcome-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 1rem 1.5rem 1.6rem;
}
#welcome-start-btn {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #0078d4 0%, #00b4d8 100%);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 120, 212, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
#welcome-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0, 120, 212, 0.5);
    filter: brightness(1.08);
}
#welcome-start-btn:active {
    transform: scale(0.98);
}

.welcome-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.welcome-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.welcome-checkbox-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    transition: border-color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}
.welcome-checkbox-label input[type="checkbox"]:checked + .welcome-checkbox-custom {
    background: #0078d4;
    border-color: #0078d4;
}
.welcome-checkbox-label input[type="checkbox"]:checked + .welcome-checkbox-custom::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}
.welcome-checkbox-label:hover .welcome-checkbox-custom {
    border-color: rgba(255, 255, 255, 0.5);
}

/* ── Welcome modal: mobile adjustments (fit without scroll on small phones) ── */
@media (max-width: 480px) {
    .welcome-card {
        border-radius: 16px;
        max-height: 94dvh;  /* taller so content fits without scrolling */
    }
    .welcome-header {
        padding: 1rem 1.2rem 0.5rem;
    }
    .welcome-logo {
        width: 32px;
        height: 32px;
        margin-bottom: 0.4rem;
    }
    .welcome-title {
        font-size: 1.08rem;
    }
    .welcome-subtitle {
        font-size: 0.78rem;
    }
    .welcome-features {
        padding: 0.2rem 0.8rem;
        gap: 0;
    }
    .welcome-feature {
        padding: 6px 8px;
        gap: 8px;
    }
    .welcome-feature-icon {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
    }
    .welcome-feature-text strong {
        font-size: 0.8rem;
    }
    .welcome-feature-text span {
        font-size: 0.72rem;
        line-height: 1.35;
    }
    .welcome-footer {
        padding: 0.6rem 1.2rem 1rem;
        gap: 10px;
    }
    #welcome-start-btn {
        padding: 10px 0;
        font-size: 0.88rem;
    }
}
