body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.title-container {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.title {
    font-size: 3rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
    letter-spacing: 1.5px;
}

.username-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 400px;
    margin: auto;
    padding: 10px;
}

.username-container input {
    padding: 12px;
    border: 1px solid #444;
    border-radius: 5px;
    margin-bottom: 10px;
    width: 100%;
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-size: 16px;
    box-sizing: border-box;
}

.username-container button {
    padding: 10px;
    border: none;
    background-color: #333;
    color: #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
    width: 50%;
}

.username-container button:hover {
    background-color: #444;
}

.chat-container {
    width: 90%;
    max-width: 800px;
    height: 70%; 
    margin: 0 auto;
    background: #1e1e1e;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.messages {
    height: 80%; 
    overflow-y: auto; 
    overflow-x: hidden;
    border: 1px solid #444;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    background-color: #2a2a2a;
    word-wrap: break-word;
}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 5px;
}

.messages::-webkit-scrollbar-track {
    background-color: #2a2a2a;
}

.messages div {
    margin-bottom: 5px;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
    position: relative;
}

.messages div:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.messages .timestamp {
    display: none;
    color: #b0b0b0;
    font-size: 0.8rem;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.messages div strong {
    font-size: 1.1rem;
}

.messages div:hover .timestamp {
    display: inline-block; 
}

.input-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #1e1e1e;
    color: #e0e0e0;
    margin-right: 10px;
    font-size: 16px;
}

button {
    padding: 12px;
    border: none;
    background-color: #333;
    color: #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 16px;
}

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

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .username-container {
        width: 95%;
    }

    .chat-container {
        width: 95%;
        height: 65%;
    }

    input[type="text"], button {
        font-size: 14px;
        padding: 10px;
    }

    .online-users {
        font-size: 14px;
    }

    .messages .timestamp {
        display: inline-block;
        position: relative;
        right: 0;
        top: 0;
        transform: none;
        font-size: 0.9rem;
        margin-left: 10px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }

    input[type="text"], button {
        font-size: 12px;
        padding: 8px;
    }

    .chat-container {
        height: 60%;
    }

    .online-users {
        font-size: 12px;
    }
}

input,
button,
textarea,
select {
    font-size: 16px !important;
}