body {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.container {
    align-items: center;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
}

.container > .content {
    align-items: stretch;
    flex: 1 1 0;
    margin: 0;
    max-width: 1280px;
    width: 100%;
}

.container > .content > main {
    min-width: 640px;
}

@media only screen and (max-width: 1124px) {
    .container {
        align-items: stretch;
    }

    .container > .content main {
        min-width: 0;
    }
}

aside,
main {
    display: flex;
    flex-direction: column;
}

.race-entrants::-webkit-scrollbar,
.race-chat > .messages::-webkit-scrollbar {
    width: 7px;
}

.race-entrants,
.race-chat > .messages {
    scrollbar-color: #1da674 #36393f;
    scrollbar-width: thin;
}

.race-entrants::-webkit-scrollbar-track,
.race-chat > .messages::-webkit-scrollbar-track {
    background: #36393f;
}

.race-entrants::-webkit-scrollbar-thumb,
.race-chat > .messages::-webkit-scrollbar-thumb {
    background-color: #1da674;
    border: 1px solid #36393f;
}

.race-entrants {
    flex: 1 1 0;
    overflow-y: auto;
}

.race-actions {
    margin-bottom: 10px;
    position: relative;
}

.race-actions:empty {
    display: none;
}

.race-actions > ul {
    display: flex;
}

.race-actions > ul > li {
    flex: 1 1 0;
    padding-left: 5px;
}

.race-actions > ul > li:first-child {
    border-left: none;
    padding-left: 0;
}

.race-actions > ul > li .btn {
    display: block;
    width: 100%;
}

.race-actions .modal {
    background: #1a1c20;
    border: 1px solid #1da674;
    border-radius: 4px;
    padding: 5px;
    z-index: 10;
    position: absolute;
        top: 0;
        right: 0;
        left: 0;
}
.race-actions .modal .btn-row {
    margin: 10px 5px 5px;
}

.streaming-required {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.streaming-required > p {
    color: #a0e9a0;
    margin: 0 0 5px;
    font-size: 13px;
}

.streaming-required > .btn {
    width: auto;
}

.race-chat {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    font-size: 13px;
    line-height: 1.384;
    position: relative;
}

.race-chat > .disconnected {
    cursor: default;
    display: none;
    font-weight: bold;
    justify-content: center;
    line-height: 27px;
    position: absolute;
    top: 10px;
    right: 0;
    left: 0;
    z-index: 101;
}

.race-chat > .scrollwarning {
    cursor: pointer;
    display: none;
    font-weight: bold;
    justify-content: center;
    line-height: 27px;
    position: absolute;
    bottom: 80px;
    right: 0;
    left: 0;
    z-index: 100;
}

.race-chat.disconnected > .disconnected {
    display: flex;
}

.race-chat.scrollwarning > .scrollwarning {
    display: flex;
}

.race-chat > .disconnected > span {
    align-items: center;
    background-color: #1a1c20;
    border-radius: 10px;
    display: flex;
    padding: 0 10px;
    pointer-events: none;
}

.race-chat > .scrollwarning > span {
    align-items: center;
    background-color: #1a1c20;
    border-radius: 10px;
    display: flex;
    padding: 0 10px;
    pointer-events: none;
}

@keyframes blink {
    50% {
        opacity: 0.2
    }
}

.race-chat > .disconnected > span > .material-icons {
    animation: blink 1.2s ease-in-out infinite;
    color: #8c3030;
    margin-right: 5px;
}

.race-chat > .scrollwarning > span > .material-icons {
    animation: blink 1.2s ease-in-out infinite;
    color: #8c3030;
    margin-right: 5px;
}

.race-chat > .messages.pinned {
    box-shadow: 0 6px 3px -3px #212328;
    margin: 8px 0 0;
    max-height: 50%;
    overflow-y: auto;
    position: relative;
}
.race-chat > .messages.regular {
    flex: 1 1 0;
    overflow-y: auto;
}

.race-chat > .messages > li {
    margin: 3px 0;
    padding: 2px;
    position: relative;
    word-break: break-word;
}

.race-chat > .messages > li.pin-placeholder {
    display: none;
}

.race-chat > .messages > li.system {
    color: #8c898c;
}

.race-chat > .messages > li.error {
    color: #f08080;
}

.race-chat > .messages > li.highlight {
    color: #a0e9a0;
}

.race-chat > .messages > li.bot {
    color: #a0ace8;
}

.race-chat > .messages.pinned > li::before {
    content: 'push_pin';
    display: inline-block;
    font-family: 'Material Icons';
    font-size: 14px;
    line-height: 1;
    -moz-font-feature-settings: 'liga';
    -moz-osx-font-smoothing: grayscale;
    margin: 3px 2px 0 0;
    vertical-align: top;
}

.race-chat > .messages > li.mentioned {
    background-color: #1a1c20;
    border-radius: 4px;
}

.race-chat > .messages > li.dm {
    padding-top: 15px;
}
.race-chat > .messages > li.dm.mentioned {
    background-color: #454037;
}
.race-chat > .messages > li.dm::after {
    color: #8c898c;
    content: 'visibility';
    font-family: 'Material Icons';
    font-size: 14px;
    line-height: 1;
    -moz-font-feature-settings: 'liga';
    -moz-osx-font-smoothing: grayscale;
    position: absolute;
        top: 1px;
        left: 2px;
}
.race-chat > .messages > li.dm > .dm-info {
    color: #8c898c;
    cursor: default;
    font-variant: all-small-caps;
    font-size: 12px;
    position: absolute;
        top: 0;
        left: 19px;
    user-select: none;
}

.race-chat > .messages > li > .timestamp {
    color: #8c898c;
    font-size: 12px;
    margin-right: 2px;
}

.race-chat > .messages > li > .material-icons {
    cursor: default;
    font-size: 12px;
    line-height: 14px;
}

.race-chat > .messages > li > .bot-actions {
    display: flex;
    margin-top: 4px;
}
.race-chat > .messages > li > .bot-actions > li {
    margin-right: 4px;
}
.race-chat > .messages > li > .bot-actions > li > .msg-action {
    background-color: #4757aa;
    border: none;
    border-radius: 4px;
    color: white;
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    padding: 4px 6px;
    text-decoration: none;
    transition: all 0.2s;
}
.race-chat > .messages > li > .bot-actions > li > .msg-action:hover {
    background-color: #334293;
}

.race-chat > .messages > .bot-survey {
    border: 1px solid #a0ace8;
    border-radius: 4px;
    margin-top: 6px;
}
.race-chat > .messages > .bot-survey,
.race-chat > .messages > .bot-survey button,
.race-chat > .messages > .bot-survey input,
.race-chat > .messages > .bot-survey select {
    font-size: 14px;
}
.race-chat > .messages > .bot-survey input {
    border-color: #a0ace8;
}
.race-chat > .messages > .bot-survey select {
    max-width: 284px;
    max-width: calc(100% - 20px);
}
.race-chat > .messages.pinned > .bot-survey::before {
    content: none;
}
.race-chat > .messages > .bot-survey > span {
    background: #212328;
    color: #a0ace8;
    cursor: default;
    float: left;
    margin: -10px 0 0 3px;
    padding: 0 2px;
}
.race-chat > .messages > .bot-survey > ul {
    clear: left;
}
.race-chat > .messages > .bot-survey > .btn-row {
    margin: 5px;
}
.race-chat > .messages > .bot-survey > .btn-row button {
    padding: 4px 6px;
}
.race-chat > .messages > .bot-survey > .btn-row .msg-action {
    border-color: #a0ace8;
}
.race-chat > .messages > .bot-survey > .btn-row .msg-action:hover {
    border-color: #334293;
    color: #a0ace8;
}

.race-chat > .messages > li > .mod-actions {
    color: #ddd8dd;
    display: none;
    vertical-align: top;
}

.show-mod-actions .race-chat > .messages > li > .mod-actions {
    display: inline-flex;
}

.race-chat > .messages > li > .mod-actions > span {
    cursor: pointer;
    font-size: 13px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    width: 16px;
}

.race-chat > .messages.pinned > li > .mod-actions > .pin,
.race-chat > .messages.regular > li > .mod-actions > .unpin {
    display: none;
}

.race-chat > .messages > li > .name {
    align-items: center;
    color: #b9b4b9;
    display: inline-flex;
    vertical-align: top;
}
.race-chat.dm > .messages > li > .name {
    cursor: pointer;
}

.race-chat > .messages > li > .name.supporter > span {
    background-image: linear-gradient(to top right, #cca32a 0, #ffea99 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
}

.race-chat > .messages > li.bot > .name {
    color: #a0ace8;
}

.race-chat > .messages > li > .name::before {
    background: no-repeat 0 0 / contain;
    margin-right: 2px;
    height: 12px;
    width: 12px;
}

.race-chat > .messages > li > .name.moderator::before {
    background-image: url(../image/sword.svg);
    content: '\a0';
}

.race-chat > .messages > li > .name.supporter.moderator::before {
    background-image: url(../image/gold_sword.svg);
}

.race-chat > .messages > li > .name.staff::before {
    background-image: url(../image/star.svg);
    content: '\a0';
}

.race-chat > .messages > li > .name.supporter.staff::before {
    background-image: url(../image/gold_star.svg);
}

.race-chat > .messages > li.deleted > .message {
    display: none;
    font-style: italic;
}
.race-chat > .messages > li.deleted.show-delete > .message {
    display: initial;
}

.race-chat > .messages > li > .message .good {
    color: #a0e9a0;
}

.race-chat > .messages > li > .message .bad {
    color: #f08080;
}

.race-chat > .messages > li > .message .bot {
    color: #a0ace8;
}

.race-chat > .messages > li > .message .mention {
    font-weight: bold;
}

.race-chat > .messages > li > .message .emote {
    height: 22px;
    vertical-align: top;
    width: 22px;
}

.race-chat > .messages > li > .deleted {
    color: #b9b4b9;
    font-style: italic;
}
.race-chat > .messages > li.show-delete > .deleted {
    display: none;
}
.race-chat.can-moderate > .messages > li > .deleted {
    cursor: pointer;
    text-decoration: underline;
}
.race-chat.can-moderate > .messages > li > .deleted::before {
    content: '<';
}
.race-chat.can-moderate > .messages > li > .deleted::after {
    content: '>';
}

.race-chat > form {
    margin: 4px -4px -4px;
    padding: 4px;
    transition: box-shadow 0.1s;
}
.race-chat > form.dm {
    box-shadow: 0 0 3px 0 #f0b132;
}

.race-chat > form label {
    margin-right: 6px;
}

.race-chat > form label[for="id_message"] {
    display: none;
}

.race-chat > form li {
    align-items: center;
    display: flex;
}

.race-chat > form li:first-child {
    display: none;
    margin-bottom: 6px;
}
.race-chat > form.dm li:first-child {
    display: flex;
}

.race-chat > form input,
.race-chat > form textarea {
    caret-color: #1da674;
    flex-grow: 1;
    font-size: 13px;
    height: 18px;
    min-height: 0;
    outline: none;
    overflow: hidden;
    padding: 6px;
    resize: none;
    vertical-align: top;
}

.race-chat > form input {
    flex: 0 0 50%;
}

.race-chat > form textarea:invalid {
    box-shadow: none;
}

.race-chat > form.dm input,
.race-chat > form.dm textarea,
.race-chat > form.dm button {
    border-color: #f0b132;
    caret-color: #f0b132;
}

.race-chat > form > .actions {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.race-chat > form > .actions > button {
    font-size: 13px;
    width: 42px;
}
.race-chat > form > .actions > button .dm,
.race-chat > form.dm > .actions > button .chat {
    display: none;
}
.race-chat > form.dm > .actions > button .dm {
    display: inline;
}

.race-chat > form > .actions > .moderation,
.race-chat > form > .actions > .notifications,
.race-chat > form > .actions > .send-dm,
.race-chat > form > .actions > .popout {
    align-items: center;
    cursor: pointer;
    display: flex;
    margin-right: 5px;
    text-decoration: none;
    transition: color 0.1s;
}

.race-chat > form > .actions > .moderation {
    margin-right: auto;
}

.race-chat > form > .actions > .moderation > .on,
.show-mod-actions .race-chat > form > .actions > .moderation > .off,
.race-chat > form > .actions > .notifications > .on,
.race-chat > form > .actions > .notifications.on > .off {
    display: none;
}

.show-mod-actions .race-chat > form > .actions > .moderation > .on,
.race-chat > form > .actions > .notifications.on > .on {
    display: initial;
}

.race-chat > form.dm > .actions > .send-dm {
    color: #f0b132;
}

.race-stream-control {
    flex: 0 0 auto;
    padding-bottom: 10px;
}

.race-stream-control > ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.race-stream-control > ul > li {
    border: 2px solid #1a1c20;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    flex: 0 0 32px;
    height: 32px;
    justify-content: center;
    line-height: 32px;
    margin: 0 0 5px 5px;
}

.race-stream-control > ul > .go-spectate {
    display: flex;
}

.race-stream-control > ul > li > a {
    display: flex;
    flex-grow: 1;
    justify-content: center;
    text-decoration: none;
}

.race-stream-control > ul > li .material-icons {
    line-height: 32px;
}

.race-nav {
    background: #1e1f24;
    display: none;
}

.race-nav > ul {
    display: flex;
    justify-content: space-around;
}

.race-nav > ul > li {
    align-items: center;
    cursor: pointer;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    padding: 5px 0;
}

.race-nav > ul > .active {
    color: #beebd1;
}

.race-nav > ul > li > .title {
    font-size: 11px;
}

@media only screen and (max-width: 600px) {
    .container {
        align-items: stretch;
    }
    .container > .content {
        margin: 0;
    }
    .container > .content > main {
        flex: 0 1 auto;
    }
    .container > .content > aside {
        flex: 1 1 auto;
    }
    .race-info > .category,
    .race-info > .goal,
    .race-info > .info,
    .race-meta,
    .race-stream-control,
    .race-entrants,
    .race-monitor,
    .race-status > .state > .help,
    .race-chat > form > .actions > .popout {
        display: none;
    }
    .race-nav-info .container > .content > main,
    .race-nav-entrants .container > .content > main {
        flex: 1 1 100%;
    }
    .race-nav-info .race-info > .category,
    .race-nav-info .race-info > .goal,
    .race-nav-info .race-info > .info,
    .race-nav-info .race-meta,
    .race-nav-entrants .race-entrants,
    .race-nav-entrants .race-monitor {
        display: initial;
    }
    .race-nav-info .race-chat,
    .race-nav-entrants .race-chat {
        display: none;
    }
    .race-intro {
        display: block;
    }
    .race-info {
        padding-bottom: 0;
    }
    .race-info > .category > .name {
        font-size: 24px;
    }
    .race-meta {
        margin: 0;
        padding-top: 10px;
    }
    .race-entrants {
        margin-top: 10px;
    }
    .race-monitor {
        margin-top: 0;
    }
    .race-monitor > ul {
        flex-wrap: wrap;
    }
    .race-monitor > ul > li {
        margin-top: 10px;
    }
    .race-monitor > ul > .invite {
        flex-basis: 100%;
    }
    .race-monitor > ul > .invite > form > ul {
        width: 100%;
    }
    .race-monitor > ul > .invite > form input {
        box-sizing: border-box;
        width: 100%;
    }
    .race-monitor > ul > .invite+li {
        margin-left: 0;
    }
    .race-status > .timer {
        font-size: 40px;
    }
    .race-status > .state > .value {
        font-size: 15px;
    }
    .entrant-row {
        align-items: center;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .entrant-row > .user {
        flex-basis: calc(100% - 50px);
    }
    .entrant-row > .user > .user-pop > .pronouns,
    .entrant-row > .status,
    .entrant-row > .finish-time {
        display: none;
    }
    .entrant-row > .status-or-time {
        display: initial;
        font-size: 13px;
    }
    .entrant-row > .monitor-actions::before {
        font-size: 17px;
    }
    .race-nav {
        display: block;
    }
    footer {
        display: none;
    }
}
