html {
    font-size: 16px; /* Base font size */
}

@keyframes flashBackground {
    0% { background-color: #000000; }
    10% { background-color: #FF0000; }
    20% { background-color: #00FF00; }
    30% { background-color: #0000FF; }
    40% { background-color: #FFFF00; }
    50% { background-color: #00FFFF; }
    60% { background-color: #FF00FF; }
    70% { background-color: #FFA500; }
    80% { background-color: #800080; }
    90% { background-color: #FFFFFF; }
    100% { background-color: #000000; }
}

@keyframes flashText {
    0% { color: #FFFFFF; }
    10% { color: #FF0000; }
    20% { color: #00FF00; }
    30% { color: #0000FF; }
    40% { color: #FFFF00; }
    50% { color: #00FFFF; }
    60% { color: #FF00FF; }
    70% { color: #FFA500; }
    80% { color: #800080; }
    90% { color: #FFFFFF; }
    100% { color: #FFFFFF; }
}

body {
    background: linear-gradient(120deg, #000000, #1a1a1a); /* Initial gradient background */
    animation: flashBackground 10s infinite; /* Apply the flash animation */
    color: white;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center vertically */
    height: 100vh;
    margin: 0;
    text-align: center;
    overflow-x: hidden; /* Hide horizontal overflow */
}

nav {
    display: flex;
    justify-content: center; /* Center all items horizontally */
    align-items: center;
    position: fixed; /* Keep navbar at the top */
    top: 20px; /* Move the navbar 20px from the top */
    width: 100%;
    max-width: 1000px; /* Set a maximum width for the navbar */
    z-index: 1000; /* Ensure it stays above other elements */
    background-color: transparent; /* Make the navbar transparent */
    padding: 0 10px; /* Add horizontal padding */
    flex-wrap: nowrap; /* Prevent items from wrapping to the next line */
    overflow: hidden; /* Hide overflow to ensure items stay on one line */
}

nav a, #home-button {
    color: white;
    text-decoration: none;
    padding: 5px 10px; /* Adjust padding */
    font-size: 0.99rem; /* Set font size to .99rem */
    background: none; /* Remove button background */
    border: none; /* Remove button border */
    cursor: pointer; /* Pointer cursor on hover */
    transition: color 0.3s, text-shadow 0.3s; /* Smooth transition */
    white-space: nowrap; /* Prevent text from wrapping */
    display: inline-flex; /* Use inline-flex to fit all items on one line */
    min-width: auto; /* Remove minimum width constraint */
    text-align: center; /* Center text */
    margin: 0 5px; /* Adjust spacing between items */
    text-transform: uppercase; /* Make all text uppercase */
}

nav a:hover, #home-button:hover { 
    text-decoration: underline;
    text-shadow: 2px 2px 4px rgba(255, 0, 0, 0.7); /* Add hover shadow effect */
}

nav .flashing-link .flashing-text {
    animation: flashText 10s infinite; /* Apply the flash animation to the text only */
}

#title-box {
    width: 100%;
    text-align: center;
    margin: 60px 0 20px; /* Adjust margins for spacing */
}

h1 {
    font-size: 2rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Add text shadow */
    animation: flashText 10s infinite; /* Apply the flash animation */
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center horizontally */
    width: 100%;
    max-width: 1200px;
    padding: 0 20px; /* Add horizontal padding */
}

#typing-box, #image-box {
    width: 100%; /* Adjust width to 100% */
    max-width: 100%; /* Ensure maximum width is 100% */
    margin: 20px auto; /* Center align with margin */
    text-align: center; /* Center the text within the box */
}

#image-box img {
    display: block;
    margin: -20px auto 0 auto; /* Adjust top margin to move the image up */
    width: 85%; /* Set the width to 100% */
    max-width: 200px; /* Limit the max width to make the image smaller */
    height: auto; /* Maintain aspect ratio */
    border: 5px solid white; /* Add a white border around the image */
}

#typing {
    white-space: pre-wrap; /* Ensure text keeps line breaks */
    word-wrap: break-word; /* Break long words to keep them within the container */
    font-size: 1.2rem; /* Adjust font size to a more moderate size */
}

#contract-address {
    margin-top:10px;
    text-align: center;
    font-size: 1.5rem;
    color: white;
    animation: flashText 10s infinite; /* Apply the flashing animation */
}

#copy-button {
    margin-left: 10px;
    padding: 5px 10px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#copy-button:hover {
    background-color: #555;
}

/* Styles for the modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000; /* Ensure it appears above other elements */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* Black with opacity */
}

.modal-content {
    background-color: black; /* Set background to black */
    color: white; /* Set text color to white */
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    text-align: center; /* Center the text */
    border-radius: 10px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#close-modal {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#close-modal:hover {
    background-color: #555;
}

/* Mobile styles */
@media (max-width: 600px) {
    nav {
        flex-direction: row; /* Keep items in a row on small screens */
    }

    nav a, #home-button {
        margin: 5px 2px; /* Adjust spacing between items */
    }

    h1 {
        font-size: 1.5rem; /* Adjust font size */
    }

    .container {
        padding: 10px; /* Adjust padding */
    }

    #contract-address {
        font-size: 1rem; /* Make the contract address text smaller for mobile devices */
    }

    #typing {
        font-size: 1rem; /* Adjust font size for mobile */
    }
}

/* Tablet styles */
@media (min-width: 601px) and (max-width: 1024px) {
    body {
        font-size: 1.125rem; /* Adjust font size */
    }

    h1 {
        font-size: 2rem; /* Adjust font size */
    }

    .container {
        padding: 20px; /* Adjust padding */
    }
}

/* Desktop styles */
@media (min-width: 1025px) {
    body {
        font-size: 1.5rem; /* Adjust font size */
    }

    h1 {
        padding: 50px;
        font-size: 4.5rem; /* Adjust font size */
    }

    .container {
        padding: 100px; /* Adjust padding */
    }
    #image-box img {
        margin: -90px auto 0 auto; /* Adjust top margin to move the image up */
        width: 60%; /* Set the width to 100% */
    }
}
