#main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative
}

#grid {
    left: calc(50% - 64px);
    top: calc(50% - 64px)
}

body,html {
    margin: 0;
    padding: 0;
    height: 100vh
}

body {
    user-select: none;
    background: #999;
    overflow: hidden
}

.bottom {
    flex: 1;
    display: flex
}

.top,body {
    display: flex;
    flex-direction: column
}

.top {
    z-index: 999
}

.top>div {
    display: flex;
    justify-content: space-between;
    gap: 16px
}

.tools {
    padding: 5px
}

.buttons {
    margin: 5px 5px 0
}

.buttons button {
    padding: 0;
    width: 48px;
    height: 48px;
    cursor: pointer;
    font-size: 12px
}

.buttons img {
    width: 100%;
    height: 100%
}


#panels2 img {
    opacity: .4
}

#panels:not(.double)>button.double {
    display: none
}

#panels.double>button.single,.arrow.reverse,body.view-reverse .arrow {
    display: none
}

.tools>div {
    font-family: monospace;
    display: flex;
    align-items: center
}

textarea {
    z-index: 999;
    background: #ffffff23;
    margin: 5px;
    outline: 0;
    border: 0;
    padding: 5px;
    resize: none;
    box-sizing: border-box;
    word-break: break-all
}

.scan::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 120px;
    height: 120px;
    border-radius: 4px;
    outline: 2px solid red;
    z-index: 1
}

.empty::before {
    display: flex;
    align-items: center;
    justify-content: center;
    content: "X";
    font-family: monospace;
    font-size: 48px;
    color: rgba(255,11,11,.842);
    position: absolute;
    inset: 0;
    background: url(src/textures/field_neutral.png);
    opacity: .2
}

.panel {
    position: absolute;
    width: 128px;
    height: 128px
}

.arrow {
    z-index: 1;
    background-size: 16px;
    background-repeat: no-repeat;
    background-position: 136px 72px;
    width: 160px;
    height: 160px;
    margin-left: -16px;
    margin-top: -16px;
    pointer-events: none
}

@media screen and (max-width:1024px) {
    .top>div {
        gap: 2px
    }

    .buttons button {
        width: 24px;
        height: 24px
    }
}

body.view-3d #main {
    transform: rotateX(60deg) rotateZ(45deg)
}

.hover_cur {
    box-shadow: inset 0 0 0 3px red;
    border-radius: 5px
}

.hover_next,.hover_prev {
    box-shadow: inset 0 0 0 3px green;
    border-radius: 5px
}

.hover_prev {
    box-shadow: inset 0 0 0 3px #00f;
    color: #80b7ff
}

#lines {
    position: absolute;
    overflow: visible;
    width: 1px;
    height: 1px;
    z-index: 2;
    pointer-events: none;
    display: none;
    color: #000
}

body.view-reverse #lines {
    color: #8f1100
}

body.view-path #lines,body.view-reverse .arrow.reverse {
    display: inherit
}

body.view-3d #btn3D,body.view-path #btnPath,body.view-reverse #btnReverse {
    opacity: 1
}

.views {
    margin-inline: 5px;
    display: flex;
    gap: 5px;
    width: 100%;
    position: relative
}

.views>div {
    margin-left: auto
}

.views button {
    border: 0;
    padding: 5px;
    cursor: pointer
}

.views>button {
    opacity: .5
}

.views button:hover {
    outline: 1px solid #000
}

body.view-reverse g {
    transform-box: fill-box;
    transform-origin: center;
    transform: rotate(180deg)
}

.switches button {
	padding: 0;
	height: 40px;
	width: 32px;
	position: relative;
}

.switches button span {
	position: absolute;
	top: 0;
	left: 0;
	width: 32px;
}

.switches button.pressed span {
	position: absolute;
	top: 25px;
	left: 0;
	width: 32px;
}

.cursor {
    width: 128px;
    height: 128px;
    z-index: 9999;
    position: absolute;
}