* {
    background-color: #000000;
    color: white;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    text-align: center;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1 {
    font-size: 170px;
    color: #169976;
    padding: 0;
    margin: 0 0 20px 0;
    font-family: "VT323";
    word-spacing: -0.5ch;
}

.description {
    font-size: 1.3rem;
    margin-top: 1px;
    padding: 0 20px;
    line-height: 1.6;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    border-radius: 9999px;
    background-color: #169976;
    padding: 0.625rem 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 1);
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #222222;
}

#play {
    margin-top: 30px;
}

#game-screen, #end-screen, #start-screen {
    display: none;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

#game-screen.show, #end-screen.show, #start-screen.show {
    display: flex;
}

#end-screen.show, #start-screen.show {
    justify-content: center;
    align-items: center;
}

/* Game screen layout */
#game-screen.show {
    justify-content: center;
    align-items: center;
    padding-top: 80px;
    padding-bottom: 20px;
}

#words {
    font-size: 150px;
    font-family: "VT323";
    letter-spacing: 8px;
    margin: 0 0 30px 0;
    padding: 0;
}

#feedback {
    margin: 0 auto 15px;
    font-size: 25px;
    width: 100%;
    text-align: center;
    min-height: 25px;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#top-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    justify-content: space-between;
    width: 100%;
    font-size: 1.8em;
    margin: 0;
    padding: 15px;
    gap: 600px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.game-over {
    font-size: 170px;
    font-weight: bold;
    color: #169976;
    padding: 0;
    margin: 0 0 40px 0;
    font-family: "VT323";
    word-spacing: -0.5ch;
}

#colors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 0 10px;
    max-width: 100%;
}

.circle-btn {
    width: 200px;
    height: 200px;
    border: none;
    margin: 0;
    cursor: pointer;
    transition: box-shadow 0.3s;
    flex-shrink: 0;
}

.circle-btn:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

#final-score {
    font-size: 22px;
    margin: 0 0 60px 0;
}

#c-end {
    font-family: "VT323";
    display: flex;
    flex-direction: column;
    align-items: center;
}

#final-feedback {
    margin: 0 0 50px 0;
    font-size: 22px;
}

#play-again {
    margin-top: 0;
}

#close-popup {
    margin-top: 10px;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 27px;
    padding: 20px;
}

#content {
    max-width: 90%;
    padding: 20px;
}

#popup-content {
    font-size: 20px;
    line-height: 1.6;
}

.popup-btn {
    background: #169976;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.popup-btn:hover {
    background: #117a5a;
}

/* Responsive styles */
@media screen and (max-width: 1024px) {
    h1 {
        font-size: clamp(80px, 15vw, 170px);
    }

    #top-bar {
        gap: 100px;
        font-size: 1.5em;
        padding: 10px;
    }

    #words {
        font-size: clamp(80px, 15vw, 150px);
        margin-bottom: 25px;
    }

    .circle-btn {
        width: clamp(120px, 15vw, 180px);
        height: clamp(120px, 15vw, 180px);
    }

    #colors {
        gap: 15px;
    }

    .game-over {
        font-size: clamp(80px, 15vw, 170px);
    }
}

@media screen and (max-width: 768px) {
    h1 {
        font-size: clamp(60px, 12vw, 100px);
    }

    .description {
        font-size: 1.1rem;
        padding: 0 15px;
    }

    #top-bar {
        grid-template-columns: 1fr;
        gap: 8px;
        font-size: 1.2rem;
        padding: 10px;
    }

    #round, #timer, #score {
        padding: 3px 0;
    }

    #game-screen.show {
        padding-top: 70px;
        padding-bottom: 15px;
    }

    #words {
        font-size: clamp(70px, 14vw, 110px);
        letter-spacing: 4px;
        margin-bottom: 20px;
    }

    .game-over {
        font-size: clamp(60px, 12vw, 100px);
    }

    #colors {
        gap: 12px;
        padding: 0 8px;
    }

    .circle-btn {
        width: clamp(90px, 14vw, 130px);
        height: clamp(90px, 14vw, 130px);
    }

    #feedback {
        font-size: 20px;
        margin-bottom: 12px;
    }

    #final-score {
        margin-bottom: 40px;
    }

    #final-feedback {
        margin-bottom: 30px;
    }

    button {
        font-size: 18px;
        padding: 0.5rem 1.2rem;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: clamp(50px, 10vw, 80px);
    }

    .description {
        font-size: 0.95rem;
    }

    #words {
        font-size: clamp(60px, 12vw, 90px);
        margin-bottom: 18px;
    }

    .circle-btn {
        width: clamp(75px, 13vw, 110px);
        height: clamp(75px, 13vw, 110px);
    }

    #colors {
        gap: 10px;
    }

    button {
        font-size: 16px;
        padding: 0.5rem 1rem;
    }

    #top-bar {
        font-size: 1rem;
        padding: 8px;
    }

    .game-over {
        font-size: clamp(50px, 10vw, 80px);
    }
}

@media screen and (max-width: 768px) and (orientation: landscape) {
    h1 {
        font-size: clamp(40px, 8vh, 70px);
        margin-bottom: 10px;
    }

    .description {
        font-size: 0.9rem;
        margin-top: 5px;
    }

    #words {
        font-size: clamp(50px, 10vh, 80px);
        margin-bottom: 15px;
    }

    #game-screen.show {
        padding-top: 50px;
        padding-bottom: 10px;
    }

    .game-over {
        font-size: clamp(40px, 8vh, 70px);
    }

    #top-bar {
        padding: 5px 10px;
        font-size: 1rem;
    }

    .circle-btn {
        width: clamp(70px, 12vw, 100px);
        height: clamp(70px, 12vw, 100px);
    }

    #colors {
        gap: 8px;
        padding: 0 5px;
    }
}