.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../img/terracota3.jpg') center center;
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
    backdrop-filter: blur(5px);
    filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 1.0s ease-in-out, filter 0.8s ease-in-out;
}

.splash-screen.loaded {
    backdrop-filter: blur(0px);
    filter: blur(0px);
}

/* Mobile fix for background */
@media (max-width: 768px) {
    .splash-screen {
        background-attachment: scroll;
        min-height: 100vh;
        height: 100vh;
        overflow: hidden;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .splash-screen {
        background-attachment: scroll;
        min-height: -webkit-fill-available;
        height: -webkit-fill-available;
    }
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Splash Messages Container */
.splash-click-tip,
.splash-welcome-message {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    /* Increased to ensure they're above envelope */
    width: 100%;
    text-align: center;
}

.splash-click-tip {
    top: 65%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.7;
    animation: pulseGently 2s ease-in-out infinite;
    cursor: pointer;
}

.splash-welcome-message {
    top: 15%;
    opacity: 0;
    animation: fadeInUp 2s ease-out 1s forwards;
}

.envelope {
    background: #E47A2E;
    /* Primary color from main site */
    border-radius: 0 0 4px 4px;
    width: 320px;
    height: 320px;
    min-height: 320px;
    margin: 20px auto;
    position: relative;
    transition: all 0.3s cubic-bezier(0.42, 0, 0.58, 1);
    transform-origin: 50% 50%;
    margin-top: 80px;
    /* Add space for messages above */
    z-index: 98;
    /* Ensure envelope is below messages */
}

.envelope:before,
.envelope:after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    z-index: 2;
}

.envelope:before {
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 296px 0 0 300px;
    border-color: transparent transparent transparent #EDF5F7;
    /* Secondary color from main site */
}

.envelope:after {
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 296px 300px;
    border-color: transparent transparent #EDF5F7 transparent;
    /* Secondary color from main site */
}

.envelope.open {
    transform: rotateZ(7deg) translateY(130px) rotateY(-9deg);
}

.envelope.open .flap-outside {
    top: -1px;
    animation: open-flap 0.6s ease-in-out forwards;
}

.envelope.open .flap-outside .flap {
    background: #E47A2E;
    /* Primary color from main site */
}

.envelope.open .card {
    transform: translateX(14%) translateY(-200px);
    transition-delay: 1.0s;
}

.envelope .card {
    background: #ffffff;
    position: absolute;
    overflow: hidden;
    left: 0;
    bottom: 0;
    width: 70%;
    height: 85%;
    padding: 10px 20px;
    transform: translateX(14%);
    transition: all 0.6s cubic-bezier(0.42, 0, 0.58, 1) 0s;
}

.envelope .card h2 {
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    line-height: 0.6;
    margin-top: 0.4em;
}

.envelope .card p {
    font-family: 'Srisakdi', cursive;
    font-size: 1.3rem;
    line-height: 1.3;
}

.envelope .flap-container {
    border-radius: 4px;
    overflow: hidden;
    position: absolute;
    top: 0;
}

/* Click Tip Styles */
.splash-click-icon {
    color: #E47A2E;
    font-size: 16px;
    animation: pointingAnimation 2s ease-in-out infinite;
}

.splash-tip-text {
    color: #121F38;
    /* Dark color from main site */
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Welcome Message Styles */
.welcome-text {
    display: block;
    color: #121F38;
    /* Dark color from main site */
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    margin: 2rem 0;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.welcome-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.dot {
    color: #E47A2E;
    font-size: 12px;
    opacity: 0;
}

.dot-1 {
    animation: dotPulse 1.5s ease-in-out 2.5s infinite;
}

.dot-2 {
    animation: dotPulse 1.5s ease-in-out 2.7s infinite;
}

.dot-3 {
    animation: dotPulse 1.5s ease-in-out 2.9s infinite;
}

/* Animations */
@keyframes pulseGently {

    0%,
    100% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
}

@keyframes pointingAnimation {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes textGlow {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(228, 122, 46, 0.3);
    }
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    .splash-click-tip,
    .splash-welcome-message {
        display: block;
        /* Show messages on mobile */
        width: 90%;
        /* Reduce width for mobile */
        padding: 0 20px;
        font-size: 0.9rem;
        /* Slightly smaller text */
    }

    .splash-click-tip {
        top: 75%;
        /* Adjust position for mobile - below envelope */
    }

    .splash-welcome-message {
        top: 15%;
        /* Adjust position for mobile */
    }

    .splash-click-icon {
        font-size: 1.2rem;
        /* Adjust icon size for mobile */
    }

    .envelope {
        margin-top: 40px;
        /* Adjust margin for mobile with messages */
        transform: scale(0.9);
        /* Slightly smaller envelope on mobile */
    }

    .welcome-text {
        font-size: 1rem;
        /* Adjust welcome text size */
    }

    .welcome-dots .dot {
        font-size: 1rem;
        /* Adjust dots size */
    }
}