@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    padding: 0 10px;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-image: url(assets/bg.jpeg);
}

.model-wrapper {
    width: 100%;
    display: grid;
    place-items: center;
}

#model {
    width: 100%;
    height: 23vw;
}

#paragraph {
    color: #646669;
}

.result-details {
    color: white;
}

::selection {
    color: #fff;
    background: #007acc;
}

.wrapper {
    width: 1010px;
    padding: 35px;
    background: rgba(110, 53, 53, 0.5);
    /* semi-transparent dark */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* for Safari */
    border-radius: 12px;
    /* optional */
    padding: 1rem;
    /* optional */
    border-radius: 10px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
}

.wrapper .input-field {
    opacity: 0;
    z-index: -999;
    position: absolute;
}

.wrapper .content-box {
    padding: 13px 20px 0;
    border-radius: 10px;
    border: 4px solid #daa410;
}

.content-box .typing-text {
    overflow: hidden;
    max-height: 256px;
    display: grid;
    place-items: center;
}

.typing-text::-webkit-scrollbar {
    width: 0;
}

.typing-text p {
    font-size: 21px;
    text-align: justify;
    letter-spacing: 1px;
    word-break: break-all;
}

.typing-text p span {
    position: relative;
    color: #ccced1;
    font-size: 1.5rem;
}

.typing-text p span.correct {
    color: #83e261;
}

.typing-text p span.incorrect {
    color: #ca4754;
    border-radius: 4px;
}

/* .typing-text p span.active {
    color: #17A2B8;
} */
.typing-text p span.active::before {
    position: absolute;
    content: "";
    height: 2px;
    width: 100%;
    bottom: 0;
    left: 0;
    opacity: 0;
    border-radius: 5px;
    background: #83e261;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    50% {
        opacity: 1;
    }
}

.content-box .content {
    margin-top: 17px;
    display: flex;
    padding: 12px 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-top: 3px solid #daa410;
}

.content button {
    outline: none;
    border: none;
    width: 105px;
    color: #daa410;
    padding: 8px 0;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 15px;
    border: 3px solid #daa410;
    background: none;
    transition: transform 0.2s ease;
}

.content button:active {
    transform: scale(0.89);
}

.content button:hover {
    background: #FFFFFF;
}

.content .result-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: calc(100% - 140px);
    justify-content: space-between;
    padding-left: 1vw;
}

.result-details li {
    display: flex;
    height: 20px;
    list-style: none;
    position: relative;
    align-items: center;
}

.result-details li:not(:first-child) {
    padding-left: 22px;
    h1-left: 2px solid #bfbfbf;
}

.result-details li p, span {
    font-size: 1.2rem;
}

.result-details li span {
    display: block;
    margin-left: 10px;
}

li span b {
    font-weight: 500;
}

li:not(:first-child) span {
    font-weight: 500;
}

@media (max-width: 745px) {
    .wrapper {
        padding: 20px;
    }

    .content-box .content {
        padding: 20px 0;
    }

    .content-box .typing-text {
        max-height: 100%;
    }

    .typing-text p {
        font-size: 19px;
        text-align: left;
    }

    .content button {
        width: 100%;
        font-size: 15px;
        padding: 10px 0;
        margin-top: 20px;
    }

    .content .result-details {
        width: 100%;
    }

    .result-details li:not(:first-child) {
        border-left: 0;
        padding: 0;
    }

    .result-details li p,
    .result-details li span {
        font-size: 15px;
    }
}

@media (max-width: 518px) {
    .wrapper .content-box {
        padding: 10px 15px 0;
    }

    .typing-text p {
        font-size: 13px;
    }

    .result-details li {
        margin-bottom: 10px;
    }

    .content button {
        margin-top: 10px;
    }
}

#game-popover {
    padding: 1rem;
    border: 2px solid #7f1414;
    border-radius: 12px;
    background-color: white;
    color: black;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

#game-popover button{
    margin-top: 1vw;
}

.popover-center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #7f1414;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    width: 300px;
    text-align: center;
}

/* Optional: darken background */
.popover-center::backdrop {
    background: rgba(0, 0, 0, 0.3);
}