@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Orbitron:wght@400;700;900&family=Press+Start+2P&family=Audiowide&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poetsen+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Chewy&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-image: url('../assets/back.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: white;
    text-align: center;
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

#instructions-screen,
#start-screen,
#game-screen {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
}

#instructions-screen {
    background-size: cover;
    background-position: center;
    max-width: 600px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
}

#instructions-screen p {
    font-family: 'Comic Neue', cursive;
    font-size: 1.5rem;
    line-height: 1.8;
    margin: 25px 0;
    color: #e0f7fa;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #4ecdc4;
    animation: slideIn 0.8s ease-out;
}

#instructions-start-btn {
    background: #5a5d63;
    color: white;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    font-size: 1.8rem;
    border-radius: 25px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s;
}

#start-btn {
    background: #0ccc39;
    color: white;
    font-weight: bold;
    border: none;
    padding: 15px 30px;
    font-size: 1.8rem;
    border-radius: 25px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s;
}

/* Game Screen Layout */
#game-screen {
    position: relative;
    padding: 20px;
    width: 100%;
}

#level-display {
    position: absolute;
    top: 90px;
    right: 33px;
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
}

#timer-display {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    min-width: 120px;
}

#pengu {
    position: fixed;
    bottom: -10px;
    right: 10px;
    width: 500px !important;
    height: auto !important;
    z-index: 1000;
}

#pengu img {
    width: 100%;
    height: auto;
    display: block;
}

#question-display {
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: bold;
    color: #fff;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 20px 0;
    max-width: 90%;
}

#options-area {
    width: 90%;
    max-width: 800px;
    height: 300px;
    border: 2px solid white;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

#options-container {
    width: 100%;
    height: 100%;
    position: absolute;
}

#options-container button {
    width: 200px;
    height: 60px;
    font-size: 1.5rem;
    font-weight: bold;
    position: absolute;
    padding: 10px 20px;
    background: #35138a;
    color: white;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 15px #b889ff, 0 0 30px #8b33ff;
}

#options-container button:hover {
    background: #7c3aed;
    transform: scale(1.08);
    box-shadow: 0 0 20px #cfa8ff, 0 0 40px #a259ff;
}

#options-container button:disabled {
    background: #666 !important;
    cursor: not-allowed;
    transform: none !important;
}

#result {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 20px 0;
    min-height: 40px;
    padding: 10px;
}

#game-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

#next-level-btn,
#reset-button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.8rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

#reset-button {
    font-weight: bold;
    background: #2234ff;
}

#next-level-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

#reset-button:hover {
    background: #e64a19;
    transform: translateY(-2px);
}

button {
    cursor: pointer;
}

#instructions-screen h1,
#start-screen h1 {
    font-family: 'Bungee', cursive;
    font-size: 3.5em;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 3px 3px 0 #f8f8f8, 6px 6px 0 rgba(127, 200, 222, 0.2);
    background: linear-gradient(45deg, #4ecdc4, #066e97c5, #7611dba9, #e30ac6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

button {
    margin: 15px auto;
    font-family: "Montserrat";
    font-size: 1.25rem;
    color: #ffffff;
    cursor: pointer;
    border-radius: 100px;
    padding: 15px 20px;
    border: 0px solid #000;
}

/* Initiate Auto-Pulse animations */
button.pulse-button {
    animation: borderPulse 1000ms infinite ease-out, colorShift 10000ms infinite ease-in;
}

button.pulse-button-hover {
    animation: colorShift 10000ms infinite ease-in;
}

button:hover,
button:focus {
    animation: borderPulse 1000ms infinite ease-out, colorShift 10000ms infinite ease-in, hoverShine 200ms;
}

/* Declare color shifting animation */
@keyframes colorShift {

    0%,
    100% {
        background: #0045e6;
    }

    33% {
        background: #fb3e3e;
    }

    66% {
        background: #0dcc00;
    }
}

/* Declare border pulse animation */
@keyframes borderPulse {
    0% {
        box-shadow: inset 0px 0px 0px 5px rgba(255, 255, 255, .4), 0px 0px 0px 0px rgba(255, 255, 255, 1);
    }

    100% {
        box-shadow: inset 0px 0px 0px 3px rgba(117, 117, 255, .2), 0px 0px 0px 10px rgba(255, 255, 255, 0);
    }
}

/* Declare shine on hover animation */
@keyframes hoverShine {
    0% {
        background-image: linear-gradient(135deg, rgba(255, 255, 255, .4) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 100%);
    }

    50% {
        background-image: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .4) 50%, rgba(255, 255, 255, 0) 100%);
    }

    100% {
        background-image: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, .4) 100%);
    }
}

#timer-display,
#level-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.45);
    padding: 12px 25px;
    border-radius: 12px;
    border: 2px solid #8b33ff;
    box-shadow: 0 0 15px #a259ff, 0 0 30px #cfa8ff;
}

@media only screen and (max-width: 768px) {
    body {
        overflow: hidden;
    }

    #instructions-screen h1,
    #start-screen h1 {
        font-size: 2.5em;
    }

    #instructions-screen {
        width: 100%;
        max-width: 100%;
        padding: 20px;
    }

    #instructions-screen p {
        font-size: 1.2rem;
        padding: 15px;
        margin: 15px 0;
    }

    #pengu {
        width: 80px !important;
        bottom:-10px;
        right: 5px;
    }

    #options-area {
        margin-right: 0;
        height: 400px;
        width:100%;
        
    }

    #options-container button {
        width: 150px;
        height: 50px;
        font-size: 1.2rem;
        padding: 5px 10px;
    }

    #level-display {
        top: 80px;
        right: 10px;
        left: auto;
        font-size: 1.2rem;
        padding: 8px 15px;
    }

    #timer-display {
        top: 10px;
        right: 10px;
        font-size: 1.2rem;
        padding: 8px 15px;
        min-width: 100px;
    }

    #question-display {
        font-size: 1.3rem;
        padding: 12px 18px;
        margin: 15px 10px;
    }

    #result {
        font-size: 1.4rem;
    }

    #game-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    #next-level-btn,
    #reset-button {
        font-size: 1.4rem;
        padding: 10px 20px;
    }
}

@media only screen and (max-width: 480px) {

    #instructions-screen h1,
    #start-screen h1 {
        font-size: 2em;
    }

    #instructions-screen p {
        font-size: 1rem;
        padding: 12px;
    }

    #instructions-start-btn,
    #start-btn {
        font-size: 1.4rem;
        padding: 12px 25px;
    }

    #pengu {
        width: 60px !important;
        bottom: 5px;
        right: 5px;
    }

    #options-area {
        height: 350px;
        width: 95%;
    }

    #options-container button {
        width: 120px;
        height: 40px;
        font-size: 1rem;
    }

    #question-display {
        font-size: 1.1rem;
        padding: 10px 15px;
    }

    #result {
        font-size: 1.2rem;
    }

    #level-display,
    #timer-display {
        font-size: 1rem;
        padding: 6px 12px;
    }
}