@font-face {
    font-family: 'Iansui';
    src: url('./fonts/Iansui-Regular.ttf') format('truetype');
    font-weight: normal;
}

* { box-sizing: border-box; }
body {
    font-family: 'Iansui', system-ui, -apple-system, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 20px;
}
.container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.form-panel {
    flex: 1;
}
.preview-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.card-preview-wrapper {
    width: 400px;
    height: 500px;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    background: white;
}

.card-container {
    width: 1080px;
    height: 1350px;
    background: white;
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(10, 1fr);
    transform: scale(0.37037037);
    transform-origin: top left;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(10, 1fr);
    z-index: 100;
}
.grid-overlay.hidden {
    display: none;
}
.grid-cell {
    border: 2px dashed rgba(0,0,0,0.2);
}

.layout-block {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#heroBlock {
}

#displayHeroImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#infoBlock {
}

.scale-wrapper {
    height: max-content;
    transform-origin: center center;
    display: flex;
    flex-direction: column;
}

#infoBlock .scale-wrapper {
    width: 100%;
    padding: 24px 32px;
    align-items: flex-start;
    gap: 16px;
    font-size: 10px; /* Base size for JS binary search */
    word-wrap: break-word;
    word-break: break-all;
}

#qrCtaBlock .scale-wrapper {
    width: 400px; 
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
}

#displayName {
    margin: 0;
    font-size: 6.4em;
    color: #2B1141;
}

.meta-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 0;
    font-size: 4em;
    color: #444;
}
.meta-info span:not(.icon) {
    flex: 1;
    min-width: 0;
    white-space: normal;
    word-break: break-all;
    word-wrap: break-word;
}
.meta-info .icon { font-size: 1.2em; }

#qrCtaBlock {
    min-width: 0;
    min-height: 0;
}

.cta-text {
    margin: 0;
    font-weight: bold;
    color: #2B1141;
    font-size: 48px;
    text-align: center;
    white-space: nowrap; /* Single line enforcement */
}

#qrCodeContainer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1 / 1;
}

.timestamp-text {
    font-size: 32px;
    color: #888;
    margin: 0;
    text-align: center;
    white-space: nowrap; /* Single line enforcement */
}


/* Responsive Layout for Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        flex-direction: column-reverse;
        gap: 10px;
    }
    .form-panel, .preview-panel {
        flex: none;
        width: 100%;
        padding: 15px;
    }
    /* Scale down the preview card to fit mobile screens (375px width typical) */
    .card-preview-wrapper {
        width: 324px;   /* 1080 * 0.3 */
        height: 405px;  /* 1350 * 0.3 */
    }
    .card-container {
        transform: scale(0.3);
    }
}
