body {
 background-color: #687589;
}

#cards {
    /* background-color: rgb(189, 189, 189); */
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 100vw;
    overflow-y: scroll;
    /* overflow-x: visible; */
    padding-top: 5vw;
    direction: rtl;
    /* clip-path: polygon(2% -100%, 100% -100%, 100% 200%, 2% 200%); */
    pointer-events: none;
}

.cardoutside {
    --randleft: 0;
    --randtop: 0;
    position: relative;
    /* filter: drop-shadow(0 0 2vw rgba(0, 0, 0, 0.178)); */

    border-radius: 1%;
    width: 20vw;
    aspect-ratio: 9.3/7.5;
    right: calc(100% - 2% + var(--randleft) * 0.2%);
    transform: translate(100%, calc(var(--randtop) * 1%));
    margin: 0 0% calc(-20vw / (9.3/7.5) + 1.0%) 0;
    /* clip-path: polygon(0% -100%, 100% -100%, 100% 200%, 0% 200%); */
    direction: ltr;
    transition: transform 100ms ease-in-out, clip-path 100ms ease-in-out;
    pointer-events: all;
}
.cardoutside:first-child {
    filter: none;
}
.cardoutside:last-child {
    margin-bottom: 20%;
}

.cardoutside:hover,
.cardoutside.clicked {
    transform: translate(120%, -3%) rotate(2deg);
    /* clip-path: polygon(-20% -100%, 2000% -100%, 2000% 200%, -20% 200%); */
    >.card {
        background-color: white;
    }
    +div {
        clip-path: polygon(0% -100%, 120% -100%, 120% 200%, 0% 200%);
    }
}

.card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #eee;
    clip-path: polygon(11% 0%, 100% 0%, 100% 87%, 89% 100%, 0% 100%, 0% 13%);
    transition: background-color 100ms ease-in-out;
}

.cardoutline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #cccccc;
    clip-path: polygon(11% 0%, 100% 0%, 100% 87%, 89% 100%, 0% 100%, 0% 13%);
    transition: background-color 100ms ease-in-out;
    transform: translate(0, -0%) scale(1.02);
}
.cardoutside:nth-child(16n)>.cardoutline {
    background-color: #ff0000;
}
.cardoutside:nth-child(256n)>.cardoutline {
    background-color: #c300ff;
}
.cardoutside.untagged>.cardoutline {
    background-color: #ffa600;
}

.cardoutside.clicked>.cardoutline {
    background-color: #525252;
}
.cardoutside:nth-child(16n).clicked>.cardoutline {
    background-color: #910000;
}
.cardoutside:nth-child(256n).clicked>.cardoutline {
    background-color: #6d008f;
}

.cardbin {
    position: absolute;
    left: 12%;
    margin: 0;
    font-size: 1vw;
    font-family:'Courier New', Courier, monospace;
    white-space:pre;
    user-select: none;
    color: #b4b4b4;
}
.cardbin>span:nth-child(1) {
    color: #b4b4b4;
}
.cardbin>span:nth-child(2) {
    color: #9b9b9b;
}
.cardbin>span:nth-child(3) {
    color: #8a8a8a;
}
.cardnum {
    position: absolute;
    right: 2%;
    margin: 0;
    text-align: end;
    font-size: 0.8vw;
    font-family: "Unkempt", cursive;
    font-weight: 700;
    font-style: normal;
    user-select: none;
}
.cardtitle {
    position: absolute;
    top: 10%;
    right: 0;
    height: 78%;
    margin: 0;
    font-size: 1.0vw;
    line-height: 120%;
    font-family: "Architect's Daughter", cursive;
    font-weight: 400;
    font-style: normal;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

#carddisp {
    position: absolute;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
}
#imgcontainer {
    position: absolute;
    top: 50%;
    left: 30vw;
    transform: translateY(-50%);
    width: min-content;
    height: min-content;
    overflow: hidden;
}
#scanimg {
    height: 90vh;
    max-width: 65vw;
    user-select: none;
}
#mousex {
    position: absolute;
    /* background-color: red; */
    backdrop-filter: invert(100%);
    top: 0;
    width: 1px;
    height: 100%;
    pointer-events: none;
}
#mousey {
    position: absolute;
    /* background-color: red; */
    backdrop-filter: invert(100%);
    left: 0;
    height: 1px;
    width: 100%;
    pointer-events: none;
}
#subplots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.subplot {
    position: absolute;
    border: 1px solid red;
    pointer-events: all;
}
.tmpsubplot {
    position: absolute;
    border: 1px solid cyan;
    pointer-events: none;
}
.hide .subplot:not(.clicked) {
    display: none;
}
.subplot.clicked {
    border: 2px solid #a34141;
}

#tagpalette {
    position: absolute;
    top: 50%;
    right: 2.5vw;
    width: calc(100vw - 5vw - 30vw - 90vh / 8 * 5);
    height: 90vh;
    transform: translateY(-50%);
    /* pointer-events: none; */
}

#globaltags {
    height: 70vh;
    background-color: #7989a0;
    margin-bottom: 1vh;
    padding: 1vh;
    overflow: scroll;
}
#tagmaker {
    margin-bottom: 1vh;
    width: 30%;
}
#currenttags {
    height: 13vh;
    background-color: #7989a0;
    padding: 1vh;
    overflow: scroll;
}

.tagentry {
    display: inline;
    background-color: #40659e;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8vw;
    padding: 0.2vw 0.3vw 0.2vw 0.3vw;
    margin: 0.2vw;
    line-height: 190%;
    border-radius: 0.6vw;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.tagentry:hover {
    background-color: #526e97;
}
.tagentry.cardtag {
    background-color: #4b535f;
    cursor: not-allowed;
}
.tagentry.symtag {
    background-color: #307986;
    cursor: not-allowed;
}

#deleteSubplot.disabled {
    background-color: #7c7c7c;
    cursor: not-allowed;
}

#deleteSubplot {
    border-radius: 10px;
    background-color: #75ee75;
    transition: background-color 0ms linear;
    cursor: pointer;
}

#deleteSubplot:active:not(.disabled) {
    background-color: red;
    transition: background-color 1000ms linear;
}

.subpCount {
    position: absolute;
    padding: 0.2vw 0.3vw 0.2vw 0.3vw;
    bottom: 0.7vw;
    font-size: 0.8vw;
    font-weight: bold;
    background-color: #526e97;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
}

.civilian {
    #globaltags {
        display: none;
    }
    #tagmaker {
        display: none;
    }
    #deleteSubplot {
        display: none;
    }
    #copyout {
        display: none;
    }
    #currenttags {
        height: 88vh;
    }
    #mousex {
        display: none;
    }
    #mousey {
        display: none;
    }
    .subplot {
        background-color: #ff000009;
    }
    .hide .subplot.clicked {
        background-color: #ffffff00;
    }
    .tagentry {
        cursor: auto !important;
    }
}