.cf-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* recorta la imagen para llenar el círculo */
    border-radius: 50%;
    /* la hace circular */
    display: block;
}

/* ── ESCENA 3D ── */
#scene {
    width: 100%;
    max-width: 600px;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 900px;
    perspective-origin: 50% 50%;
    padding: 20px 0 80px;
    position: relative;
    z-index: 1;
}

/* ── CONTENEDOR DE ROTACIÓN ── */
#card-wrap {
    transform-style: preserve-3d;
    transition: transform 0.08s linear;
    cursor: grab;
    user-select: none;
    position: relative;
    top: -200px;
}

#card-wrap:active {
    cursor: grabbing;
}

/* ── DIMENSIONES COMPARTIDAS ── */
#card-front,
#card-back {
    width: 340px;
    height: 215px;
    border-radius: 16px;
    position: absolute;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

/* ── FRENTE ── */
#card-front {
    background: linear-gradient(135deg, #1a2540 0%, #263356 40%, #1e3a5f 70%, #152035 100%);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    transform: translateZ(1px);
}

/* Brillo holográfico sutil */
#card-front::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
            transparent 20%,
            rgba(120, 180, 255, 0.04) 30%,
            rgba(180, 140, 255, 0.06) 40%,
            rgba(120, 220, 180, 0.04) 50%,
            transparent 60%);
    border-radius: 16px;
    pointer-events: none;
    z-index: 10;
}

/* Reflejo en borde superior */
#card-front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 11;
}

/* ── REVERSO ── */
#card-back {
    background: linear-gradient(135deg, #1e3a5f 0%, #152035 100%);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.4);
    transform: rotateY(180deg) translateZ(1px);
}

/* Placeholder invisible para mantener dimensiones en el flujo */
#placeholder {
    width: 340px;
    height: 215px;
    visibility: hidden;
}

/* ── CHIP DORADO ── */
.cf-chip {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 3;
    width: 30px;
    height: 22px;
    border-radius: 4px;
    background: linear-gradient(135deg, #c8a96e, #e8cc8a, #b8922a);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cf-chip::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(150, 100, 0, 0.5);
    border-radius: 2px;
}

/* ── ENCABEZADO DEL FRENTE ── */
.cf-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 2;
}

.cf-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4e8cff, #7b5ea7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    font-family: Georgia, serif;
    letter-spacing: -0.5px;
    box-shadow: 0 2px 8px rgba(78, 140, 255, 0.4);
    flex-shrink: 0;
}

.cf-org {
    color: rgba(255, 255, 255, 0.75);
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

.cf-role {
    color: #7eb4ff;
    font-size: 10px;
    letter-spacing: 1px;
    margin-top: 1px;
    font-family: 'Courier New', monospace;
}

/* ── CUERPO DEL FRENTE ── */
.cf-body {
    display: flex;
    padding: 12px 18px 10px;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.cf-photo {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px solid rgba(120, 180, 255, 0.5);
    background: linear-gradient(145deg, #2a3a5e, #1a2a45);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(120, 180, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cf-photo svg {
    width: 52px;
    height: 52px;
    opacity: 0.7;
}

.cf-info {
    flex: 1;
}

.cf-name {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: Georgia, serif;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.cf-title {
    color: #7eb4ff;
    font-size: 8.5px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    margin-bottom: 8px;
}

.cf-field {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 5px;
}

.cf-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: rgba(78, 140, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.cf-icon svg {
    width: 9px;
    height: 9px;
}

.cf-label {
    font-size: 7.5px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: 'Courier New', monospace;
}

.cf-val {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 1px;
    font-family: 'Courier New', monospace;
}

/* ── PIE DEL FRENTE ── */
.cf-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: linear-gradient(90deg, rgba(78, 140, 255, 0.15), rgba(123, 94, 167, 0.15));
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 2;
}

.cf-barcode {
    display: flex;
    gap: 1.5px;
    align-items: center;
}

.cf-barcode span {
    display: inline-block;
    height: 18px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 1px;
}

.b1 {
    width: 1.5px;
}

.b2 {
    width: 2.5px;
}

.b3 {
    width: 1px;
}

.b4 {
    width: 3px;
}

.b5 {
    width: 1.5px;
}

.b6 {
    width: 2px;
}

.cf-member {
    font-size: 7.5px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

/* ── REVERSO: ELEMENTOS ── */
.cb-strip {
    width: 100%;
    height: 38px;
    margin-top: 24px;
    background: rgba(0, 0, 0, 0.6);
}

.cb-sig {
    margin: 10px 18px;
    background: rgba(255, 255, 255, 0.9);
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    position: relative;
    overflow: hidden;
}

.cb-sig::after {
    content: 'Yair Vergara';
    font-family: 'Brush Script MT', cursive;
    font-size: 16px;
    color: #1a2540;
    letter-spacing: 1px;
}

.cb-qr {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    padding: 4px;
    background: white;
    border-radius: 4px;
}

.cb-qr span {
    background: #1a2540;
    border-radius: 1px;
}

.cb-qr span.w {
    background: transparent;
}

.cb-info {
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 8px;
    font-family: 'Courier New', monospace;
    line-height: 1.8;
    letter-spacing: 0.8px;
}

.cb-nfc {
    position: absolute;
    left: 18px;
    bottom: 20px;
    width: 36px;
    height: 36px;
    opacity: 0.4;
}

/* ── TEXTO DE AYUDA ── */
#hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(150, 170, 220, 0.65);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
}

/* ── TÍTULO ── */
#page-title {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.25);
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    margin-bottom: -20px;
}

/* ── ANIMACIÓN DE CAÍDA ── */
@keyframes dropIn {
    0% {
        transform: translateY(-140px) translateZ(-200px) rotateX(-25deg) rotateY(-15deg);
        opacity: 0;
    }

    60% {
        transform: translateY(18px) translateZ(0) rotateX(5deg) rotateY(4deg);
        opacity: 1;
    }

    80% {
        transform: translateY(-6px) rotateX(-2deg) rotateY(-2deg);
    }

    100% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }
}

#card-wrap.drop-in {
    animation: dropIn 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}