:root {
    color-scheme: light dark;
    font-family: system-ui;

    --accent-color: #6a61e5;
    --outline: 2px solid var(--accent-color);
}

*,
*::after,
*::before {
    margin: 0;
    box-sizing: border-box;
}

*:focus-visible {
    outline: var(--outline);
}

::selection {
    background-color: var(--accent-color);
    color: white;
}

html, body {
    height: 100%;
}

body {
    display: grid;
    place-content: center;
}

h1 {
    text-align: center;
    font-size: 2.5em;
}

.error {
    text-align: center;
}

.bad {
    outline: 2px solid red;
}

.setup {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body > * {
    max-width: calc(100vw - 2em);
}

p {
    max-width: 60ch;
}

body:not([no-logo])::before {
    content: '';
    background: url('/static/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    width: min(12em, 100vw);
    aspect-ratio: 2 / 1;
}

.row-pw {
    --_row-height: 2.5rem;
    --_btn-margin: 0.5rem;
    --_font-size: 1.5rem;
}

.row-link {
    --_row-height: 2rem;
    --_btn-margin: 0.5rem;
    --_font-size: 1.25rem;
}

.row-txt-with-btn {
    display: flex;
    flex-direction: row;
    border: 1px solid currentColor;
}

.row-txt-with-btn > .txt {
    font-family: monospace;
    font-size: var(--_font-size);
    border: none;
    min-width: 0;
    width: 25ch;
    flex-grow: 1;
    background-color: transparent;
    padding-inline-start: 0.5rem;
}

.row-link > .sharing-link {
    display: grid;
    align-content: center;
    padding-inline: 0.5rem 0.25rem;
    width: fit-content;
    overflow: auto;
}

.row-txt-with-btn:has(input:focus-visible) {
    outline: var(--outline);
}

.row-txt-with-btn > input:focus-visible {
    outline: none;
}

.row-txt-with-btn > button {
    height: var(--_row-height);
    background-color: Canvas;
    border: none;
    border-radius: 0.5rem;
    margin: var(--_btn-margin);
    margin-inline-start: 0;
}

.row-txt-with-btn > button:hover {
    cursor: pointer;
    background-color: color-mix(in srgb, Canvas, var(--accent-color) 20%);
}

button svg {
    height: 100%;
    fill: currentColor;
}

.row-exp {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gen-link {
    font-family: inherit;
    font-size: 1.25rem;
    padding: 0.5em;
}

.setup[hidden],
.setup:not([hidden]) + .row-link {
    display: none;
}

.copy-btn {
    padding: 0.25rem;
    position: relative;
}

.copy-btn::before {
    content: attr(flavour-text);
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(calc(100% + 1em), -50%);

    font-family: system-ui;
    background-color: var(--accent-color);
    color: white;

    padding: 0.5em 1em;
    border-radius: 0.5em;

    pointer-events: none;

    opacity: 0;
    transition: opacity 0.2s;
}

.copy-btn.show-flavour::before {
    opacity: 1;
}
