/* General styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none;
}

.d-flex {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.card-add {
    width: 63mm;
    height: 88mm;
    position: relative;
    border: solid 1px #000;
    color: #000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: transparent;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin: 0px;
}

.card-add:hover {
    cursor: pointer;
    background: transparent;
    color: #333;
}

.card-add:hover svg {
    fill: #333;
}

.card-add svg {
    display: block;
    text-align: center;
    width: 50px;
    height: 50px;
}

.card {
    width: 63mm;
    height: 88mm;
    position: relative;
    page-break-inside: avoid;
    border: solid 1px #000;
    background-color: #000;
}

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

/* Grayscale mask */
.card .grayscale-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.card .grayscale-mask img {
    filter: grayscale(100%);
    clip-path: polygon(0 0, 100% 0, 100% 53%, 0 53%);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card .grayscale-mask.full-grayscale-mask img {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.card.location .grayscale-mask img {
    /* Clip 50% from the right off the image instead */
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.card.location .grayscale-mask.full-grayscale-mask img {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.display-only {
    display: flex;
    justify-content: center;
}

.display-only > div {
    width: min(100%, 800px);
    margin: 0 1rem;
}

select {
    display: block;
    padding: 0.5rem;
    width: 100%;
    margin: 1rem 0;
    border-radius: 2px;
}

button, .button {
    display: block;
    padding: 0.5rem;
    width: 100%;
    margin: 1rem 0;

    font-size: 18px;
    text-decoration: none;
    text-align: center;

    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 2px;
}

button:hover, .button:hover {
    background-color: #0056b3;
}

h1 {
    text-align: center;
}
.card-count {
    text-align: center;
    font-size: 40px;
    color: #fff;
    position: absolute;
    z-index: 1;
    width: 63mm;
    height: 88mm;
    line-height: 88mm;
}

.delete-button {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #ff0000;
    color: #fff;
    border: none;
    padding: 5px;
    width: 25px;
    height: 25px;
    font-size: 12px;
    margin: 0;
}

.delete-button:hover {
    background-color: #cc0000;
}

button[data-role="close"] {
    display: block;
    width: auto;
    padding: 0.7rem 1.2rem;

    font-size: 1.2rem;
    font-weight: 700;

    border: none;
    background-color: #cc0000;
    color: #FFF;

    position: absolute;
    top: -15px;
    right: -15px;
    margin: 0;
}

dialog {
    overflow: visible;
    width: min(calc(100% - 1.2rem), 960px);

    border: 4px solid #000;
    flex-direction: column;
    gap: 1rem;
}

dialog > div {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

dialog .cards {
    overflow-y: auto;
    max-height: 80vh;
}

input[type="text"] {
    border: solid 1px #000;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    font-size: 1rem;
    display: block;
}

#cardSelectionContainer {
    min-height: 50vh;
}