/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    color: #f0f0f0;
}

/* Fullscreen background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./assets/garden.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* Dark overlay layer (for fading in/out) */
#dark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    z-index: 1;
}

#dark-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Wing shadow overlay */
#wing-shadow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2;
}

#wing-shadow.active {
    opacity: 0.15;
}

/* Music toggle button (top-left) */
#music-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f0f0f0;
    padding: 10px 15px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 100;
    backdrop-filter: blur(5px);
}

#music-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

/* Progress indicator (top-right) */
#progress-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(200, 150, 150, 0.3);
    padding: 12px 20px;
    font-size: 14px;
    letter-spacing: 1px;
    border-radius: 5px;
    z-index: 100;
    backdrop-filter: blur(5px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Hotspot container */
#hotspot-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Individual hotspots (invisible divs) */
.hotspot {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.hotspot:hover {
    box-shadow: 0 0 20px 8px rgba(180, 50, 50, 0.6),
                0 0 40px 15px rgba(180, 50, 50, 0.3);
    transform: scale(1.1);
}

/* Debug mode - visible hotspots */
.hotspot.debug {
    background: rgba(255, 0, 0, 0.25);
    border: 1px solid rgba(255, 0, 0, 0.8);
}

/* Hint shimmer - stronger glow */
.hotspot.hint {
    animation: hintGlow 1.2s ease-in-out;
}

@keyframes hintGlow {
    0%, 100% {
        box-shadow: 0 0 20px 8px rgba(180, 50, 50, 0.6),
                    0 0 40px 15px rgba(180, 50, 50, 0.3);
    }
    50% {
        box-shadow: 0 0 30px 12px rgba(180, 50, 50, 0.8),
                    0 0 60px 20px rgba(180, 50, 50, 0.5);
    }
}

/* Collection pulse - triggered when hotspot is found */
.hotspot.pulse {
    animation: collectPulse 0.9s ease-out;
}

@keyframes collectPulse {
    0% {
        box-shadow: 0 0 20px 8px rgba(180, 50, 50, 0.6),
                    0 0 40px 15px rgba(180, 50, 50, 0.3);
        transform: scale(1);
    }
    40% {
        box-shadow: 0 0 50px 20px rgba(200, 60, 60, 0.9),
                    0 0 100px 40px rgba(200, 60, 60, 0.6);
        transform: scale(1.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(180, 50, 50, 0);
        transform: scale(1);
        opacity: 0;
    }
}

/* Mobile tap area expansion */
.hotspot::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
}

/* Mobile-only subtle pulse */
@media (hover: none) and (pointer: coarse) {
    .hotspot {
        animation: mobilePulse 3.8s ease-in-out infinite;
    }

    @keyframes mobilePulse {
        0%, 100% {
            box-shadow: 0 0 10px 4px rgba(180, 50, 50, 0.15);
        }
        50% {
            box-shadow: 0 0 15px 6px rgba(180, 50, 50, 0.25);
        }
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background: rgba(20, 15, 15, 0.95);
    border: 2px solid rgba(200, 150, 150, 0.4);
    padding: 40px 50px;
    max-width: 500px;
    width: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.close-button:hover {
    color: rgba(255, 200, 200, 1);
    transform: scale(1.1);
}

.clue-text {
    font-size: 16px;
    line-height: 1.8;
    color: #e0e0e0;
    text-align: center;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Unlock button */
#unlock-button {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(60, 20, 20, 0.9);
    border: 2px solid rgba(200, 150, 150, 0.5);
    color: #f0e0e0;
    padding: 15px 40px;
    font-size: 16px;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(5px);
    text-transform: uppercase;
}

#unlock-button:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#unlock-button:hover {
    background: rgba(80, 30, 30, 1);
    border-color: rgba(220, 180, 180, 0.8);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 5px 20px rgba(180, 50, 50, 0.4);
}

/* Final message section */
#final-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

#final-message:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.final-message-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

#final-title {
    font-size: 42px;
    margin-bottom: 30px;
    letter-spacing: 3px;
    color: #f0e0e0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

#final-text {
    font-size: 18px;
    line-height: 1.8;
    color: #d0d0d0;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Garden entry button */
.garden-button {
    display: inline-block;
    margin-top: 36px;
    padding: 14px 38px;
    background: rgba(40, 10, 10, 0.85);
    border: 1px solid rgba(180, 80, 80, 0.5);
    color: #e8d0d0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease,
                transform 0.2s ease;
}

.garden-button:hover {
    background: rgba(70, 20, 20, 0.95);
    border-color: rgba(220, 130, 130, 0.8);
    box-shadow: 0 0 18px 4px rgba(180, 50, 50, 0.35),
                0 0 40px 10px rgba(180, 50, 50, 0.15);
    transform: scale(1.04);
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #music-toggle,
    #progress-indicator {
        top: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }

    #music-toggle {
        left: 10px;
    }

    #progress-indicator {
        right: 10px;
    }

    .modal-content {
        padding: 30px 25px;
        max-width: 90%;
    }

    .clue-text {
        font-size: 14px;
    }

    #unlock-button {
        bottom: 40px;
        padding: 12px 30px;
        font-size: 14px;
    }

    .hotspot {
        width: 50px;
        height: 50px;
    }

    #final-title {
        font-size: 32px;
        margin-bottom: 20px;
    }

    #final-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #final-title {
        font-size: 24px;
    }

    #final-text {
        font-size: 14px;
    }

    .modal-content {
        padding: 25px 20px;
    }
}
