img::selection {
    background: transparent;
}

/* Стиль для всего скролл бара */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

/* Стиль для фона скролл бара */
::-webkit-scrollbar-track {
    margin: 10px;
    border-radius: 3px;
    background: #333;
}
.controls_list::-webkit-scrollbar-track {
    margin: 40px !important;
}

/* Стиль для ползунка скролл бара */
::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

/* Стиль для ползунка скролл бара при наведении курсора */
::-webkit-scrollbar-thumb:hover {
    background: #666; /* темнее цвет ползунка */
}

html{
    background: rgba(0, 0, 0, 1);
    background-image: url(https://editor.teremok.games/img/bg/bg-d.jpg);
    background-position: center;
    background-repeat: repeat;
    background-size: cover;
}
body {
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color:transparent;
    margin: 0;
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.5px;
    text-align: center;
    overflow: hidden;
    font-size: 16px;

    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
}
.f-panzoom.can-zoom_out,
.f-panzoom.is-draggable{
    cursor: default !important;
}
.f-panzoom__content{
    max-height: unset !important;
}

h1 {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 20px;
    margin-top: 10px;
    text-shadow: 0 2px 9px #2ea1ee;
}
h2{
    margin: 0;
    font-weight: 400;
}
h3{
    margin: 0;
    display: inline-block;
}
a{
    text-decoration: none;
    color: #22a0f4;
    font-style: italic;
    transition: opacity .2s, visibility .2s linear .2s;
}
a:hover {
    opacity: .8;
}

.container {
    margin-right: auto;
    margin-left: auto;
    height: 100vh;
    outline: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
table{
    margin: auto;
}
td{
    padding: 0;

}
.controls{
    display: block;
    position: fixed;
    width: calc(100% - 40px);
    margin: 0 20px;
    height: 120px;
    bottom: 0;
    z-index: 9999999;
}
.controls_list{
    margin: 0 auto;
    height: 80px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    max-width: calc(100% - 40px);
    width: fit-content;
    padding: 5px 20px;
    background: #000000cc;
    border-radius: 80px;
    display: flex;
    align-items: center;
    justify-content: left;
}
.controls img{
    width: 40px;
    height: 40px;
    margin-right: 10px;
    cursor: pointer;
    transition: 0s;
    z-index: 99;
}
.controls img[selected_tool]{
    width: 60px;
    height: 60px;
}
.paint,
.settings{
    display: none;
    position: absolute;
    top: -245px;
    background-color: #000000cc;
    padding: 5px;
    /*background: linear-gradient(0deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 20px, #000000cc 20px, #000000cc 100%);*/
    border-radius: 100px 100px 0 0;
    padding-bottom: 35px;
}
.settings {
    top: -185px !important;
}
.paint img,
.settings img{
    width: 40px !important;
    margin: 5px !important;
    display: block;
    padding-bottom: 5px;
}
.paint img:last-child,
.settings img:last-child{
    padding-bottom: 0;
}
.controls img:last-child{
    margin-right: 0;
}
.f-panzoom__content{
    /*padding: 60px;*/
    /*margin: 60px 60px 120px 60px;*/
    min-width: 210px;
}

#content{
    position: absolute;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
}
#grid{
    opacity: 0;
    transition: opacity 2s, visibility 2s linear 2s;
}

table{
    height: 140px;
}
td{
    min-width: 140px;
    min-height: 140px;
    max-width: 140px;
    max-height: 140px;
    padding: 0 11px;
}

@keyframes spin {
    /* Начальное состояние: блок не повернут и имеет исходные размеры */
    0% {
        transform: rotate(0deg) scale(1);
    }
    /* Блок повернут на 30 градусов и увеличен на 20% */
    8.33% {
        transform: rotate(30deg) scale(1.2);
    }
    /* Блок повернут на 60 градусов и имеет исходные размеры */
    16.67% {
        transform: rotate(60deg) scale(1);
    }
    /* Блок повернут на 90 градусов и увеличен на 20% */
    25% {
        transform: rotate(90deg) scale(1.2);
    }
    /* Блок повернут на 120 градусов и имеет исходные размеры */
    33.33% {
        transform: rotate(120deg) scale(1);
    }
    /* Блок повернут на 150 градусов и увеличен на 20% */
    41.67% {
        transform: rotate(150deg) scale(1.2);
    }
    /* Блок повернут на 180 градусов и имеет исходные размеры */
    50% {
        transform: rotate(180deg) scale(1);
    }
    /* Блок повернут на 210 градусов и увеличен на 20% */
    58.33% {
        transform: rotate(210deg) scale(1.2);
    }
    /* Блок повернут на 240 градусов и имеет исходные размеры */
    66.67% {
        transform: rotate(240deg) scale(1);
    }
    /* Блок повернут на 270 градусов и увеличен на 20% */
    75% {
        transform: rotate(270deg) scale(1.2);
    }
    /* Блок повернут на 300 градусов и имеет исходные размеры */
    83.33% {
        transform: rotate(300deg) scale(1);
    }
    /* Блок повернут на 330 градусов и увеличен на 20% */
    91.67% {
        transform: rotate(330deg) scale(1.2);
    }
    /* Конечное состояние: блок повернут на 360 градусов и имеет исходные размеры */
    100% {
        transform: rotate(360deg) scale(1);
    }
}
.cellSelection{
    animation: spin 10s infinite;
    animation-direction: reverse;
    animation-timing-function: linear;
}
[size="small"] .cellSelection{
    min-width: 160px;
    max-width: 160px;
    margin-top: -80px;
    margin-left: -80px;
}
[size="big"] .cellSelection{
    min-width: 180px;
    max-width: 180px;
    margin-top: -90px;
    margin-left: -90px;
}

.line_1{
    transform: rotate(60deg);
    margin-left: -108px;
    margin-top: -74px;
    z-index: -1;
}
.line_2{
    transform: rotate(120deg);
    margin-left: -30px;
    margin-top: -74px;
    z-index: -1;
}
.line_3{
    margin-left: 11px;
    margin-top: -4px;
    z-index: -1;
}
.line_4{
    transform: rotate(60deg);
    margin-left: -32px;
    margin-top: 64px;
    z-index: -1;
}
.line_5{
    transform: rotate(120deg);
    margin-left: -116px;
    margin-top: 64px;
    z-index: -1;
}
.line_6{
    margin-left: -151px;
    margin-top: -8px;
    z-index: -1;
}
td img{
    pointer-events: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    max-width: 140px;
    margin-top: -70px;
    margin-left: -70px;
    width: 100%;
    position: fixed;
}

dialog{
    color: #ffffff !important;
}
dialog#modal {
    border-radius: 20px;
    background: #000000cc;
    border-color: #22a0f4;
    border-left: none;
    border-right: none;
    box-shadow: #000000 0 0 20px;
    padding: 20px;
}
dialog#modal p {
    display: inline-grid;
    justify-items: start;
    margin: 0 10px;
}
dialog#modal p>*{
    margin: 5px 0;
}
dialog#modal p>a{
    margin: 0 !important;
}
dialog[open]::backdrop {
    backdrop-filter: blur(3px);
    background: #0000003d;
}
dialog[open] {
    animation: show .5s;
}

dialog.hide {
    animation: hide .5s;
}
#modal div{
    padding: 10px;
}
#modal div:last-child{
    padding: 20px;
}
#modal button{
    transition: 0.4s;
}

@keyframes show {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0%);
    }
}

@keyframes hide {
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

select{
    padding: 5px;
    border-radius: 5px;
    font-family: 'Rajdhani', sans-serif !important;
    letter-spacing: 0.5px;
    font-size: 18px;
}

button{
    font-family: 'Rajdhani', sans-serif !important;
    letter-spacing: 0.5px;

    padding: 5px 15px;
    margin: 0 10px;
    border-radius: 5px;
    font-weight: 800;
    font-size: 18px;
    background: #00000063;
    cursor: pointer;

    border: 2px solid #ababab;
    text-shadow: 0 0 8px #ababab;
    box-shadow: #ababab 0 0 10px;
    color: #ababab;
}
button:hover{
    filter: drop-shadow(0 0 10px rgba(171, 171, 171, 0.5));
}
.green_button{
    border: 2px solid #52d372 !important;
    text-shadow: 0 0 8px #52d372 !important;
    box-shadow: #52d372 0 0 10px !important;
    color: #52d372 !important;
}
.green_button:hover{
    filter: drop-shadow(0 0 10px rgba(82, 211, 114, 0.5)) !important;
}
.blue_button{
    border: 2px solid #22a0f4 !important;
    text-shadow: 0 0 8px #22a0f4 !important;
    box-shadow: #22a0f4 0 0 10px !important;
    color: #22a0f4 !important;
}
.blue_button:hover{
    filter: drop-shadow(0 0 10px rgba(34, 160, 244, 0.5)) !important;
}

#tool-power:hover,
[in_color="green"]:hover{
    filter: drop-shadow(0 0 8px rgba(82, 211, 114, 1)) !important;
}
#tool-power[selected_tool],
[in_color="green"][selected_tool]{
    filter: drop-shadow(0 0 10px rgba(82, 211, 114, 1)) !important;
}

#tool-size:hover,
[in_color="magenta"]:hover{
    filter: drop-shadow(0 0 8px #b46aff) !important;
}
#tool-size[selected_tool],
[in_color="magenta"][selected_tool]{
    filter: drop-shadow(0 0 10px #b46aff) !important;
}

#tool-connection:hover,
[in_color="yellow"]:hover{
    filter: drop-shadow(0 0 8px #f8d33b) !important;
}
#tool-connection[selected_tool],
[in_color="yellow"][selected_tool]{
    filter: drop-shadow(0 0 10px #f8d33b) !important;
}

#tool-remove:hover,
[in_color="red"]:hover{
    filter: drop-shadow(0 0 8px #fb5b34) !important;
}
#tool-remove[selected_tool],
[in_color="red"][selected_tool]{
    filter: drop-shadow(0 0 10px #fb5b34) !important;
}

#tool-settings:hover,
#tool-align:hover,
[in_color="grey"]:hover{
    filter: drop-shadow(0 0 8px #ababab) !important;
}
.settings img:hover{
    filter: drop-shadow(0 0 8px #ababab) !important;
}
[in_color="grey"][selected_tool]{
    filter: drop-shadow(0 0 10px #ababab) !important;
}

[in_color="blue"]:hover{
    filter: drop-shadow(0 0 8px rgba(34, 160, 244, 1)) !important;
}
[in_color="blue"][selected_tool]{
    filter: drop-shadow(0 0 10px rgba(34, 160, 244, 1)) !important;
}

[size="small"] .cell{
    max-width: 140px;
    margin-top: -70px;
    margin-left: -70px;
}
[size="big"] .cell{
    max-width: 160px;
    margin-top: -80px;
    margin-left: -80px;
}

td[state="disabled"] img{
    opacity: 0.3 !important;
}

td.line_disabled img{
    opacity: 0.5;
    cursor: not-allowed !important;
}

.enemy:before{
    content: "";
    background-position: left;
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}
.enemy_1:before{
    background-image: url(https://editor.teremok.games/img/map/cell_small_green_8.png);
}
.enemy_1 select{
    border: 2px solid #01cc33;
}
.enemy_2:before{
    background-image: url(https://editor.teremok.games/img/map/cell_small_yellow_8.png);
}
.enemy_2 select{
    border: 2px solid #ffcc00;
}
.enemy_3:before{
    background-image: url(https://editor.teremok.games/img/map/cell_small_red_8.png);
}
.enemy_3 select{
    border: 2px solid #ff3300;
}
.enemy_4:before{
    background-image: url(https://editor.teremok.games/img/map/cell_small_magenta_8.png);
}
.enemy_4 select{
    border: 2px solid #9933ff;
}

.shake_0[state="enabled"] .cell,
.shake_0[state="enabled"] .num{
    animation: shake .88s;
    animation-iteration-count: infinite;
}
.shake_1[state="enabled"] .cell,
.shake_1[state="enabled"] .num{
    animation: shake 0.84s;
    animation-iteration-count: infinite;
}
.shake_2[state="enabled"] .cell,
.shake_2[state="enabled"] .num{
    animation: shake .8s;
    animation-iteration-count: infinite;
}
.shake_3[state="enabled"] .cell,
.shake_3[state="enabled"] .num{
    animation: shake .92s;
    animation-iteration-count: infinite;
}
.shake_4[state="enabled"] .cell,
.shake_4[state="enabled"] .num{
    animation: shake .96s;
    animation-iteration-count: infinite;
}
.shake_5[state="enabled"] .cell,
.shake_5[state="enabled"] .num{
    animation: shake 1s;
    animation-iteration-count: infinite;
}
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.copy,
.copied{
    margin-left: 25px;
}
.copy:after {
    content: "";
    margin-left: 5px;
    margin-bottom: 1px;
    background-image: url(https://editor.teremok.games/img/controls/copy.png);
    background-position: right;
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
}
.copied:after {
    content: "";
    margin-left: 5px;
    margin-bottom: 1px;
    background-image: url(https://editor.teremok.games/img/controls/check.png);
    background-position: right;
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

#load-btn,
#new-btn{
    font-size: 16px;
    font-weight: bold;
    margin-top: 15px;
    display: block;
}
#map-code-editing{
    display: block;
    padding: 5px;
    border-radius: 5px;
    font-family: 'Rajdhani', sans-serif !important;
    letter-spacing: 0.5px;
    font-size: 18px;
    margin: 5px;
}