.resident-id-showcase {
    flex: 1;
    min-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    overflow: visible;
}

/* Deep-sea ceramic Resident ID — matches LonelyIsle app Scheme C */
.resident-id-card {
    --base-top: #152033;
    --base-mid: #0b1220;
    --base-bottom: #121820;
    --bloom-blue: rgba(90, 140, 180, 0.28);
    --bloom-gold: rgba(180, 140, 80, 0.2);
    --foil-bright: #e8cd8a;
    --foil-soft: #b4a064;
    --foil-muted: rgba(90, 110, 140, 0.55);
    --ink: #f2f6fb;
    --label: #7f8fa3;
    --title: #c9b07a;
    --dash: rgba(201, 176, 122, 0.28);
    --micro-rule: rgba(201, 176, 122, 0.14);
    --barcode: #d8c08a;
    --portrait-width: 84px;
    --portrait-height: 108px;

    position: relative;
    width: 304px;
    max-width: 100%;
    min-height: 350px;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    color: var(--ink);
    isolation: isolate;
    background:
        radial-gradient(ellipse 220px 180px at 8% 10%, var(--bloom-blue), transparent 70%),
        radial-gradient(ellipse 200px 180px at 92% 92%, var(--bloom-gold), transparent 70%),
        radial-gradient(circle 110px at 42% 32%, rgba(232, 205, 140, 0.16), transparent 72%),
        linear-gradient(145deg, var(--base-top) 0%, var(--base-mid) 48%, var(--base-bottom) 100%);
    border: 1.5px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 0 0 1.5px rgba(232, 205, 140, 0.42),
        0 0 0 2px rgba(180, 160, 100, 0.18),
        inset 0 0 0 0.5px rgba(255, 255, 255, 0.06),
        0 22px 40px rgba(0, 0, 0, 0.48),
        0 0 32px rgba(232, 205, 140, 0.12);
    transform: rotate(-2.5deg);
    transform-origin: center;
    animation: resident-id-card-float 5.5s ease-in-out infinite;
}

.resident-id-card::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 12px;
    border: 1px solid var(--micro-rule);
    pointer-events: none;
    z-index: 0;
}

.resident-id-card > * {
    position: relative;
    z-index: 1;
}

@keyframes resident-id-card-float {
    0%, 100% {
        transform: rotate(-2.5deg) translateY(0);
    }
    50% {
        transform: rotate(-2.5deg) translateY(-4px);
    }
}

.resident-id-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--dash);
}

.resident-id-card__title {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--title);
}

.resident-id-card__app-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 0.5px solid rgba(180, 160, 100, 0.55);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(232, 205, 140, 0.12);
}

.resident-id-card__body {
    display: grid;
    grid-template-columns: var(--portrait-width) minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
    padding-top: 24px;
    flex: 1;
}

.resident-id-card__portrait {
    width: var(--portrait-width);
    height: var(--portrait-height);
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid rgba(180, 160, 100, 0.35);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 1px rgba(232, 205, 140, 0.08);
}

.resident-id-card__portrait picture,
.resident-id-card__portrait img {
    display: block;
    width: var(--portrait-width);
    height: var(--portrait-height);
    max-width: none;
}

.resident-id-card__portrait img {
    object-fit: cover;
    object-position: center center;
}

.resident-id-card__fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;
    min-width: 0;
}

.resident-id-card__field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.resident-id-card__label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--label);
}

.resident-id-card__value {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: var(--ink);
    line-height: 1.3;
    word-break: break-word;
}

.resident-id-card__footer {
    margin-top: auto;
    padding: 14px 0 0;
    border-top: 1px dashed var(--dash);
}

/* Matches app IslanderIDBarcodeView unit widths + 1.2pt gaps */
.resident-id-card__barcode {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr 1fr 2fr 4fr 1fr 2fr 1fr 3fr 2fr 1fr 4fr 2fr 1fr 3fr 1fr 2fr 3fr 1fr 2fr 4fr 1fr 2fr 3fr 1fr 2fr 1fr 3fr 2fr;
    column-gap: 1.2px;
    align-items: stretch;
    height: 28px;
    width: 100%;
    opacity: 0.78;
}

.resident-id-card__barcode span {
    display: block;
    min-width: 0;
    height: 100%;
    background: var(--barcode);
}

@media (max-width: 768px) {
    .resident-id-showcase {
        padding: 8px 0 0;
    }

    .resident-id-card {
        width: min(304px, 100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .resident-id-card {
        animation: none;
    }
}
