.artwork {
    background: #050505;
}

.artwork .words {
    inset: auto;
    top: 50%;
    left: 50%;
    width: auto;
    height: min(88vh, calc((62vw - 80px) * 1.5));
    aspect-ratio: 2 / 3;
    border: 1px solid rgba(255, 255, 255, .12);
    overflow: hidden;
    transform: translate(-50%, -50%);
}

.artwork > img,
.placement img {
    display: none;
}

.placement > div {
    border: 1px solid #292927;
    background: #050505;
}

.placement #marker {
    width: 42%;
    height: auto;
    max-width: 42%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(5, 5, 5, .72);
    box-shadow: none;
    color: #fff;
    font-family: Georgia, serif;
    font-style: normal;
    line-height: 1.1;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    transform: translate(-50%, -50%);
}

.placement #marker.is-placeholder {
    color: #777;
    font-size: 13px !important;
}

.word {
    white-space: pre-wrap;
}

.artwork .word {
    width: 42%;
    max-width: 42%;
}

.font-size-choice {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin: 0;
    padding: 0;
    border: 0;
}

.font-size-choice legend {
    grid-column: 1 / -1;
    margin-bottom: 7px;
    color: #aaa;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.font-size-choice label {
    cursor: pointer;
}

.font-size-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.font-size-choice span {
    display: block;
    padding: 11px 8px;
    border: 1px solid #393936;
    color: #888;
    text-align: center;
}

.font-size-choice input:checked + span {
    border-color: var(--gold);
    background: #191711;
    color: #fff;
}

.font-family-choice .type-serif { font-family: Georgia, serif; }
.font-family-choice .type-sans { font-family: Arial, sans-serif; }
.font-family-choice .type-mono { font-family: "Courier New", monospace; }

.rotation-choice {
    grid-template-columns: repeat(5, 1fr);
    grid-column: 1 / -1;
}

.existing-preview-word {
    position: absolute;
    z-index: 1;
    width: 42%;
    max-width: 42%;
    color: #fff;
    line-height: 1.05;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    pointer-events: none;
}

.placement #marker {
    z-index: 2;
}

dialog {
    max-width: calc(100vw - 24px);
    overflow-x: hidden;
}

dialog form {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

dialog form > *,
.placement,
.placement > div,
.font-size-choice {
    min-width: 0;
    max-width: 100%;
}

dialog textarea,
dialog input {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 850px) {
    dialog form {
        grid-template-columns: minmax(0, 1fr);
    }

    .artwork .words {
        height: min(82vh, calc((100vw - 40px) * 1.5));
    }
}
