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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    font-size: 18px;
}
#container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    /* Offset upward by half the title height so #app lands at true center */
    margin-top: -70px;
}

#title {
    width: 720px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

#title p {
    font-size: 64px;
    font-weight: bold;
    margin: -0.17em 0;
    padding: 0 0 0 16px;
}

#back {
    font-size: 18px;
    text-decoration: none;
    color: black;
    padding: 0 16px 0 0;
}

#back:hover {
    font-weight: bold;
}
#app {
    display: grid;
    grid-template-columns: 1fr 148px;
    grid-template-rows: auto 1fr auto;
    width: 720px;
    height: 540px;
    border: 1px solid #000;
}

#header {
    grid-column: 1/3;
    border-bottom: 1px solid #000;
    padding: 4px;
    display: flex;
    justify-content: space-between;
}

#messages {
    grid-column: 1;
    grid-row: 2;
    overflow-y: auto;
    padding: 4px;
}

#users {
    grid-column: 2;
    grid-row: 2;
    border-left: 1px solid #000;
    padding: 4px;
    overflow-y: auto;
}

#input-bar {
    grid-column: 1 / 3;
    grid-row: 3;
    border-top: 1px solid #000;
    display: flex;
    align-items: center;
    padding: 0;
    gap: 8px;
}

#input-hint {
    color: #999;
    white-space: nowrap;
    order: 1;
    padding-right: 4px;
}

#input {
    flex: 1;
    padding: 4px;
    font-family: monospace;
    box-sizing: border-box;
    border: none;
    outline: none;
    font-size: inherit;
}

#messages div {
    white-space: pre-wrap;
    word-break: break-word;
}

.pm {
    font-style: italic;
}

.sys {
    color: #999;
}

.user-badge {
    display: inline-block;
    width: 1ch;
    margin-right: 0.4ch;
    text-align: center;
}

.mention {
    background: #fffbe6;
}

.mention-nick {
    font-weight: bold;
}
