body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/background.jpg') no-repeat center center/cover;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow-y: auto;
    /* Allow scrolling if content overflows */
}

/* White overlay effect for the start screen */
#start-screen::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    /* Increased opacity for readability */
    z-index: -1;
}

/* Ensure content sits above the overlay */
.overlay-content,
.footer-logos {
    z-index: 101;
    width: 90%;
    max-width: 800px;
}

.welcome-text {
    font-size: 2rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: normal;
}

.instructions-container {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 40px;
}

.instruction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
}

.instruction-item img {
    height: 60px;
    margin-bottom: 10px;
}

.instruction-item p {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

#start-btn {
    background-color: #73394b;
    color: white;
    font-size: 1.2rem;
    padding: 12px 40px;
    border: none;
    border-radius: 25px;
    /* Rounded button style */
    cursor: pointer;
    text-transform: capitalize;
    font-weight: bold;
    transition: transform 0.2s, background-color 0.2s;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#start-btn:hover {
    transform: scale(1.05);
    background-color: #5e2e3d;
}

.disclaimer {
    font-size: 0.7rem;
    color: #555;
    margin-top: 20px;
    line-height: 1.4;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer Logos on Start Screen */
.footer-logos {
    position: relative;
    /* Prevent overlap */
    bottom: auto;
    margin-top: 30px;
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-shrink: 0;
    padding-bottom: 20px;
}

.logo {
    width: 120px;
    height: auto;
}

/* Iframe styling */
.tour-frame {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    /* Behind start screen initially */
}

/* Persistent Logos during tour */
#persistent-logos {
    position: absolute;
    bottom: 20px;
    right: 20px;
    left: auto;
    width: auto;
    display: flex;
    flex-direction: column;
    /* Stack vertically always */
    align-items: flex-end;
    /* Align to right */
    justify-content: flex-end;
    gap: 15px;
    z-index: 50;
    /* Above iframe */
    pointer-events: none;
}

#persistent-logos .logo {
    width: 82px;
    /* Increased size */
    background: rgba(255, 255, 255, 0.8);
    /* White overlay behind logo */
    padding: 5px;
    /* Spacing for the background */
    border-radius: 8px;
    /* Rounded corners */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* Subtle shadow for depth */
}

/* Finishes Wrapper */
#finishes-wrapper {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 90%;
    max-width: 800px;
    pointer-events: none;
    /* Let clicks pass through if not on elements */
}

/* Finishes Controls */
#finishes-controls {
    display: flex;
    gap: 0;
    /* Connected buttons */
    background: #000;
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
    pointer-events: auto;
    /* Enable clicks */
    width: max-content;
}

#sin-acabados-notice {
    /* color: white; */
    /* text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.5); */
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
}

.finish-btn {
    background: #000;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 0;
    transition: background 0.3s;
}

.finish-btn.active {
    background: #73394b;
    font-weight: bold;
}

.finish-btn:hover:not(.active) {
    background: #333;
}

.hidden {
    display: none !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .logo {
        width: 92px;
    }

    .welcome-text {
        font-size: 1.5rem;
    }

    .instructions-container {
        flex-direction: row;
        gap: 15px;
        align-items: flex-start;
        justify-content: center;
        width: 90%;
        margin-bottom: 20px;
    }

    .instruction-item {
        width: 48%;
        max-width: none;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .instruction-item img {
        height: 40px;
        /* Smaller icon for mobile */
        margin-bottom: 5px;
    }

    .instruction-item p {
        font-size: 0.75rem;
        /* Smaller text for mobile */
    }

    /* Mobile: Keep logos on right, stacked */
    #persistent-logos {
        right: 20px;
        left: auto;
        bottom: 20px;
        /* Inherit column direction from main style */
        align-items: flex-end;
    }

    #persistent-logos .logo {
        width: 60px;
        /* Smaller on mobile */
    }

    #finishes-wrapper {
        bottom: 20px;
        width: 95%;
    }

    #finishes-controls {
        width: max-content;
    }

    #sin-acabados-notice {
        font-size: 0.75rem;
        max-width: 220px;
        line-height: 1.2;
    }

    .finish-btn {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}

/* Back Button Style */
.back-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 200;
    /* Above start screen overlay content */
    color: #333;
    /* Dark text for visibility on white overlay */
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, background 0.2s;
}

.back-btn:hover {
    transform: scale(1.05);
    background: #fff;
    color: #73394b;
    /* Brand color on hover */
}

@media (max-width: 768px) {
    .back-btn .btn-text {
        display: none;
    }

    .back-btn {
        padding: 10px;
        /* Reduced padding for icon only */
        border-radius: 50%;
        /* Circle shape for icon only */
        width: 40px;
        height: 40px;
        justify-content: center;
    }
}

/* Mini Map Styles */
.mini-map {
    position: absolute;
    bottom: 80px;
    /* Above back button */
    left: 20px;
    width: 170px;
    /* Desktop */
    z-index: 150;
    /* Above tour frame */
    pointer-events: none;
    /* Just visual */
    transition: opacity 0.3s;
}

.mini-map img {
    width: 100%;
    height: auto;
    display: block;
    /* Optional: shadow */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@media (max-width: 768px) {
    .mini-map {
        width: 120px;
        /* Mobile */
        bottom: 70px;
        /* Adjust for mobile back button */
    }
}

/* Checkbox Highlight Animation */
@keyframes flash-red {
    0% {
        outline: 2px solid red;
        outline-offset: 2px;
    }

    50% {
        outline: 2px solid transparent;
        outline-offset: 2px;
    }

    100% {
        outline: 2px solid red;
        outline-offset: 2px;
    }
}

.highlight-checkbox {
    animation: flash-red 1s infinite;
}