* {
    box-sizing: border-box;
}

@font-face {
  font-family: "DOS"; 
  src: url('https://file.garden/ZswAc6hgIRcOzeXF/Web437_DOS-V_re_ANK24.woff2') format('woff2');
}

html,
body {
    width: 100%;
    height: 100%;
    cursor: url('../pawcursor.png'), auto;
    margin: 0;
    padding: 0;
    font-family:"DOS", "Courier New", Courier, monospace;
    background: #e8e5dc;
    color: #111;
    overflow: hidden;
}


#dog-maker {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}


/* = botones = */

button {
    font-family:
        "DOS",
        "Courier New",
        Courier,
        monospace;

    font-weight: bold;

    border: 2px solid #111;

    background: #eee;

    padding: 8px 12px;

    cursor: pointer;
}


button:hover {
    background: #fff;
}


button:active {
    transform: translateY(1px);
}


/* == encabezado = */

.main-header {

    width: 100%;

    flex-shrink: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding: 10px 16px 12px;

    background: #e8e5dc;

    border-bottom: 3px solid #111;

}


/* = titulo = */

.title-image-container {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    margin-bottom: 8px;
}


.title-image {

    display: block;

    max-width: min(520px, 70vw);

    max-height: 70px;

    width: auto;

    height: auto;

    object-fit: contain;
}


/* = botones bajo titulo = */

.main-actions {

    display: flex;

    align-items: center;

    justify-content: center;

    flex-wrap: wrap;

    gap: 8px;
}


.main-actions button {

    min-width: 110px;

    padding: 8px 12px;

    font-size: 11px;
}


/* = guardar = */

.export-button {
background: #ffe36e;
}
.export-button:hover {
background: #fff08f;
}

/* = formulario = */
.form-button {
background: #c9e8ff;
}
.form-button:hover {
background: #e0f3ff;
}


/* = editor = */

.editor {

    flex: 1;

    min-height: 0;

    display: flex;
}


/* = side bars = */

.sidebar {

    background: #d7d3c8;

    display: flex;

    flex-direction: column;

    overflow: hidden;
}


/* = izquierda = */

.left-sidebar {

    width: 170px;

    flex-shrink: 0;

    border-right: 3px solid #111;
}


/* = derecha = */

.right-sidebar {

    width: 250px;

    flex-shrink: 0;

    border-left: 3px solid #111;
}


/* = titulos = */

.sidebar-title {

    height: 45px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    padding: 0 10px;

    font-weight: bold;

    font-size: 13px;

    background: #bbb7ac;

    border-bottom: 2px solid #111;
}


/* = categorias = */

#categoryButtons {

    display: flex;

    flex-direction: column;

    padding: 8px;

    gap: 5px;

    overflow-y: auto;
}


.category-button {

    width: 100%;

    text-align: left;

    background: #e9e6dc;

    border: 2px solid #555;

    padding: 10px 8px;

    font-size: 12px;
}


.category-button:hover {

    background: #fff;
}


.category-button.active {

    background: #111;

    color: white;

    border-color: #111;
}


/* = controles izquiersa = */

.left-controls {

    margin-top: auto;

    padding: 8px;

    border-top: 3px solid #111;

    background: #bbb7ac;
}


/* = seleccion = */

.selection-label {

    font-size: 9px;

    font-weight: bold;

    margin-bottom: 3px;
}


.selection-name {

    min-height: 30px;

    display: flex;

    align-items: center;

    padding: 5px 6px;

    margin-bottom: 8px;

    background: #eee;

    border: 2px solid #555;

    font-size: 9px;

    line-height: 1.2;

    overflow: hidden;

    word-break: break-word;
}


/* = capas = */

.layer-title {

    padding: 5px 0;

    border-top: 2px solid #555;

    font-size: 10px;

    font-weight: bold;

    text-align: center;
}


.layer-controls {

    display: flex;

    flex-direction: column;

    gap: 5px;

    margin-top: 4px;
}


.layer-controls button {

    width: 100%;

    padding: 7px 5px;

    font-size: 9px;
}


.layer-controls .danger {

    background: #ff7777;
}


.layer-controls .danger:hover {

    background: #ff9999;
}


/* = workspace = */

.workspace {

    flex: 1;

    min-width: 0;

    min-height: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    position: relative;

    overflow: hidden;

    background-image: url("../lostdog/lostdogbg.png");

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    padding: 12px;
}


/* titulo y botones */

.workspace-controls {

    width: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    flex-shrink: 0;

    margin-bottom: 10px;
}


.title-image {

    display: block;

    max-width: min(520px, 70%);

    max-height: 65px;

    width: auto;

    height: auto;

    object-fit: contain;

    margin-bottom: 8px;
}


.main-actions {

    display: flex;

    align-items: center;

    justify-content: center;

    flex-wrap: wrap;

    gap: 8px;
}


.main-actions button {

    min-width: 110px;

    padding: 8px 12px;

    font-family:
        "DOS",
        "Courier New",
        Courier,
        monospace;

    font-weight: bold;

    font-size: 11px;

    border: 2px solid #111;

    background: #eee;

    cursor: pointer;
}


.main-actions button:hover {

    background: #fff;
}


/* texto en workspace */

.workspace-label {

    flex-shrink: 0;

    max-width: 90%;

    margin-bottom: 10px;

    font-size: 12px;

    font-weight: bold;

    text-align: center;

    background: #fff;

    border: 2px solid #111;

    padding: 6px 10px;
}


/* canvas */

#portrait-wrapper {

    width: min(55vh, 500px);

    height: min(55vh, 500px);

    position: relative;

    flex-shrink: 1;

    min-height: 0;
}


/* = texto canvas = */

.workspace-label {

    max-width: 90%;

    margin-bottom: 10px;

    font-size: 12px;

    font-weight: bold;

    text-align: center;

    background: #fff;

    border: 2px solid #111;

    padding: 6px 10px;
}


/* = ayuda = */

.workspace-help {

    margin-top: 15px;

    max-width: 90%;

    font-size: 11px;

    font-weight: bold;

    text-align: center;

    background: #fff;

    border: 2px solid #111;

    padding: 6px 10px;
}


/* = canvas = */

#portrait-wrapper {

    width: min(55vh, 500px);

    height: min(55vh, 500px);

    position: relative;

    flex-shrink: 0;
}


#portrait {

    width: 100%;

    height: 100%;

    position: relative;

    overflow: hidden;

    background: white;

    border: 4px solid #111;

    box-shadow:
        8px 8px 0 #111;

    isolation: isolate;
}


/* = canvas vacio = */

#drop-message {

    position: absolute;

    left: 50%;

    top: 50%;

    transform: translate(-50%, -50%);

    text-align: center;

    font-size: 11px;

    pointer-events: none;

    color: #999;

    border: 2px dashed #aaa;

    padding: 12px;

    z-index: 0;
}


#portrait.has-components #drop-message {

    display: none;
}


#portrait.drag-over {

    outline: 5px dashed #111;

    outline-offset: -8px;
}


/* = biblioteca = */

.component-library {

    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding: 10px;

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    align-content: start;

    gap: 8px;
}


/* = assetssss == */

.component-item {

    position: relative;

    aspect-ratio: 1 / 1;

    background: #eee;

    border: 2px solid #555;

    cursor: grab;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    user-select: none;
}


.component-item:hover {

    background: white;

    border-color: #111;

    transform: scale(1.03);
}


.component-item:active {

    cursor: grabbing;
}


.component-item img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    pointer-events: none;
}


/* = assets en canvas = */

.face-component {

    position: absolute;

    transform-origin: center center;

    cursor: move;

    user-select: none;

    touch-action: none;

    z-index: 10;
}


.face-component img {

    width: 100%;

    height: 100%;

    display: block;

    pointer-events: none;

    user-select: none;
}


/* = asset seleccionado = */

.face-component.selected {

    outline: 2px dashed #111;

    outline-offset: 3px;
}


.face-component.selected::after {

    content: "";

    position: absolute;

    right: -7px;

    bottom: -7px;

    width: 12px;

    height: 12px;

    background: white;

    border: 2px solid #111;

    cursor: nwse-resize;
}


/* = scrollbar = */

.component-library::-webkit-scrollbar {

    width: 12px;
}


.component-library::-webkit-scrollbar-track {

    background: #aaa;
}


.component-library::-webkit-scrollbar-thumb {

    background: #333;
}


/* = tablet = */

@media (max-width: 800px) {


    .left-sidebar {

        width: 125px;
    }


    .right-sidebar {

        width: 190px;
    }


    .category-button {

        font-size: 9px;

        padding: 8px 5px;
    }


    .workspace-help {

        display: none;
    }


    .main-actions {

        gap: 4px;
    }


    .main-actions button {

        min-width: auto;

        padding: 6px 8px;

        font-size: 9px;
    }


    .title-image {

        max-height: 55px;
    }


    .workspace-label {

        font-size: 9px;
    }


    .selection-name {

        font-size: 8px;
    }


    .layer-controls button {

        font-size: 8px;
    }

}


/* = mini = */

@media (max-width: 600px) {


    .main-header {

        padding: 6px 8px 8px;
    }


    .title-image {

        max-width: 80vw;

        max-height: 45px;
    }


    .main-actions {

        width: 100%;

        gap: 3px;
    }


    .main-actions button {

        flex: 1;

        min-width: 0;

        padding: 6px 3px;

        font-size: 8px;
    }


    .left-sidebar {

        width: 105px;
    }


    .right-sidebar {

        width: 155px;
    }


    .sidebar-title {

        font-size: 10px;
    }


    .component-library {

        grid-template-columns: 1fr;
    }


    .workspace-label {

        display: none;
    }


    #portrait-wrapper {

        width: min(60vh, 400px);

        height: min(60vh, 400px);
    }

}