.tf-v1-popover {
    bottom: 96px;
    position: fixed;
    right: 16px;
    z-index: 1;
}

hr {
    width: 500px;
    display: flex;
    flex-wrap: wrap;
}

body {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    left: 0;
    top: 40px;
    bottom: 0;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    background: #000000;
    display: block;
    flex-wrap: wrap;
    justify-content: center;
    position: fixed;
}

#title {
    font-size: 35px;
    font-weight: bold;
    margin-top: 0;
    font-family: "Times New Roman";
}

#BG-overlay {
    opacity: 0;
    position: fixed;
    display: block;
    height: 100%;
    width: 100%;
    top: 0;
    margin: 0;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.49);
    z-index: 1;
    cursor: pointer;
}

#Block-overlay {
    opacity: 0;
    position: fixed;
    display: block;
    height: 100%;
    width: 100%;
    top: 0;
    margin: 0;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0);
    z-index: -1;
    cursor: pointer;
}

#Center-overlay {
    overflow-y: auto;
    font-family: "Lato", Sans-serif;
    opacity: 0;
    top: 2%;
    position: fixed;
    display: block;
    height: fit-content;
    right: 30%;
    left: 30%;
    padding: 10px;
    border-radius: 1.5%;
    align-content: normal;
    color: white;
    text-align: left;
    background-color: #1a1a1b;
    z-index: 3;
    cursor: pointer;
}

#scorePoints {
    font-weight: bolder;
}

.line {
    margin: auto;
    margin-top: 5%;
    border: 1px ridge rgba(255, 255, 255, 0.7);
}

#board {
    position: fixed;
    top: 20%;
    width: 100%;
    height: 417px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, auto);
    overflow: hidden;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 0;
}

#Header {
    font-weight: bolder;
    text-align: center;
    position: fixed;
    display: inline-block;
    margin-top: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    height: fit-content;
    width: 100%;
    left: 0;
    right: 0;
    top: 0;
    justify-self: center;
    background-color: #000000;
    z-index: 1;
    cursor: pointer;
    font-family: Sans-serif;
    font-size: 25px;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #d3d6da;
    pointer-events: none;
    color: #ffffff;
}

#AnswerTxt {
    z-index: 5;
}

#Answer {
    opacity: 0;
    background-color: aliceblue;
    display: inline-flex;
    justify-content: center;
    place-items: center;
    place-content: center;
    width: fit-content;
    border-radius: 5px;
    height: 3%;
    margin-top: 40px;
    padding-left: 10px;
    padding-right: 10px;
    font-family: 'Roboto', Sans-serif;
    z-index: 10;
}

.sample-tile {
    border: 2px solid rgb(145, 145, 145);
    width: 35px;
    height: 35px;
    margin: 2.5px;
    color: #ffffff;
    font-size: 20px;
    font-family: Sans-serif;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    float: left;
}

.close_icon {
    width: 24px;
    height: 24px;
    position: absolute;
    top: 10px;
    right: 16px;
    color: white;
    cursor: pointer;
}

.top-G-O, .bottom-G-O {
    margin-top: 0;
    margin-bottom: 0;
}

.bottom-G-O {
    line-height: 100%;
    justify-self: center;
    text-align: center;
}

.container-G-O {
    display: grid;
    grid-template-columns: 20% 50% 20%;
    justify-content: space-evenly;
    margin: 0;
    padding-top: 2%;
    padding-bottom: 2%;
    font-size: 150%;
}

.result {
    margin-top: 10px;
    justify-content: center;
    display: grid;
    place-content: center;
    place-items: center;
    place-self: center;
    position: fixed;
    grid-template-columns: auto auto;
    width: 100%;
}

#Share {
    float: right;
    margin: 0;
    margin-left: 20px;
    background-color: #333399;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: larger;
    font-weight: 700;
    font-family: Sans-serif;
    cursor: pointer;
}

#your-score, #total-score {
    font-size: 20px;
    margin: auto;
    margin-top: 25px;
    text-align: center;
    font-weight: bolder;
}

#score {
    font-family: "Lato", Sans-serif;
    font-weight: bold;
    float: right;
    color: white;
    margin-left: 40px;
    margin-top: 50px;
}

#lives {
    font-family: "Lato", Sans-serif;
    font-weight: bold;
    float: left;
    color: #ffffff;
    margin-right: 40px;
}

#wrapper {
    width: 100%;
    height: 140px;
    overflow-y: auto;
}

#flag-GO {
    border-bottom: 1px solid #4f4f4f;
    margin: 5px;
    text-align: center;
    font-size: 200%;
    justify-self: center;
    margin-bottom: 5%;
    padding-bottom: 10px;
}

.container-TS {
    font-family: Sans-serif;
    border-top: 1px solid #4f4f4f;
    display: grid;
    grid-template-columns: 40% 20% 35%;
    text-align: center;
    margin: auto;
    margin-top: 5%;
    padding-top: 5%;
    font-size: 15px;
    width: 100%;
}

#Game-over-container {
    display: grid;
    place-items: center;
    place-self: center;
    position: fixed;
    width: 100%;
    justify-content: normal;
    place-content: normal;
    z-index: -1;
    opacity: 0;
}

#Game-over {
    opacity: 0;
    top: 25%;
    position: fixed;
    height: fit-content;
    padding: 10px;
    padding-top: 0;
    border-radius: 1.5%;
    align-content: normal;
    color: white;
    text-align: left;
    background-color: #1a1a1b;
    z-index: -1;
    width: 400px;
    margin: 2px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.tile {
    border: 2px solid rgb(145, 145, 145);
    width: 60px;
    height: 60px;
    margin: 2.5px;
    color: #ffffff;
    font-size: 25px;
    font-family: Sans-serif;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: -1;
}

/* ✅ FIXED KEYBOARD SECTION */
#keyboardParent {
    position: fixed;
    bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #000;
    padding: 8px 0;
    z-index: 2;
    box-sizing: border-box;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 600px;
    margin: 3px 0;
}

.key-tile {
    flex: 1;
    max-width: 45px;
    height: 60px;
    margin: 2px;
    border-radius: 6px;
    font-family: 'Times New Roman', 'Gill Sans MT', 'Calibri', 'Trebuchet MS', 'Sans-serif';
    font-size: 18px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #d3d6da;
    box-sizing: border-box;
}

.enter-key-tile,
.Backspace-key-tile {
    flex: 1.5;
    max-width: 70px;
    height: 60px;
    margin: 2px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background-color: #797979;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* Mobile-friendly scaling */
@media (max-width: 600px) {
    .key-tile {
        max-width: 32px;
        height: 48px;
        font-size: 16px;
        margin: 1.5px;
    }

    .enter-key-tile,
    .Backspace-key-tile {
        max-width: 55px;
        height: 48px;
        font-size: 15px;
    }

    #keyboardParent {
        padding: 6px 0;
    }
}

.sample {
    display: inline-block;
}

#feedback {
    opacity: 0;
    background-color: aliceblue;
    display: inline-flex;
    position: relative;
    top: 10%;
    justify-content: center;
    place-items: center;
    place-content: center;
    width: fit-content;
    text-align: center;
    border-radius: 5px;
    height: 3%;
    margin: auto;
    margin-top: 40px;
    padding-left: 10px;
    padding-right: 10px;
    font-family: 'Roboto', Sans-serif;
    z-index: 0;
    display: grid;
    place-items: center;
}

/* Responsive tweaks */
@media (max-height: 830px) {
    .enter-key-tile, .Backspace-key-tile {
        height: 55px;
    }

    .key-tile {
        height: 55px;
    }

    .tile {
        width: 38px;
        height: 38px;
    }

    #board {
        height: 290px;
    }

    #Center-overlay {
        height: 90%;
    }
}

@media (max-width: 900px) {
    #Center-overlay {
        right: 15%;
        left: 15%;
    }
}

@media (max-width: 450px) {
    .tf-v1-popover-button {
        width: fit-content;
        height: fit-content;
        right: 8px;
        bottom: 1%;
        text-align: center;
    }

    .tf-v1-popover-button-icon {
        width: 25px;
        height: 25px;
        font-size: 24px;
        border-radius: 50%;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}
