:root {
    /* COLORES */
    --bg: #2e2e2e;
    --bg_barra: #2e2e2e00;
    --bg_separador1: #2e2e2e00;
    --bg_canvas_1_original: #c9c9c9;
    --bg_canvas_2_original: #2e2e2e;
    --bg_canvas_1: #c9c9c9;
    --bg_canvas_2: #2e2e2e;
    --bg_separador2: #2e2e2e00;
    --bg_dashboard: var(--bg);
    --bg_modal: var(--bg);

    --modal-color: white;
    --button-icon-color: black;
    --button-icon-line-width: 0.2;
    --barra-button-icon-line-width: 1;
    --bd-dashboard-button: lightblue;
    --bd-dashboard-button-pressed: rgb(60, 197, 243);

    /* TAMAÑOS */
    --barra-height: 6vw;
    --barra-width: 75vw;

    --barra-square-height: 3.5vw;
    --barra-square-width: 3.5vw;
    --barra-square-color: white;
    --barra-square-color-border-width: 0.3vw;
    --barra-square-color-border-radius: 1vw;
    --barra-square-color-border-style: solid;
    --barra-square-color-border-color: white;

    --barra-icon-fill: black;
    --barra-icon-stroke-width: 0.1vw;
    --barra-icon-stroke: black;

    --separador1-height: 0vw;
    --separador1-width: 75vw;

    --canvas-height: 35vw;
    --canvas-width: 35vw;
    --canvas-border-width: 0.5vw;
    --canvas-border-radius: 0vw;
    --canvas-border-style: solid;
    --canvas-border-color: rgb(98, 98, 98);

    --canvas-pixels-width: 10;
    --canvas-pixels-height: 10;

    --separador2-height: 35vw;
    --separador2-width: 5vw;

    --dashboard-height: 35vw;
    --dashboard-width: 35vw;
    --dashboard-border-width: 0vw;
    --dashboard-border-radius: 0vw;
    --dashboard-border-style: solid;
    --dashboard-border-color: rgb(98, 98, 98);

    --dashboard-button-height: 8vw;
    --dashboard-button-width: 8vw;

    --dashboard-estuche-height: 30%;
    --dashboard-estuche-width: 100%;

    --dashboard-colores-height: 70%;
    --dashboard-colores-width: 100%;

    --dashboard-colores-color-height: 4vw;
    --dashboard-colores-color-width: 4vw;
    --dashboard-colores-color-icon-color: white;
    --dashboard-colores-color-icon-line-width: 3;

    --estuche-buttons-border-width: 0.5vw;
    --estuche-buttons-border-radius: 2vw;
    --estuche-buttons-border-style: solid;
    --estuche-buttons-border-color: white;

    --estuche-buttons-border-width-pressed: 1vw;
    --estuche-buttons-border-radius-pressed: 2vw;
    --estuche-buttons-border-style-pressed: solid;
    --estuche-buttons-border-color-pressed: white;

    --estuche-colores-border-width: 0.3vw;
    --estuche-colores-border-radius: 1vw;
    --estuche-colores-border-style: solid;
    --estuche-colores-border-color: white;

    --estuche-colores-border-width-pressed: 0.3vw;
    --estuche-colores-border-radius-pressed: 1vw;
    --estuche-colores-border-style-pressed: solid;
    --estuche-colores-border-color-pressed: yellow;
}

@media (max-width: 600px) {

    :root {
        /* TAMAÑOS */
        --canvas-height: 80vw;
        --canvas-width: 80vw;

        --separador1-height: 80vw;
        --separador1-width: 5vw;
        
        --separador2-height: 5vw;
        --separador2-width: 80vw;

        --dashboard-height: 80vw;
        --dashboard-width: 80vw;

        --dashboard-button-height: 20vw;
        --dashboard-button-width: 20vw;

        --dashboard-colores-color-height: 10vw;
        --dashboard-colores-color-width: 10vw;

        --estuche-buttons-border-radius: 0.2vw;
        --estuche-buttons-border-radius-pressed: 0.2vw;

    }
}

* {
    margin: 0;
    padding: 0;
}

body {
    width: 100vw;
    height: 100vh;
    font-family: monospace;
    background-color: var(--bg);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;

}

/* CANCELAR DRAGGING POR CSS */
* {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

img,a {
    pointer-events: none;
}

/* BARRA SUPERIOR */

#barra {
    height: var(--barra-height);
    width: var(--barra-width);
    background-color: var(--bg_barra);

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1vw;
}

#barra .square {
    height: var(--barra-square-height);
    width: var(--barra-square-width);
    border-width: var(--barra-square-color-border-width);
    border-radius: var(--barra-square-color-border-radius);
    border-style: var(--barra-square-color-border-style);
    border-color: var(--barra-square-color-border-color);
}

#barra .button {
    background-color: var(--bd-dashboard-button);
    display: flex;
    align-items: center;
    justify-content: center;
}

#barra .button svg {
    height: 60%;
    width: 60%;
    fill: var(--barra-icon-fill);
    stroke-width: var(--barra-icon-stroke-width);
    stroke: var(--barra-icon-stroke);
}

#canvas-color-1 {
    background-color: var(--bg_canvas_1);
}

#canvas-color-2 {
    background-color: var(--bg_canvas_2);
}

/* COLOR PICKERS BARRA */
.withpicker * {
    opacity: 0 ;
    border-radius: var(--barra-square-color-border-radius);
    position: absolute;
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

/* COLOR PICKERS COLORES */
.color .color-picker, .color .clr-field{
    height: var(--dashboard-colores-color-height);
    width: var(--dashboard-colores-color-width);
    opacity: 0 !important;
    cursor: pointer;
    position: absolute;
}

/* CONTENEDORES*/

#contenedores {
    height: fit-content;
    width: fit-content;
    
    display: flex;
    flex-direction: row;
}

/* SEPARADOR ENTRE BARRA Y CONTENEDORES */

#separador1 {
    height: var(--separador1-height);
    width: var(--separador1-width);
    background-color: var(--bg_separador1);
}

/* CANVAS */

#canvas {
    height: var(--canvas-height);
    width: var(--canvas-width);
    background-color: var(--bg_canvas_1);

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;

    border-width: var(--canvas-border-width);
    border-radius: var(--canvas-border-radius);
    border-style: var(--canvas-border-style);
    border-color: var(--canvas-border-color);
}

/* De las filas pares uno si uno no*/
.blancas {
    background-color: var(--bg_canvas_1);
}

/* De las filas impares uno no uno si */
.negras{
    background-color: var(--bg_canvas_2);
}

@media (max-width: 600px) {

    #contenedores {
        height: fit-content;
        width: fit-content;
        
        display: flex;
        flex-direction: column;
    }
}

/* SEPARADOR ENTRE CANVAS Y DASHBOARD */

#separador2 {
    height: var(--separador2-height);
    width: var(--separador2-width);
    background-color: var(--bg_separador2);
}

/* DASHBOARD */

#dashboard {
    height: var(--dashboard-height);
    width: var(--dashboard-width);
    background-color: var(--bg_dashboard);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;

    border-width: var(--dashboard-border-width);
    border-radius: var(--dashboard-border-radius);
    border-style: var(--dashboard-border-style);
    border-color: var(--dashboard-border-color);
}

#estuche {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    height: var(--dashboard-estuche-height);
    width: var(--dashboard-estuche-width);
}

#estuche .button {
    height: var(--dashboard-button-height);
    width: var(--dashboard-button-width);
    background-color: var(--bd-dashboard-button);
    
    display: flex;
    justify-content: space-around;
    align-items: center;

    border-width: var(--estuche-buttons-border-width);
    border-radius: var(--estuche-buttons-border-radius);
    border-style: var(--estuche-buttons-border-style);
    border-color: var(--estuche-buttons-border-color);

    cursor: pointer;
}

.icono {
    height: 80%;
    width: 80%;
    fill: var(--button-icon-color);
    stroke-width: var(--button-icon-line-width);
    stroke: var(--button-icon-color);
}

#colores {
    height: var(--dashboard-colores-height);
    width: var(--dashboard-colores-width);
    
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 2vw;
}

.color {
    border-width: var(--estuche-colores-border-width);
    border-style: var(--estuche-colores-border-style);
    border-color: var(--estuche-colores-border-color);
    border-radius: var(--estuche-colores-border-radius);

    height: var(--dashboard-colores-color-height);
    width: var(--dashboard-colores-color-width);

    cursor: pointer;

    display: flex;
    justify-content: center;
    align-items: center;
}

.color svg {
    height: 80%;
    width: 80%;
    fill: var(--dashboard-colores-color-icon-color);
    stroke-width: var(---dashboard-colores-color-icon-line-width);
    stroke: var(--dashboard-colores-color-icon-color);
}

.border-invisible {
    border-color: var(--bg_dashboard) !important;
    box-shadow: 0 0 0 rgba(0,0,0,0) !important;
}

#menu-click-derecho{
    position:absolute;
    display:none;
    background:white;
    border:1px solid #ccc;
    border-radius:5px;
    box-shadow:0 2px 10px rgba(0,0,0,.2);
    min-width:150px;
    z-index:99999;
}

#menu-click-derecho .opcion{
    padding:8px 12px;
    cursor:pointer;
}

#menu-click-derecho .opcion:hover{
    background:#eee;
}

#menu-click-derecho .opcion.disabled {
    color: var(--texto-deshabilitado, #777); /* ajusta a tu paleta */
    cursor: default;
    pointer-events: none;
    opacity: 0.5;
}

#modal-overlay, #cargando-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#modal-overlay.show , #cargando-overlay.show { display: flex; }

#modal-caja, #cargando-caja {
    background: var(--bg_modal);
    color: var(--modal-color);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    position: relative;
    text-align: center;
    font-family: sans-serif;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
 
#modal-cerrar {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    background: none;
    border: none;
    color: var(--modal-color);
}

#modal-caja p, #cargando-overlay p {
    margin: 2vw;
    font-size: 2vw;
}

#botones-modal {
    display: flex;
    justify-content: space-around;
    width: max-content;
    gap: 5vw;
}

#botones-modal > div {
    border-style: solid;
    border-radius: 0.2vw;
    border-radius: 1vw;
    padding: 1vw;
    padding: 1vw;
    cursor: pointer;
}

#modal-aceptar {
    color: red;
    border-color: red;
    background-color: var(--bg_modal);
}

#modal-cancelar {
    color: white;
    border-color: white;
    background-color: green;
}

.eliminado {
    display: none !important;
}

.puntitos span {
    opacity: 0;
    animation: parpadeo 1.2s infinite;
}
.puntitos span:nth-child(1) { animation-delay: 0s; }
.puntitos span:nth-child(2) { animation-delay: 0.2s; }
.puntitos span:nth-child(3) { animation-delay: 0.4s; }

@keyframes parpadeo {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}