/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Press Start 2P', cursive;
    color: #ffe81f; /* Star Wars yellow */
    background-color: #000; /* Space black */
}

/* Starfield Background */
.stars,
.twinkling {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat;
    z-index: 0;
}

.stars {
    background-image: url('stardust.png'); /* Use local images */
    z-index: 0;
}

.twinkling {
    background-image: url('tiny-grid.png'); /* Use local images */
    animation: twinkling 200s linear infinite;
    z-index: 1;
}

@keyframes twinkling {
    from {
        background-position: 0 0;
    }
    to {
        background-position: -10000px 5000px;
    }
}

/* Logo Styles */
.logo-container {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    z-index: 2;
}

.logo {
    font-size: 4em;
    color: #ffe81f;
    text-shadow: 0 0 10px rgba(255, 232, 31, 0.8);
    animation: glow 2s ease-in-out infinite alternate;
    cursor: pointer;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(255, 232, 31, 0.8);
    }
    to {
        text-shadow: 0 0 20px rgba(255, 232, 31, 1);
    }
}

/* Scrolling Text (Star Wars Crawl) */
.scrolling-text {
    position: relative;
    height: 100vh;
    perspective: 400px;
    overflow: hidden;
    z-index: 1;
}

.crawl {
    position: absolute;
    top: 100vh;
    width: 80%;
    max-width: 800px;
    margin: 0 auto;
    transform-origin: 50% 100%;
    animation: crawlAnimation 180s linear;
}

@keyframes crawlAnimation {
    0% {
        top: 100vh;
        transform: rotateX(20deg) translateZ(0);
    }
    100% {
        top: -250vh; /* Adjusted to accommodate more text */
        transform: rotateX(25deg) translateZ(-500px);
    }
}

.title p {
    text-align: center;
    font-size: 2em;
    margin-bottom: 10px;
}

.title h1 {
    text-align: center;
    font-size: 3em;
    margin-bottom: 40px;
}

.crawl p {
    font-size: 1.2em;
    line-height: 1.5;
    text-align: justify;
    margin-bottom: 30px;
}

.contact {
    text-align: center;
    margin-top: 50px;
}

.contact span {
    color: #fff;
}

/* Easter Egg Popup */
.easter-egg {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px;
    border: 2px solid #ffe81f;
    border-radius: 10px;
    display: none;
    z-index: 3;
}

.easter-egg p {
    font-size: 1em;
    color: #ffe81f;
    text-align: center;
}

/* Static Buttons at the Bottom */
.button-container {
    position: fixed;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 2;
}

.button-container button {
    padding: 15px 30px;
    font-size: 1em;
    color: #000;
    background-color: #ffe81f;
    border: 2px solid #000;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 232, 31, 0.8);
    transition: background-color 0.3s, color 0.3s;
}

.button-container button:hover {
    background-color: #000;
    color: #ffe81f;
}

.button-container button:active {
    box-shadow: none;
}

/* Play Sound Button */
#playSoundButton {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 30px;
    font-size: 1em;
    color: #000;
    background-color: #ffe81f;
    border: 2px solid #000;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    z-index: 3;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 232, 31, 0.8);
}

#playSoundButton:hover {
    background-color: #000;
    color: #ffe81f;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 2.5em;
    }

    .logo-container {
        top: 20px;
    }

    .title p {
        font-size: 1.5em;
    }

    .title h1 {
        font-size: 2em;
    }

    .crawl {
        width: 90%;
    }

    .crawl p {
        font-size: 1em;
        line-height: 1.4;
    }

    .button-container button {
        padding: 10px 20px;
        font-size: 0.8em;
    }

    #playSoundButton {
        top: 80px; /* Move button below the logo */
        padding: 10px 20px;
        font-size: 0.8em;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .logo {
        font-size: 2em;
    }

    .title p {
        font-size: 1.2em;
    }

    .title h1 {
        font-size: 1.5em;
    }

    .crawl {
        width: 95%;
    }

    .crawl p {
        font-size: 0.9em;
        line-height: 1.4;
    }

    .button-container button {
        padding: 8px 15px;
        font-size: 0.7em;
    }

    #playSoundButton {
        top: 80px;
        padding: 8px 15px;
        font-size: 0.7em;
    }

    .easter-egg {
        bottom: 100px;
        right: 10px;
        padding: 15px;
    }

    .easter-egg p {
        font-size: 0.9em;
    }
}

/* Lightsaber Cursor (Easter Egg) */
body.lightsaber-active {
    cursor: url('lightsaber-cursor.png'), auto;
}

/* Hover Effects */
.logo:hover {
    animation: none;
    text-shadow: 0 0 25px rgba(255, 232, 31, 1);
}
