@font-face {
    font-family: "TerminusTTF";
    src: url("./fonts/TerminusTTF-4.49.3.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: TerminusTTF, monospace, sans-serif;
    background: #0a0a0a;
    color: #d4d4d4;
}

body {
    background-image:
        radial-gradient(circle at top left, rgba(70, 70, 90, 0.12), transparent 40%),
        radial-gradient(circle at bottom right, rgba(100, 100, 140, 0.08), transparent 40%);
}

a,
a:link,
a:hover,
a:active,
a:visited {
    text-decoration: none;
    color: inherit;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(12, 12, 12, 0.96);
}

#announce_container {
    display: none;
}

.announce_text {
    text-align: center;
    background: linear-gradient(90deg, #3a3a60, #505088);
    border: 1px solid #5d5da5;
    border-radius: 6px;
    color: #f2f2ff;
    padding: 4px 10px;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 0 8px rgba(90, 90, 150, 0.3);
}

.unread {
    margin-left: 4px;
    color: #ff4f4f;
    font-size: 11px;
}

#total_unread {
    font-weight: bold;
    color: #ffffff;
}

#chat_window {
    flex: 1;
    min-height: 0;
    background: #101010;
    display: flex;
    flex-flow: column;
    border-top: 1px solid #222;
}

#chat_upper {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: linear-gradient(to bottom, #1a1a1a, #111111);
    border-bottom: 1px solid #242424;
    color: #e9e9e9;
    user-select: none;
}

.chat_tab_button {
    height: 26px;
    border: 1px solid #2f2f2f;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(to bottom, #181818, #101010);
    color: #a8a8a8;
    text-align: center;
    font-family: TerminusTTF, monospace, sans-serif;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 2px;
    padding: 0 12px;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.chat_tab_button:hover {
    background: linear-gradient(to bottom, #232323, #171717);
    color: #ffffff;
    border-color: #4a4a4a;
}

.chat_tab_selected {
    background: linear-gradient(to bottom, #2a2a2a, #1c1c1c);
    color: #ffffff;
    border-color: #5a5a5a;
    box-shadow: inset 0 -2px 0 #7c7cff;
}

#usr_online {
    margin-left: auto;
    padding-left: 14px;
    color: #9fdf9f;
    cursor: default;
    user-select: none;
}

.chatfield {
    flex: 1;
    border: 0;
    margin: 0;
    padding: 10px;
    overflow: auto;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    background:
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.015),
            rgba(255, 255, 255, 0)
        ),
        #0d0d0d;
    color: #d6d6d6;
    line-height: 1.4;
}

.chatfield > div {
    overflow: hidden;
    margin-bottom: 2px;
}

#chat_lower {
    width: 100%;
    display: flex;
    border-top: 1px solid #242424;
    background: #111111;
}

#chatbar {
    width: 100%;
    margin: 0;
    border: 0;
    background: #181818;
    color: #e4e4e4;
    padding: 10px 12px;
    font: inherit;
    outline: none;
    transition: background 0.15s ease;
}

#chatbar:focus {
    background: #1e1e1e;
}

#chatbar::placeholder {
    color: #777;
}

#chatsend {
    margin: 0;
    border: 0;
    border-left: 1px solid #2d2d2d;
    background: linear-gradient(to bottom, #2d2d44, #1d1d2d);
    color: #f0f0ff;
    padding: 0 18px;
    font: inherit;
    cursor: pointer;
    transition:
        background 0.15s ease,
        filter 0.15s ease;
}

#chatsend:hover {
    background: linear-gradient(to bottom, #404060, #2a2a44);
    filter: brightness(1.1);
}

.unread_bar {
    background-color: #ff4040;
    width: 100%;
    height: 2px;
    margin-top: 8px;
    margin-bottom: 8px;
    text-align: center;
    box-shadow: 0 0 6px rgba(255, 64, 64, 0.7);
}

.unread_bar_msg {
    background-color: #0d0d0d;
    position: relative;
    top: -8px;
    padding: 0 5px;
    font-family: TerminusTTF, monospace, sans-serif;
    font-size: 0.7em;
    color: #ff5050;
}

.chat_emote {
    background-image: url('./emotes.png');
    background-size: auto 400%;
    height: 16px;
    vertical-align: middle;
    display: inline-block;
}

#nick_input {
    width: 140px;
    border: 1px solid #333;
    border-radius: 5px;
    background: #161616;
    color: #f0f0f0;
    padding: 6px 8px;
    font: inherit;
    outline: none;
}

#nick_input:focus {
    border-color: #6666aa;
}

#world_tabs {
    padding: 4px 4px 0;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    background: #121212;
    border-bottom: 1px solid #242424;
}

#add_world_tab {
    min-width: 30px;
    padding: 0 10px;
    font-weight: bold;
}

#panel_host {
    flex: 1;
    min-height: 0;
    display: flex;
}

.world_panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.world_tab {
    white-space: nowrap;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #111111;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4d4d4d;
}

::selection {
    background: #5a5aa0;
    color: white;
}