body {
    height: 100vh;
    margin: 0;
    background: rgb(34, 34, 34);
    color: white;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 1.5em;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 25px;
}

header img {
    width: 250px;
    height: auto;
}

header div {
    margin: 20px;
    text-align: center;
}

h1 {
    margin: 0px;
    font-weight: 600;
    font-size: 3em;
}

h2 {
    margin: 0;
    font-weight: 300;
}

section {
    width: 80%;
    margin: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

p {
    margin-top: 0;
    text-align: justify;
}

em {
    font-weight: bolder;
    font-style: unset;
}

a {
    color: white;
    text-decoration: unset;
    font-weight: bold;
    transition: opacity .3s;
}

a:hover {
    opacity: .6;
}

form[name="generator"] {
    width: 1050px;
    margin: 15px;
    padding: 25px;
    border-radius: 15px;
    background-color: rgb(43, 43, 43);
    box-shadow: 2px 2px 10px 2px black;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.form_table {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.form_col {
    width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.form_row {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
}

.form_row.left {
    justify-content: flex-start;
}

.form_row.right {
    justify-content: flex-end;
}

.form_row.left label {
    margin-left: 20px;
}

.form_row.right label {
    margin-right: 20px;
}

.form_row.center {
    justify-content: center;
    margin-bottom: 20px;
}

input[type="text"] {
    width: 220px;
    height: 30px;
    border: none;
    border-radius: 5px;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 1em;
    text-align: center;
    padding: 2px 10px;
}

input[type="text"].short {
    width: 40px;
    height: 25px;
    font-size: 0.8em;
}

input[type="checkbox"] {
    font-size: 17px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 50px;
    height: 25px;
    background: rgb(221, 221, 221);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    outline: none;
    -webkit-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
}

input[type="checkbox"]:checked {
    background: rgb(14, 207, 255);
}

input[type="checkbox"]:after {
    position: absolute;
    content: "";
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: white;
    -webkit-box-shadow: 0 0 .25em rgba(0, 0, 0, .3);
    box-shadow: 0 0 .25em rgba(0, 0, 0, .3);
    -webkit-transform: scale(.7);
    transform: scale(.7);
    left: 0;
    -webkit-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
}

input[type="checkbox"]:checked:after {
    left: calc(100% - 1.5em);
}

select {
    width: 200px;
    height: 25px;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 0.7em;
    padding: 0px 8px;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

#fade_seconds {
    margin: 10px;
    font-size: 0.7em;
    font-weight: 200;
}

select:focus,
input:focus {
    outline: none;
}

#submit_container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.preview {
    margin-top: 30px;
    display: flex;
}

.preview img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    cursor: pointer;
}

#example {
    margin: 25px 0px;
    margin-top: 10px;
    padding: 1rem;
    border-radius: 15px;
    overflow: hidden;
    color: white;
    font-weight: 800;
    word-break: break-word;
    transition: background-color .3s ease-in-out;
}

#example.white {
    background-color: white;
}

#example .user_info {
    display: inline-block;
}

#example .badge {
    vertical-align: middle;
    border-radius: 10%;
}

#example .cheer_bits {
    color: rgb(189, 98, 255);
    font-size: 0.6em;
    -webkit-text-stroke: 1px black;
}

#example .emote {
    vertical-align: middle;
}

#example .emoji {
    vertical-align: middle;
}

input[type="submit"],
input[type="button"] {
    width: 150px;
    height: 45px;
    border: none;
    border-radius: 5px;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    opacity: .7;
    transition: opacity .3s;
}

input[type="submit"]:hover,
input[type="button"]:hover {
    opacity: 1;
}

#result {
    position: relative;
    width: 950px;
    margin: 15px;
    padding: 25px;
    border-radius: 15px;
    background-color: rgb(43, 43, 43);
    box-shadow: 2px 2px 10px 2px black;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#alert {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    width: 800px;
    height: 30px;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;
    color: black;
    font-size: 1em;
    text-align: center;
    padding: 2px 10px;
    transition: opacity .2s ease-out;
}

#url {
    width: 800px;
    cursor: pointer;
}

#result p {
    text-align: center;
    font-size: 0.9em;
    margin: 1em;
}

#donation {
    font-size: 0.7em;
    font-weight: 300;
    text-align: center;
    margin: 30px;
}

#donation .emote {
    height: 30px;
    width: 30px;
    margin-bottom: -5px;
    margin-right: 0;
}

#donation form {
    margin: 15px;
}

#paypal {
    width: 100px;
    height: 25px;
    border-radius: 20px;
    background-color: rgb(255, 196, 57);
    font-size: 0.9em;
    font-weight: 600;
}

footer {
    width: 100%;
    margin-top: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: black;
}

footer p {
    font-size: 0.8em;
    font-weight: 200;
    margin: 5px;
}

footer a {
    font-weight: 400;
}

.github {
    height: 20px;
    margin-left: 5px;
    vertical-align: middle;
}


/* Scrollbar */

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

::-webkit-scrollbar-thumb {
    background: rgb(43, 43, 43);
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(77, 77, 77);
}

::-webkit-scrollbar-track {
    background: black;
}

/* Tchat control-room theme */
:root {
    --ink: #101419;
    --panel: #191f26;
    --panel-light: #222a33;
    --line: #36424d;
    --muted: #9aa8b4;
    --text: #f3f6f8;
    --coral: #ff6b5f;
    --cyan: #52d7d3;
    --yellow: #f5c86a;
}

body {
    min-height: 100vh;
    height: auto;
    background-color: var(--ink);
    background-image: linear-gradient(135deg, rgba(82, 215, 211, .06) 0, transparent 32%), radial-gradient(circle at 88% 4%, rgba(255, 107, 95, .14), transparent 28%);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
}

header {
    width: min(1120px, calc(100% - 40px));
    justify-content: flex-start;
    margin-top: 48px;
}

header div {
    margin: 0;
    text-align: left;
}

.eyebrow,
.section_kicker {
    color: var(--cyan);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: left;
}

.eyebrow {
    margin: 0 0 12px;
}

h1 {
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    line-height: .9;
    letter-spacing: 0;
}

h2 {
    color: var(--muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 500;
    margin-top: 14px;
}

section {
    width: min(1120px, calc(100% - 40px));
    margin: 42px auto 56px;
    align-items: stretch;
}

section > p {
    max-width: 740px;
    color: var(--muted);
    line-height: 1.7;
    text-align: left;
}

a {
    color: var(--cyan);
}

form[name="generator"] {
    box-sizing: border-box;
    width: 100%;
    margin: 24px 0 0;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(25, 31, 38, .94);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
    align-items: stretch;
}

.channel_row {
    box-sizing: border-box;
    height: auto;
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 26px;
}

.field_label,
.preset_control label {
    color: var(--muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"],
select {
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-light);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
}

.channel_row input[type="text"] {
    width: min(100%, 460px);
    height: 50px;
    padding: 8px 14px;
    font-size: 18px;
    text-align: left;
}

input[type="text"]::placeholder {
    color: #6f7d88;
}

.setup_bar {
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(16, 20, 25, .7);
}

.setup_bar strong {
    display: block;
    margin-top: 5px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 500;
}

.preset_control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preset_control select {
    width: 150px;
    height: 38px;
    font-size: 14px;
}

.form_table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.form_col {
    box-sizing: border-box;
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(34, 42, 51, .52);
    align-items: stretch;
}

.form_col br {
    display: block;
    height: 14px;
    content: '';
}

.form_row {
    min-height: 44px;
    height: auto;
    justify-content: space-between !important;
    gap: 18px;
}

.form_row label {
    margin: 0 !important;
    color: var(--muted);
    font-size: 14px;
}

.form_row select {
    order: 2;
    width: 180px;
    height: 34px;
}

.form_row.right label {
    order: 1;
}

.form_row input[type="checkbox"] {
    order: 2;
}

input[type="checkbox"] {
    flex: 0 0 auto;
    width: 42px;
    height: 23px;
    background: #52606b;
}

input[type="checkbox"]:after {
    width: 23px;
    height: 23px;
}

input[type="checkbox"]:checked {
    background: var(--coral);
}

#submit_container {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.preview {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 0;
    color: var(--muted);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preview_label {
    margin-right: auto;
}

.preview img {
    width: 22px;
    height: 22px;
}

#brightness {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 76px;
    height: 36px;
    padding: 4px;
    border: 1px solid #53616c;
    border-radius: 20px;
    background: #26313a;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

#brightness.light {
    border-color: #d5dbe0;
    background: #e8edf0;
}

.theme_icon {
    z-index: 1;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    transition: transform .25s ease, background-color .25s ease;
}

#brightness.light .theme_icon {
    transform: translateX(40px);
    background: #ffffff;
}

.theme_track {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 11px;
    color: #a8b5bf;
    font-size: 12px;
}

.theme_track::before {
    content: 'D';
}

.theme_track::after {
    content: 'L';
}

#brightness:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

#brightness_state {
    min-width: 38px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

#example {
    box-sizing: border-box;
    width: 100%;
    min-height: 112px;
    margin: 14px 0 22px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #101419;
}

#preview_stream {
    overflow: hidden;
}

.preview_line {
    white-space: nowrap;
    animation: preview-arrive .45s ease-out both;
}

.preview_line.leaving {
    animation: preview-leave .4s ease-in both;
}

.preview_line .user_info {
    display: inline;
}

.preview_line .nick {
    font-weight: 700;
}

.preview_line .paint_name {
    color: transparent;
    background-image: linear-gradient(110deg, var(--paint-color), #ffffff, var(--paint-color));
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: paint-shimmer 2.8s ease-in-out infinite;
}

.preview_line .colon {
    margin-right: 12px;
}

@keyframes preview-arrive {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes preview-leave {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes paint-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

input[type="submit"],
input[type="button"] {
    width: auto;
    min-width: 150px;
    height: 44px;
    border-radius: 6px;
    background: var(--coral);
    color: #17191c;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    opacity: 1;
}

input[type="submit"]:hover,
input[type="button"]:hover {
    background: #ff887d;
}

#result {
    box-sizing: border-box;
    width: 100%;
    margin: 24px 0 0;
    padding: 28px;
    border: 1px solid var(--cyan);
    border-radius: 10px;
    background: rgba(25, 31, 38, .94);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

#url {
    width: min(100%, 800px);
    height: 44px;
    text-align: left;
}

#result p {
    color: var(--muted);
}

footer {
    margin-top: 0;
    background: #0a0d10;
    color: var(--muted);
}

@media (max-width: 720px) {
    header,
    section {
        width: min(100% - 28px, 1120px);
    }

    header {
        margin-top: 30px;
    }

    section {
        margin-top: 30px;
    }

    form[name="generator"],
    #result {
        padding: 18px;
    }

    .setup_bar,
    .preset_control {
        align-items: flex-start;
        flex-direction: column;
    }

    .preset_control select {
        width: 100%;
    }

    .form_table {
        grid-template-columns: 1fr;
    }
}