/* Chat Styles */

.chat-container {
    max-width: 700px;
    margin: 20px auto;
    font-family: 'Courier New', Courier, monospace;
    background: #fdf5e6;
    border: 3px double #8b4513;
    padding: 15px;
    box-shadow: 5px 5px 0px #8b4513;
    position: relative;
    min-height: 500px;
}

/* Gatekeeper Overlay */
.chat-gatekeeper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fdf5e6;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.gatekeeper-title {
    font-size: 1.5em;
    color: #8b4513;
    margin-bottom: 20px;
    font-weight: bold;
}

.naming-step {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.naming-step.active {
    display: flex;
}

.login-input {
    padding: 10px;
    border: 2px solid #8b4513;
    font-family: inherit;
    font-size: 1.1em;
    width: 250px;
    text-align: center;
}

.login-btn {
    background: #8b4513;
    color: #fff;
    border: 1px solid #5d2e0a;
    padding: 10px 30px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.9em;
}

.login-btn:hover {
    background: #a0522d;
}

.chat-content-hidden {
    display: none !important;
}

.chat-header {
    text-align: center;
    border-bottom: 2px solid #8b4513;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.chat-header h1 {
    font-size: 1.5em;
    color: #8b4513;
    margin: 0;
    text-transform: uppercase;
}

/* Room Tabs */
.chat-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 0px;
    flex-wrap: wrap;
}

.chat-tab {
    padding: 8px 15px;
    background: #deb887;
    border: 2px solid #8b4513;
    border-bottom: none;
    cursor: pointer;
    font-weight: bold;
    color: #5d2e0a;
    transition: all 0.2s;
    font-size: 0.9em;
}

.chat-tab:hover {
    background: #f5deb3;
}

.chat-tab.active {
    background: #fdf5e6;
    color: #8b4513;
    position: relative;
    z-index: 2;
    margin-bottom: -2px;
}

/* Message Area */
.chat-window {
    border: 2px solid #8b4513;
    background: #fff;
    height: 400px;
    overflow-y: scroll;
    padding: 10px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: #8b4513 #fdf5e6;
}

.chat-message {
    padding: 5px 10px;
    border-bottom: 1px dashed #d2b48c;
    animation: fadeIn 0.3s ease;
}

.chat-message:last-child {
    border-bottom: none;
}

.msg-meta {
    font-size: 0.8em;
    color: #8b4513;
    margin-bottom: 3px;
}

.msg-author {
    font-weight: bold;
}

.msg-time {
    font-style: italic;
    margin-left: 10px;
}

.msg-text {
    word-wrap: break-word;
    color: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Area */
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #deb887;
    padding: 15px;
    border: 2px solid #8b4513;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    padding: 8px;
    border: 1px solid #8b4513;
    font-family: inherit;
}

.input-name {
    width: 150px;
}

.input-msg {
    flex-grow: 1;
}

.chat-submit {
    background: #8b4513;
    color: #fff;
    border: 1px solid #5d2e0a;
    padding: 8px 20px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
}

.chat-submit:hover {
    background: #a0522d;
}

.chat-status {
    font-size: 0.8em;
    height: 1.2em;
    color: #8b4513;
    text-align: right;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .input-name {
        width: 100%;
    }

    .chat-window {
        height: 300px;
    }
}