:root {
    --dark-color: #14315B;
    --medium-color: #64A4FF;
    --light-color: #d5e4fa;
    --medium-light-color: #b2cbf0;
    --highlight-color: #f79b45;
    --bg-color: var(--medium-light-color);
    --fg-color: var(--light-color);
}

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

html {
    margin: 8px;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--dark-color);
    background-color: var(--light-color);
}

body {
    position: relative;
}

.bg {
    background-image: linear-gradient(to right bottom, var(--light-color), var(--medium-light-color));
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
}

h1,
form {
    padding: 8px;
}

form {
    width: fit-content;
    display: grid;
    grid-template-columns: max-content max-content;
    column-gap: 1em;
    row-gap: 1ex;
}

form>div:nth-child(odd) {
    padding-top: 0.5ex;
}

label {
    font-weight: bold;
}

#message {
    width: 500px;
    min-height: 10ex;
}

code {
    font-family: 'Courier New', Courier, monospace;
}

textarea,
input,
select,
button {
    padding: 0.5ex 0.5em;
    font-family: Arial, Helvetica, sans-serif;
}

input+span {
    margin-left: 0.5em;
}

input:invalid,
input.invalid {
    color: red;
    outline: 2px solid red;
}

input.invalid+span {
    color: red;
    font-weight: bold;
}

input:invalid+span::after {
    content: "\00274C";
    color: red;
}

#title {
    font-weight: bold;
    font-size: larger;
}

.subtle {
    opacity: 0.5;
}

#channel-url {
    text-overflow: ellipsis;
    width: calc(100% - 22px);
}

#status-dialog.with-progress-bar>div:first-child {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    height: 1ex;
    background-image: linear-gradient(90deg, #ff0000, #f7fc00, #64ff73, #0400ff, #f264ff);
    background-size: 200% 100%;
    animation-name: gradient;
    animation-duration: 2000ms;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-direction: initial;
}

.status-text {
    min-height: 50px;
    padding: 0.5ex 0.5em;
    color: black;
}

.status-text.error {
    color: rgb(172, 11, 11) !important;
    font-weight: bold;
}

@keyframes gradient {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: -200% 0%;
    }
}

button {
    cursor: pointer;
    border-radius: 0;
    border: 1px solid var(--dark-color);
}

button:disabled {
    cursor: not-allowed;
}

.help::after {
    content: '❓';
    vertical-align: super;
    font-size: smaller;
    cursor: help;
}

#help-floater {
    position: absolute;
    width: 200px;
    padding: 2ex 1em;
    background-color: var(--dark-color);
    display: none;
    font-size: smaller;
    z-index: 10001;
    display: flex;
    flex-direction: row;
    color: white;
}

#help-floater>div:not(:last-child) {
    pointer-events: none;
    cursor: crosshair;
}

#help-floater>div:last-child {
    cursor: pointer;
    font-size: larger;
}

#help-floater.hidden {
    display: none;
}

#help-floater:after {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: var(--dark-color);
    border-left: 0;
    border-top: 0;
    margin-top: -10px;
    margin-left: -10px;
}

dialog {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1em;
    background: var(--bg-color);
    color: var(--fg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-width: calc(clamp(18px, 2vw, 22px) / 2);
    border-color: var(--dark-color);
    border-style: solid;
    width: 100%;
    overflow: auto;
}

dialog * {
    user-select: text;
}

dialog>div {
    margin: 0 auto;
    width: fit-content;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 16px;
}

dialog::backdrop {
    background-color: color-mix(in srgb, var(--bg-color) 50%, transparent);
    backdrop-filter: blur(3px);
}
