body {
    background: url('/static/img/paper-fibers.png') repeat, #f4e4bc;
    font-family: 'Special Elite', cursive;
    color: #5c4033;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container, .auth-container {
    background: rgba(245, 235, 200, 0.9);
    padding: 20px;
    border: 3px solid #8b5a2b;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
}

.auth-container {
    max-width: 350px;
    width: 100%;
    text-align: center;
}

h1 {
    font-size: 28px;
    color: #8b5a2b;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.rules-container h1 {
    font-size: 20px;
    margin: 15px 0 10px;
}

h2 {
    font-size: 24px;
    color: #5c4033;
    border-bottom: 2px dashed #8b5a2b;
    padding-bottom: 5px;
    margin-top: 20px;
}

.error {
    color: #8b5a2b;
    font-size: 14px;
    margin: 10px 0;
}

.auth-form, .chat-create-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.chat-create-form input[type="text"],
.chat-create-form select {
    background: #fff8e1;
    border: 2px solid #8b5a2b;
    padding: 8px;
    font-family: 'Special Elite', cursive;
    font-size: 14px;
    color: #5c4033;
    border-radius: 5px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-create-form input[readonly] {
    background: #e6d9a8;
    cursor: not-allowed;
}

button, .auth-form button, .chat-create-form button {
    background: #8b5a2b;
    color: #fff8e1;
    border: none;
    padding: 10px;
    font-family: 'Special Elite', cursive;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

button:hover, .auth-form button:hover, .chat-create-form button:hover {
    background: #a66d3c;
}

.exit-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #8b5a2b;
    color: #fff8e1;
    border: none;
    padding: 8px 16px;
    font-family: 'Special Elite', cursive;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

.exit-btn:hover {
    background: #a66d3c;
}

#map {
    height: 400px;
    margin: 20px 0;
    border: 2px solid #8b5a2b;
    border-radius: 5px;
}

.chat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chat-list li {
    padding: 10px;
    border-bottom: 1px dashed #8b5a2b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-list li a {
    color: #5c4033;
    text-decoration: none;
    font-size: 16px;
}

.chat-list li a:hover {
    color: #8b5a2b;
}

.user-count {
    background: #8b5a2b;
    color: #fff8e1;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.search-container {
    margin: 10px 0;
}

#chat-search {
    width: 100%;
    background: #fff8e1;
    border: 2px solid #8b5a2b;
    padding: 8px;
    font-family: 'Special Elite', cursive;
    font-size: 14px;
    color: #5c4033;
    border-radius: 5px;
}

#messages {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #8b5a2b;
    border-radius: 5px;
}

.message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 5px;
}

.message.mine {
    background: #d4c292;
    margin-left: 20%;
    text-align: right;
}

.message.other {
    background: #e6d9a8;
    margin-right: 20%;
}

.message .timestamp {
    font-size: 12px;
    color: #7a5b3a;
    margin-top: 5px;
}

#message-input {
    width: calc(100% - 110px);
    background: #fff8e1;
    border: 2px solid #8b5a2b;
    padding: 8px;
    font-family: 'Special Elite', cursive;
    font-size: 14px;
    color: #5c4033;
    border-radius: 5px;
    margin-right: 10px;
}

#file-input {
    margin: 10px 0;
}

#voice-chat-controls {
    margin: 10px 0;
}

#voice-participants {
    margin-top: 10px;
}

#voice-select-participants {
    margin-top: 5px;
}

#voice-select-participants label {
    display: block;
    margin: 5px 0;
}

#location-controls {
    margin: 10px 0;
}

#location-controls button {
    margin-right: 10px;
}

.rules-container {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #8b5a2b;
    border-radius: 5px;
}

.rules-container ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.rules-container li {
    margin-bottom: 5px;
}

.rules-agreement {
    margin-top: 10px;
    font-size: 14px;
}


@media (prefers-contrast: high) {
    body {
        background: #fff;
        color: #000;
    }
    .container, .auth-container {
        background: #fff;
        border-color: #000;
    }
    .auth-form input[type="text"],
    .auth-form input[type="password"],
    .chat-create-form input[type="text"],
    .chat-create-form select,
    #chat-search,
    #message-input {
        background: #fff;
        color: #000;
        border-color: #000;
    }
    button, .auth-form button, .chat-create-form button, .exit-btn {
        background: #000;
        color: #fff;
    }
    .message.mine, .message.other {
        background: #ddd;
    }
    h1, h2, .chat-list li a {
        color: #000;
    }
    .user-count {
        background: #000;
        color: #fff;
    }
}