body {
    margin: 0;
    padding: clamp(10px, 3vh, 30px) 0;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: black;
    color: #fff;
    text-align: center;
    overflow: visible;
    position: relative;
}

.space-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 15% 25%, rgba(255, 215, 0, 0.02) 0%, transparent 40%), 
                radial-gradient(circle at 75% 75%, rgba(187, 134, 252, 0.03) 0%, transparent 50%), 
                radial-gradient(circle at 30% 70%, rgba(0, 191, 255, 0.02) 0%, transparent 60%);
    animation: spaceShift 20s infinite linear;
}

@keyframes spaceShift {
    0% { background-position: 0 0; }
    50% { background-position: 100px 50px; }
    100% { background-position: 0 0; }
}

.smoke-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.smoke-particle {
    position: absolute;
    width: 80px; /* Increased size for more coverage */
    height: 80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent); /* Grayish-white for mystery */
    filter: blur(25px); /* Increased blur for diffuse smoke */
    animation: smokeRise 40s infinite ease-in-out; /* Slower for lingering effect */
}

.smoke-particle:nth-child(1) { left: 5%; bottom: -10%; animation-delay: 0s; animation-duration: 35s; width: 70px; height: 70px; }
.smoke-particle:nth-child(2) { left: 15%; bottom: -15%; animation-delay: 3s; animation-duration: 45s; }
.smoke-particle:nth-child(3) { left: 25%; bottom: -20%; animation-delay: 6s; animation-duration: 38s; width: 90px; height: 90px; }
.smoke-particle:nth-child(4) { left: 35%; bottom: -25%; animation-delay: 9s; animation-duration: 42s; }
.smoke-particle:nth-child(5) { left: 45%; bottom: -30%; animation-delay: 12s; animation-duration: 40s; width: 60px; height: 60px; }
.smoke-particle:nth-child(6) { left: 55%; bottom: -35%; animation-delay: 15s; animation-duration: 37s; }
.smoke-particle:nth-child(7) { left: 65%; bottom: -40%; animation-delay: 18s; animation-duration: 43s; width: 85px; height: 85px; }
.smoke-particle:nth-child(8) { left: 75%; bottom: -45%; animation-delay: 21s; animation-duration: 39s; }
.smoke-particle:nth-child(9) { left: 85%; bottom: -50%; animation-delay: 24s; animation-duration: 41s; width: 75px; height: 75px; }
.smoke-particle:nth-child(10) { left: 95%; bottom: -55%; animation-delay: 27s; animation-duration: 36s; }
.smoke-particle:nth-child(11) { left: 10%; bottom: -60%; animation-delay: 30s; animation-duration: 44s; width: 95px; height: 95px; }
.smoke-particle:nth-child(12) { left: 30%; bottom: -65%; animation-delay: 33s; animation-duration: 40s; }

@keyframes smokeRise {
    0% { transform: translateY(100vh) translateX(0) scale(0.6); opacity: 0.4; }
    50% { transform: translateY(50vh) translateX(20px) scale(1.5); opacity: 0.6; } /* Added sway */
    100% { transform: translateY(-60vh) translateX(-10px) scale(3); opacity: 0; } /* Added sway */
}

#spaceCanvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    opacity: 0.8;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 95%;
    padding: clamp(15px, 4vw, 25px);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 10px rgba(255, 102, 0, 0.3),
        0 0 20px rgba(255, 102, 0, 0.2),
        0 0 30px rgba(255, 69, 0, 0.1);
    animation: containerFade 3s ease-in-out;
    margin: 0 auto; /* Center the container horizontally */
    width: clamp(300px, 90%, 600px); /* Ensure consistent width and centering */
}

@keyframes containerFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-family: 'Pacifico', cursive;
    font-size: clamp(2.5em, 8vw, 3.5em);
    margin-bottom: 10px;
    font-weight: 400;
    color: #ff6600;
    -webkit-text-stroke: 0.5px #fff; /* Tubular outline */
    text-stroke: 0.5px #fff; /* Fallback */
    text-shadow: 
        0 0 2px #fff, 
        0 0 5px #ff6600,
        0 0 10px #ff6600,
        0 0 20px #ff6600,
        0 0 40px #ff4500, 
        0 0 60px #ff4500,
        0 0 80px #ff4500,
        0 0 100px #ff4500;
    animation: neonGlow 3s infinite ease-in-out;
    letter-spacing: 0.02em;
}

.coming-soon-badge {
    font-size: clamp(1em, 3vw, 1.2em);
    color: #ff6600;
    background: linear-gradient(145deg, rgba(255, 102, 0, 0.15), rgba(255, 102, 0, 0.05));
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 20px;
    padding: 5px 15px;
    margin-bottom: 15px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 10px rgba(255, 102, 0, 0.4),
        0 0 20px rgba(255, 69, 0, 0.2);
    animation: neonGlow 3s infinite ease-in-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.coming-soon-badge:hover {
    transform: scale(1.05);
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 102, 0, 0.5),
        0 0 25px rgba(255, 69, 0, 0.3);
}

@keyframes neonGlow {
    0%, 40%, 42%, 44%, 80%, 82%, 100% {
        text-shadow: 
            0 0 2px #fff, 
            0 0 5px #ff6600,
            0 0 10px #ff6600,
            0 0 20px #ff6600,
            0 0 40px #ff4500, 
            0 0 60px #ff4500,
            0 0 80px #ff4500,
            0 0 100px #ff4500;
    }
    41%, 43%, 81% {
        text-shadow: 
            0 0 1px #fff,
            0 0 3px #ff6600,
            0 0 6px #ff6600,
            0 0 12px #ff6600,
            0 0 24px #ff4500,
            0 0 36px #ff4500,
            0 0 48px #ff4500,
            0 0 60px #ff4500;
        opacity: 0.95;
    }
}

.flip-clock {
    text-align: center;
    perspective: 1000px;
    margin: clamp(10px, 3vw, 20px) auto;
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap; /* For better mobile flow if needed */
}

.flip-clock__piece {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    position: relative;
}

.flip-clock__slot {
    font-size: clamp(0.6em, 2vw, 0.8em);
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card {
    display: block;
    position: relative;
    width: clamp(50px, 10vw, 60px);
    height: clamp(70px, 14vw, 80px);
    font-size: clamp(1.8em, 4vw, 2.2em);
    line-height: clamp(70px, 14vw, 80px);
    perspective: 1000px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.card__top, .card__bottom, .card__back::before, .card__back::after {
    position: absolute;
    width: 100%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.card__top {
    top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px 5px 0 0;
}

.card__bottom {
    bottom: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 5px 5px;
    overflow: hidden;
}

.card__back {
    top: 0;
    height: 100%;
    transform: rotateX(0deg);
}

.card__back::before {
    content: attr(data-value);
    position: absolute;
    top: 0;
    width: 100%;
    height: 50%;
    border-radius: 5px 5px 0 0;
    transform-origin: bottom;
}

.card__back .card__bottom {
    position: absolute;
    bottom: 0;
    transform-origin: top;
}

.flip .card__back::before {
    animation: flipDown 0.6s cubic-bezier(0.37, 0.01, 0.94, 0.35) forwards;
}

.flip .card__back .card__bottom {
    animation: flipDownBottom 0.6s cubic-bezier(0.15, 0.45, 0.28, 1) forwards;
}

@keyframes flipDown {
    0% { transform: rotateX(0deg); z-index: 2; }
    100% { transform: rotateX(180deg); z-index: 1; }
}

@keyframes flipDownBottom {
    0% { transform: rotateX(-180deg); z-index: 1; }
    100% { transform: rotateX(0deg); z-index: 2; }
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 2vw, 20px);
    margin: 15px 0;
    flex-direction: row; /* Default row for larger screens */
}

.invite-btn {
    background: linear-gradient(145deg, rgba(255, 102, 0, 0.2), rgba(255, 102, 0, 0.1)); /* 3D gradient */
    border: 2px solid #ff6600;
    color: #fff;
    padding: clamp(8px, 2vw, 10px) clamp(15px, 4vw, 20px);
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.2s ease, background 0.3s ease;
    font-size: clamp(0.9em, 3vw, 1em);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    display: inline-block;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1), /* Bottom shadow for 3D */
        0 0 10px rgba(255, 102, 0, 0.3),
        0 0 20px rgba(255, 102, 0, 0.2);
    flex: 1; /* Make buttons same size */
    max-width: 200px; /* Limit max width for balance */
}

.invite-btn:hover {
    background: linear-gradient(145deg, rgba(255, 102, 0, 0.3), rgba(255, 102, 0, 0.2));
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.2), /* Inset for pressed 3D effect */
        0 0 20px rgba(255, 102, 0, 0.4),
        0 0 30px rgba(255, 69, 0, 0.3);
    transform: translateY(-3px) scale(1.05);
}

.contact {
    margin-top: clamp(10px, 2vw, 20px);
    margin-bottom: clamp(15px, 3vw, 30px); /* Increased to prevent overlap */
    font-size: clamp(0.8em, 2.5vw, 1em);
    opacity: 0.8;
}

.contact-link {
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
}

.globe-wrapper {
    position: relative;
    margin-top: clamp(5px, 1vw, 10px);
    height: clamp(150px, 30vw, 250px); /* Adjusted for mobile */
}

#earth {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(120px, 25vw, 300px);
    height: clamp(120px, 25vw, 300px);
    background: url('https://www.solarsystemscope.com/textures/download/2k_earth_daymap.jpg') 0 0 repeat-x / 400px 200px;
    border-radius: 50%;
    animation: rotate 20s linear infinite;
    box-shadow: inset 10px 0 40px 3px rgba(0, 0, 0, 0.8);
    transform-style: preserve-3d;
    z-index: 0;
}

#earth:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: -40px 7px 40px 5px rgba(0,0,0,.8) inset;
}

#earth:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 50px 50px, #fff, #000);
    opacity: .15;
}

@keyframes rotate {
    0% { background-position: 0 0; }
    100% { background-position: 400px 0; }
}

.current-times {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.current-times p {
    margin: clamp(2px, 1vw, 5px) 0;
    font-size: clamp(0.7em, 2vw, 0.9em);
    opacity: 0.8;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5); /* For readability over globe */
    max-width: 90%;
    text-align: center;
    white-space: nowrap; /* Prevent wrapping on small screens */
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(0, 0, 0, 0.6); /* Matches homepage container background */
    padding: clamp(25px, 6vw, 50px); /* Increased padding for better spacing */
    border-radius: 15px;
    border: 2px solid #ff6600;
    box-shadow: 
        0 0 15px rgba(255, 102, 0, 0.4),
        0 0 30px rgba(255, 102, 0, 0.3),
        0 0 45px rgba(255, 69, 0, 0.2); /* Enhanced shadow for depth */
    width: clamp(300px, 80%, 450px); /* Responsive width matching homepage */
    max-width: 450px;
    text-align: center;
    animation: containerFade 0.5s ease-in-out;
    backdrop-filter: blur(12px); /* Slightly stronger blur for effect */
    max-height: 80vh; /* Prevent cut-off on mobile */
    overflow-y: auto; /* Scroll if content exceeds height */
}

.close {
    color: #fff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ff6600;
}

.modal-content h2 {
    font-family: 'Pacifico', cursive;
    font-size: clamp(1.5em, 5vw, 2.5em);
    margin-bottom: 20px;
    font-weight: 400;
    color: #ff6600;
    -webkit-text-stroke: 0.5px #fff;
    text-stroke: 0.5px #fff;
    text-shadow: 
        0 0 2px #fff,
        0 0 5px #ff6600,
        0 0 10px #ff6600,
        0 0 20px #ff6600,
        0 0 40px #ff4500;
    animation: neonGlow 3s infinite ease-in-out;
    letter-spacing: 0.02em;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: clamp(15px, 4vw, 20px);
    width: 100%;
}

.modal-content label {
    color: #fff;
    text-align: left;
    margin-bottom: 5px;
    font-size: clamp(0.9em, 3vw, 1em);
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ff6600;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.3);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    font-size: clamp(0.9em, 3vw, 1em);
}

.modal-content input:focus {
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
    transform: translateY(-2px);
}

.modal-content button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(145deg, rgba(255, 102, 0, 0.2), rgba(255, 102, 0, 0.1));
    border: 2px solid #ff6600;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    font-size: clamp(0.9em, 3vw, 1em);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(255, 102, 0, 0.3);
}

.modal-content button:hover {
    background: linear-gradient(145deg, rgba(255, 102, 0, 0.3), rgba(255, 102, 0, 0.2));
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(255, 102, 0, 0.4);
    transform: translateY(-3px) scale(1.05);
}

@media (min-width: 601px) {
    .container {
        max-width: 80%;
        padding: clamp(30px, 5vw, 50px);
        box-shadow: 
            0 0 15px rgba(255, 102, 0, 0.4),
            0 0 30px rgba(255, 102, 0, 0.3),
            0 0 45px rgba(255, 69, 0, 0.2);
    }

    h1 {
        font-size: 5em;
        margin-bottom: 10px;
    }

    .coming-soon-badge {
        font-size: 1.5em;
        padding: 8px 20px;
        margin-bottom: 30px;
    }

    .flip-clock {
        margin: 30px auto;
        flex-wrap: nowrap;
    }

    .flip-clock__slot {
        font-size: 0.9em;
        bottom: -20px;
    }

    .card {
        width: 70px;
        height: 90px;
        font-size: 2.8em;
        line-height: 90px;
    }

    .colon {
        font-size: 2.8em;
        line-height: 90px;
    }

    .invite-btn {
        padding: 12px 30px;
        margin: 20px 0;
        font-size: 1.2em;
    }

    .contact {
        margin-top: 30px;
        margin-bottom: 40px; /* Further increased for desktop */
    }

    .globe-wrapper {
        margin-top: 20px;
    }

    #earth {
        width: clamp(200px, 30vw, 300px);
        height: clamp(200px, 30vw, 300px);
        background-size: 600px 300px;
        box-shadow: inset 20px 0 80px 6px rgba(0, 0, 0, 0.8);
    }

    #earth:after {
        box-shadow: -60px 10px 60px 8px rgba(0,0,0,.8) inset;
    }

    #earth:before {
        background: radial-gradient(circle at 100px 100px, #fff, #000);
        opacity: .2;
    }

    @keyframes rotate {
        0% { background-position: 0 0; }
        100% { background-position: 600px 0; }
    }

    .current-times p {
        font-size: 1em;
        white-space: normal;
    }

    .modal-content {
        width: clamp(300px, 60%, 500px);
        max-width: 500px;
        padding: clamp(35px, 8vw, 60px); /* Adjusted for larger screens */
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 70%;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    .cta-buttons {
        flex-direction: column;
        gap: 15px; /* Increased gap for better balance */
        padding: 0; /* Removed horizontal padding to ensure centering */
        justify-content: center; /* Center the column */
        align-items: center; /* Center buttons horizontally */
        margin: 0 auto; /* Center within container */
        width: 100%; /* Ensure full width for centering */
    }

    .invite-btn {
        width: 80%; /* Reduced width for better centering on small screens */
        padding: 10px;
        max-width: 200px; /* Maintain max-width for balance */
    }

    .modal-content {
        width: 90%;
        padding: clamp(25px, 6vw, 40px); /* Adjusted for mobile */
        border-radius: 20px;
        box-shadow: 
            0 6px 15px rgba(255, 102, 0, 0.4),
            0 10px 30px rgba(255, 102, 0, 0.3);
    }

    .flip-clock {
        margin-bottom: clamp(30px, 8vw, 50px); /* Increased for more space between clock and CTAs on mobile */
    }
}
