* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: black;
    color: white;
    font-family: 'VT323', monospace;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-user-select: none;
    /* Safari */
    -ms-user-select: none;
    /* IE 10+ and Edge */
    user-select: none;
    /* Standard syntax */
}

body,
html {
    overflow: hidden;
}

#bmc-wbtn {
    width: 50px !important;
    height: 50px !important;
    background: rgb(255, 255, 255) !important;
    z-index: 1000 !important;
}

#bmc-wbtn img {
    display: none;
    /* Hide the original image */
}

#bmc-wbtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    background-image: url('https://chborel.ch/wp-content/uploads/2024/08/coffee_cup.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.title {
    font-size: 3rem;
    -webkit-background-clip: text;
    -webkit-text-fill-color: black;
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
}

.space-invaders-font {
    font-family: 'VT323', monospace;
}

.small-font {
    font-size: 12px;
}

.popup-close-btn {
    position: absolute;
    top: 5px;
    right: 15px;
    color: white;
    /* White text to contrast with the black H2 header */
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1005;
    line-height: 1;
    font-family: sans-serif;
    /* Cleaner X look than VT323 */
    transition: color 0.2s;
}

.popup-close-btn:hover {
    color: #ccc;
    /* Light grey on hover */
}

.recent-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
    border: 2px solid white;
}


.marker-cluster div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding-right: 10px;
    padding-bottom: 10px;
}

.marker-cluster span {
    display: inline-block;
    text-align: center;
}

.marker-cluster-pie {
    background-color: transparent !important;
}

.marker-cluster-pie svg {
    display: block;
}

@keyframes wiggle {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(45deg);
    }

    50% {
        transform: rotate(0deg);
    }

    75% {
        transform: rotate(-45deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.wiggle-marker img {
    transform-origin: center;
    /* Ensures the rotation is centered */
    display: block;
    /* Fix for keeping the element inline */
}


.city-item {
    display: block;
    align-items: center;
    margin-bottom: 10px;
}

.city-name {
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 40%;
    padding-top: 2px;
    text-align: right;
    font-size: 1.2rem;
}

.city-sign {
    display: inline-block;
    transition: transform 0.3s;
}

.city-sign.rotated {
    transform: rotate(90deg);
}

.progress-bar-container {
    width: 90%;
    background-color: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    top: 2px;
    left: 20px;
}

.progress-bar {
    display: flex;
    width: 100%;
    height: 15px;
}

.progress-segment {
    height: 100%;
    color: white;
    text-align: right;
    padding-top: 1px;
    padding-right: 5px;
    font-size: .75em;
}

.progress-segment.green {
    background-color: green;
}

.progress-segment.pink {
    background-color: pink;
}

.progress-segment.mixed {
    background: repeating-linear-gradient(-45deg,
            green,
            green 5px,
            red 5px,
            red 10px);
}

.progress-segment.red {
    background-color: red;
}

.progress-segment.grey {
    background-color: grey;
}

.toggle-group {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.toggle-container {
    display: block;
    align-items: left;
    font-size: 1.2rem;
}

.toggle-container img {
    vertical-align: middle;
    height: 1em;
    margin-left: 5px;
}

.nested-toggle {
    margin-top: 5px;
}

.switch {
    margin-right: 10px;
}

#map-container {
    flex: 1;
    position: relative;
    width: 100vw;
}

#map {
    width: 100vw;
    height: 100vh;
}

#cities-list {
    list-style-type: none;
    padding: 0;
    overflow-y: auto;
    /* Enables vertical scrolling */
    max-height: 600px;
}

#cities-list li {
    text-align: left;
}

#nav-buttons {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1000;
    align-items: center;
}

#nav-buttons span {
    font-family: 'VT323', monospace;
    font-size: 2rem;
    color: black;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

#prev-button,
#next-button {
    cursor: pointer;
    position: relative;
    display: inline-block;
    padding-top: 5px !important;
}

#prev-button::before,
#next-button::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    /* Adjust the width as needed */
}

#prev-button::before {
    left: -20px;
    /* Adjust the left position as needed */
}

#next-button::before {
    right: -20px;
    /* Adjust the right position as needed */
}

#date-picker {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: black;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 5px;
    border-radius: 5px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    min-width: 200px;
    backdrop-filter: blur(5px) !important;
}

/* Style the flatpickr calendar */
.flatpickr-calendar {
    background-color: rgba(255, 255, 255, 1);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 5px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /*
    position: absolute;
    left: 50% !important;
    transform: translate(-50%, -2%);
    */
}

.flatpickr-calendar .flatpickr-month {
    background-color: rgba(255, 255, 255, 1);
    border-radius: 5px;
}

.flatpickr-calendar .flatpickr-day,
.flatpickr-calendar .flatpickr-month,
.flatpickr-calendar .flatpickr-weekday {
    font-size: 1rem;
}

.flatpickr-calendar .flatpickr-day {
    border-radius: 5px;
}

.flatpickr-calendar .flatpickr-day.selected {
    background-color: #007bff;
    color: white;
}

.flatpickr-calendar .flatpickr-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.flatpickr-current-month input.cur-year {
    font-size: 0.8em;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-size: 0.8em;
}

/* Media query for mobile devices */
@media (max-width: 600px) {
    #date-picker {
        font-size: 1rem;
        /* Increase font size for better readability on mobile */
        padding: 5px;
        /* Increase padding for better touch target on mobile */
        min-width: 200px;
        /* Adjust minimum width for mobile */
    }
}


#time-text {
    font-family: 'VT323', monospace;
    font-size: 1.2rem !important;
    color: black;
    background-color: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    padding: 5px !important;
    border-radius: 5px !important;
    backdrop-filter: blur(5px) !important;
}

.icon-color-grey {
    filter: invert(48%) sepia(5%) saturate(0%) hue-rotate(220deg) brightness(87%) contrast(86%);
    image-rendering: pixelated;
}

.icon-color-purple {
    filter: invert(30%) sepia(90%) saturate(7489%) hue-rotate(277deg) brightness(92%) contrast(90%);
    image-rendering: pixelated;
}

.icon-color-green {
    filter: invert(53%) sepia(67%) saturate(631%) hue-rotate(67deg) brightness(91%) contrast(91%);
    image-rendering: pixelated;
}

.icon-color-red {
    filter: invert(22%) sepia(92%) saturate(4429%) hue-rotate(349deg) brightness(102%) contrast(101%);
    image-rendering: pixelated;
}

.icon-color-yellow {
    filter: brightness(0) saturate(100%) invert(62%) sepia(83%) saturate(759%) hue-rotate(10deg) brightness(94%) contrast(97%);
    image-rendering: pixelated;
}

#popup-dialogue-box {
    position: relative;
    /* Already set in JS, but good practice to ensure */
    /* Your existing styles like background, padding, border-radius etc. */
    background-color: white;
    color: black;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 10px;
    /* This might need slight adjustment now */
    max-width: 300px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* The speech bubble tail */
#popup-dialogue-box::after {
    content: '';
    /* Necessary for pseudo-elements */
    position: absolute;
    bottom: -10px;
    /* Position it just below the bottom edge. Adjust size as needed. */
    left: 50%;
    /* Center horizontally */
    transform: translateX(-50%);
    /* Fine-tune centering */
    width: 0;
    height: 0;
    border-style: solid;
    /* Creates the triangle: */
    border-width: 10px 10px 0 10px;
    /* Top, Right, Bottom, Left */
    /* Make the top border match the bubble background, others transparent */
    border-color: white transparent transparent transparent;
}


.iss-icon {
    width: 24px;
    height: 24px;
    background-image: url('https://chborel.ch/wp-content/uploads/2024/08/iss.png');
    /* Replace with the actual path to your ISS icon image */
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    image-rendering: pixelated;
}

.blue-circle {
    width: 12px;
    height: 12px;
    background-color: rgba(0, 122, 255, 0.5);
    border-radius: 50%;
    position: relative;
}

.blue-circle::before {
    content: '';
    width: 12px;
    height: 12px;
    background-color: rgba(0, 122, 255, 1);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.instagram-icon {
    width: 16px;
    height: 16px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    position: relative;
    left: 0px;
}

.leaflet-popup-close-button {
    display: none;
}

.leaflet-popup-content-wrapper {
    border-radius: 0%;
}

.leaflet-popup {}

.leaflet-popup-tip {}

.leaflet-popup-content {
    padding: 0px;
    margin: 0px 0px 0px 0px;
    font-size: 1.1rem;
}

.leaflet-popup-content textarea {
    font-size: 1.1rem;
}

div.hidden,
button.hidden {
    display: none !important;
}

#refresh-button {
    margin: 10px;
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
}

.invader-patchwork {
    display: flex;
    flex-wrap: wrap;
    overflow-y: scroll;
    max-height: 330px;
    justify-content: center;
    margin-top: 10px;
    gap: 10px;
}

.invader-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.invader-image {
    width: 100%;
    height: 100%;
    display: block;
}

.invader-caption {
    position: absolute;
    bottom: 1px;
    right: 1px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 8px;
    padding: 2px 8px;
    text-align: right;
}


/* Sidebar */
#side-buttons-container {
    position: fixed;
    right: 20px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Adjust the gap as needed */
    z-index: 1000;
}

#side-buttons-container button,
#side-buttons-container #draggable-button-container {
    background-color: white;
    background-size: 30px;
    background-repeat: no-repeat;
    background-position: center;
    color: black;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#recenter-button {
    background-image: url('https://chborel.ch/wp-content/uploads/2024/08/gps.png');
}

#cities-info-button {
    background-image: url('https://chborel.ch/wp-content/uploads/2024/07/city.png');
    image-rendering: pixelated;
}

#account-info-button {
    background-image: url("https://img.icons8.com/?size=48&id=82807&format=png");
    image-rendering: pixelated;
}

#coffee-button {
    background-image: url('https://storage.ko-fi.com/cdn/logomarkLogo.png');
}

#kofiframe {
    display: none;
    border: none;
    padding: 4px;
    background: #f9f9f9;
    height: 80vh;
    position: fixed;
    right: 80px;
    bottom: 60px;
}

#achievements-button {
    background-image: url('https://chborel.ch/wp-content/uploads/2024/08/achievements.svg');
    image-rendering: pixelated;
    background-size: 50% !important;
}

#draggable-button-container {
    background-image: url('https://chborel.ch/wp-content/uploads/2024/07/location_icon.png');
}

#search-button {
    background-image: url('https://chborel.ch/wp-content/uploads/2024/07/invader_magnifier.png');
}

#select-mode-button {
    position: fixed;
    top: 60px;
    left: 20px;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px dotted black;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    background-color: transparent;
    z-index: 1000;
}

#select-mode-button.solid {
    background-color: black;
    /* Solid color */
}

.draggable-pin-button {
    background-color: transparent !important;
    color: transparent;
    border: none;
    width: 50px;
    height: 50px;
    cursor: grab;
    touch-action: none;
}

.draggable-pin-button:active {
    cursor: grabbing;
}

.leaflet-touch .leaflet-control-geocoder {
    position: fixed;
    top: 50px;
    right: 20px;
    display: block;
}

@media (max-width: 600px) {
    #side-buttons-container {
        right: 10px;
        /* Move buttons closer to the edge */
        gap: 10px;
        /* Reduce the space between buttons */
    }

    #side-buttons-container button,
    #side-buttons-container #draggable-button-container {
        width: 40px;
        /* Smaller width */
        height: 40px;
        /* Smaller height */
        background-size: 24px;
        /* Smaller icon inside the button */
    }

    #shop-button {
        background-size: 35px !important;
    }
}




#map-title {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5000;
    width: 100%;
    background-color: black;
    color: white;
    text-align: center;
    padding: 0px 0px 0px 0px;
    margin: 0;
    white-space: nowrap;
    font-size: 3em;
    font-family: 'VT323';
}

#public-comments-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

#public-comments-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    color: black;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    position: relative;
}

#public-comments-title {
    margin-bottom: 14px;
    margin-right: 24px;
    font-size: 1.3rem;
    text-align: center;
}

#public-comments-list {
    list-style-type: none;
    padding: 0;
    margin-bottom: 12px;
    width: 100%;
    overflow-y: auto;
    flex: 1 1 0;
    min-height: 200px;
}

#public-comments-list li {
    background-color: #f9f9f9;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
}

#public-comments-list li button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 10px;
}

#public-comments-list li button img {
    width: 16px;
    height: 16px;
}

#new-public-comment {
    width: 100%;
    height: 80px;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: none;
    font-size: 1rem;
    box-sizing: border-box;
}

#save-public-comment {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    width: 100%;
    font-size: 1rem;
}

#save-public-comment:hover:not(:disabled) {
    opacity: 0.9;
}

#save-public-comment:disabled {
    background-color: #ccc;
    cursor: default;
}

#button-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 6px;
}

.comment-you-badge {
    display: inline-block;
    font-size: 0.7em;
    background: #e0e0e0;
    color: #555;
    border-radius: 8px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    font-family: sans-serif;
}

#public-comments-content .popup-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 1.6rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

#public-comments-content .popup-close-btn:hover {
    color: #333;
}

.comments-empty-state {
    text-align: center;
    color: #aaa;
    font-style: italic;
    padding: 20px 0;
    font-family: sans-serif;
    font-size: 0.95rem;
}

/* Slider */
#slider-container {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 60vh;
    /* Adjust the height as needed */
    padding: 10px;
    display: flex;
    align-items: center;
    z-index: 1000;
}

#time-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 100%;
    height: 100%;
    background: transparent;
    /* Optional: Make the background transparent */
}

.hidden {
    display: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--toggle-color);
}

input:checked+.slider:before {
    transform: translateX(14px);
}

input[id="toggle-green"]:checked+.slider {
    --toggle-color: #4CAF50;
}

input[id="toggle-grey"]:checked+.slider {
    --toggle-color: #808080;
}

input[id="toggle-yellow"]:checked+.slider {
    --toggle-color: #e5c004;
}

input[id="toggle-red"]:checked+.slider {
    --toggle-color: #FF0000;
}

input[id="toggle-red-cities"]:checked+.slider {
    --toggle-color: #FF0000;
}

input[id="toggle-edges"]:checked+.slider {
    --toggle-color: #0000FF;
}

input[id="toggle-maps"]:checked+.slider {
    --toggle-color: #007AFF;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001 !important;
}

#account-info-popup,
#cities-info-popup,
#achievements-popup,
#shop-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001 !important;
    font-family: 'VT323';
}

#account-info-content,
#achievements-content,
#cities-info-content,
#shop-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow-y: auto;
    font-size: 1.1rem;
    max-height: 77vh;
    background: white;
    /* Changed from black */
    color: black;
    /* Changed from white */
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 95%;
    box-sizing: border-box;
    font-family: "VT323";
}

#side-buttons-container #shop-button {
    background-image: url('https://chborel.ch/wp-content/uploads/2024/08/gift.svg');
    background-position: center 40%;
    background-size: 42px;
}

#account-info-popup h2,
#cities-info-popup h2,
#achievements-popup h2,
#shop-popup h2 {
    background: black;
    color: white;
    padding: 7px;
    /* Negative margins pull the header flush with the parent's edges */
    margin: -10px -10px 0px -10px;
    /* Round the top corners to match the parent popup box */
    border-radius: 10px 10px 0 0;
}

.shop-description {
    font-size: 0.7em;
    font-style: italic;
    color: #666;
    margin-top: 5px;
    margin-bottom: 20px;
    padding: 0 15px;
}


/* MODIFIED: Styles for the new shop layout with rows, price below title, and discounts */
#shop-items-container {
    display: flex;
    flex-direction: column;
    /* Stack items vertically */
    gap: 15px;
    /* Space between rows */
    padding: 10px;
}

.shop-item {
    display: flex;
    align-items: stretch;
    /* This makes children fill the height by default */
    background-color: #f2f2f2;
    border-radius: 8px;
    /* padding: 10px; <-- REMOVED */
    width: 100%;
    text-decoration: none;
    color: black;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    overflow: hidden;
    /* CRITICAL: This clips the child image's corners */
}

.shop-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 255, 255, 0.1);
}

.shop-item::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #999;

    /* FIXES: */
    align-self: center;
    /* Vertically center the triangle */
    margin-left: 15px;
    /* Space between text and triangle */
    margin-right: 15px;
    /* Space between triangle and right edge */
    flex-shrink: 0;
}

/* This rule is the same, it holds the button(s) */
.shop-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

/* NEW: This is the container for the "Couleurs" button and its swatch pop-up.
   position: relative is CRITICAL for the pop-up positioning. */
.colors-button-container {
    position: relative;
    display: inline-block;
    /* Allows it to sit nicely in the flex container */
}

/* MODIFIED: This is now the pop-up for the swatches. */
.shop-item-colors {
    display: none;
    /* Hide it by default */
    position: absolute;
    bottom: 110%;
    /* Position it above the button */
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    flex-wrap: wrap;
    /* Allows colors to wrap if there are many */
    gap: 6px;
    width: 120px;
    /* Give it a fixed width */
    justify-content: center;
    /* Center the swatches inside */
}

/* NEW: A little triangle pointing down from the pop-up */
.shop-item-colors::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

/* NEW: The magic rule to show the pop-up on hover OR click/tap (focus) */
.colors-button-container:hover .shop-item-colors,
.colors-button-container .colors-btn:focus+.shop-item-colors {
    display: flex;
    width: 150px;
}

/* The individual color swatch style is unchanged, but ensure it's there */
.color-swatch {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.shop-item-image {
    width: 90px;
    aspect-ratio: 1 / 1;
    /* This forces the element to be a square */
    object-fit: cover;
    /* This crops the image to fill the square without distortion */
    border-radius: 8px 0 0 8px;
    flex-shrink: 0;
}

.shop-item-text-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 15px;
    /* Adds back the necessary spacing internally */
}

.shop-item-name {
    font-size: .75em;
    font-family: 'VT323', sans-serif;
    margin-bottom: 5px;
    /* Space between name and price */
}

/* Container for price elements (original and discounted) */
.shop-item-price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Space between original and discounted price */
    font-size: .7em;
}

.shop-item-price,
.shop-item-original-price {
    /* Base style for prices */
    font-weight: bold;
}

.shop-item-original-price {
    text-decoration: line-through;
    /* Strikethrough for original price */
    color: #aaa;
    /* Dimmer color for original price */
}

.shop-item-discounted-price {
    color: red;
    /* Green color for discounted price */
}

.view-3d-btn {
    border-radius: 10px;
    /* Adjust the value to control the roundness of the corners */
    background-color: #acacac;
    /* Dark grey background */
    border: none;
    /* No outline */
    color: white;
    /* White text */
    padding: 5px 10px;
    /* Adjust padding as needed */
    font-size: 12px;
    /* Adjust font size as needed */
    cursor: pointer;
    /* Change cursor to pointer on hover */
    margin-top: 5px;
}

#image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    /* Changed from flex for initial state */
    justify-content: center;
    align-items: center;
    z-index: 10002;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

#image-lightbox-overlay.visible {
    display: flex;
    /* Re-enable flex when visible */
    opacity: 1;
    pointer-events: auto;
}

/* Styling for the <img> tag inside the lightbox */
#lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 5px;
    cursor: default;
}

/* Ensure the model container takes up space */
#model-container {
    display: flex;
    /* This will be changed from none by JS */
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.lightbox-close-button {
    position: absolute;
    top: 40px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10003;
    background-color: black;
    border-radius: 50%;
    height: 45px;
    width: 45px;
    text-align: center;
}

#lightbox-purchase-btn {
    position: absolute;
    top: 90px;
    /* Position it below the 'X' close button */
    right: 30px;
    /* Align it with the 'X' close button */
    z-index: 10004;
    /* Make sure it's on top */

    display: none;
    /* Hidden by default, JS will show it */
    padding: 10px 20px;
    /* Slightly smaller padding to fit better */
    background-color: #4CAF50;
    color: white;
    font-family: 'VT323', monospace;
    font-size: 1em;
    /* Slightly smaller font size */
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#lightbox-purchase-btn:hover {
    background-color: #45a049;
    /* Darker green on hover */
    transform: scale(1.05);
    /* Slight zoom effect */
}

/* Container for the 3D viewer canvas */
#model-viewer-container {
    width: 80vw;
    height: 70vh;
    max-width: 800px;
    max-height: 600px;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);

    /* --- Improved Pixelated Night Sky Background --- */

    /* 1. Base color for the deep space */
    background-color: #0c0a1a;

    /* 2. Layer multiple gradients to create a non-uniform starfield */
    background-image:
        /* Layer 4: A very subtle "pixel dust" texture to add depth and break the grid */
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),

        /* Layer 3: A dense field of very dim, tiny stars */
        radial-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 0),

        /* Layer 2: A sparse field of medium-brightness stars */
        radial-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 0),

        /* Layer 1: A very sparse field of the brightest stars */
        radial-gradient(white 1px, transparent 0);

    /* 3. Give each layer a different size to make the pattern appear random */
    background-size:
        10px 10px,
        /* Size for the pixel dust */
        10px 10px,
        /* Size for the pixel dust */
        40px 40px,
        /* Size for the dim stars */
        100px 100px,
        /* Size for the medium stars */
        150px 150px;
    /* Size for the bright stars */

    /* 4. Offset each layer differently to prevent alignment */
    background-position:
        0 0,
        /* Position for pixel dust */
        0 0,
        /* Position for pixel dust */
        20px 30px,
        /* Offset for dim stars */
        40px 60px,
        /* Offset for medium stars */
        75px 100px;
    /* Offset for bright stars */
}

/* Color selector container */
#color-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
}

#colors-available-text {
    font-family: 'VT323', monospace;
    color: white;
    font-size: 1em;
    margin-top: 10px;
    /* Add some space above the text */
    margin-bottom: -10px;
    /* Reduce the default gap to the color buttons */
}

/* Individual color buttons */
.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #00aaff;
    /* Highlight for the active color */
    transform: scale(1.15);
}

.disabled-button {
    background-color: grey !important;
    pointer-events: none;
    opacity: 0.5;
    !important
}

.marker-cluster {
    background-color: grey;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    color: white;
    font-weight: bold;
}

.cluster-green {
    background-color: green;
}

.cluster-red {
    background-color: red;
}

.cluster-grey {
    background-color: grey;
}

.language-selector {
    position: absolute;
    top: 50px;
    right: 10px;
    z-index: 1000;
}

.language-selector span {
    cursor: pointer;
    margin-right: 10px;
    font-size: 24px;
    /* Adjust the size as needed */
}

.language-selector span.greyed-out {
    filter: grayscale(100%);
}

#image-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    z-index: 9999;
    pointer-events: none;
}

#animated-image {
    width: 200px;
    height: auto;
    opacity: 0;
    position: relative;
    bottom: -100px;
    pointer-events: none;
    image-rendering: pixelated;
}

@keyframes slideIn {
    0% {
        bottom: -100px;
        opacity: .25;
    }

    100% {
        bottom: 50px;
        opacity: 1;
    }
}

@keyframes stay {

    0%,
    100% {
        bottom: 50px;
        opacity: 1;
    }
}

@keyframes slideOut {
    0% {
        bottom: 50px;
        opacity: 1;
    }

    100% {
        bottom: -100px;
        opacity: .25;
    }
}

.close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 2010;
}

.ad {
    position: fixed;
    /* or use position: sticky; if you want it to scroll with the page */
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    /* Ensure the ad is above other content */
    background-color: #fff;
    /* Optional: Add a background color */
    padding: 10px;
    /* Optional: Add padding */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Optional: Add a shadow for better visibility */
    box-sizing: border-box;
    /* Include padding and border in the element's total width and height */
    max-width: 100%;
    /* Ensure the ad doesn't exceed the viewport width */
    overflow: hidden;
    /* Handle any overflow content */
}

@media (max-width: 768px) {
    .ad {
        top: auto;
        z-index: 2000;
        bottom: 0px;
        height: 50vh;
        width: 100vw;
        /* Ensure the ad takes the full width of the viewport on smaller screens */
    }
}

/* Spinner styles */
#loading-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    /* Dark semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Make sure it's on top of everything */
    pointer-events: none;
}

.spinner {
    border: 8px solid #f3f3f3;
    /* Light grey */
    border-top: 8px solid #3498db;
    /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Dynamic styles for pin control buttons (moved from JS dynamic injection) */
.pin-control-buttons {
    position: absolute;
    display: flex;
    gap: 5px;
    z-index: 9999;
    pointer-events: auto;
    left: 30px;
    top: -10px;
}
.pin-control-buttons button {
    width: 24px;
    height: 24px;
    border: 1px solid #ccc;
    border-radius: 50%;
    cursor: pointer;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 14px;
    line-height: 1;
    font-family: system-ui;
}
.pin-control-buttons .done-btn {
    color: #4CAF50;
}
.pin-control-buttons .cancel-btn {
    color: #f44336;
}

/* ── Map Toggle Bar ─────────────────────────────────── */
#map-toggles {
    position: fixed;
    bottom: 80px;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    transform: translateX(calc(-100% + 36px));
    transition: transform 0.25s ease;
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: #222;
}

#map-toggles.open {
    transform: translateX(0);
}

#map-toggles-body {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 12px 0 0 12px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

#map-toggles-tab {
    width: 36px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: bold;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    min-height: 44px;
    padding: 0;
    flex-shrink: 0;
}

.map-toggle-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.map-toggle-row.nested {
    padding-left: 20px;
}

.map-toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green  { background: #4CAF50; }
.dot-grey   { background: #9E9E9E; }
.dot-yellow { background: #FFC107; }
.dot-red    { background: #F44336; }
.dot-blue   { background: #2196F3; }

/* ── Spotlight Search ───────────────────────────────── */
#search-popup {
    position: fixed;
    inset: 0;
    z-index: 2001;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20vh;
    background: transparent;
}

#search-panel {
    width: min(580px, 95vw);
    background: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    font-family: 'VT323', monospace;
}

#search-input-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
}

#search-icon {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    caret-color: #fff;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

#search-kbd-esc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

#search-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0;
}

#search-results {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: calc(8 * 60px);
    overflow-y: auto;
}

#search-results:empty {
    display: none;
}

#search-results li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 6px;
    height: 56px;
    box-sizing: border-box;
    transition: background 0.1s;
}

#search-results li:hover,
#search-results li.search-result-active {
    background: rgba(255, 255, 255, 0.08);
}

.search-result-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
}

.search-result-thumb-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
}

.search-result-name {
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'VT323', monospace;
}

.search-result-city {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'VT323', monospace;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.search-result-points {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-family: 'VT323', monospace;
}

.search-result-marker {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: pixelated;
}
