body {
    font-family: Arial, sans-serif;
    padding: 20px;
    max-width: 800px;  /* Limit width for better desktop layout */
    margin: 0 auto;
}

.small-title {
    font-size: 18px; /* Adjust this value to the desired size */
    margin: 0px 0px 10px 0px;  /* Optional: Adjusts the space around the title */
    text-align: left; /* Optional: Centers the title */
    padding: 0; 
}



#score {
    display: flex;
    justify-content: flex-end; /* Aligns the score to the right */
    padding: 10px;
    font-size: 18px;
    margin-top: -45px; /* Adjust this value to move the score upwards */
    margin-right: 10px; /* Adjusts the right margin to align with the container */
    color: #333;
}




#word-list, #sentence-composer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;  /* Allows items to wrap onto the next line if necessary */
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f0f0f0;
    overflow-y: auto;
}

#word-list {
    min-height: 50px;
    max-height: 150px;  /* Prevents too much vertical expansion */
}

#sentence-composer {
    min-height: 50px;
    background-color: #fff;
}

.word-item {
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: move;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: auto;             /* Allow width to adjust based on content */
    min-width: 100px;        /* Ensure a minimum width for smaller words */
    max-width: 150px;        /* Set a maximum width to prevent excessive stretching */
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    line-height: 1;
    flex-grow: 1;            /* Allow the item to grow to fill available space */
}


button {
    margin-top: 10px;
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
    width: auto;
    min-width: 120px;
    display: inline-block;
    border-radius: 5px;
    border: 1px solid #ccc;}

#feedback {
    margin-top: 20px;
    font-size: 18px;
    color: green;
    display: none;
}

/* Responsive adjustments for small screens */
@media screen and (max-width: 768px) {
    #word-list, #sentence-composer {
        flex-wrap: wrap;  /* Ensure words wrap correctly but stay in row format */
        max-height: none;  /* Allow more flexibility on small screens */
    }

    .word-item {
        padding: 10px;
        width: auto;              /* Allow width to be flexible */
        min-width: 60px;          /* Ensure a minimum width */
        max-width: 150px;         /* Limit the maximum width */
        height: 50px;             /* Maintain the height */
        font-size: 14px;          /* Adjust font size for readability */
        white-space: nowrap;      /* Prevent text from wrapping */
        overflow: hidden;         /* Hide overflow */
        text-overflow: ellipsis;  /* Show ellipsis for long words */
        text-align: center;       /* Center the text */
        display: flex;            /* Use flexbox for alignment */
        justify-content: center;  /* Center horizontally */
        align-items: center;      /* Center vertically */
        word-break: break-all;    /* Break long words if necessary */
    }

    button {
        width: 100%;  /* Make buttons full-width for easier tapping on small screens */
    }

    #feedback {
        text-align: center; 
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
        width: fit-content;
    }
}

/* Glowing effect */
.glow {
    animation: glowing 2s ease-in-out 5;
}

@keyframes glowing {
    0% { box-shadow: 0 0 5px #fff; }
    50% { box-shadow: 0 0 5px #567bff, 0 0 10px #567bff, 0 0 15px #567bff, 0 0 20px #567bff; }
    100% { box-shadow: 0 0 5px #fff; }
}

/* Blinking effect */
.blink {
    animation: blinking 1s step-start 5;
}

@keyframes blinking {
    50% { opacity: 0; }
}
