* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: "VT323", 'PixelChinese', monospace;
}

body {
    background-color: #000;
    color: #fff;
}

@font-face {
  font-family: 'PixelChinese';
  src: url('pixelChinese.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

main {
    height: 100vh;
    padding: 1rem 1rem 2rem 1rem;
    display: flex;
    flex-flow: column;
}

form {
    width: 100%;
    margin: auto;
    max-width: 600px;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    gap: .25rem;
}

input {
    flex-grow: 1;
    max-width: calc(80% - .25rem);
}

button {
    width: 20%;
}

input,
button {
    border-radius: 10px;
    padding: .5rem;
}

.chat-display {
    background-color: #333;
    list-style-type: none;
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    margin: 1rem auto;
    padding: 0;
    display: flex;
    flex-flow: column;
    justify-content: left;
    overflow: auto;
    flex-grow: 1;
}

.post {
    background-color: #eee;
    border-radius: 10px;
    padding: 0 0 .25rem;
    margin: .5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.post--left {
    width: 60%;
    align-self: flex-end;
}

.post--right {
    width: 60%;
    align-self: flex-start;
}

.post__header {
    color: #fff;
    padding: .25rem .5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

.post__header--user {
    background-color: skyblue;
}

.post__header--reply {
    background-color: pink;
}

.post__header--name {
    font-weight: bold;
}

.post__header--time {
    font-size: .8rem;
}

.post__text {
    margin-top: 5px;
    color: #333;
    padding: .25rem .5rem;
}

.user-list,
.room-list,
.activity {
    width: 100%;
    min-height: 2rem;
    margin: 0 auto;
    max-width: 600px;
    padding: .5rem .25rem;
}

.activity {
    font-style: italic;
}

@media (max-width: 750px) {
    main {
        font-size: 1rem; /* Adjust font size for better readability */
        padding: 0.2rem; /* Reduce padding for more screen space */
        display: flex; /* Set up flexbox layout */
        flex-direction: column; /* Stack children vertically */
        justify-content: space-between; /* Space between items */
        max-height: 90vh; /* Limit the maximum height */
        overflow: auto; /* Allow scrolling */
        position: relative; /* Establish positioning context */
    }
    .form-msg {
        display: flex;
        flex-direction: row; /* Align children horizontally */
        justify-content: space-between; /* Distribute space between elements */
        gap: 0.25rem; /* Adjust the gap between elements */
        width: 100%; /* Use full width */
    }

    .form-msg input[type="text"] {
        flex: 1; /* Take up as much space as possible */
        margin-right: 0.25rem; /* Add a little margin to the right of the input */
    }

    .form-msg button {
        white-space: nowrap; /* Prevent the text inside the button from wrapping */
        padding: 0.5rem 1rem; /* Add padding inside the button */
        /* Set a width or flex-basis if you want to specify button width */
    }

    form {
        display: flex;
        width: 100%; /* Use full width */
        flex-direction: column; /* Stack inputs vertically */
        align-items: center;
        gap: 0.25rem; /* Adjust the gap between elements */
    }
    .form-join {
        display: flex;
        width: 100%; /* Use full width */
        flex-direction: row; /* Align children horizontally */
        justify-content: space-between; /* Distribute space between elements */
        gap: 0.25rem; /* Adjust the gap between elements */
    }

    .form-join input[type="text"],
    .form-join button {
        flex-grow: 1; /* Allow inputs and button to grow and fill the form */
        margin: 0.1rem; /* Small margin for spacing */
    }

    /* If you want the button to be smaller than the input fields */
    .form-join button {
        flex-grow: 0; /* Do not allow the button to grow */
        flex-basis: 20%; /* Set the base width of the button */
    }

    input{
        width: 30%;
    }
    button {
        width: 40%;
    }

    .chat-display {
        width: 100%; /* Use full width */
        margin: 0.25rem 0; /* Adjust margins */
    }

    .post {
        margin: 0.125rem 0; /* Adjust margins for posts */
    }

    .post--left{
        width: 60%;
        align-self: flex-end;
    }
    .post--right {
        width: 60%;
        align-self: flex-start;
    }
}