html{height:100%;margin:0;padding:0;}
body{height:100%;color:#000;margin:0px;padding:0px;width: 100%;}
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {margin: 0;padding: 0;border: 0;outline: 0;
vertical-align: baseline;background: transparent;}
body {line-height: 1;}
ol, ul {list-style: none;}
blockquote, q {quotes: none;}
blockquote:before, blockquote:after,
q:before, q:after {content: '';content: none;}
:focus {outline: 0;}ins {text-decoration: none;}
del{text-decoration: line-through;}
table {border-collapse: collapse;border-spacing: 0;}
body {/*background: rgb(81, 0, 213);*/
    font-family: "Geologica", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    line-height: 1.4;
    background: rgb(113 100 135);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #949494;
    color: white;
    background-image: url(/site/modules/lenta/02bg.png);
    background-size: 5px;
    background-position: center;
}


.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;

    font-size: 20px;
    color: white;
    font-family: sans-serif;
}

.hidden {
    display: none;
}



.app {
    max-width: 420px;
    padding: 30px;
    /* background: #2a3040; */
    border-radius: 20px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); */
    width: 90%;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    margin-top: 0;
    text-align: center;
}

input {
    width: 100%;
    padding: 14px;

    border: none;
    border-radius: 10px;

    margin-bottom: 15px;

    font-size: 14px;
}

button {
    width: 100%;
    padding: 14px;

    border: none;
    border-radius: 10px;

    background: #5b8cff;
    color: white;

    font-size: 16px;
    cursor: pointer;

    transition: 0.2s;
}

button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

canvas {
    width: 100%;
    margin-top: 20px;

    border-radius: 14px;

    image-rendering: pixelated;

    background: #87ceeb;
}


/* =====================================================
   КНОПКА ВЫБОРА ФАЙЛА (CUSTOM)
   ===================================================== */

   .file-btn {
    display: inline-block;
    padding: 12px 18px;
    background: #111;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
    transition: 0.2s ease;
    user-select: none;
    width: 100%;
    text-align: center;
    font-size: 20px;
    border-radius: 31px;
    background: #287fb5;
}

.btn_save{

    padding: 12px 18px;
    background: #111;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
    transition: 0.2s ease;
    user-select: none;
    width: 100%;
    text-align: center;
    font-size: 20px;
    border-radius: 31px;
    background: #49b528;  
}

.file-btn:hover {
    background: #333;
}

.file-btn:active {
    transform: scale(0.98);
}

/* прячем реальный input */
.file-btn input[type="file"] {
    display: none;
}



/* =====================================================
   CANVAS ПО УМОЛЧАНИЮ СКРЫТ
   ===================================================== */

   #canvas {
    display: none;
    width: 500px;
    height: 500px;
    image-rendering: pixelated;
    border-radius: 12px;
    background: #111;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* когда активен */
#canvas.active {
    display: block;
}



#gallery {
    display: flex;
    flex-wrap: wrap;
  }
  
  .placeholder {
    width: 150px;
    height: 150px;
    background: #ccc;
    margin: 5px;
    display: inline-block;
    background-image: linear-gradient(90deg, #ccc, #ddd, #ccc);
    background-size: 200% 100%;
    animation: loading 1.2s infinite;
  }
  
  .error-box {
    width: 150px;
    height: 150px;
    background: #999;
    margin: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
  }
  
  .loaded-img {
    width: 256px;
    height: 256px;
}
  
  @keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }




    
  .loaded-img {
    width: 256px;
    height: 256px;
}
  
  @keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }


  #gallery {
    display: flex;
    flex-wrap: wrap;
    width: 90%;
    margin: 20px auto;
    padding: 6px;
    /* border: 1px solid #ccc; */
    box-shadow: 1px 1px 70px #1d007db5;
    background: #ffffff;
}

.cell {
    position: relative;
    box-sizing: border-box;
}

.cell::before {
    content: "";
    display: block;
    padding-top: 100%;
}

.cell-inner {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.cell-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


  