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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* Desktop Layout */
.game-container {
    display: flex;
    height: 100vh;
}

.image-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.location-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.guess-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 12px 30px;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: all 0.3s ease;
}

.guess-button:disabled {
    cursor: not-allowed;
}

.guess-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile Layout */
.map-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 90;
    cursor: pointer;
}

.map-toggle img {
    height: 40px;
    color: white;
}

.mobile-map-container {
    position: fixed;
    bottom: -80vh;
    left: 0;
    width: 100%;
    height: 80vh;
    background-color: white;
    z-index: 80;
    transition: transform 0.4s ease;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 16px 16px 0 0;
}

.mobile-map-container.open {
    transform: translateY(-100%);
}

.map-handle {
    width: 40px;
    height: 5px;
    background-color: #ccc;
    border-radius: 3px;
    margin: 10px auto;
}

.mobile-map {
    width: 100%;
    height: calc(100% - 25px);
}

.map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 70;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.map-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Dialog Styles */
.result-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.result-dialog.visible {
    opacity: 1;
    pointer-events: auto;
}

.dialog-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.dialog-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.dialog-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.distance-info {
    text-align: center;
}

.result-map-container {
    height: 400px;
    width: 100%;
}

.dialog-body {
    padding: 20px;
    overflow-y: auto;
}

.score-display {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
}

.final-score {
    font-size: 32px;
    text-align: center;
    margin: 20px 0;
    color: #2196F3;
}

.dialog-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
}

.next-button {
    padding: 10px 24px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.next-button:hover {
    background-color: #0b7dda;
}

.submit-form {
    margin-top: 20px;
}

.name-input {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.submit-button {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.submit-button:hover {
    background-color: #45a049;
}

.level-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 50;
}

.score-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 50;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 6px;
    background-color: #f1f1f1;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 110;
}

.progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
}

/* Media Query for Mobile */
@media (max-width: 768px) {
    .game-container {
        display: block;
    }

    .image-container {
        width: 100%;
        height: 100vh;
    }

    .map-container {
        display: none;
    }

    .map-toggle {
        display: block;
    }

    .dialog-content {
        width: 95%;
        max-width: 500px;
    }

    .result-map-container {
        height: 300px;
    }
}

.intro-image {
    height: 100%;
    margin-top: 3rem;
}

.start-button {
    padding: 1rem;
    width: 8rem;
}

/* Spinner Container */
.loading-spinner {
    position: absolute; /* Or fixed, depending on your layout */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Make sure it's on top of other content */
    border-radius: 8px; /* Match your container if applicable */
}

/* The Spinner Itself */
.spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite; /* Spin animation */
    margin-bottom: 10px;
}

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