@page {
    margin: 0mm 5mm;
    size: A4 portrait;
}

body {
    font-family: "Noto Sans JP", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.header {
    justify-content: space-between;
    text-align: center;
    margin: 2px;
}

.header h1 {
    margin: 0 auto;
}

.header p {
    margin: 0 auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn i {
    margin-right: 8px;
}

#save-button {
    background-color: #54bc9a;
}

#load-button {
    background-color: #DEFFCE;
    color: #202020;
}

#print-button {
    background-color: #202020;
}

.sm {
    display: none;
}

.btn:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.btn:active {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
}

#g_cards {
    display: grid;
    grid-template-rows: repeat(8, auto);
    grid-template-columns: 105mm 105mm;
    row-gap: 5mm;
    column-gap: 5mm;
    justify-content: center;
}

.card {
    background-color: #54bc9a !important;
    width: 105mm;
    height: 29.7mm;
    border-radius: 1.2mm;
    padding: 1mm;
    display: flex;
    gap: 1mm;
}

.card_image_base {
    aspect-ratio: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

.card_image {
    max-width: 100%;
    aspect-ratio: 1;
}

.card_block {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.card_txt_base {
    width: 75%;
    height: 100%;
    border-top-right-radius: 1mm;
    border-bottom-right-radius: 1mm;
    background-color: #deffcd !important;
    display: grid;
    grid-template-rows: 4fr 5fr;
    grid-template-columns: 100%;
}

.card_name_base {
    display: flex;
    margin: 1px;
    border: 1px solid #54bc9a !important;
    border-top-right-radius: 1mm;
    align-items: center;
    font-size: 170%;
}

.card_name_base p {
    margin: 0 0 0 2mm;
    font-weight: 600;
    color: #4f4f4f;
}

.card_ex_base {
    border-top: 1px solid #54bc9a !important;
    display: grid;
    height: 100%;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 7fr 2fr;
}

.card_ex_base p {
    margin: 0mm;
    color: #4f4f4f;
}

.first-num {
    font-weight: 700;
    font-size: larger;
}

.second-num {
    font-weight: 400;
}

.first-desc {
    display: flex;
    grid-column: 1/2;
    grid-row: 1/2;
}

.second-desc {
    grid-column: 1/2;
    grid-row: 2/3;
}

.plus {
    font-weight: 700;
    font-size: larger;
}

.inf {
    display: inline-flex;
}

.attr_img {
    margin: 3px;
}

.money-mp-cell {
    grid-column: 2/3;
    grid-row: 1/3;
    position: relative;
}

.money-circle {
    width: 82%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgb(255, 255, 170);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #dddd88 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.money-circle p {
    margin: 0;
    font-size: larger;
}

.mp-box {
    width: 90%;
    height: 90%;
    background: #7777ff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10%;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mp-box p {
    margin: 0 auto;
    color: white;
}

.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0;
    pointer-events: none;
}

.config {
    margin: 5px;
    font-size: 1em;
}

.selectbox {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.selectbox::after {
    position: absolute;
    right: 15px;
    width: 10px;
    height: 7px;
    background-color: #535353;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    content: '';
    pointer-events: none;
}

.selectbox select {
    appearance: none;
    min-width: 150px;
    height: 2.8em;
    padding: .4em calc(.8em + 30px) .4em .8em;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    background-color: #fff;
    color: #333333;
    font-size: 1em;
    cursor: pointer;
}

.inputbox input[type="text"] {
    color: #333;
    margin: 1% 0;
    font-size: 1em;
}

.inputbox input[type="text"]:focus {
    border: 2px solid #54bc9a;
    z-index: 10;
    outline: 0;
}

.inputbox input[type="number"] {
    color: #333;
    margin: 1% 0;
    font-size: 1em;
}

.inputbox input[type="number"]:focus {
    border: 2px solid #54bc9a;
    z-index: 10;
    outline: 0;
}

.color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-block;
    margin: auto 0;
    border: 1px solid #777;
    border-radius: 50%;
}

.color-picker::-webkit-color-swatch,
.color-picker::-webkit-color-swatch-wrapper {
    border: none;
    padding: 0;
    border-radius: 50%;
}

.color-show {
    margin: auto 0;
}

.print-credit {
    display: none;
}

@media print {
    .noprint {
        display: none;
    }


    #g_cards {
        display: grid;
        grid-template-rows: 29.7mm 29.7mm 29.7mm 29.7mm 29.7mm 29.7mm 29.7mm 29.7mm;
        grid-template-columns: 105mm 105mm;
        row-gap: 3mm;
        column-gap: 3mm;
        break-after: auto;
        justify-content: left;
        transform-origin: initial;
        width: 100%;
        transform: (1.0);
    }

    body {
        width: 172mm;
        height: 251mm;
        -webkit-print-color-adjust: exact;
        font-family: "Noto Sans JP", sans-serif;
        font-optical-sizing: auto;
        font-weight: 400;
        font-style: normal;
    }

    .print-credit {
        display: block;
        position: fixed;
        bottom: 5mm;
        right: 10mm;
        font-size: 10pt;
        color: #666;
        z-index: 9999;
        display: block;
    }

}

@media (max-width: 450px) {
    #g_cards {
        grid-template-rows: repeat(32, auto);
        grid-template-columns: 105mm;
        transform: scale(0.8);
        transform-origin: top left;
        justify-content: center;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .selectbox {
        transform: scale(0.8);
        transform-origin: top left;
    }

    .header h1 {
        transform: scale(0.8);
    }

    .header p {
        transform: scale(0.8);
    }

    .btn {
        transform: scale(0.8);
    }

    #print-button {
        display: none;
    }

    .sm {
        display: block;
    }
}