html,
body {
    margin: 0;
    width: 100%;
    height: 100%;

    font-family: "Exo 2", sans-serif;
    line-height: 1.75em;
}

.dark-theme .light,
.light-theme .dark {
    display: none;
}

html.dark-theme {
    background-color: #0a0a0a;
    color: #eee;

    --navbar-background: #0a0a0abb;
    --navbar-border: #444;
    --nav-button-hover: #fff1;
    --nav-button-active: #ffffff0b;
    --nav-drawer-background: #111;
    --nav-screen-cover: #080808bb;
    --avatar-preload-background: #eee;
    --sidebar-background: #080808;
    --sidebar-border: #444;
    --sidebar-button-hover: #fff1;
    --sidebar-button-active: #ffffff0b;
    --sidebar-button-selected: #fff2;
    --shell-main-background: #0c0c0c;
    --panel-border: #444;
    --panel-background-1: #ffffff09;
    --panel-background: #ffffff04;
    --panel-background-error: #ff444450;
    --panel-background-highlight: #00968840;
    --text-primary: #eee;
    --text-secondary: #aaa;
    --text-tertiary: #777;
    --text-inverse: #080808;
    --text-red: #e66;
    --text-inverse-green: #090;
    --button-primary-background: #eee;
    --button-primary-hover: #f8f8f8;
    --button-primary-active: #d8d8d8;
    --button-primary: #111;
    --button-secondary-background: #111;
    --button-secondary-hover: #181818;
    --button-secondary-active: #080808;
    --button-secondary: #eee;
    --button-secondary-border: #444;
    --switch-off-background: #222;
    --switch-on-background: #eee;
    --switch-handle: #111;
    --switch-border: #444;
    --save-bar-background: #222;
    --input-background: #111;
    --input-hover: #222;
    --input-border: #444;
    --input-outline: #888;
    --guild-icon-background: #fff1;
    --badge-primary-background: #222;
    --badge-primary: #eee;
    --badge-danger-background: #711;
    --badge-danger: #eee;
    --combobox-background: #000;
    --combobox-border: #444;
    --code-background: #222;
    --modal-background: #090909;
    --hr-border: #333;
    --lock-background: #0001;
    --lock-background-red: #f001;
    --mention-background: #1f3c59;
    --green-text: #22cc22;
    --red-text: #ff4444;
    --spoiler-overlay: #222;
    --vs-border: #888;
}

html.light-theme {
    background-color: #eee;
    color: #111;

    --navbar-background: #eeeb;
    --navbar-border: #bbb;
    --nav-button-hover: #0001;
    --nav-button-active: #00000019;
    --nav-drawer-background: #eaeaea;
    --nav-screen-cover: #1119;
    --avatar-preload-background: #111;
    --sidebar-background: #e6e6e6;
    --sidebar-border: #bbb;
    --sidebar-button-hover: #0001;
    --sidebar-button-active: #00000019;
    --sidebar-button-selected: #00000025;
    --shell-main-background: #eee;
    --panel-border: #bbb;
    --panel-background-1: #00000008;
    --panel-background: #00000004;
    --panel-background-error: #bb000050;
    --panel-background-highlight: #00968840;
    --text-primary: #111;
    --text-secondary: #666;
    --text-tertiary: #999;
    --text-inverse: #eee;
    --text-red: #f00;
    --text-inverse-green: #6e6;
    --button-primary-background: #111;
    --button-primary-hover: #181818;
    --button-primary-active: #080808;
    --button-primary: #eee;
    --button-secondary-background: #ddd;
    --button-secondary-hover: #e8e8e8;
    --button-secondary-active: #ccc;
    --button-secondary: #111;
    --button-secondary-border: #bbb;
    --switch-off-background: #ccc;
    --switch-on-background: #111;
    --switch-handle: #eee;
    --switch-border: #bbb;
    --save-bar-background: #ccc;
    --input-background: #eee;
    --input-hover: #ddd;
    --input-border: #ccc;
    --input-outline: #888;
    --guild-icon-background: #0001;
    --badge-primary-background: #ccc;
    --badge-primary: #111;
    --badge-danger-background: #d33;
    --badge-danger: #eee;
    --combobox-background: #f5f5f5;
    --combobox-border: #bbb;
    --code-background: #d9d9d9;
    --modal-background: #e4e4e4;
    --hr-border: #ccc;
    --lock-background: #fff3;
    --lock-background-red: #fbb3;
    --mention-background: #90b9e2;
    --red-text: #ff2222;
    --green-text: #00aa00;
    --spoiler-overlay: #d9d9d9;
    --vs-border: #888;
}

@media (any-pointer: coarse) {
    .kbm {
        display: none !important;
    }
}

@media (any-pointer: fine) {
    .mobile {
        display: none !important;
    }
}

@media screen and (max-width: 639px) {
    .sm,
    .sm-up,
    .md,
    .md-up,
    .lg,
    .lg-up,
    .xl {
        display: none !important;
    }
}

@media screen and (min-width: 640px) and (max-width: 767px) {
    .xs,
    .md,
    .md-up,
    .lg,
    .lg-up,
    .xl {
        display: none !important;
    }
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
    .xs,
    .sm,
    .sm-dn,
    .lg,
    .lg-up,
    .xl {
        display: none !important;
    }
}

@media screen and (min-width: 1024px) and (max-width: 1279px) {
    .xs,
    .sm,
    .sm-dn,
    .md,
    .md-dn,
    .xl {
        display: none !important;
    }
}

@media screen and (min-width: 1280px) {
    .xs,
    .sm,
    .sm-dn,
    .md,
    .md-dn,
    .lg,
    .lg-dn {
        display: none !important;
    }
}

.small-text {
    font-size: 80%;
}

.geo {
    font-family: Geo, sans-serif;
}

a {
    color: var(--text-primary);
}

.text-secondary a,
.text-tertiary a {
    color: unset;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0.25rem 0;
    font-family: Geo, sans-serif;
}

h1 {
    font-size: 24pt;
    font-weight: unset;
}

h2 {
    font-size: 19pt;
    font-weight: unset;
}

h3 {
    font-size: 17pt;
    font-weight: unset;
}

h4 {
    font-size: 15pt;
    font-weight: bold;
}

h5 {
    font-size: 14pt;
    font-weight: bold;
}

h6 {
    font-size: 13pt;
    font-weight: bold;
}

p {
    margin: 0;
}

p:not(.wide) {
    max-width: 800px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.3rem;
    box-sizing: border-box;

    background-color: var(--background);
    color: var(--foreground);
    cursor: default;
    user-select: none;
    border: 1px solid var(--border);
    outline: unset;
    font-family: "Exo 2", sans-serif;
    font-size: 11pt;
    text-decoration: none;
    padding: 0.25rem 1rem;
}

.btn:not([disabled]):hover {
    background-color: var(--hover);
}

.btn:not([disabled]):active {
    background-color: var(--active);
}

.btn[disabled] {
    opacity: 60%;
}

.btn:not([disabled]):not(.static):active {
    scale: 96%;
}

.btn.small {
    padding: 0.25rem;
}

.btn.primary {
    --background: var(--button-primary-background);
    --foreground: var(--button-primary);
    --hover: var(--button-primary-hover);
    --active: var(--button-primary-active);
}

.btn.secondary {
    --background: var(--button-secondary-background);
    --foreground: var(--button-secondary);
    --hover: var(--button-secondary-hover);
    --active: var(--button-secondary-active);
    --border: var(--button-secondary-border);
}

.panel {
    display: flex;
    flex-direction: column;
    align-items: start;
    align-self: stretch;
    gap: 0.75rem;
    height: max-content;

    overflow-x: scroll;
    overflow-y: visible;

    background-color: var(--panel-background-1);
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
}

.panel .panel {
    background-color: var(--panel-background);
}

.panel.error {
    background-color: var(--panel-background-error);
}

.panel.highlight {
    background-color: var(--panel-background-highlight);
}

.switch-grid {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0.25rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="color"],
select,
textarea {
    background-color: var(--input-background);
    border: 1px solid var(--input-border);
    outline: unset;
    color: var(--text-primary);
    font-family: "Exo 2", sans-serif;
    font-size: 12pt;
    padding: 0.5rem;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
input[type="color"]:hover,
select:hover,
textarea:hover {
    background-color: var(--input-hover);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border: 1px solid var(--input-outline);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="password"]::placeholder,
select::placeholder,
textarea:placeholder {
    color: var(--text-tertiary);
}

textarea {
    align-self: stretch;
    height: 4.5rem;
    resize: vertical;
}

.badge {
    background-color: var(--background);
    color: var(--foreground);
    padding: 0 0.5rem;
    font-size: 10pt;
}

.badge.primary {
    --background: var(--badge-primary-background);
    --foreground: var(--badge-primary);
}

.badge.danger {
    --background: var(--badge-danger-background);
    --foreground: var(--badge-danger);
}

label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

code,
pre {
    font-family: "Kode Mono", monospace;
}

code:not(.plain),
pre:not(.plain) {
    background-color: var(--code-background);
    padding: 0 0.5rem;
}

pre code {
    background-color: unset;
    padding: unset;
}

.flex {
    display: flex;
    gap: 0.5rem;
}

.flex.col {
    flex-direction: column;
}

.flex:not(.no-center) {
    align-items: center;
}

.flex.no-center {
    align-items: start;
}

.flex.stretch {
    align-items: stretch;
}

.flex.no-gap {
    gap: 0;
}

.flex.wide-gap {
    gap: 1rem;
}

.flex:not(.no-wrap) {
    flex-wrap: wrap;
}

hr {
    width: 90%;
    border-width: 1px;
    border-color: var(--hr-border);
}

hr.full {
    width: 100%;
    opacity: 50%;
}

#header {
    font-weight: normal;
    font-size: calc(16pt + 2vw);
    text-align: center;
    line-height: calc(12pt + 2vw);
}

#subheader {
    font-weight: normal;
    font-size: calc(12pt + 0.75vw);
    text-align: center;
    color: var(--text-secondary);
    line-height: calc(8pt + 0.75vw);
}

.stretch-self {
    align-self: stretch;
}

.mention {
    background-color: var(--mention-background);
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.green-text {
    color: var(--green-text);
}

.red-text {
    color: var(--red-text);
}

.justify {
    justify-content: space-between;
}

.grow {
    flex-grow: 1;
}

.ws-nowrap {
    white-space: nowrap;
}

.vs {
    height: 1rem;
    width: 1px;
    background-color: var(--vs-border);
}
