@font-face {
    font-family: "Algo FY Black";
    src: url("../assets/fonts/Algo_FY_Black.ttf") format("truetype");
}

@font-face {
    font-family: "Algo FY Regular";
    src: url("../assets/fonts/Algo_FY_Regular.ttf") format("truetype");
}

@font-face {
    font-family: "Arek Regular";
    src: url("../assets/fonts/ArekLatin-Regular.ttf") format("truetype");
}

@font-face {
    font-family: "Arek Semibold Italic";
    src: url("../assets/fonts/Arek Semibold Italic.otf") format("opentype");
}

@font-face {
    font-family: "Arek Bold";
    src: url("../assets/fonts/Arek Bold.otf") format("opentype");
}

@font-face {
    font-family: "Arek Extrabold";
    src: url("../assets/fonts/Arek Extrabold.otf") format("opentype");
}

@font-face {
    font-family: "Longbow BB";
    src: url("../assets/fonts/Longbow BB.ttf") format("truetype");
}

@font-face {
    font-family: "BreveSlave";
    src: url("../assets/fonts/breve-slab-text-semi-bold.ttf") format("truetype");
}

:root {
    --ui-bg: #1d1b1a;
    --ui-panel: #282421;
    --ui-panel-2: #352f2a;
    --ui-text: #f2eadf;
    --ui-muted: #c8bba8;
    --ink: #4f3f30;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #453d34, var(--ui-bg));
    color: var(--ui-text);
}

button,
input,
select,
textarea {
    font: inherit;
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 420px) 1fr;
    gap: 22px;
    padding: 22px;
}

.editor {
    background: linear-gradient(180deg, var(--ui-panel), var(--ui-panel-2));
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    padding: 18px;
    align-self: start;
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow: auto;
}

.editor h1 {
    margin: 0 0 14px;
    font-size: 22px;
    letter-spacing: .02em;
}

.section {
    border-top: 1px solid rgba(255, 255, 255, .10);
    padding-top: 14px;
}

.section h2 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--ui-muted);
    text-transform: uppercase;
    letter-spacing: .12em;
}

.field {
    display: grid;
    gap: 6px;
    margin-bottom: 11px;
}

.field.inline {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 10px;
}

.editor-two-col,
.spawn-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
}

.editor-two-col .field {
    margin-bottom: 11px;
}

label {
    font-size: 13px;
    color: #eadbc3;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .13);
    background: rgba(0, 0, 0, .25);
    color: var(--ui-text);
    border-radius: 10px;
    padding: 9px 10px;
    outline: none;
}

textarea {
    resize: vertical;
}

input[type="checkbox"] {
    width: auto;
    transform: translateY(2px);
}

.checkbox-row {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--ui-muted);
    font-size: 13px;
    white-space: normal;
    margin-bottom: 11px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.btn {
    cursor: pointer;
    border: 0;
    color: #fff4e6;
    background: #8e211f;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
}

.btn.secondary {
    background: #53483c;
}

.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: .45;
    filter: grayscale(.35);
    box-shadow: none;
}

.btn:disabled:hover,
.btn[disabled]:hover {
    transform: none;
}

.export-note {
    color: var(--ui-muted);
    font-size: 12px;
    line-height: 1.35;
    margin: 12px 0 0;
}

.export-note code {
    color: #fff4e6;
    background: rgba(0,0,0,.2);
    border-radius: 5px;
    padding: 1px 4px;
}

.rich-bold {
    font-weight: bold;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.7);
}

.rich-blue {
    color: #21708E;
}

.rich-bold.rich-blue {
    text-shadow: 0 0 1px rgba(33, 112, 142, 0.7);
}

.rich-black {
    color: #1E1A1B;
}

.description-icon,
.old-skill-icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 0;
    margin-top: -3px;
    margin-right: -3px;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.description-icon-chi,
.old-skill-icon-chi {
    background-image: url("../assets/chi.png");
}

.preview-wrap {
    min-width: 0;
    display: grid;
    place-items: start center;
    overflow: auto;
    padding-bottom: 24px;
}

.scale-shell {
    transform-origin: top center;
}

.export-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .55);
    color: #fff4e6;
    cursor: wait;
}

.export-loading[hidden] {
    display: none !important;
}

.export-loading-box {
    padding: 16px 22px;
    border-radius: 14px;
    background: rgba(40, 36, 33, .96);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
    font-weight: 700;
    letter-spacing: .02em;
}


.card {
    width: var(--card-w);
    height: var(--card-h);
    position: relative;
    overflow: hidden;
    color: var(--ink);
    box-shadow: 0 25px 60px rgba(0, 0, 0, .52);
}

.name-plate,
.race-flag,
.body-slot,
.life-panel-top,
.life-panel-bottom,
.life-panel-bottom-shadow,
.life-panel-bottom-core,
.life-panel-bottom-life-track,
.abomination-flame-bg,
.spawn-number-bg,
.card-bg,
.name-background,
.number-bar,
.danger-bar,
.equip-slot-icon,
.equip-trait-icon,
.weapon-type-icon,
.weapon-bg,
.weapon-stat-bg {
    position: absolute;
    inset: 0;
    width: var(--card-w);
    height: var(--card-h);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

.set-icon-clip,
.set-icon-mask {
    position: absolute;
    inset: 0;
    width: var(--card-w);
    height: var(--card-h);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    pointer-events: none;
}

.set-icon,
.set-emblem {
    position: absolute;
    pointer-events: none;
}

.portrait,
.art {
    position: absolute;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.portrait.dragging,
.art.dragging {
    cursor: grabbing;
}

.portrait img,
.art img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
}

.portrait.empty,
.art.empty {
    pointer-events: none;
}

.portrait.empty::before,
.art.empty::before {
    color: rgba(255, 255, 255, .62);
    font-family: Georgia, serif;
    font-weight: 800;
    text-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}

.card.export {
    border-radius: 0 !important;
}

.card.export::after {
    display: none !important;
    content: none !important;
}

@media (max-width: 1120px) {
    .app {
        grid-template-columns: 1fr;
    }

    .editor {
        position: static;
        max-height: none;
    }
}

