/* Card Dimensions: 91mm x 55mm */
.card-root {
    width: 91mm;
    height: 55mm;
    background-color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform-origin: top left;
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
}

/* =========================================
   STANDARD LAYOUT (Modern, Cute, Cool, Simple)
   ========================================= */
.standard-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.standard-layout .media-side {
    position: relative;
    overflow: hidden;
}

.standard-layout .media-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.standard-layout .media-side .no-image {
    width: 100%;
    height: 100%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 8pt;
}

.standard-layout .info-side {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* --- MODERN STYLE --- */
.style-modern {
    background: #fff;
}

.style-modern .media-side {
    width: 42%;
    border-right: 1px solid #eee;
}

.style-modern .info-side {
    padding: 3mm 4mm;
}

.style-modern .header-group {
    border-bottom: 2px solid #d32f2f;
    padding-bottom: 1mm;
    margin-bottom: 1mm;
}

.style-modern .work-name {
    font-size: 7pt;
    color: #666;
    margin-bottom: 0.5mm;
}

.style-modern .char-name {
    font-size: 13pt;
    font-weight: 700;
}

.style-modern .cn-name {
    font-size: 9pt;
    margin-left: 2mm;
    color: #444;
}

.style-modern .contact-list {
    margin-top: 1mm;
    display: flex;
    flex-direction: column;
    gap: 0.5mm;
}

.style-modern .contact-item {
    font-size: 6.5pt;
    align-items: center;
    gap: 1mm;
    display: flex;
}

.style-modern .real-name {
    font-size: 6pt;
    color: #999;
    margin-top: 1mm;
}

/* Fix overlap: Move SNS up or Wrap */
.style-modern .sns-list {
    margin-top: auto;
    margin-bottom: 8mm;
    /* Leave space for sub-images at bottom right if needed */
    display: flex;
    flex-wrap: wrap;
    gap: 1mm;
}

.style-modern .sns-tag {
    background: #f4f4f4;
    padding: 0.5mm 1.5mm;
    border-radius: 2px;
    font-size: 6pt;
    display: flex;
    align-items: center;
    gap: 0.5mm;
}

/* Move sub-images to strict bottom-right to avoid overlap */
.style-modern .sub-images {
    position: absolute;
    bottom: 2mm;
    right: 2mm;
    display: flex;
    gap: 1mm;
    z-index: 10;
}

.style-modern .sub-thumb-wrapper {
    width: 9mm;
    height: 9mm;
    border: 1px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

.style-modern .sub-thumb-inner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --- CUTE STYLE --- */
.style-cute {
    background: #fff0f5;
    background-image: radial-gradient(#ffbee0 1px, transparent 0);
    background-size: 6mm 6mm;
}

.style-cute .media-side {
    width: 35%;
    margin: 3mm;
    border-radius: 4mm;
    border: 2px solid #ff80ab;
    box-shadow: 3px 3px 0 rgba(255, 128, 171, 0.3);
}

.style-cute .info-side {
    padding: 4mm 2mm 2mm 0;
}

.style-cute .work-name {
    display: inline-block;
    background: #ff80ab;
    color: white;
    padding: 0.5mm 2mm;
    border-radius: 4mm;
    font-size: 6pt;
}

.style-cute .char-name {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    /* fallback */
    color: #ec407a;
    font-size: 14pt;
    font-weight: 700;
}

.style-cute .sns-list {
    margin-top: 2mm;
}

.style-cute .sns-tag {
    color: #ec407a;
    background: white;
    border: 1px solid #ff80ab;
    border-radius: 3mm;
    margin-bottom: 1mm;
    margin-right: 1mm;
}

.style-cute .sub-images {
    position: absolute;
    bottom: 2mm;
    right: 2mm;
    gap: 1mm;
    display: flex;
}

.style-cute .sub-thumb-wrapper {
    width: 8mm;
    height: 8mm;
    border-radius: 50%;
    border: 2px solid white;
    overflow: hidden;
    position: relative;
}

.style-cute .sub-thumb-inner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --- COOL STYLE --- */
.style-cool {
    background: #212121;
    color: #eee;
}

.style-cool .media-side {
    width: 50%;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
}

.style-cool .info-side {
    padding: 4mm;
    text-align: right;
    align-items: flex-end;
}

.style-cool .header-group {
    border-bottom: 1px solid #444;
    width: 100%;
}

.style-cool .work-name {
    color: #03a9f4;
    font-size: 7pt;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.style-cool .char-name {
    font-size: 14pt;
    font-weight: 300;
    letter-spacing: 1px;
}

.style-cool .sns-tag {
    background: transparent;
    color: #aaa;
    border: 1px solid #444;
}

.style-cool .sub-images {
    position: absolute;
    bottom: 2mm;
    left: 2mm;
    /* Left side for Cool */
    z-index: 20;
}

.style-cool .sub-thumb-wrapper {
    width: 10mm;
    height: 10mm;
    border: 1px solid #03a9f4;
    filter: grayscale(80%);
    overflow: hidden;
    position: relative;
}

.style-cool .sub-thumb-inner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --- SIMPLE STYLE --- */
.style-simple {
    background: white;
    flex-direction: column;
    padding: 0;
}

.style-simple .media-side {
    height: 25mm;
    width: 100%;
}

.style-simple .info-side {
    padding: 3mm 5mm;
    align-items: center;
    text-align: center;
}

.style-simple .char-name {
    font-size: 14pt;
    letter-spacing: 2px;
}

.style-simple .sns-list {
    justify-content: center;
    margin-top: 2mm;
}


/* =========================================
   FULL PICTURE LAYOUT
   ========================================= */
.full-bg {
    width: 100%;
    height: 100%;
    position: relative;
}

.full-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* object-fit: cover; -> Handled by background-size */
}

.full-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 10mm 4mm 3mm 4mm;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.full-content .work-name {
    font-size: 7pt;
    opacity: 0.8;
}

.full-content .char-name {
    font-size: 16pt;
    font-weight: 700;
}

.full-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 1mm;
    padding-top: 1mm;
}

.full-footer .mini-tag {
    display: inline-block;
    font-size: 6pt;
    margin-right: 2mm;
    opacity: 0.9;
}


/* =========================================
   GRID LAYOUT
   ========================================= */
/* Font Sizes Utilities */
/* 1=XS, 2=S, 3=M, 4=L, 5=XL (High Contrast) */
.size-1 {
    font-size: 0.6em !important;
}

.size-2 {
    font-size: 0.8em !important;
}

.size-3 {
    font-size: 1.0em !important;
}

.size-4 {
    font-size: 1.4em !important;
}

.size-5 {
    font-size: 1.8em !important;
}

/* Grid Specific Sizing (High Contrast) */
.grid-name.size-1 {
    font-size: 4mm !important;
}

.grid-name.size-2 {
    font-size: 5mm !important;
}

.grid-name.size-3 {
    font-size: 7mm !important;
}

.grid-name.size-4 {
    font-size: 9mm !important;
}

.grid-name.size-5 {
    font-size: 12mm !important;
}

.grid-sns.size-1 i {
    font-size: 3mm !important;
}

.grid-sns.size-2 i {
    font-size: 4mm !important;
}

.grid-sns.size-3 i {
    font-size: 6mm !important;
}

.grid-sns.size-4 i {
    font-size: 8mm !important;
}

.grid-sns.size-5 i {
    font-size: 10mm !important;
}

/* Grid Template Fixes */
.grid-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #ffffff;
}

.grid-images {
    /* 4 Columns Horizontal */
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr;
    height: 100%;
    /* Occupy full height? Or partial? */
    /* User said "Images divided into 4 horizontal columns" */
    /* And "Be careful text doesn't overflow". */
    /* I'll let images take full height, and overlay text at bottom. */
    width: 100%;
    position: relative;
    overflow: hidden;
}

.grid-cell {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
    /* White background for missing images */
}

.grid-cell img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Grid Info Overlay */
.grid-info {
    justify-content: space-between;
}

.grid-name {
    font-weight: 700;
    font-size: 12pt;
}

.grid-sns {
    font-size: 10pt;
    color: #666;
    display: flex;
    gap: 2mm;
}