@import url("https://fonts.googleapis.com/css2?family=Mr+Dafoe&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@900&display=swap");

body,
html {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: radial-gradient(rgba(#7600bf, 0.5) 0%, transparent 70%),
        linear-gradient(#0b161e 40%, #202076 70%);
    background-color: #041618;
    perspective: 700px;
    font-size: clamp(10px, 2vw, 20px);
    margin: 0;
    font-family: "Exo";
}

.cover-image-container {
    width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.cover-image {
    width: 100%;
    height: auto;
    max-width: 1080px;
    display: block;
    margin: auto;
    text-align: center;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 25px 25px rgba(0, 0, 0, 0.3);
}

#startMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-align: center;
    z-index: 1;
    pointer-events: none; /* Prevents interaction */
}

.title-container {
    margin-top: 20px;
    margin-bottom: 20px; /* Adjust this value as needed to move the titles higher */
}

h1 {
    position: relative;
    font-family: "Exo";
    font-size: 4em;
    margin: 0;
    transform: skew(-15deg);
    letter-spacing: 0.03em;
}

h1::after {
    content: "";
    position: absolute;
    top: -0.1em;
    right: 0.05em;
    width: 0.4em;
    height: 0.4em;
    background: radial-gradient(
            white 3%,
            rgba(white, 0.3) 15%,
            rgba(white, 0.05) 60%,
            transparent 80%
        ),
        radial-gradient(rgba(white, 0.2) 50%, transparent 60%) 50% 50% / 5% 100%,
        radial-gradient(rgba(white, 0.2) 50%, transparent 60%) 50% 50% / 70% 5%;
    background-repeat: no-repeat;
}

h1 span:first-child {
    display: block;
    text-shadow: 0 0 0.1em #8ba2d0, 0 0 0.2em black, 0 0 5em #165ff3;
    -webkit-text-stroke: 0.06em rgba(black, 0.5);
}

h1 span:last-child {
    position: absolute;
    left: 0;
    top: 0;
    background-image: linear-gradient(
        #28efc2 25%,
        #00a1ef 35%,
        white 50%,
        #3f9a82 50%,
        #c8f878 55%,
        #28efc2 75%
    );
    -webkit-text-stroke: 0.01em #c8f878;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-family: "Mr Dafoe";

    font-size: 3em;
    margin-top: -0.6em;
    color: white;
    text-shadow: 0 0 0.05em #fff, 0 0 0.2em #98f529, 0 0 0.3em #0b274b;
    transform: rotate(-7deg);
    margin-bottom: 5px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #3b5969;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    /* margin-top: 50px; Add this to create space between the titles and game container */
}

#gameCanvas {
    display: block;
    background-color: #000;
    border-radius: 10px;
    border: 2px solid #11242e;
    margin-bottom: 10px;
    position: relative;
    height: 350px;
}

#startMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-align: center;
    z-index: 1;
    pointer-events: none; /* Prevents interaction */
}

#weekOf {
    color: #a1cd70;
}

.info-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    background-color: #a1cd70;
    color: #333;
    font-size: 20px;
    padding: 10px;
    border-radius: 0 0 10px 10px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.info-section {
    background-color: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
}

/* Adjust the .life-and-timer class to ensure proper layout */
.life-and-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px; /* Adjust as needed */
}

.ip-container {
    text-align: left; /* Align to the left */
    font-size: 14px;
    color: #22343d;
    margin-top: 5px;
    position: absolute;
    left: 10px;
    bottom: 10px;
}

.timer-container {
    background-color: #041618;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    text-align: center;
    font-size: 18px;
    margin-top: 10px; /* Adjust this value as necessary to position correctly */
}

.life-container {
    display: flex;
    align-items: center;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background: linear-gradient(45deg, #d9f5b9, #f5f7fa, #89ffe0);
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

@keyframes gradientBackground {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.modal-content h1 {
    font-size: 36px;
    color: #ff0000;
    margin: 0 0 20px;
    text-transform: uppercase;
    font-family: "Arial Black", sans-serif;
    text-shadow: 2px 2px #000;
}

.modal-content .final-score {
    font-size: 36px;
    margin: 10px 0;
}

#finalScore {
    color: blueviolet !important;
    display: flex;
    align-items: center;
    justify-content: center;
    align-content: center;
    text-align: center;
    font-weight: normal;
    width: 100%;
    font-size: 5vw;
    background: linear-gradient(
        -45deg,
        #175169 25%,
        #175169 25%,
        #175169 50%,
        #175169 50%,
        #599b10 75%,
        #599b10 75%,
        #599b10
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: blink 1s linear infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#restartButton,
#submitButton {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #a1cd72;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#restartButton:hover {
    background-color: #88ae60;
}

#lifeLostModal {
    display: none;
    position: fixed;
    z-index: 2;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

#lifeLostModal .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    text-align: center;
}

#continueButton {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #a1cd72;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#continueButton:hover {
    background-color: #88ae60;
}

/* Landing Page Styles */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #3b5969;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.landing-container h1 {
    color: white;
    font-size: 3em;
    margin-bottom: 20px;
}

#fxWalletContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#fxWallet {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#userForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#userForm input {
    margin: 10px;
    padding: 10px;
    border-radius: 5px;
    border: none;
    font-size: 1em;
    width: 100%;
}

#userForm button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #a1cd72;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 50px;
}

#userForm button:hover {
    background-color: #88ae60;
}

#fxWallet {
    padding: 10px 20px; /* Adjust padding for button size */
    font-size: 16px; /* Adjust font size if needed */
    background-color: #4a90e2; /* Custom background color */
    color: white; /* Text color */
    border: none; /* Border style */
    margin-bottom: 10px;
}

#fxWallet:hover {
    background-color: #2d7fde;
}

/* Leaderboard Page Styles */
.leaderboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #3b5969;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 50%;
    max-height: 800px;
    overflow-y: auto;
    position: relative;
}

.title-container {
    flex: 0 0 auto; /* Do not allow the title to shrink */
    margin-bottom: 20px;
}

.table-container {
    flex: 1 1 auto; /* Allow the table container to grow and shrink */
    width: 100%;
    max-height: 400px; /* Set a fixed height for the table container */
    overflow-y: auto; /* Enable vertical scrolling */
}

.leaderboard-container h1 {
    color: white;
    font-size: 3em;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    color: white;
}

th {
    background-color: #3b5969;
    position: sticky;
    top: 0;
    z-index: 2;
}

@media (max-width: 600px) {
    h1 {
        font-size: 3em;
    }

    h2 {
        font-size: 2em;
    }

    #userForm input,
    #userForm button {
        font-size: 0.8em;
    }

    .modal-content {
        width: 80%;
    }
}

.leaderboard-btn {
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    float: right;
}

.leaderboard-btn:hover {
    background-color: #45a049;
}

.button-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    width: 100%;
}

.play-button-container {
    position: sticky;
}

.play-btn {
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
    display: block;
    text-align: center;
    width: 100px;
    margin-left: auto;
    margin-right: auto;
}

.play-btn:hover {
    background-color: #45a049;
}

.modal-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.modal-buttons button:hover {
    background-color: #45a049;
}

.next-level-btn {
  display: none;  
}
