/* STATUS WORD */
.commission-status {
    color: #5fe07a;
}

.commission-status.is-closed {
    color: #ff6b5e;
}

/* HIRE BOX */
.contact-box.hire-box {
    grid-column: 1 / -1;
    justify-content: center;
    color: #171003;
    border-image-source: var(--tex-hire-gold, var(--tex-btn-hover));
    -webkit-tap-highlight-color: transparent;
}

.contact-box.hire-box:hover,
.contact-box.hire-box:focus-visible {
    color: #171003;
    border-image-source: var(--tex-hire-gold-hover, var(--tex-btn-hover));
}

.contact-box.hire-box:active {
    border-image-source: var(--tex-hire-gold, var(--tex-btn-press));
}

.hire-box .contact-logo,
.hire-box:hover .contact-logo {
    filter: none;
}

/* FORM WINDOW */
.hire-dialog {
    width: min(640px, calc(100vw - 16px));
    max-width: none;
    max-height: calc(100dvh - 16px);
    margin: auto;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--text);
    color-scheme: dark;
    scrollbar-color: #3d3d47 #101013;
    scrollbar-width: thin;
    font-family: var(--font-pixel);
    font-size: 22px;
    line-height: 26px;
    -webkit-tap-highlight-color: transparent;
}

.hire-dialog::backdrop {
    background: rgba(0, 0, 0, 0.78);
}

/* The display rules below would otherwise beat the hidden attribute. */
.hire-dialog [hidden] {
    display: none !important;
}

.hire-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.hire-title {
    margin: 0;
    font-family: var(--font-title);
    font-size: calc(var(--fp2) * 8);
    line-height: 24px;
    color: var(--text);
    text-shadow: var(--fp2) var(--fp2) 0 #000;
}

.hire-close {
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
}

.hire-body,
.hire-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.hire-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hire-label {
    display: block;
    margin: 0 0 8px;
    padding: 0;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 20px;
    color: var(--gold);
}

.hire-optional {
    color: var(--text-3);
}

.hire-note {
    margin: 4px 0 0;
    font-size: 20px;
    line-height: 24px;
    color: var(--text-3);
}

.hire-closed {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 26px;
    color: #ff8a7e;
}

.hire-count {
    margin: 4px 0 0;
    font-size: 20px;
    line-height: 24px;
    text-align: right;
    color: var(--text-3);
}

.hire-input {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    font: inherit;
    color: var(--text);
    background: #0c0c0f;
    border: 0;
    border-radius: 0;
    box-shadow: inset 4px 4px 0 #050507, inset -4px -4px 0 #2b2b32;
}

.hire-input::placeholder {
    color: var(--text-3);
}

.hire-input:focus {
    outline: 4px solid var(--gold-bright);
    outline-offset: 0;
}

textarea.hire-input {
    min-height: 120px;
    resize: vertical;
}

#hire-custom {
    margin-top: 8px;
}

.hire-contact {
    display: grid;
    grid-template-columns: minmax(112px, 150px) minmax(0, 1fr);
    gap: 8px;
}

/* FIELD CHIPS */
.hire-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hire-chip {
    min-height: 40px;
    padding: 4px 12px;
    font-family: var(--font-label);
    font-size: calc(var(--fp2) * 8);
    line-height: 16px;
    color: var(--text-2);
    background: #1a1a20;
    border: 0;
    box-shadow: inset 2px 2px 0 #33333b, inset -2px -2px 0 #0c0c0f;
    cursor: pointer;
}

.hire-chip:hover {
    color: var(--gold-light);
}

.hire-chip[aria-pressed="true"] {
    color: #171003;
    background: var(--gold-bright);
    box-shadow: inset 2px 2px 0 var(--gold-light), inset -2px -2px 0 var(--gold-dark);
}

/* IMAGES */
.hire-images {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hire-thumb {
    position: relative;
    width: 96px;
    height: 72px;
    background: #08080a;
    box-shadow: 0 0 0 2px #33333b;
}

.hire-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hire-thumb-remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    font-family: var(--font-label);
    font-size: 16px;
    line-height: 28px;
    color: var(--text);
    background: rgba(8, 8, 10, 0.86);
    border: 0;
    cursor: pointer;
}

.hire-thumb-remove:hover {
    color: #ff8a7e;
}

.hire-captcha {
    min-height: 65px;
    display: flex;
    justify-content: center;
}

.hire-error {
    margin: 0;
    font-size: 22px;
    line-height: 26px;
    color: #ff8a7e;
}

/* SUBMIT BUTTON */
.hire-submit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 64px;
    padding: 8px 16px;
    font-family: var(--font-label);
    font-size: calc(var(--fp3) * 8);
    line-height: 24px;
    text-transform: uppercase;
    color: #171003;
    background: none;
    border: 8px solid transparent;
    border-image: var(--tex-hire-gold) 4 fill / 8px stretch;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.55));
    cursor: pointer;
}

.hire-submit::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -24px;
    width: 12px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 16px 0 0 rgba(255, 255, 255, 0.3);
    opacity: 0;
}

.hire-submit:hover:not(.is-sending):not(.is-striking):not(.is-sent),
.hire-submit:focus-visible:not(.is-sending):not(.is-striking):not(.is-sent) {
    border-image-source: var(--tex-hire-gold-hover);
    outline: none;
}

.hire-submit:hover:not(.is-sending):not(.is-striking):not(.is-sent)::before {
    animation: hire-shine 0.7s steps(14) both;
}

.hire-submit:active:not(.is-sending):not(.is-striking):not(.is-sent) {
    translate: 0 4px;
    filter: none;
}

@keyframes hire-shine {
    0% {
        left: -24px;
        opacity: 1;
    }
    99% {
        left: 100%;
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.hire-bar {
    display: none;
    padding: 4px;
    box-shadow: none;
}

.hire-bar span.on::after {
    opacity: 1;
}

.hire-pickaxe {
    display: none;
}

.hire-submit.is-sending,
.hire-submit.is-striking {
    border-image-source: var(--tex-hire-dark);
    cursor: progress;
}

.hire-submit.is-sending .hire-submit-label,
.hire-submit.is-striking .hire-submit-label {
    display: none;
}

.hire-submit.is-sending .hire-bar,
.hire-submit.is-striking .hire-bar {
    display: flex;
}

.hire-submit.is-striking .hire-pickaxe {
    display: block;
    position: absolute;
    right: calc(50% - 134px);
    bottom: 2px;
    width: 64px;
    height: 64px;
    background: var(--tex-pickaxe) center / 64px 64px no-repeat;
    image-rendering: pixelated;
    transform-origin: 0% 100%;
    animation: hire-strike 0.42s steps(4) both;
}

@keyframes hire-strike {
    0% {
        rotate: 30deg;
        translate: 24px -16px;
    }
    70% {
        rotate: -40deg;
        translate: -24px 0;
    }
    100% {
        rotate: -18deg;
        translate: -16px 0;
    }
}

.hire-submit.is-sent {
    color: #06240e;
    border-image-source: var(--tex-hire-ok);
    cursor: default;
    animation: hire-pop 0.3s steps(4) both;
}

@keyframes hire-pop {
    0% {
        scale: 1.06;
    }
    100% {
        scale: 1;
    }
}

.hire-submit.is-failed {
    color: #2b0805;
    border-image-source: var(--tex-hire-bad);
    animation: hire-shake 0.4s steps(6) both;
}

@keyframes hire-shake {
    0%,
    100% {
        translate: 0 0;
    }
    20%,
    60% {
        translate: -8px 0;
    }
    40%,
    80% {
        translate: 8px 0;
    }
}

.hire-spark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    background: var(--gold-bright);
    box-shadow: 2px 2px 0 var(--gold-dark);
    pointer-events: none;
    animation: hire-spark 0.7s steps(10) var(--delay, 0ms) both;
}

.hire-spark.is-light {
    background: var(--gold-light);
    box-shadow: none;
}

@keyframes hire-spark {
    0% {
        translate: 0 0;
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        translate: var(--dx) calc(var(--dy) + 40px);
        opacity: 0;
    }
}

/* AFTER SENDING */
.hire-done {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.hire-done p {
    margin: 0;
}

.hire-done-title {
    font-family: var(--font-label);
    font-size: calc(var(--fp3) * 8);
    line-height: 32px;
    color: #5fe07a;
}

@media (max-width: 480px) {
    .hire-dialog {
        padding: 8px;
    }

    .hire-contact {
        grid-template-columns: minmax(0, 1fr);
    }

    .hire-chip {
        padding: 4px 8px;
    }

    .hire-submit {
        font-size: calc(var(--fp2) * 8);
    }
}
